diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-10 07:46:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-10 07:46:23 (GMT) |
commit | d04037e2ec5c24ef18b159dc174f9c3d6b73a0f7 (patch) | |
tree | 18a999c732269376c9c201d869164d6fc67f0114 | |
parent | 7542a1d1998f569169fa1697d2dbd79e736377a1 (diff) | |
parent | ea3910ca7bc5d606a0642b00742d37b7b036c7be (diff) | |
download | tk-d04037e2ec5c24ef18b159dc174f9c3d6b73a0f7.zip tk-d04037e2ec5c24ef18b159dc174f9c3d6b73a0f7.tar.gz tk-d04037e2ec5c24ef18b159dc174f9c3d6b73a0f7.tar.bz2 |
TIP #606 implementation: Export more private Tk functions
43 files changed, 454 insertions, 146 deletions
diff --git a/doc/3DBorder.3 b/doc/3DBorder.3 index f589e66..0bc41d0 100644 --- a/doc/3DBorder.3 +++ b/doc/3DBorder.3 @@ -9,7 +9,7 @@ .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, fBTk_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 <tk.h>\fR @@ -17,9 +17,18 @@ Tk_Alloc3DBorderFromObj, Tk_Get3DBorder, Tk_Get3DBorderFromObj, Tk_Draw3DRectang 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 @@ -90,6 +99,8 @@ Height of rectangle describing border or bevel, in pixels. 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, @@ -133,6 +144,16 @@ 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 @@ -159,11 +180,24 @@ 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 diff --git a/doc/AddOption.3 b/doc/AddOption.3 index c1c116a..a331455 100644 --- a/doc/AddOption.3 +++ b/doc/AddOption.3 @@ -13,6 +13,9 @@ Tk_AddOption \- Add an option to the option database .sp void \fBTk_AddOption\fR(\fItkwin, name, value, priority\fR) +.sp +void +\fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR) .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. @@ -20,12 +23,16 @@ Token for window. 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. @@ -46,5 +53,7 @@ user-specific startup files. .IP 80 Used for options specified interactively after the application starts running. +\fBTk_GetSystemDefault\fR return a Tk_Uid string representation of the given \fIdbname\fR and \fIclassName\fR of a configuration option. +Returns NULL if there are no system defaults that match this pair. .SH KEYWORDS class, name, option, add diff --git a/doc/MainWin.3 b/doc/MainWin.3 index 94bd7e2..b11b6cd 100644 --- a/doc/MainWin.3 +++ b/doc/MainWin.3 @@ -17,12 +17,26 @@ Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main window inform 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 @@ -36,5 +50,12 @@ 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 diff --git a/doc/WinUtil.3 b/doc/WinUtil.3 new file mode 100644 index 0000000..253ed19 --- /dev/null +++ b/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 <tk.h>\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 diff --git a/generic/tk.decls b/generic/tk.decls index 418ae35..7c459b2 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1097,6 +1097,44 @@ declare 280 { 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. diff --git a/generic/tk3d.c b/generic/tk3d.c index e988d3e..65ae8d0 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -1387,6 +1387,40 @@ TkDebugBorder( } 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: diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 829d65a..5b9affe 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -3162,7 +3162,7 @@ DisplayCanvas( 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 */ @@ -3221,7 +3221,7 @@ DisplayCanvas( 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 */ } @@ -3248,10 +3248,10 @@ DisplayCanvas( 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)); } } diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 89b327d..e9db3b9 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -455,7 +455,7 @@ Tk_InitOptions( 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; diff --git a/generic/tkDecls.h b/generic/tkDecls.h index f2fe64c..dc3563a 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -896,6 +896,36 @@ 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; @@ -1189,6 +1219,16 @@ typedef struct TkStubs { 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; @@ -1763,6 +1803,26 @@ extern const TkStubs *tkStubsPtr; (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) */ @@ -1782,6 +1842,10 @@ extern const TkStubs *tkStubsPtr; #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, diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 20173c6..28ad727 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1927,9 +1927,9 @@ DisplayEntry( 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); } } } diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 9dbee48..2b45c31 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -579,8 +579,8 @@ CreateFrame( * 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) { @@ -634,7 +634,7 @@ CreateFrame( 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) { @@ -727,7 +727,7 @@ CreateFrame( Tcl_SetErrorCode(interp, "TK", "FRAME", "CONTAINMENT", NULL); goto error; } - TkpMakeContainer(framePtr->tkwin); + Tk_MakeContainer(framePtr->tkwin); } if (type == TYPE_TOPLEVEL) { Tcl_DoWhenIdle(MapFrame, framePtr); @@ -843,7 +843,7 @@ FrameWidgetObjCmd( 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; @@ -1035,7 +1035,7 @@ ConfigureFrame( || ((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); } @@ -1502,10 +1502,10 @@ DisplayFrame( 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)); } } @@ -1747,7 +1747,7 @@ FrameEventProc( 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; @@ -1796,7 +1796,7 @@ FrameEventProc( } } } else if (eventPtr->type == ActivateNotify) { - TkpSetMainMenubar(framePtr->interp, framePtr->tkwin, + Tk_SetMainMenubar(framePtr->interp, framePtr->tkwin, framePtr->menuName); } return; @@ -1834,7 +1834,7 @@ FrameCmdDeletedProc( 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; @@ -2068,7 +2068,7 @@ TkMapTopFrame( 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) { diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 3f91d5e..28cddd2 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -308,7 +308,7 @@ declare 83 { # 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) } diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 2e96807..de7e9fc 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -267,7 +267,8 @@ EXTERN void TkSelInit(Tk_Window tkwin); 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 */ @@ -660,7 +661,7 @@ typedef struct TkIntStubs { 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 */ @@ -1204,6 +1205,25 @@ extern const TkIntStubs *tkIntStubsPtr; #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 diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 68b82cb..6a3b73e 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -2192,10 +2192,10 @@ DisplayListbox( 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); } } diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 174736a..8958c51 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -580,14 +580,14 @@ Tk_MenuObjCmd( 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; } @@ -3139,7 +3139,7 @@ TkNewMenuName( /* *---------------------------------------------------------------------- * - * 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. @@ -3155,7 +3155,7 @@ TkNewMenuName( */ 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 @@ -3297,7 +3297,7 @@ TkSetWindowMenuBar( } else { TkpSetWindowMenuBar(tkwin, NULL); } - TkpSetMainMenubar(interp, tkwin, menuName); + Tk_SetMainMenubar(interp, tkwin, menuName); } /* diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index fd059bf..be82b71 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -775,7 +775,7 @@ TkMenuEventProc( 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) { diff --git a/generic/tkMessage.c b/generic/tkMessage.c index c0b9963..90d92ea 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -712,10 +712,10 @@ DisplayMessage( 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)); } } diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index ac3e95a..8a18796 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -25,6 +25,8 @@ /* 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 */ @@ -59,6 +61,17 @@ static int TkWinGetPlatformId(void) { # 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) { @@ -1332,7 +1345,17 @@ const TkStubs tkStubs = { 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. */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 7682682..2301f49 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2468,7 +2468,7 @@ DisplayDLine( } #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 */ @@ -2593,7 +2593,7 @@ DisplayDLine( 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++; } @@ -4424,10 +4424,10 @@ DisplayText( 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)); } } diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 41ac565..d8331c3 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -584,7 +584,7 @@ TkDrawInsetFocusHighlight( * 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 diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 884bbb4..904a336 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -1322,7 +1322,7 @@ 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; @@ -1439,10 +1439,10 @@ Tk_DestroyWindow( * (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; @@ -1793,7 +1793,7 @@ Tk_MakeWindowExist( 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, diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c index 1588d21..cf90577 100644 --- a/macosx/tkMacOSXConfig.c +++ b/macosx/tkMacOSXConfig.c @@ -17,7 +17,7 @@ /* *---------------------------------------------------------------------- * - * TkpGetSystemDefault -- + * Tk_GetSystemDefault -- * * Given a dbName and className for a configuration option, * return a string representation of the option. @@ -34,7 +34,7 @@ */ 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. */ diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 9f6966a..245279b 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1563,7 +1563,7 @@ TkMacOSXGetClipRgn( /* *---------------------------------------------------------------------- * - * TkpClipDrawableToRect -- + * Tk_ClipDrawableToRect -- * * Clip all drawing into the drawable d to the given rectangle. If width * or height are negative, reset to no clipping. @@ -1578,7 +1578,7 @@ TkMacOSXGetClipRgn( */ void -TkpClipDrawableToRect( +Tk_ClipDrawableToRect( TCL_UNUSED(Display *), Drawable d, int x, int y, @@ -1679,7 +1679,7 @@ TkMacOSXMakeStippleMap( /* *---------------------------------------------------------------------- * - * TkpDrawHighlightBorder -- + * Tk_DrawHighlightBorder -- * * This procedure draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. @@ -1701,7 +1701,7 @@ TkMacOSXMakeStippleMap( */ void -TkpDrawHighlightBorder ( +Tk_DrawHighlightBorder ( Tk_Window tkwin, GC fgGC, GC bgGC, diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 029624d..3f5d0a4 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -75,16 +75,17 @@ static void EmbedWindowDeleted(TkWindow *winPtr); */ 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)) { @@ -178,7 +179,7 @@ TkpScanWindowId( /* *---------------------------------------------------------------------- * - * 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 @@ -198,7 +199,7 @@ TkpScanWindowId( */ 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 @@ -322,7 +323,7 @@ TkpUseWindow( /* *---------------------------------------------------------------------- * - * 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 @@ -339,7 +340,7 @@ TkpUseWindow( */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) /* Token for a window that is about to become * a container. */ { @@ -440,7 +441,7 @@ TkMacOSXGetHostToplevel( 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. @@ -637,13 +638,13 @@ TkpRedirectKeyEvent( /* *---------------------------------------------------------------------- * - * 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. * @@ -653,28 +654,28 @@ TkpRedirectKeyEvent( *---------------------------------------------------------------------- */ -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; diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index b0af85b..145e7c0 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -160,8 +160,6 @@ typedef struct TkWindowPrivate MacDrawable; */ 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); diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 794e704..b60c15f 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -665,7 +665,7 @@ setXEventPoint( 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; diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 346ee47..9f60bf8 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -1106,7 +1106,7 @@ TkpSetWindowMenuBar( /* *---------------------------------------------------------------------- * - * TkpSetMainMenubar -- + * Tk_SetMainMenubar -- * * Puts the menu associated with a window into the menubar. Should only be * called when the window is in front. @@ -1126,7 +1126,7 @@ TkpSetWindowMenuBar( */ 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. */ diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 0624f30..891421f 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -361,7 +361,7 @@ enum { 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; diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 6ed53ee..abf2073 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -293,7 +293,7 @@ TkpDisplayScrollbar( } else { fgGC = bgGC; } - TkpDrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth, (Pixmap) macWin); } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index e8d8b22..8908183 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -198,14 +198,14 @@ XMapWindow( 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); @@ -546,7 +546,7 @@ MoveResizeWindow( */ if (Tk_IsEmbedded(macWin->winPtr)) { - TkWindow *contWinPtr = TkpGetOtherWindow(macWin->winPtr); + TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)macWin->winPtr); if (contWinPtr) { macParent = contWinPtr->privatePtr; @@ -804,7 +804,7 @@ TkMacOSXSetDrawingEnabled( */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr) { TkMacOSXSetDrawingEnabled(childPtr, flag); @@ -885,7 +885,7 @@ TkMacOSXUpdateClipRgn( 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, @@ -918,7 +918,7 @@ TkMacOSXUpdateClipRgn( } if (Tk_IsContainer(winPtr)) { - win2Ptr = TkpGetOtherWindow(winPtr); + win2Ptr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (win2Ptr) { if (Tk_IsMapped(win2Ptr)) { TkMacOSXWinCGBounds(win2Ptr, &bounds); @@ -952,7 +952,7 @@ TkMacOSXUpdateClipRgn( 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); } @@ -1115,7 +1115,7 @@ Tk_MacOSXGetNSWindowForDrawable( 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); @@ -1161,7 +1161,7 @@ TkMacOSXGetRootControl( } 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); @@ -1243,7 +1243,7 @@ TkMacOSXInvalClipRgns( */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr) { TkMacOSXInvalClipRgns((Tk_Window)childPtr); @@ -1398,7 +1398,7 @@ UpdateOffsets( } if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr != NULL) { UpdateOffsets(childPtr,deltaX,deltaY); } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 56d69b2..cae3d02 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -572,7 +572,7 @@ GenerateUpdates( */ if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); + childPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (childPtr != NULL && Tk_IsMapped(childPtr)) { GenerateUpdates(updateBounds, childPtr); } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 3aaf423..74ea7cf 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -4456,7 +4456,7 @@ UpdateGeometryInfo( */ 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. @@ -4473,7 +4473,7 @@ UpdateGeometryInfo( 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; } @@ -4746,7 +4746,7 @@ Tk_GetRootCoords( break; } - otherPtr = TkpGetOtherWindow(winPtr); + otherPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (otherPtr == NULL) { break; } @@ -4829,7 +4829,7 @@ Tk_CoordsToWindow( */ 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; @@ -4925,7 +4925,7 @@ Tk_TopCoordsToWindow( */ 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 && @@ -6275,7 +6275,7 @@ TkMacOSXMakeRealWindowExist( */ if (Tk_IsEmbedded(winPtr)) { - TkWindow *contWinPtr = TkpGetOtherWindow(winPtr); + TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)winPtr); if (contWinPtr != NULL) { TkMacOSXMakeRealWindowExist( diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index d4f7259..409592c 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -227,8 +227,8 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} 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 { diff --git a/unix/tkUnixConfig.c b/unix/tkUnixConfig.c index 922f127..3a5aed1 100644 --- a/unix/tkUnixConfig.c +++ b/unix/tkUnixConfig.c @@ -16,7 +16,7 @@ /* *---------------------------------------------------------------------- * - * TkpGetSystemDefault -- + * Tk_GetSystemDefault -- * * Given a dbName and className for a configuration option, return a * string representation of the option. @@ -33,7 +33,7 @@ */ 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. */ diff --git a/unix/tkUnixDraw.c b/unix/tkUnixDraw.c index a9d6d73..813df79 100644 --- a/unix/tkUnixDraw.c +++ b/unix/tkUnixDraw.c @@ -175,7 +175,7 @@ ScrollRestrictProc( /* *---------------------------------------------------------------------- * - * TkpDrawHighlightBorder -- + * Tk_DrawHighlightBorder -- * * This function draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. @@ -195,7 +195,7 @@ ScrollRestrictProc( */ void -TkpDrawHighlightBorder( +Tk_DrawHighlightBorder( Tk_Window tkwin, GC fgGC, GC bgGC, diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c index bdb6950..3057729 100644 --- a/unix/tkUnixEmbed.c +++ b/unix/tkUnixEmbed.c @@ -71,7 +71,7 @@ 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 @@ -91,7 +91,7 @@ static void EmbedWindowDeleted(TkWindow *winPtr); */ 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 @@ -194,7 +194,7 @@ TkpUseWindow( /* *---------------------------------------------------------------------- * - * TkpMakeWindow -- + * Tk_MakeWindow -- * * Create an actual window system window object based on the current * attributes of the specified TkWindow. @@ -209,13 +209,14 @@ TkpUseWindow( */ 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)); @@ -250,7 +251,7 @@ TkpMakeWindow( /* *---------------------------------------------------------------------- * - * 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 @@ -266,7 +267,7 @@ TkpMakeWindow( */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) /* Token for a window that is about to become * a container. */ { @@ -691,13 +692,13 @@ EmbedSendConfigure( /* *---------------------------------------------------------------------- * - * 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. * @@ -707,9 +708,9 @@ EmbedSendConfigure( *---------------------------------------------------------------------- */ -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; @@ -719,10 +720,10 @@ TkpGetOtherWindow( 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; diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index 3b67aa0..afaffe7 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -290,7 +290,7 @@ TkpSetWindowMenuBar( */ void -TkpSetMainMenubar( +Tk_SetMainMenubar( TCL_UNUSED(Tcl_Interp *), TCL_UNUSED(Tk_Window), TCL_UNUSED(const char *)) diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index ef47c51..173fd68 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -4756,7 +4756,7 @@ UpdateGeometryInfo( 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, @@ -4770,7 +4770,7 @@ UpdateGeometryInfo( 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; } @@ -5776,12 +5776,12 @@ Tk_GetRootCoords( 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 @@ -5806,7 +5806,7 @@ Tk_GetRootCoords( * query its coordinates. */ - winPtr = otherPtr; + winPtr = (TkWindow *)otherPtr; continue; } } @@ -5940,7 +5940,7 @@ Tk_CoordsToWindow( 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 @@ -6040,7 +6040,7 @@ Tk_CoordsToWindow( * 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; } @@ -7046,7 +7046,7 @@ CreateWrapper( /* * 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 diff --git a/win/tkWinConfig.c b/win/tkWinConfig.c index 1c93e12..ab0bb5f 100644 --- a/win/tkWinConfig.c +++ b/win/tkWinConfig.c @@ -16,7 +16,7 @@ /* *---------------------------------------------------------------------- * - * TkpGetSystemDefault -- + * Tk_GetSystemDefault -- * * Given a dbName and className for a configuration option, return a * string representation of the option. @@ -33,7 +33,7 @@ */ 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. */ diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 531f06b..730af71 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -1457,7 +1457,7 @@ TkWinFillRect( /* *---------------------------------------------------------------------- * - * TkpDrawHighlightBorder -- + * Tk_DrawHighlightBorder -- * * This function draws a rectangular ring around the outside of a widget * to indicate that it has received the input focus. @@ -1477,7 +1477,7 @@ TkWinFillRect( */ void -TkpDrawHighlightBorder( +Tk_DrawHighlightBorder( Tk_Window tkwin, GC fgGC, GC bgGC, diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 126b6d1..7a10795 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -183,7 +183,7 @@ void Tk_MapEmbeddedWindow( /* *---------------------------------------------------------------------- * - * 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 @@ -229,7 +229,7 @@ void Tk_MapEmbeddedWindow( */ 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 @@ -344,7 +344,7 @@ TkpUseWindow( /* *---------------------------------------------------------------------- * - * 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 @@ -361,7 +361,7 @@ TkpUseWindow( */ void -TkpMakeContainer( +Tk_MakeContainer( Tk_Window tkwin) { TkWindow *winPtr = (TkWindow *) tkwin; @@ -889,13 +889,13 @@ ContainerEventProc( /* *---------------------------------------------------------------------- * - * 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. * @@ -905,9 +905,9 @@ ContainerEventProc( *---------------------------------------------------------------------- */ -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; @@ -916,10 +916,10 @@ TkpGetOtherWindow( 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; diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 24e64f1..886c14e 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -1540,7 +1540,7 @@ TkpSetWindowMenuBar( /* *---------------------------------------------------------------------- * - * TkpSetMainMenubar -- + * Tk_SetMainMenubar -- * * Puts the menu associated with a window into the menubar. Should only * be called when the window is in front. @@ -1555,7 +1555,7 @@ TkpSetWindowMenuBar( */ 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 diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index 572bccd..54af4a4 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -247,13 +247,14 @@ TkpScanWindowId( */ 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); |