Index: doc/3DBorder.3 ================================================================== --- doc/3DBorder.3 +++ doc/3DBorder.3 @@ -7,21 +7,30 @@ '\" .TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_Alloc3DBorderFromObj, Tk_Get3DBorder, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance +Tk_Alloc3DBorderFromObj, Tk_ClipDrawableToRect, Tk_DrawHighlightBorder, Tk_Get3DBorder, Tk_Get3DBorderColors, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance .SH SYNOPSIS .nf \fB#include \fR .sp Tk_3DBorder \fBTk_Alloc3DBorderFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp +void +\fBTk_ClipDrawableToRect(\fIdisplay, drawable, x, y, width, height\fB)\fR +.sp +void +\fBTk_DrawHighlightBorder(\fItkwin, fgGC, bgGC, highlightWidth, drawable\fB)\fR +.sp Tk_3DBorder \fBTk_Get3DBorder(\fIinterp, tkwin, colorName\fB)\fR .sp +void +\fBTk_Get3DBorderColors(\fIborder, bgColorPtr, darkColorPtr, lightColorPtr\fB)\fR +.sp Tk_3DBorder \fBTk_Get3DBorderFromObj(\fItkwin, objPtr\fB)\fR .sp void \fBTk_Draw3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR @@ -88,10 +97,12 @@ Height of rectangle describing border or bevel, in pixels. .AP int borderWidth in Width of border in pixels. Positive means border is inside rectangle given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means border is outside rectangle. +.AP int highlightWidth in +Width of ring around the outside of the widget if the widget has received the input focus. .AP int relief in Indicates 3-D position of interior of value relative to exterior; should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR, \fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR (may also be \fBTK_RELIEF_FLAT\fR for \fBTk_Fill3DRectangle\fR). @@ -131,10 +142,20 @@ Non-zero means this bevel forms the top side of the value; zero means it forms the bottom side. .AP int which in Specifies which of the border's graphics contexts is desired. Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR. +.AP XColor *bgColorPtr out +Pointer to location in which to store the background color of the given border. +.AP XColor *darkColorPtr out +Pointer to location in which to store the color for darker areas of the given border. +.AP XColor *lightColorPtr out +Pointer to location in which to store the color for lighter areas of the given border. +.AP GC fgGC in +Foreground X graphics context. +.AP GC fgGC in +Background X graphics context. .BE .SH DESCRIPTION .PP These procedures provide facilities for drawing window borders in a way that produces a three-dimensional appearance. @@ -156,15 +177,28 @@ interpreter \fIinterp\fR. If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches information about the return value in \fIobjPtr\fR, which speeds up future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR and \fItkwin\fR. +.PP +\fBTk_ClipDrawableToRect\fR will clip all drawing into the drawable d to the given rectangle. If width or height are negative, reset to no clipping. +Subsequent drawing into d is offset and clipped as specified. +The function is only used when \fBTK_NO_DOUBLE_BUFFERING\fR is specified at compile time. +.PP +\fBTk_DrawHighlightBorder\fR draws a rectangular ring around the outside of a widget +to indicate that it has received the input focus. +On the Macintosh, this puts a 1 pixel border in the bgGC color between +the widget and the focus ring, except in the case where highlightWidth +is 1, in which case the border is left out. +For proper Mac L&F, use highlightWidth of 3. .PP \fBTk_Get3DBorder\fR is identical to \fBTk_Alloc3DBorderFromObj\fR except that the color is specified with a string instead of a value. This prevents \fBTk_Get3DBorder\fR from caching the return value, so \fBTk_Get3DBorder\fR is less efficient than \fBTk_Alloc3DBorderFromObj\fR. +.PP +\fBTk_Get3DBorderColors\fR returns the used colors of the given border. .PP \fBTk_Get3DBorderFromObj\fR returns the token for an existing border, given the window and color name used to create the border. \fBTk_Get3DBorderFromObj\fR does not actually create the border; it must already have been created with a previous call to Index: doc/AddOption.3 ================================================================== --- doc/AddOption.3 +++ doc/AddOption.3 @@ -11,23 +11,30 @@ .nf \fB#include \fR .sp void \fBTk_AddOption\fR(\fItkwin, name, value, priority\fR) +.sp +Tcl_Obj * +\fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR) .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. .AP "const char" *name in Multi-element name of option. .AP "const char" *value in Value of option. +.AP "const char" *dbName in +The option database name. +.AP "const char" *className in +The name of the option class. .AP int priority in Overall priority level to use for option. .BE .SH DESCRIPTION .PP -This procedure is invoked to add an option to the database +\fBTk_AddOption\fR is invoked to add an option to the database associated with \fItkwin\fR's main window. \fIName\fR contains the option being specified and consists of names and/or classes separated by asterisks or dots, in the usual X format. \fIValue\fR contains the text string to associate with \fIname\fR; this value will be returned in calls to \fBTk_GetOption\fR. @@ -44,7 +51,11 @@ \fB.Xdefaults\fR, resource databases loaded into the X server, or user-specific startup files. .IP 80 Used for options specified interactively after the application starts running. +.PP +\fBTk_GetSystemDefault\fR returns a Tcl_Obj* with the string identifying +a configuration option matching the given \fIdbname\fR and \fIclassName\fR. +Returns NULL if there are no system defaults that match this pair. .SH KEYWORDS class, name, option, add Index: doc/MainWin.3 ================================================================== --- doc/MainWin.3 +++ doc/MainWin.3 @@ -15,16 +15,30 @@ \fB#include \fR .sp Tk_Window \fBTk_MainWindow\fR(\fIinterp\fR) .sp +void +\fBTk_SetMainMenubar\fR(\fIinterp, tkwin, menuName\fR) +.sp +void +\fBTk_SetWindowMenubar\fR(\fIinterp, tkwin, oldMenuName, menuName\fR) +.sp int \fBTk_GetNumMainWindows\fR() .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tcl_Interp *interp in/out Interpreter associated with the application. +.AP Tk_Window tkwin in +Token for main window. +.AP const char *menuName in +The name of the new menubar that the toplevel needs to be set to. +NULL means that their is no menu now. +.AP const char *oldMenuName in +The name of the menubar previously set in this toplevel. +NULL means no menu was set previously. .BE .SH DESCRIPTION .PP A main window is a special kind of toplevel window used as the outermost window in an application. @@ -34,7 +48,14 @@ associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and leaves an error message in interpreter \fIinterp\fR's result. .PP \fBTk_GetNumMainWindows\fR returns a count of the number of main windows currently open in the current thread. +\fBTk_SetMainMenubar\fR +Called when a toplevel widget is brought to front. On the Macintosh, +sets up the menubar that goes accross the top of the main monitor. On +other platforms, nothing is necessary. +\fBTk_SetWindowMenubar\fR associates a menu with a window. +The old menu clones for the menubar are thrown away, and a handler is +set up to allocate the new ones. .SH KEYWORDS application, main window ADDED doc/WinUtil.3 Index: doc/WinUtil.3 ================================================================== --- /dev/null +++ doc/WinUtil.3 @@ -0,0 +1,64 @@ +'\" +'\" Copyright (c) 1990-1993 The Regents of the University of California. +'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +.TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures" +.so man.macros +.BS +.SH NAME +Tk_GetOtherWindow, Tk_MakeContainer, Tk_MakeWindow, Tk_UseWindow \- window utility functions +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_GetOtherWindow(\fItkwin\fB)\fR +.sp +\fBTk_MakeContainer(\fItkwin\fB)\fR +.sp +\fBTk_MakeWindow(\fItkwin, parent\fB)\fR +.sp +int +\fBTk_UseWindow(\fIinterp, tkwin, string\fB)\fR +.SH ARGUMENTS +.AS XSetWindowAttributes borderWidth +.AP Tcl_Interp * interp in +Interpreter associated with the application. +.AP Tk_Window tkwin in +Token for window. +.AP Window parent in +Parent window. +.AP "const char" *string in +String identifying an X window to use for \fItkwin\fR; must be an integer value. +.BE +.SH DESCRIPTION +.PP +If both the container and embedded window are in the same process, +\fBTk_GetOtherWindow\fR will return either one, given the other. +If winPtr is a container, the return value is the token for the +embedded window, and vice versa. If the "other" window isn't in this +process, NULL is returned. +.PP +\fBTk_MakeContainer\fR is called to indicate that a particular window will be a +container for an embedded application. This changes certain aspects of +the window's behavior, such as whether it will receive events anymore. +.PP +\fBTk_MakeWindow\fR creates an actual window system window object based on the +current attributes of the specified TkWindow. It returns the handle to the new +window, or None on failure. +.PP +\fBTk_UseWindow\fR causes a Tk window to use a given X window as its +parent window, rather than the root window for the screen. It is +invoked by an embedded application to specify the window in which it +is embedded. +.PP +The return value is normally TCL_OK. If an error occurs (such as +string not being a valid window spec), then the return value is +TCL_ERROR and an error message is left in the interp's result if +interp is non-NULL. +.PP +.SH KEYWORDS +parent, window Index: generic/tk.decls ================================================================== --- generic/tk.decls +++ generic/tk.decls @@ -1094,10 +1094,48 @@ # TIP#529 declare 280 { void Tk_CreatePhotoImageFormatVersion3( const Tk_PhotoImageFormatVersion3 *formatPtr) } + +# TIP#606 +declare 281 { + void Tk_DrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, + int highlightWidth, Drawable drawable) +} +declare 282 { + void Tk_SetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName) +} +declare 283 { + void Tk_SetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, + const char *oldMenuName, const char *menuName) +} +declare 284 { + void Tk_ClipDrawableToRect(Display *display, Drawable d, int x, + int y, int width, int height) +} +declare 285 { + Tcl_Obj *Tk_GetSystemDefault(Tk_Window tkwin, + const char *dbName, const char *className) +} +declare 286 { + int Tk_UseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) +} +declare 287 { + void Tk_MakeContainer(Tk_Window tkwin) +} +declare 288 { + Tk_Window Tk_GetOtherWindow(Tk_Window tkwin) +} +declare 289 { + void Tk_Get3DBorderColors(Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, + XColor *lightColorPtr) +} +declare 290 { + Window Tk_MakeWindow(Tk_Window tkwin, Window parent) +} + # Define the platform specific public Tk interface. These functions are # only available on the designated platform. interface tkPlat Index: generic/tk3d.c ================================================================== --- generic/tk3d.c +++ generic/tk3d.c @@ -1385,10 +1385,44 @@ Tcl_ListObjAppendElement(NULL, resultPtr, objPtr); } } return resultPtr; } + +/* + *-------------------------------------------------------------- + * + * Tk_Get3BorderColors -- + * + * Given a Tk_3DBorder determine its 3 colors. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +Tk_Get3DBorderColors( + Tk_3DBorder border, + XColor *bgColorPtr, + XColor *darkColorPtr, + XColor *lightColorPtr) +{ + if (bgColorPtr) { + *bgColorPtr = *((TkBorder *)border)->bgColorPtr; + } + if (darkColorPtr) { + *darkColorPtr = *((TkBorder *) border)->darkColorPtr; + } + if (lightColorPtr) { + *lightColorPtr = *((TkBorder *) border)->lightColorPtr; + } +} /* * Local Variables: * mode: c * c-basic-offset: 4 Index: generic/tkCanvas.c ================================================================== --- generic/tkCanvas.c +++ generic/tkCanvas.c @@ -3160,11 +3160,11 @@ Tk_Depth(tkwin)); #else canvasPtr->drawableXOrigin = canvasPtr->xOrigin; canvasPtr->drawableYOrigin = canvasPtr->yOrigin; pixmap = Tk_WindowId(tkwin); - TkpClipDrawableToRect(Tk_Display(tkwin), pixmap, + Tk_ClipDrawableToRect(Tk_Display(tkwin), pixmap, screenX1 - canvasPtr->xOrigin, screenY1 - canvasPtr->yOrigin, width, height); #endif /* TK_NO_DOUBLE_BUFFERING */ /* @@ -3219,11 +3219,11 @@ screenY1 - canvasPtr->drawableYOrigin, (unsigned int) width, (unsigned int) height, screenX1 - canvasPtr->xOrigin, screenY1 - canvasPtr->yOrigin); Tk_FreePixmap(Tk_Display(tkwin), pixmap); #else - TkpClipDrawableToRect(Tk_Display(tkwin), pixmap, 0, 0, -1, -1); + Tk_ClipDrawableToRect(Tk_Display(tkwin), pixmap, 0, 0, -1, -1); #endif /* TK_NO_DOUBLE_BUFFERING */ } /* * Draw the window borders, if needed. @@ -3246,14 +3246,14 @@ bgGC = Tk_GCForColor(canvasPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (canvasPtr->textInfo.gotFocus) { fgGC = Tk_GCForColor(canvasPtr->highlightColorPtr, Tk_WindowId(tkwin)); - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, canvasPtr->highlightWidth, Tk_WindowId(tkwin)); } else { - TkpDrawHighlightBorder(tkwin, bgGC, bgGC, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, canvasPtr->highlightWidth, Tk_WindowId(tkwin)); } } } Index: generic/tkConfig.c ================================================================== --- generic/tkConfig.c +++ generic/tkConfig.c @@ -453,11 +453,11 @@ * Second, check for a system-specific default value. */ if ((valuePtr == NULL) && (optionPtr->dbNameUID != NULL)) { - valuePtr = TkpGetSystemDefault(tkwin, optionPtr->dbNameUID, + valuePtr = Tk_GetSystemDefault(tkwin, optionPtr->dbNameUID, optionPtr->dbClassUID); if (valuePtr != NULL) { source = SYSTEM_DEFAULT; } } Index: generic/tkDecls.h ================================================================== --- generic/tkDecls.h +++ generic/tkDecls.h @@ -894,10 +894,40 @@ /* 279 */ EXTERN Tcl_Obj * Tk_FontGetDescription(Tk_Font tkfont); /* 280 */ EXTERN void Tk_CreatePhotoImageFormatVersion3( const Tk_PhotoImageFormatVersion3 *formatPtr); +/* 281 */ +EXTERN void Tk_DrawHighlightBorder(Tk_Window tkwin, GC fgGC, + GC bgGC, int highlightWidth, + Drawable drawable); +/* 282 */ +EXTERN void Tk_SetMainMenubar(Tcl_Interp *interp, + Tk_Window tkwin, const char *menuName); +/* 283 */ +EXTERN void Tk_SetWindowMenuBar(Tcl_Interp *interp, + Tk_Window tkwin, const char *oldMenuName, + const char *menuName); +/* 284 */ +EXTERN void Tk_ClipDrawableToRect(Display *display, Drawable d, + int x, int y, int width, int height); +/* 285 */ +EXTERN Tcl_Obj * Tk_GetSystemDefault(Tk_Window tkwin, + const char *dbName, const char *className); +/* 286 */ +EXTERN int Tk_UseWindow(Tcl_Interp *interp, Tk_Window tkwin, + const char *string); +/* 287 */ +EXTERN void Tk_MakeContainer(Tk_Window tkwin); +/* 288 */ +EXTERN Tk_Window Tk_GetOtherWindow(Tk_Window tkwin); +/* 289 */ +EXTERN void Tk_Get3DBorderColors(Tk_3DBorder border, + XColor *bgColorPtr, XColor *darkColorPtr, + XColor *lightColorPtr); +/* 290 */ +EXTERN Window Tk_MakeWindow(Tk_Window tkwin, Window parent); typedef struct { const struct TkPlatStubs *tkPlatStubs; const struct TkIntStubs *tkIntStubs; const struct TkIntPlatStubs *tkIntPlatStubs; @@ -1187,10 +1217,20 @@ int (*tk_GetDoublePixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 276 */ Tcl_Obj * (*tk_NewWindowObj) (Tk_Window tkwin); /* 277 */ void (*tk_SendVirtualEvent) (Tk_Window tkwin, const char *eventName, Tcl_Obj *detail); /* 278 */ Tcl_Obj * (*tk_FontGetDescription) (Tk_Font tkfont); /* 279 */ void (*tk_CreatePhotoImageFormatVersion3) (const Tk_PhotoImageFormatVersion3 *formatPtr); /* 280 */ + void (*tk_DrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 281 */ + void (*tk_SetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 282 */ + void (*tk_SetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 283 */ + void (*tk_ClipDrawableToRect) (Display *display, Drawable d, int x, int y, int width, int height); /* 284 */ + Tcl_Obj * (*tk_GetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 285 */ + int (*tk_UseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 286 */ + void (*tk_MakeContainer) (Tk_Window tkwin); /* 287 */ + Tk_Window (*tk_GetOtherWindow) (Tk_Window tkwin); /* 288 */ + void (*tk_Get3DBorderColors) (Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, XColor *lightColorPtr); /* 289 */ + Window (*tk_MakeWindow) (Tk_Window tkwin, Window parent); /* 290 */ } TkStubs; extern const TkStubs *tkStubsPtr; #ifdef __cplusplus @@ -1761,10 +1801,30 @@ (tkStubsPtr->tk_SendVirtualEvent) /* 278 */ #define Tk_FontGetDescription \ (tkStubsPtr->tk_FontGetDescription) /* 279 */ #define Tk_CreatePhotoImageFormatVersion3 \ (tkStubsPtr->tk_CreatePhotoImageFormatVersion3) /* 280 */ +#define Tk_DrawHighlightBorder \ + (tkStubsPtr->tk_DrawHighlightBorder) /* 281 */ +#define Tk_SetMainMenubar \ + (tkStubsPtr->tk_SetMainMenubar) /* 282 */ +#define Tk_SetWindowMenuBar \ + (tkStubsPtr->tk_SetWindowMenuBar) /* 283 */ +#define Tk_ClipDrawableToRect \ + (tkStubsPtr->tk_ClipDrawableToRect) /* 284 */ +#define Tk_GetSystemDefault \ + (tkStubsPtr->tk_GetSystemDefault) /* 285 */ +#define Tk_UseWindow \ + (tkStubsPtr->tk_UseWindow) /* 286 */ +#define Tk_MakeContainer \ + (tkStubsPtr->tk_MakeContainer) /* 287 */ +#define Tk_GetOtherWindow \ + (tkStubsPtr->tk_GetOtherWindow) /* 288 */ +#define Tk_Get3DBorderColors \ + (tkStubsPtr->tk_Get3DBorderColors) /* 289 */ +#define Tk_MakeWindow \ + (tkStubsPtr->tk_MakeWindow) /* 290 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ @@ -1779,10 +1839,14 @@ #undef Tk_GetStyleFromObj #undef Tk_FreeStyleFromObj #define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj) #define Tk_FreeStyleFromObj(obj) /* no-op */ #define Tk_GetImageMasterData Tk_GetImageModelData + +#ifndef MAC_OSX_TK +# undef Tk_ClipDrawableToRect +#endif #if defined(_WIN32) && defined(UNICODE) # define Tk_MainEx Tk_MainExW EXTERN void Tk_MainExW(int argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); Index: generic/tkEntry.c ================================================================== --- generic/tkEntry.c +++ generic/tkEntry.c @@ -1925,13 +1925,13 @@ GC fgGC, bgGC; bgGC = Tk_GCForColor(entryPtr->highlightBgColorPtr, pixmap); if (entryPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(entryPtr->highlightColorPtr, pixmap); - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, xBound, pixmap); + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, xBound, pixmap); } else { - TkpDrawHighlightBorder(tkwin, bgGC, bgGC, xBound, pixmap); + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, xBound, pixmap); } } } #ifndef TK_NO_DOUBLE_BUFFERING Index: generic/tkFrame.c ================================================================== --- generic/tkFrame.c +++ generic/tkFrame.c @@ -577,12 +577,12 @@ * 1. Must set the window's class before calling ConfigureFrame, so that * unspecified options are looked up in the option database using the * correct class. * 2. Must set visual information before calling ConfigureFrame so that * colors are allocated in a proper colormap. - * 3. Must call TkpUseWindow before setting non-default visual - * information, since TkpUseWindow changes the defaults. + * 3. Must call Tk_UseWindow before setting non-default visual + * information, since Tk_UseWindow changes the defaults. */ if (screenName == NULL) { screenName = (type == TYPE_TOPLEVEL) ? "" : NULL; } @@ -632,11 +632,11 @@ Tk_SetClass(newWin, className); if (useOption == NULL) { useOption = Tk_GetOption(newWin, "use", "Use"); } if ((useOption != NULL) && (*useOption != 0) - && (TkpUseWindow(interp, newWin, useOption) != TCL_OK)) { + && (Tk_UseWindow(interp, newWin, useOption) != TCL_OK)) { goto error; } if (visualName == NULL) { visualName = Tk_GetOption(newWin, "visual", "Visual"); } @@ -725,11 +725,11 @@ "windows cannot have both the -use and the -container" " option set", -1)); Tcl_SetErrorCode(interp, "TK", "FRAME", "CONTAINMENT", NULL); goto error; } - TkpMakeContainer(framePtr->tkwin); + Tk_MakeContainer(framePtr->tkwin); } if (type == TYPE_TOPLEVEL) { Tcl_DoWhenIdle(MapFrame, framePtr); } Tcl_SetObjResult(interp, Tk_NewWindowObj(newWin)); @@ -841,11 +841,11 @@ #ifdef _WIN32 if (c == 'u') { const char *string = Tcl_GetString(objv[i+1]); - if (TkpUseWindow(interp, framePtr->tkwin, + if (Tk_UseWindow(interp, framePtr->tkwin, string) != TCL_OK) { result = TCL_ERROR; goto done; } continue; @@ -1033,11 +1033,11 @@ if ((((oldMenuName == NULL) && (framePtr->menuName != NULL)) || ((oldMenuName != NULL) && (framePtr->menuName == NULL)) || ((oldMenuName != NULL) && (framePtr->menuName != NULL) && strcmp(oldMenuName, framePtr->menuName) != 0)) && framePtr->type == TYPE_TOPLEVEL) { - TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName, + Tk_SetWindowMenuBar(interp, framePtr->tkwin, oldMenuName, framePtr->menuName); } if (oldMenuName != NULL) { ckfree(oldMenuName); @@ -1500,14 +1500,14 @@ bgGC = Tk_GCForColor(framePtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (framePtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(framePtr->highlightColorPtr, Tk_WindowId(tkwin)); - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, hlWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, hlWidth, Tk_WindowId(tkwin)); } else { - TkpDrawHighlightBorder(tkwin, bgGC, bgGC, hlWidth, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, hlWidth, Tk_WindowId(tkwin)); } } /* @@ -1745,11 +1745,11 @@ } else if (eventPtr->type == ConfigureNotify) { ComputeFrameGeometry(framePtr); goto redraw; } else if (eventPtr->type == DestroyNotify) { if (framePtr->menuName != NULL) { - TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, + Tk_SetWindowMenuBar(framePtr->interp, framePtr->tkwin, framePtr->menuName, NULL); ckfree(framePtr->menuName); framePtr->menuName = NULL; } if (framePtr->tkwin != NULL) { @@ -1794,11 +1794,11 @@ if (framePtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == ActivateNotify) { - TkpSetMainMenubar(framePtr->interp, framePtr->tkwin, + Tk_SetMainMenubar(framePtr->interp, framePtr->tkwin, framePtr->menuName); } return; redraw: @@ -1832,11 +1832,11 @@ { Frame *framePtr = (Frame *)clientData; Tk_Window tkwin = framePtr->tkwin; if (framePtr->menuName != NULL) { - TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, + Tk_SetWindowMenuBar(framePtr->interp, framePtr->tkwin, framePtr->menuName, NULL); ckfree(framePtr->menuName); framePtr->menuName = NULL; } @@ -2066,11 +2066,11 @@ if (Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_FRAME) { framePtr->type = TYPE_TOPLEVEL; Tcl_DoWhenIdle(MapFrame, framePtr); if (framePtr->menuName != NULL) { - TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, NULL, + Tk_SetWindowMenuBar(framePtr->interp, framePtr->tkwin, NULL, framePtr->menuName); } } else if (!Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_TOPLEVEL) { framePtr->type = TYPE_FRAME; } else { Index: generic/tkInt.decls ================================================================== --- generic/tkInt.decls +++ generic/tkInt.decls @@ -306,11 +306,11 @@ # Exported publically as Tk_SetClassProcs in 8.4a2 #declare 84 { # void TkSetClassProcs(Tk_Window tkwin, # TkClassProcs *procs, ClientData instanceData) #} -declare 85 { +declare 85 {deprecated {renamed to Tk_SetWindowMenuBar}} { void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName) } declare 86 { KeySym TkStringToKeysym(const char *name) Index: generic/tkIntDecls.h ================================================================== --- generic/tkIntDecls.h +++ generic/tkIntDecls.h @@ -265,11 +265,12 @@ EXTERN void TkSelInit(Tk_Window tkwin); /* 83 */ EXTERN void TkSelPropProc(XEvent *eventPtr); /* Slot 84 is reserved */ /* 85 */ -EXTERN void TkSetWindowMenuBar(Tcl_Interp *interp, +TK_DEPRECATED("renamed to Tk_SetWindowMenuBar") +void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 86 */ EXTERN KeySym TkStringToKeysym(const char *name); /* 87 */ @@ -658,11 +659,11 @@ void (*tkSelDeadWindow) (TkWindow *winPtr); /* 80 */ void (*tkSelEventProc) (Tk_Window tkwin, XEvent *eventPtr); /* 81 */ void (*tkSelInit) (Tk_Window tkwin); /* 82 */ void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */ void (*reserved84)(void); - void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */ + TCL_DEPRECATED_API("renamed to Tk_SetWindowMenuBar") void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */ KeySym (*tkStringToKeysym) (const char *name); /* 86 */ int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */ void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */ void (*tkWmDeadWindow) (TkWindow *winPtr); /* 89 */ TkWindow * (*tkWmFocusToplevel) (TkWindow *winPtr); /* 90 */ @@ -1202,14 +1203,33 @@ #undef TkUnixDoOneXEvent_ #undef TkUnixSetMenubar_ #undef TkWmCleanup_ #undef TkSendCleanup_ #undef TkpTestsendCmd_ +#undef TkSetWindowMenuBar +#undef TkpDrawHighlightBorder +#undef TkpUseWindow +#undef TkpSetMainMenubar +#undef TkpGetOtherWindow +#undef TkpGetSystemDefault +#undef TkpMakeContainer +#undef TkpMakeWindow + +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION == 8) +# define TkSetWindowMenuBar Tk_SetWindowMenuBar +# define TkpDrawHighlightBorder Tk_DrawHighlightBorder +# define TkpUseWindow Tk_UseWindow +# define TkpSetMainMenubar Tk_SetMainMenubar +# define TkpGetOtherWindow ((TkWindow *(*)(TkWindow *))(void *)Tk_GetOtherWindow) +# define TkpGetSystemDefault Tk_GetSystemDefault +# define TkpMakeContainer Tk_MakeContainer +# define TkpMakeWindow ((Window (*)(TkWindow *, Window))(void *)Tk_MakeWindow) +#endif #if !defined(MAC_OSX_TK) # undef TkpWillDrawWidget # undef TkpRedrawWidget # define TkpWillDrawWidget(w) 0 # define TkpRedrawWidget(w) #endif #endif /* _TKINTDECLS */ Index: generic/tkListbox.c ================================================================== --- generic/tkListbox.c +++ generic/tkListbox.c @@ -2190,14 +2190,14 @@ GC fgGC, bgGC; bgGC = Tk_GCForColor(listPtr->highlightBgColorPtr, pixmap); if (listPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(listPtr->highlightColorPtr, pixmap); - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, listPtr->highlightWidth, pixmap); } else { - TkpDrawHighlightBorder(tkwin, bgGC, bgGC, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, listPtr->highlightWidth, pixmap); } } #ifndef TK_NO_DOUBLE_BUFFERING XCopyArea(listPtr->display, pixmap, Tk_WindowId(tkwin), Index: generic/tkMenu.c ================================================================== --- generic/tkMenu.c +++ generic/tkMenu.c @@ -578,18 +578,18 @@ TkMenuTopLevelList *nextPtr; Tk_Window listtkwin; while (topLevelListPtr != NULL) { /* - * Need to get the next pointer first. TkSetWindowMenuBar changes + * Need to get the next pointer first. Tk_SetWindowMenuBar changes * the list, so that the next pointer is different after calling * it. */ nextPtr = topLevelListPtr->nextPtr; listtkwin = topLevelListPtr->tkwin; - TkSetWindowMenuBar(menuPtr->interp, listtkwin, + Tk_SetWindowMenuBar(menuPtr->interp, listtkwin, Tk_PathName(menuPtr->tkwin), Tk_PathName(menuPtr->tkwin)); topLevelListPtr = nextPtr; } } @@ -3137,11 +3137,11 @@ } /* *---------------------------------------------------------------------- * - * TkSetWindowMenuBar -- + * Tk_SetWindowMenuBar -- * * Associates a menu with a window. Called by ConfigureFrame in in * response to a "-menu .foo" configuration option for a top level. * * Results: @@ -3153,11 +3153,11 @@ * *---------------------------------------------------------------------- */ void -TkSetWindowMenuBar( +Tk_SetWindowMenuBar( Tcl_Interp *interp, /* The interpreter the toplevel lives in. */ Tk_Window tkwin, /* The toplevel window. */ const char *oldMenuName, /* The name of the menubar previously set in * this toplevel. NULL means no menu was set * previously. */ @@ -3295,11 +3295,11 @@ topLevelListPtr->nextPtr = menuRefPtr->topLevelListPtr; menuRefPtr->topLevelListPtr = topLevelListPtr; } else { TkpSetWindowMenuBar(tkwin, NULL); } - TkpSetMainMenubar(interp, tkwin, menuName); + Tk_SetMainMenubar(interp, tkwin, menuName); } /* *---------------------------------------------------------------------- * Index: generic/tkMenuDraw.c ================================================================== --- generic/tkMenuDraw.c +++ generic/tkMenuDraw.c @@ -773,11 +773,11 @@ } else if (eventPtr->type == ConfigureNotify) { TkEventuallyRecomputeMenu(menuPtr); TkEventuallyRedrawMenu(menuPtr, NULL); } else if (eventPtr->type == ActivateNotify) { if (menuPtr->menuType == TEAROFF_MENU) { - TkpSetMainMenubar(menuPtr->interp, menuPtr->tkwin, NULL); + Tk_SetMainMenubar(menuPtr->interp, menuPtr->tkwin, NULL); } } else if (eventPtr->type == DestroyNotify) { if (menuPtr->tkwin != NULL) { if (!(menuPtr->menuFlags & MENU_DELETION_PENDING)) { TkDestroyMenu(menuPtr); Index: generic/tkMessage.c ================================================================== --- generic/tkMessage.c +++ generic/tkMessage.c @@ -710,14 +710,14 @@ GC fgGC, bgGC; bgGC = Tk_GCForColor(msgPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (msgPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(msgPtr->highlightColorPtr,Tk_WindowId(tkwin)); - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, msgPtr->highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, msgPtr->highlightWidth, Tk_WindowId(tkwin)); } else { - TkpDrawHighlightBorder(tkwin, bgGC, bgGC, msgPtr->highlightWidth, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, msgPtr->highlightWidth, Tk_WindowId(tkwin)); } } } Index: generic/tkStubInit.c ================================================================== --- generic/tkStubInit.c +++ generic/tkStubInit.c @@ -23,10 +23,12 @@ #if defined(MAC_OSX_TK) /* we could have used _TKMACINT */ #include "tkMacOSXInt.h" #include "tkMacOSXPrivate.h" +#else +# define Tk_ClipDrawableToRect 0 #endif /* TODO: These ought to come in some other way */ #include "tkPlatDecls.h" #include "tkIntXlibDecls.h" @@ -56,10 +58,21 @@ #else # define Tk_TranslateWinEvent 0 # define Tk_PointerEvent 0 # define TkWinGetPlatformId 0 #endif + +#if defined(TK_NO_DEPRECATED) || (TCL_MAJOR_VERSION > 8) +# define TkSetWindowMenuBar 0 +# define TkpDrawHighlightBorder 0 +# define TkpUseWindow 0 +# define TkpSetMainMenubar 0 +# define TkpGetOtherWindow 0 +# define TkpGetSystemDefault 0 +# define TkpMakeContainer 0 +# define TkpMakeWindow 0 +#endif static int doNothing(void) { /* dummy implementation, no need to do anything */ @@ -1330,11 +1343,21 @@ Tk_GetButtonMask, /* 275 */ Tk_GetDoublePixelsFromObj, /* 276 */ Tk_NewWindowObj, /* 277 */ Tk_SendVirtualEvent, /* 278 */ Tk_FontGetDescription, /* 279 */ - Tk_CreatePhotoImageFormatVersion3 /* 280 */ + Tk_CreatePhotoImageFormatVersion3, /* 280 */ + Tk_DrawHighlightBorder, /* 281 */ + Tk_SetMainMenubar, /* 282 */ + Tk_SetWindowMenuBar, /* 283 */ + Tk_ClipDrawableToRect, /* 284 */ + Tk_GetSystemDefault, /* 285 */ + Tk_UseWindow, /* 286 */ + Tk_MakeContainer, /* 287 */ + Tk_GetOtherWindow, /* 288 */ + Tk_Get3DBorderColors, /* 289 */ + Tk_MakeWindow, /* 290 */ }; /* !END!: Do not edit above this line. */ Index: generic/tkTextDisp.c ================================================================== --- generic/tkTextDisp.c +++ generic/tkTextDisp.c @@ -2466,11 +2466,11 @@ } else { y_off = 0; } #ifdef TK_NO_DOUBLE_BUFFERING - TkpClipDrawableToRect(display, pixmap, dInfoPtr->x, y + y_off, + Tk_ClipDrawableToRect(display, pixmap, dInfoPtr->x, y + y_off, dInfoPtr->maxX - dInfoPtr->x, height); #endif /* TK_NO_DOUBLE_BUFFERING */ /* * First, clear the area of the line to the background color for the text @@ -2591,11 +2591,11 @@ XCopyArea(display, pixmap, Tk_WindowId(textPtr->tkwin), dInfoPtr->copyGC, dInfoPtr->x, y + y_off, (unsigned) (dInfoPtr->maxX - dInfoPtr->x), (unsigned) height, dInfoPtr->x, dlPtr->y + y_off); #else - TkpClipDrawableToRect(display, pixmap, 0, 0, -1, -1); + Tk_ClipDrawableToRect(display, pixmap, 0, 0, -1, -1); #endif /* TK_NO_DOUBLE_BUFFERING */ linesRedrawn++; } /* @@ -4422,14 +4422,14 @@ bgGC = Tk_GCForColor(textPtr->highlightBgColorPtr, Tk_WindowId(textPtr->tkwin)); if (textPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(textPtr->highlightColorPtr, Tk_WindowId(textPtr->tkwin)); - TkpDrawHighlightBorder(textPtr->tkwin, fgGC, bgGC, + Tk_DrawHighlightBorder(textPtr->tkwin, fgGC, bgGC, textPtr->highlightWidth, Tk_WindowId(textPtr->tkwin)); } else { - TkpDrawHighlightBorder(textPtr->tkwin, bgGC, bgGC, + Tk_DrawHighlightBorder(textPtr->tkwin, bgGC, bgGC, textPtr->highlightWidth, Tk_WindowId(textPtr->tkwin)); } } borders = textPtr->borderWidth + textPtr->highlightWidth; if (textPtr->padY > 0) { Index: generic/tkUtil.c ================================================================== --- generic/tkUtil.c +++ generic/tkUtil.c @@ -582,11 +582,11 @@ * Tk_DrawFocusHighlight -- * * This function draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. * - * This function is now deprecated. Use TkpDrawHighlightBorder instead, + * This function is now deprecated. Use Tk_DrawHighlightBorder instead, * since this function does not handle drawing the Focus ring properly on * the Macintosh - you need to know the background GC as well as the * foreground since the Mac focus ring separated from the widget by a 1 * pixel border. * Index: generic/tkWindow.c ================================================================== --- generic/tkWindow.c +++ generic/tkWindow.c @@ -1320,11 +1320,11 @@ void Tk_DestroyWindow( Tk_Window tkwin) /* Window to destroy. */ { - TkWindow *winPtr = (TkWindow *) tkwin; + TkWindow *winPtr = (TkWindow *)tkwin; TkDisplay *dispPtr = winPtr->dispPtr; XEvent event; TkHalfdeadWindow *halfdeadPtr, *prev_halfdeadPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -1437,14 +1437,14 @@ * application is also in this process. Delete the embedded window * in-line here, for the same reasons we delete children in-line * (otherwise, for example, the Tk window may appear to exist even * though its X window is gone; this could cause errors). Special * note: it's possible that the embedded window has already been - * deleted, in which case TkpGetOtherWindow will return NULL. + * deleted, in which case Tk_GetOtherWindow will return NULL. */ - TkWindow *childPtr = TkpGetOtherWindow(winPtr); + TkWindow *childPtr = (TkWindow *)Tk_GetOtherWindow(tkwin); if (childPtr != NULL) { childPtr->flags |= TK_DONT_DESTROY_WINDOW; Tk_DestroyWindow((Tk_Window) childPtr); } @@ -1791,11 +1791,11 @@ createProc = Tk_GetClassProc(winPtr->classProcsPtr, createProc); if (createProc != NULL && parent != None) { winPtr->window = createProc(tkwin, parent, winPtr->instanceData); } else { - winPtr->window = TkpMakeWindow(winPtr, parent); + winPtr->window = Tk_MakeWindow(tkwin, parent); } hPtr = Tcl_CreateHashEntry(&winPtr->dispPtr->winTable, (char *) winPtr->window, &isNew); Tcl_SetHashValue(hPtr, winPtr); Index: macosx/tkMacOSXConfig.c ================================================================== --- macosx/tkMacOSXConfig.c +++ macosx/tkMacOSXConfig.c @@ -15,17 +15,17 @@ /* *---------------------------------------------------------------------- * - * TkpGetSystemDefault -- + * Tk_GetSystemDefault -- * * Given a dbName and className for a configuration option, * return a string representation of the option. * * Results: - * Returns a Tk_Uid that is the string identifier that identifies + * Returns a Tcl_Obj* with the string identifier that identifies * this option. Returns NULL if there are no system defaults * that match this pair. * * Side effects: * None, once the package is initialized. @@ -32,11 +32,11 @@ * *---------------------------------------------------------------------- */ Tcl_Obj * -TkpGetSystemDefault( +Tk_GetSystemDefault( Tk_Window tkwin, /* A window to use. */ const char *dbName, /* The option database name. */ const char *className) /* The name of the option class. */ { (void)tkwin; Index: macosx/tkMacOSXDraw.c ================================================================== --- macosx/tkMacOSXDraw.c +++ macosx/tkMacOSXDraw.c @@ -1561,11 +1561,11 @@ } /* *---------------------------------------------------------------------- * - * TkpClipDrawableToRect -- + * Tk_ClipDrawableToRect -- * * Clip all drawing into the drawable d to the given rectangle. If width * or height are negative, reset to no clipping. * * Results: @@ -1576,11 +1576,11 @@ * *---------------------------------------------------------------------- */ void -TkpClipDrawableToRect( +Tk_ClipDrawableToRect( TCL_UNUSED(Display *), Drawable d, int x, int y, int width, int height) { @@ -1677,11 +1677,11 @@ } /* *---------------------------------------------------------------------- * - * TkpDrawHighlightBorder -- + * Tk_DrawHighlightBorder -- * * This procedure draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. * * On the Macintosh, this puts a 1 pixel border in the bgGC color between @@ -1699,11 +1699,11 @@ * *---------------------------------------------------------------------- */ void -TkpDrawHighlightBorder ( +Tk_DrawHighlightBorder ( Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable) Index: macosx/tkMacOSXEmbed.c ================================================================== --- macosx/tkMacOSXEmbed.c +++ macosx/tkMacOSXEmbed.c @@ -73,20 +73,21 @@ * *---------------------------------------------------------------------- */ Window -TkpMakeWindow( - TkWindow *winPtr, +Tk_MakeWindow( + Tk_Window tkwin, Window parent) { MacDrawable *macWin; + TkWindow *winPtr = (TkWindow *)tkwin; (void)parent; /* * If this window is marked as embedded then the window structure should - * have already been created in the TkpUseWindow function. + * have already been created in the Tk_UseWindow function. */ if (Tk_IsEmbedded(winPtr)) { macWin = winPtr->privatePtr; } else { @@ -176,11 +177,11 @@ } /* *---------------------------------------------------------------------- * - * TkpUseWindow -- + * Tk_UseWindow -- * * This procedure causes a Tk window to use a given X window as its * parent window, rather than the root window for the screen. It is * invoked by an embedded application to specify the window in which it * is embedded. @@ -196,11 +197,11 @@ * *---------------------------------------------------------------------- */ int -TkpUseWindow( +Tk_UseWindow( Tcl_Interp *interp, /* If not NULL, used for error reporting if * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an * associated X window. */ const char *string) /* String identifying an X window to use for @@ -320,11 +321,11 @@ } /* *---------------------------------------------------------------------- * - * TkpMakeContainer -- + * Tk_MakeContainer -- * * This procedure is called to indicate that a particular window will be * a container for an embedded application. This changes certain aspects * of the window's behavior, such as whether it will receive events * anymore. @@ -337,11 +338,11 @@ * *---------------------------------------------------------------------- */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) /* Token for a window that is about to become * a container. */ { TkWindow *winPtr = (TkWindow *) tkwin; Container *containerPtr; @@ -438,11 +439,11 @@ topWinPtr = winPtr->privatePtr->toplevel->winPtr; if (!Tk_IsEmbedded(topWinPtr)) { return winPtr->privatePtr->toplevel; } - contWinPtr = TkpGetOtherWindow(topWinPtr); + contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)topWinPtr); /* * TODO: Here we should handle out of process embedding. */ @@ -635,48 +636,48 @@ } /* *---------------------------------------------------------------------- * - * TkpGetOtherWindow -- + * Tk_GetOtherWindow -- * * If both the container and embedded window are in the same process, * this procedure will return either one, given the other. * * Results: - * If winPtr is a container, the return value is the token for the + * If tkwin is a container, the return value is the token for the * embedded window, and vice versa. If the "other" window isn't in this * process, NULL is returned. * * Side effects: * None. * *---------------------------------------------------------------------- */ -TkWindow * -TkpGetOtherWindow( - TkWindow *winPtr) /* Tk's structure for a container or embedded +Tk_Window +Tk_GetOtherWindow( + Tk_Window tkwin) /* Tk's structure for a container or embedded * window. */ { Container *containerPtr; /* - * TkpGetOtherWindow returns NULL if both windows are not in the same + * Tk_GetOtherWindow returns NULL if both windows are not in the same * process... */ - if (!(winPtr->flags & TK_BOTH_HALVES)) { + if (!(((TkWindow *)tkwin)->flags & TK_BOTH_HALVES)) { return NULL; } for (containerPtr = firstContainerPtr; containerPtr != NULL; containerPtr = containerPtr->nextPtr) { - if (containerPtr->embeddedPtr == winPtr) { - return containerPtr->parentPtr; - } else if (containerPtr->parentPtr == winPtr) { - return containerPtr->embeddedPtr; + if ((Tk_Window)containerPtr->embeddedPtr == tkwin) { + return (Tk_Window)containerPtr->parentPtr; + } else if ((Tk_Window)containerPtr->parentPtr == tkwin) { + return (Tk_Window)containerPtr->embeddedPtr; } } return NULL; } Index: macosx/tkMacOSXInt.h ================================================================== --- macosx/tkMacOSXInt.h +++ macosx/tkMacOSXInt.h @@ -158,12 +158,10 @@ /* * Prototypes of internal procs not in the stubs table. */ MODULE_SCOPE void TkMacOSXDefaultStartupScript(void); -MODULE_SCOPE void TkpClipDrawableToRect(Display *display, Drawable d, int x, - int y, int width, int height); MODULE_SCOPE void TkpRetainRegion(Region r); MODULE_SCOPE void TkpReleaseRegion(Region r); MODULE_SCOPE void TkpShiftButton(NSButton *button, NSPoint delta); MODULE_SCOPE Bool TkTestLogDisplay(Drawable drawable); Index: macosx/tkMacOSXKeyEvent.c ================================================================== --- macosx/tkMacOSXKeyEvent.c +++ macosx/tkMacOSXKeyEvent.c @@ -663,11 +663,11 @@ NSPoint local = [w mouseLocationOutsideOfEventStream]; NSPoint global = [w tkConvertPointToScreen: local]; int win_x, win_y; if (Tk_IsEmbedded(winPtr)) { - TkWindow *contPtr = TkpGetOtherWindow(winPtr); + TkWindow *contPtr = (TkWindow *)Tk_GetOtherWindow(tkwin); if (Tk_IsTopLevel(contPtr)) { local.x -= contPtr->wmInfoPtr->xInParent; local.y -= contPtr->wmInfoPtr->yInParent; } else { TkWindow *topPtr = TkMacOSXGetHostToplevel(winPtr)->winPtr; Index: macosx/tkMacOSXMenu.c ================================================================== --- macosx/tkMacOSXMenu.c +++ macosx/tkMacOSXMenu.c @@ -1104,11 +1104,11 @@ } /* *---------------------------------------------------------------------- * - * TkpSetMainMenubar -- + * Tk_SetMainMenubar -- * * Puts the menu associated with a window into the menubar. Should only be * called when the window is in front. * * This is a no-op on all other platforms. On OS X it is a no-op when @@ -1124,11 +1124,11 @@ * *---------------------------------------------------------------------- */ void -TkpSetMainMenubar( +Tk_SetMainMenubar( Tcl_Interp *interp, /* The interpreter of the application */ Tk_Window tkwin, /* The frame we are setting up */ const char *menuName) /* The name of the menu to put in front. */ { static Tcl_Interp *currentInterp = NULL; Index: macosx/tkMacOSXMouseEvent.c ================================================================== --- macosx/tkMacOSXMouseEvent.c +++ macosx/tkMacOSXMouseEvent.c @@ -359,11 +359,11 @@ global.x = floor(global.x); global.y = floor(TkMacOSXZeroScreenHeight() - global.y); local.x = floor(local.x); local.y = floor(eventWindow.frame.size.height - local.y); if (Tk_IsEmbedded(winPtr)) { - TkWindow *contPtr = TkpGetOtherWindow(winPtr); + TkWindow *contPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (Tk_IsTopLevel(contPtr)) { local.x -= contPtr->wmInfoPtr->xInParent; local.y -= contPtr->wmInfoPtr->yInParent; } else { TkWindow *topPtr = TkMacOSXGetHostToplevel(winPtr)->winPtr; Index: macosx/tkMacOSXScrlbr.c ================================================================== --- macosx/tkMacOSXScrlbr.c +++ macosx/tkMacOSXScrlbr.c @@ -291,11 +291,11 @@ if (scrollPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(scrollPtr->highlightColorPtr, (Pixmap) macWin); } else { fgGC = bgGC; } - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth, (Pixmap) macWin); } Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Index: macosx/tkMacOSXSubwindows.c ================================================================== --- macosx/tkMacOSXSubwindows.c +++ macosx/tkMacOSXSubwindows.c @@ -196,18 +196,18 @@ NSPoint viewLocation = [view convertPoint:mouse fromView:nil]; if (NSPointInRect(viewLocation, NSInsetRect([view bounds], 2, 2))) { Tk_UpdatePointer((Tk_Window) winPtr, x, y, [NSApp tkButtonState]); } } else { - TkWindow *contWinPtr = TkpGetOtherWindow(winPtr); + Tk_Window contWinPtr = Tk_GetOtherWindow((Tk_Window)winPtr); /* * Rebuild the container's clipping region and display * the window. */ - TkMacOSXInvalClipRgns((Tk_Window)contWinPtr); + TkMacOSXInvalClipRgns(contWinPtr); TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW); } TkMacOSXInvalClipRgns((Tk_Window)winPtr); } else { @@ -544,11 +544,11 @@ /* * Find the Parent window, for an embedded window it will be its container. */ if (Tk_IsEmbedded(macWin->winPtr)) { - TkWindow *contWinPtr = TkpGetOtherWindow(macWin->winPtr); + TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)macWin->winPtr); if (contWinPtr) { macParent = contWinPtr->privatePtr; } else { /* @@ -802,11 +802,11 @@ /* * If the window is a container, set the flag for its embedded window. */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr) { TkMacOSXSetDrawingEnabled(childPtr, flag); } } @@ -883,11 +883,11 @@ } TkMacOSXWinCGBounds(win2Ptr, &bounds); ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds); } } else if (Tk_IsEmbedded(winPtr)) { - win2Ptr = TkpGetOtherWindow(winPtr); + win2Ptr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (win2Ptr) { TkMacOSXUpdateClipRgn(win2Ptr); ChkErr(HIShapeIntersect, win2Ptr->privatePtr->aboveVisRgn, rgn, rgn); } @@ -916,11 +916,11 @@ rgnChanged = 1; win2Ptr = win2Ptr->nextPtr; } if (Tk_IsContainer(winPtr)) { - win2Ptr = TkpGetOtherWindow(winPtr); + win2Ptr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (win2Ptr) { if (Tk_IsMapped(win2Ptr)) { TkMacOSXWinCGBounds(win2Ptr, &bounds); ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds); rgnChanged = 1; @@ -950,11 +950,11 @@ */ if (!Tk_IsTopLevel(winPtr)) { TkMacOSXUpdateClipRgn(winPtr->parentPtr); } else if (Tk_IsEmbedded(winPtr)) { - win2Ptr = TkpGetOtherWindow(winPtr); + win2Ptr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (win2Ptr) { TkMacOSXUpdateClipRgn(win2Ptr); } } macWin->aboveVisRgn = TkMacOSXHIShapeCreateEmpty(); @@ -1113,11 +1113,11 @@ result = macWin->toplevel->winPtr->wmInfoPtr->window; } else if (macWin->winPtr && macWin->winPtr->wmInfoPtr && macWin->winPtr->wmInfoPtr->window) { result = macWin->winPtr->wmInfoPtr->window; } else if (macWin->toplevel && (macWin->toplevel->flags & TK_EMBEDDED)) { - TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr); + TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)macWin->toplevel->winPtr); if (contWinPtr) { result = TkMacOSXGetNSWindowForDrawable((Drawable)contWinPtr->privatePtr); } } @@ -1159,11 +1159,11 @@ } else if (!macWin->toplevel) { result = macWin->view; } else if (!(macWin->toplevel->flags & TK_EMBEDDED)) { result = macWin->toplevel->view; } else { - TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr); + TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)macWin->toplevel->winPtr); if (contWinPtr) { result = TkMacOSXGetRootControl((Drawable)contWinPtr->privatePtr); } } @@ -1241,11 +1241,11 @@ /* * Also, if the window is a container, mark its embedded window. */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr) { TkMacOSXInvalClipRgns((Tk_Window)childPtr); } @@ -1396,11 +1396,11 @@ } childPtr = childPtr->nextPtr; } if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr != NULL) { UpdateOffsets(childPtr,deltaX,deltaY); } /* Index: macosx/tkMacOSXWindowEvent.c ================================================================== --- macosx/tkMacOSXWindowEvent.c +++ macosx/tkMacOSXWindowEvent.c @@ -570,11 +570,11 @@ /* * Generate updates for any contained windows */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr != NULL && Tk_IsMapped(childPtr)) { GenerateUpdates(updateBounds, childPtr); } /* Index: macosx/tkMacOSXWm.c ================================================================== --- macosx/tkMacOSXWm.c +++ macosx/tkMacOSXWm.c @@ -4454,11 +4454,11 @@ * ICCCM. Moving a window to its current location may cause it to shift * position on the screen. */ if (Tk_IsEmbedded(winPtr)) { - TkWindow *contWinPtr = TkpGetOtherWindow(winPtr); + Tk_Window contWinPtr = Tk_GetOtherWindow((Tk_Window)winPtr); /* * TODO: Here we should handle out of process embedding. */ @@ -4471,11 +4471,11 @@ * embedded windows are not allowed to move. */ wmPtr->x = wmPtr->y = 0; wmPtr->flags &= ~(WM_NEGATIVE_X|WM_NEGATIVE_Y); - Tk_GeometryRequest((Tk_Window)contWinPtr, width, height); + Tk_GeometryRequest(contWinPtr, width, height); } return; } if (wmPtr->flags & WM_MOVE_PENDING) { wmPtr->configWidth = width; @@ -4744,11 +4744,11 @@ x += winPtr->wmInfoPtr->xInParent; y += winPtr->wmInfoPtr->yInParent; break; } - otherPtr = TkpGetOtherWindow(winPtr); + otherPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (otherPtr == NULL) { break; } /* @@ -4827,11 +4827,11 @@ * Container windows cannot have children. So if it is a container, * look there, otherwise inspect the children. */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr != NULL) { if (Tk_IsMapped(childPtr)) { tmpx = x - childPtr->changes.x; tmpy = y - childPtr->changes.y; bd = childPtr->changes.border_width; @@ -4923,11 +4923,11 @@ * Container windows cannot have children. So if it is a container, * look there, otherwise inspect the children. */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr != NULL) { if (Tk_IsMapped(childPtr) && x > childPtr->changes.x && x < childPtr->changes.x + childPtr->changes.width && y > childPtr->changes.y && @@ -6273,11 +6273,11 @@ * If this is embedded, make sure its container's toplevel exists, then * return... */ if (Tk_IsEmbedded(winPtr)) { - TkWindow *contWinPtr = TkpGetOtherWindow(winPtr); + TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (contWinPtr != NULL) { TkMacOSXMakeRealWindowExist( contWinPtr->privatePtr->toplevel->winPtr); macWin->flags |= TK_HOST_EXISTS; Index: tests/unixEmbed.test ================================================================== --- tests/unixEmbed.test +++ tests/unixEmbed.test @@ -225,12 +225,12 @@ testembed } -cleanup { deleteWindows } -result {{XXX .f2 {} .t2} {XXX .f1 {} .t1}} -# Can't think of any way to test the procedures TkpMakeWindow, -# TkpMakeContainer, or EmbedErrorProc. +# Can't think of any way to test the procedures Tk_MakeWindow, +# Tk_MakeContainer, or EmbedErrorProc. test unixEmbed-2.1 {EmbeddedEventProc procedure} -constraints { unix testembed notAqua } -setup { Index: unix/tkUnixConfig.c ================================================================== --- unix/tkUnixConfig.c +++ unix/tkUnixConfig.c @@ -14,17 +14,17 @@ /* *---------------------------------------------------------------------- * - * TkpGetSystemDefault -- + * Tk_GetSystemDefault -- * * Given a dbName and className for a configuration option, return a * string representation of the option. * * Results: - * Returns a Tk_Uid that is the string identifier that identifies this + * Returns a Tcl_Obj* with the string identifier that identifies this * option. Returns NULL if there are no system defaults that match this * pair. * * Side effects: * None, once the package is initialized. @@ -31,11 +31,11 @@ * *---------------------------------------------------------------------- */ Tcl_Obj * -TkpGetSystemDefault( +Tk_GetSystemDefault( Tk_Window tkwin, /* A window to use. */ const char *dbName, /* The option database name. */ const char *className) /* The name of the option class. */ { (void)tkwin; Index: unix/tkUnixDraw.c ================================================================== --- unix/tkUnixDraw.c +++ unix/tkUnixDraw.c @@ -173,11 +173,11 @@ } /* *---------------------------------------------------------------------- * - * TkpDrawHighlightBorder -- + * Tk_DrawHighlightBorder -- * * This function draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. * * On Unix, we just draw the simple inset ring. On other sytems, e.g. the @@ -193,11 +193,11 @@ * *---------------------------------------------------------------------- */ void -TkpDrawHighlightBorder( +Tk_DrawHighlightBorder( Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable) Index: unix/tkUnixEmbed.c ================================================================== --- unix/tkUnixEmbed.c +++ unix/tkUnixEmbed.c @@ -69,11 +69,11 @@ static void EmbedWindowDeleted(TkWindow *winPtr); /* *---------------------------------------------------------------------- * - * TkpUseWindow -- + * Tk_UseWindow -- * * This function causes a Tk window to use a given X window as its parent * window, rather than the root window for the screen. It is invoked by * an embedded application to specify the window in which it is embedded. * @@ -89,11 +89,11 @@ * *---------------------------------------------------------------------- */ int -TkpUseWindow( +Tk_UseWindow( Tcl_Interp *interp, /* If not NULL, used for error reporting if * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an * associated X window. */ const char *string) /* String identifying an X window to use for @@ -192,11 +192,11 @@ } /* *---------------------------------------------------------------------- * - * TkpMakeWindow -- + * Tk_MakeWindow -- * * Create an actual window system window object based on the current * attributes of the specified TkWindow. * * Results: @@ -207,17 +207,18 @@ * *---------------------------------------------------------------------- */ Window -TkpMakeWindow( - TkWindow *winPtr, /* Tk's information about the window that is +Tk_MakeWindow( + Tk_Window tkwin, /* Tk's information about the window that is * to be instantiated. */ Window parent) /* Window system token for the parent in which * the window is to be created. */ { Container *containerPtr; + TkWindow *winPtr = (TkWindow *) tkwin; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->flags & TK_EMBEDDED) { /* @@ -248,11 +249,11 @@ } /* *---------------------------------------------------------------------- * - * TkpMakeContainer -- + * Tk_MakeContainer -- * * This function is called to indicate that a particular window will be a * container for an embedded application. This changes certain aspects of * the window's behavior, such as whether it will receive events anymore. * @@ -264,11 +265,11 @@ * *---------------------------------------------------------------------- */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) /* Token for a window that is about to become * a container. */ { TkWindow *winPtr = (TkWindow *) tkwin; Container *containerPtr; @@ -689,42 +690,42 @@ } /* *---------------------------------------------------------------------- * - * TkpGetOtherWindow -- + * Tk_GetOtherWindow -- * * If both the container and embedded window are in the same process, * this function will return either one, given the other. * * Results: - * If winPtr is a container, the return value is the token for the + * If tkwin is a container, the return value is the token for the * embedded window, and vice versa. If the "other" window isn't in this * process, NULL is returned. * * Side effects: * None. * *---------------------------------------------------------------------- */ -TkWindow * -TkpGetOtherWindow( - TkWindow *winPtr) /* Tk's structure for a container or embedded +Tk_Window +Tk_GetOtherWindow( + Tk_Window tkwin) /* Tk's structure for a container or embedded * window. */ { Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (containerPtr = tsdPtr->firstContainerPtr; containerPtr != NULL; containerPtr = containerPtr->nextPtr) { - if (containerPtr->embeddedPtr == winPtr) { - return containerPtr->parentPtr; - } else if (containerPtr->parentPtr == winPtr) { - return containerPtr->embeddedPtr; + if ((Tk_Window)containerPtr->embeddedPtr == tkwin) { + return (Tk_Window)containerPtr->parentPtr; + } else if ((Tk_Window)containerPtr->parentPtr == tkwin) { + return (Tk_Window)containerPtr->embeddedPtr; } } return NULL; } Index: unix/tkUnixMenu.c ================================================================== --- unix/tkUnixMenu.c +++ unix/tkUnixMenu.c @@ -288,11 +288,11 @@ * *---------------------------------------------------------------------- */ void -TkpSetMainMenubar( +Tk_SetMainMenubar( TCL_UNUSED(Tcl_Interp *), TCL_UNUSED(Tk_Window), TCL_UNUSED(const char *)) { /* Index: unix/tkUnixWm.c ================================================================== --- unix/tkUnixWm.c +++ unix/tkUnixWm.c @@ -4754,11 +4754,11 @@ * position on the screen. */ if ((winPtr->flags & (TK_EMBEDDED|TK_BOTH_HALVES)) == (TK_EMBEDDED|TK_BOTH_HALVES)) { - TkWindow *childPtr = TkpGetOtherWindow(winPtr); + Tk_Window childPtr = Tk_GetOtherWindow((Tk_Window)winPtr); /* * This window is embedded and the container is also in this process, * so we don't need to do anything special about the geometry, except * to make sure that the desired size is known by the container. Also, @@ -4768,11 +4768,11 @@ wmPtr->x = wmPtr->y = 0; wmPtr->flags &= ~(WM_NEGATIVE_X|WM_NEGATIVE_Y); height += wmPtr->menuHeight; if (childPtr != NULL) { - Tk_GeometryRequest((Tk_Window) childPtr, width, height); + Tk_GeometryRequest(childPtr, width, height); } return; } serial = NextRequest(winPtr->display); height += wmPtr->menuHeight; @@ -5774,16 +5774,16 @@ y -= winPtr->wmInfoPtr->menuHeight; winPtr = winPtr->wmInfoPtr->winPtr; continue; } if (winPtr->flags & TK_TOP_LEVEL) { - TkWindow *otherPtr; + Tk_Window otherPtr; if (!(winPtr->flags & TK_EMBEDDED)) { break; } - otherPtr = TkpGetOtherWindow(winPtr); + otherPtr = Tk_GetOtherWindow((Tk_Window)winPtr); if (otherPtr == NULL) { /* * The container window is not in the same application. Query * the X server. */ @@ -5804,11 +5804,11 @@ /* * The container window is in the same application. Let's * query its coordinates. */ - winPtr = otherPtr; + winPtr = (TkWindow *)otherPtr; continue; } } winPtr = winPtr->parentPtr; if (winPtr == NULL) { @@ -5938,11 +5938,11 @@ } if (wmPtr->wrapperPtr != NULL) { if (child == wmPtr->wrapperPtr->window) { goto gotToplevel; } else if (wmPtr->winPtr->flags & TK_EMBEDDED && - TkpGetOtherWindow(wmPtr->winPtr) == NULL) { + Tk_GetOtherWindow((Tk_Window)wmPtr->winPtr) == NULL) { /* * This toplevel is embedded in a window belonging to * a different application. */ @@ -6038,11 +6038,11 @@ * The window containing the point is a container, and the * embedded application is in this same process. Switch over to * the toplevel for the embedded application and start processing * that toplevel from scratch. */ - winPtr = TkpGetOtherWindow(nextPtr); + winPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)nextPtr); if (winPtr == NULL) { return (Tk_Window) nextPtr; } wmPtr = winPtr->wmInfoPtr; childX = x; @@ -7044,11 +7044,11 @@ Tk_MakeWindowExist((Tk_Window) winPtr); } /* * The code below is copied from CreateTopLevelWindow, Tk_MakeWindowExist, - * and TkpMakeWindow. The idea is to create an "official" Tk window (so + * and Tk_MakeWindow. The idea is to create an "official" Tk window (so * that we can get events on it), but to hide the window outside the * official Tk hierarchy so that it isn't visible to the application. See * the comments for the other functions if you have questions about this * code. */ Index: win/tkWinConfig.c ================================================================== --- win/tkWinConfig.c +++ win/tkWinConfig.c @@ -14,17 +14,17 @@ /* *---------------------------------------------------------------------- * - * TkpGetSystemDefault -- + * Tk_GetSystemDefault -- * * Given a dbName and className for a configuration option, return a * string representation of the option. * * Results: - * Returns a Tk_Uid that is the string identifier that identifies this + * Returns a Tcl_Obj* with the string identifier that identifies this * option. Returns NULL if there are no system defaults that match this * pair. * * Side effects: * None, once the package is initialized. @@ -31,11 +31,11 @@ * *---------------------------------------------------------------------- */ Tcl_Obj * -TkpGetSystemDefault( +Tk_GetSystemDefault( Tk_Window tkwin, /* A window to use. */ const char *dbName, /* The option database name. */ const char *className) /* The name of the option class. */ { Tcl_Obj *valueObjPtr; Index: win/tkWinDraw.c ================================================================== --- win/tkWinDraw.c +++ win/tkWinDraw.c @@ -1455,11 +1455,11 @@ } /* *---------------------------------------------------------------------- * - * TkpDrawHighlightBorder -- + * Tk_DrawHighlightBorder -- * * This function draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. * * On Windows, we just draw the simple inset ring. On other sytems, e.g. @@ -1475,11 +1475,11 @@ * *---------------------------------------------------------------------- */ void -TkpDrawHighlightBorder( +Tk_DrawHighlightBorder( Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable) Index: win/tkWinEmbed.c ================================================================== --- win/tkWinEmbed.c +++ win/tkWinEmbed.c @@ -181,11 +181,11 @@ } /* *---------------------------------------------------------------------- * - * TkpUseWindow -- + * Tk_UseWindow -- * * This procedure causes a Tk window to use a given Windows handle for a * window as its underlying window, rather than a new Windows window * being created automatically. It is invoked by an embedded application * to specify the window in which the application is embedded. @@ -227,11 +227,11 @@ * *---------------------------------------------------------------------- */ int -TkpUseWindow( +Tk_UseWindow( Tcl_Interp *interp, /* If not NULL, used for error reporting if * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an * associated X window. */ const char *string) /* String identifying an X window to use for @@ -342,11 +342,11 @@ } /* *---------------------------------------------------------------------- * - * TkpMakeContainer -- + * Tk_MakeContainer -- * * This procedure is called to indicate that a particular window will be * a container for an embedded application. This changes certain aspects * of the window's behavior, such as whether it will receive events * anymore. @@ -359,11 +359,11 @@ * *---------------------------------------------------------------------- */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) { TkWindow *winPtr = (TkWindow *) tkwin; Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -887,41 +887,41 @@ } /* *---------------------------------------------------------------------- * - * TkpGetOtherWindow -- + * Tk_GetOtherWindow -- * * If both the container and embedded window are in the same process, * this procedure will return either one, given the other. * * Results: - * If winPtr is a container, the return value is the token for the + * If tkwin is a container, the return value is the token for the * embedded window, and vice versa. If the "other" window isn't in this * process, NULL is returned. * * Side effects: * None. * *---------------------------------------------------------------------- */ -TkWindow * -TkpGetOtherWindow( - TkWindow *winPtr) /* Tk's structure for a container or embedded +Tk_Window +Tk_GetOtherWindow( + Tk_Window tkwin) /* Tk's structure for a container or embedded * window. */ { Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (containerPtr = tsdPtr->firstContainerPtr; containerPtr != NULL; containerPtr = containerPtr->nextPtr) { - if (containerPtr->embeddedPtr == winPtr) { - return containerPtr->parentPtr; - } else if (containerPtr->parentPtr == winPtr) { - return containerPtr->embeddedPtr; + if ((Tk_Window)containerPtr->embeddedPtr == tkwin) { + return (Tk_Window)containerPtr->parentPtr; + } else if ((Tk_Window)containerPtr->parentPtr == tkwin) { + return (Tk_Window)containerPtr->embeddedPtr; } } return NULL; } Index: win/tkWinMenu.c ================================================================== --- win/tkWinMenu.c +++ win/tkWinMenu.c @@ -1538,11 +1538,11 @@ } /* *---------------------------------------------------------------------- * - * TkpSetMainMenubar -- + * Tk_SetMainMenubar -- * * Puts the menu associated with a window into the menubar. Should only * be called when the window is in front. * * Results: @@ -1553,11 +1553,11 @@ * *---------------------------------------------------------------------- */ void -TkpSetMainMenubar( +Tk_SetMainMenubar( Tcl_Interp *interp, /* The interpreter of the application */ Tk_Window tkwin, /* The frame we are setting up */ const char *menuName) /* The name of the menu to put in front. If * NULL, use the default menu bar. */ { Index: win/tkWinWindow.c ================================================================== --- win/tkWinWindow.c +++ win/tkWinWindow.c @@ -245,17 +245,18 @@ * *---------------------------------------------------------------------- */ Window -TkpMakeWindow( - TkWindow *winPtr, +Tk_MakeWindow( + Tk_Window tkwin, Window parent) { HWND parentWin; int style; HWND hwnd; + TkWindow *winPtr = (TkWindow *)tkwin; if (parent != None) { parentWin = Tk_GetHWND(parent); style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; } else {