summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-02 09:31:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-02 09:31:57 (GMT)
commitd3c05cb7bc14ac6c30cc09aa71adcc82835c0ebc (patch)
tree38027978064b528a0f964ec2e0ee4b5a522af580
parente40f7fb58ec75a963d483f76cedd2ce59e5e2845 (diff)
parent8952ee7ee1dc5bbc401ee01f356e3b8ff4a170a3 (diff)
downloadtk-d3c05cb7bc14ac6c30cc09aa71adcc82835c0ebc.zip
tk-d3c05cb7bc14ac6c30cc09aa71adcc82835c0ebc.tar.gz
tk-d3c05cb7bc14ac6c30cc09aa71adcc82835c0ebc.tar.bz2
Merge 8.6
-rw-r--r--generic/tkStubInit.c1
-rw-r--r--macosx/tkMacOSXDialog.c56
-rw-r--r--macosx/tkMacOSXDraw.c14
-rw-r--r--macosx/tkMacOSXEmbed.c8
-rw-r--r--macosx/tkMacOSXFont.c2
-rw-r--r--macosx/tkMacOSXInit.c2
-rw-r--r--macosx/tkMacOSXKeyEvent.c8
-rw-r--r--macosx/tkMacOSXMenubutton.c2
-rw-r--r--macosx/tkMacOSXMenus.c2
-rw-r--r--macosx/tkMacOSXMouseEvent.c6
-rw-r--r--macosx/tkMacOSXPrivate.h2
-rw-r--r--macosx/tkMacOSXSubwindows.c50
-rw-r--r--macosx/tkMacOSXTest.c2
-rw-r--r--macosx/tkMacOSXWindowEvent.c14
-rw-r--r--macosx/tkMacOSXWm.c86
-rw-r--r--tests/safe.test34
16 files changed, 144 insertions, 145 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 4a92c50..6e4d306 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -57,6 +57,7 @@ MODULE_SCOPE const TkStubs tkStubs;
#define TkpTestsendCmd_ TkpTestsendCmd
#define TkGenWMConfigureEvent_ TkGenWMConfigureEvent
#define TkGenerateActivateEvents_ TkGenerateActivateEvents
+#define Tk_MacOSXGetNSWindowForDrawable TkMacOSXDrawable
#ifdef _WIN32
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index dd8cf5c..b7475e2 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -198,13 +198,17 @@ getFileURL(
@implementation TKApplication(TKDialog)
- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url {
+ (void)sender;
+ (void)url;
return YES;
}
- (void)panel:(id)sender didChangeToDirectoryURL:(NSURL *)url {
+ (void)sender; (void)url;
}
- (BOOL)panel:(id)sender validateURL:(NSURL *)url error:(NSError **)outError {
+ (void)sender; (void)url;
*outError = nil;
return YES;
}
@@ -233,7 +237,7 @@ getFileURL(
callbackInfo->cmdObj, &objc, &objv);
if (result == TCL_OK && objc) {
- tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ tmpv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
tmpv[objc] = resultObj;
TkBackgroundEvalObjv(callbackInfo->interp, objc + 1, tmpv,
@@ -271,7 +275,7 @@ getFileURL(
callbackInfo->cmdObj, &objc, &objv);
if (result == TCL_OK && objc) {
- tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ tmpv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
tmpv[objc] = resultObj;
TkBackgroundEvalObjv(callbackInfo->interp, objc + 1, tmpv,
@@ -805,7 +809,7 @@ Tk_GetOpenFileObjCmd(
}
Tcl_IncrRefCount(cmdObj);
}
- callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
+ callbackInfo = (FilePanelCallbackInfo *)ckalloc(sizeof(FilePanelCallbackInfo));
callbackInfo->cmdObj = cmdObj;
callbackInfo->interp = interp;
callbackInfo->multiple = multiple;
@@ -914,7 +918,7 @@ Tk_GetSaveFileObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
TkWindow *winPtr = clientData;
char *str;
int i, result = TCL_ERROR, haveParentOption = 0;
@@ -1082,7 +1086,7 @@ Tk_GetSaveFileObjCmd(
}
Tcl_IncrRefCount(cmdObj);
}
- callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
+ callbackInfo = (FilePanelCallbackInfo *)ckalloc(sizeof(FilePanelCallbackInfo));
callbackInfo->cmdObj = cmdObj;
callbackInfo->interp = interp;
callbackInfo->multiple = 0;
@@ -1157,7 +1161,7 @@ Tk_ChooseDirectoryObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
TkWindow *winPtr = clientData;
char *str;
int i, result = TCL_ERROR, haveParentOption = 0;
@@ -1232,7 +1236,7 @@ Tk_ChooseDirectoryObjCmd(
}
Tcl_IncrRefCount(cmdObj);
}
- callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
+ callbackInfo = (FilePanelCallbackInfo *)ckalloc(sizeof(FilePanelCallbackInfo));
callbackInfo->cmdObj = cmdObj;
callbackInfo->interp = interp;
callbackInfo->multiple = 0;
@@ -1358,7 +1362,7 @@ TkAboutDlg(void)
int
TkMacOSXStandardAboutPanelObjCmd(
- ClientData clientData, /* Unused. */
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1394,8 +1398,7 @@ Tk_MessageBoxObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData;
- TkWindow *winPtr = (TkWindow *)clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
char *str;
int i, result = TCL_ERROR, haveParentOption = 0;
int index, typeIndex, iconIndex, indexDefaultOption = 0;
@@ -1529,11 +1532,11 @@ Tk_MessageBoxObjCmd(
}
Tcl_IncrRefCount(cmdObj);
}
- callbackInfo = ckalloc(sizeof(AlertCallbackInfo));
+ callbackInfo = (AlertCallbackInfo *)ckalloc(sizeof(AlertCallbackInfo));
callbackInfo->cmdObj = cmdObj;
callbackInfo->interp = interp;
callbackInfo->typeIndex = typeIndex;
- parent = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ parent = TkMacOSXGetNSWindowForDrawable(((TkWindow *)tkwin)->window);
if (haveParentOption && parent && ![parent attachedSheet]) {
parentIsKey = [parent isKeyWindow];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
@@ -1630,6 +1633,7 @@ enum FontchooserOption {
- (void) changeFont: (id) sender
{
NSFontManager *fm = [NSFontManager sharedFontManager];
+ (void)sender;
if ([fm currentFontAction] == NSViaPanelFontAction) {
NSFont *font = [fm convertFont:fontPanelFont];
@@ -1653,14 +1657,16 @@ enum FontchooserOption {
}
}
-- (NSUInteger) validModesForFontPanel: (NSFontPanel *) fontPanel
+- (NSUInteger) validModesForFontPanel: (NSFontPanel *)fontPanel
{
+ (void)fontPanel;
+
return (NSFontPanelStandardModesMask & ~NSFontPanelAllEffectsModeMask) |
NSFontPanelUnderlineEffectModeMask |
NSFontPanelStrikethroughEffectModeMask;
}
-- (void) windowDidOrderOffScreen: (NSNotification *) notification
+- (void) windowDidOrderOffScreen: (NSNotification *)notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
@@ -1718,7 +1724,7 @@ FontchooserEvent(
result = Tcl_ListObjGetElements(fontchooserInterp,
fcdPtr->cmdObj, &objc, &objv);
if (result == TCL_OK) {
- tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ tmpv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
tmpv[objc] = fontObj;
TkBackgroundEvalObjv(fontchooserInterp, objc + 1, tmpv,
@@ -1760,7 +1766,7 @@ FontchooserCget(
case FontchooserParent:
if (fcdPtr->parent != None) {
resObj = Tcl_NewStringObj(
- ((TkWindow *) fcdPtr->parent)->pathName, -1);
+ ((TkWindow *)fcdPtr->parent)->pathName, -1);
} else {
resObj = Tcl_NewStringObj(".", 1);
}
@@ -1981,14 +1987,14 @@ static int
FontchooserShowCmd(
ClientData clientData, /* Main window */
Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const objv[])
+ TCL_UNUSED(int),
+ TCL_UNUSED(Tcl_Obj *const *))
{
FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser",
NULL);
if (fcdPtr->parent == None) {
- fcdPtr->parent = (Tk_Window) clientData;
+ fcdPtr->parent = (Tk_Window)clientData;
Tk_CreateEventHandler(fcdPtr->parent, StructureNotifyMask,
FontchooserParentEventHandler, fcdPtr);
}
@@ -2027,10 +2033,10 @@ FontchooserShowCmd(
static int
FontchooserHideCmd(
- ClientData clientData, /* Main window */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const objv[])
+ TCL_UNUSED(void *), /* Main window */
+ TCL_UNUSED(Tcl_Interp *),
+ TCL_UNUSED(int),
+ TCL_UNUSED(Tcl_Obj *const *))
{
NSFontPanel *fp = [[NSFontManager sharedFontManager] fontPanel:NO];
@@ -2129,9 +2135,9 @@ DeleteFontchooserData(
MODULE_SCOPE int
TkInitFontchooser(
Tcl_Interp *interp,
- ClientData clientData)
+ TCL_UNUSED(void *))
{
- FontchooserData *fcdPtr = ckalloc(sizeof(FontchooserData));
+ FontchooserData *fcdPtr = (FontchooserData *)ckalloc(sizeof(FontchooserData));
bzero(fcdPtr, sizeof(FontchooserData));
Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteFontchooserData,
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 5ca7dff..a3bd0d8 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -85,7 +85,7 @@ TkMacOSXInitCGDrawing(
}
if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit",
- (char *) &cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
+ (char *)&cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
Tcl_ResetResult(interp);
}
cgAntiAliasLimit = limit;
@@ -95,11 +95,11 @@ TkMacOSXInitCGDrawing(
*/
if (Tcl_LinkVar(interp, "::tk::mac::useThemedToplevel",
- (char *) &useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
+ (char *)&useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::mac::useThemedFrame",
- (char *) &useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
+ (char *)&useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
transparentColor = TkMacOSXClearPixel();
@@ -262,7 +262,7 @@ TkMacOSXGetCGContextForDrawable(
if (macDraw->flags & TK_IS_BW_PIXMAP) {
bitsPerPixel = 8;
- bitmapInfo = (CGBitmapInfo) kCGImageAlphaOnly;
+ bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly;
} else {
colorspace = CGColorSpaceCreateDeviceRGB();
bitsPerPixel = 32;
@@ -1158,7 +1158,7 @@ TkScrollWindow(
TkRegion damageRgn) /* Region to accumulate damage in. */
{
Drawable drawable = Tk_WindowId(tkwin);
- MacDrawable *macDraw = (MacDrawable *) drawable;
+ MacDrawable *macDraw = (MacDrawable *)drawable;
TKContentView *view = (TKContentView *) TkMacOSXGetNSViewForDrawable(drawable);
CGRect srcRect, dstRect;
HIShapeRef dmgRgn = NULL, extraRgn = NULL;
@@ -1657,8 +1657,8 @@ ClipToGC(
HIShapeRef *clipRgnPtr) /* must point to initialized variable */
{
if (gc && gc->clip_mask &&
- ((TkpClipMask *) gc->clip_mask)->type == TKP_CLIP_REGION) {
- TkRegion gcClip = ((TkpClipMask *) gc->clip_mask)->value.region;
+ ((TkpClipMask *)gc->clip_mask)->type == TKP_CLIP_REGION) {
+ TkRegion gcClip = ((TkpClipMask *)gc->clip_mask)->value.region;
int xOffset = ((MacDrawable *)d)->xOff + gc->clip_x_origin;
int yOffset = ((MacDrawable *)d)->yOff + gc->clip_y_origin;
HIShapeRef clipRgn = *clipRgnPtr, gcClipRgn;
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index e58cdd0..acf2e69 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -853,7 +853,7 @@ ContainerEventProc(
* Here we are following unix, by destroying the container.
*/
- Tk_DestroyWindow((Tk_Window) winPtr);
+ Tk_DestroyWindow((Tk_Window)winPtr);
}
Tk_DeleteErrorHandler(errHandler);
}
@@ -902,8 +902,8 @@ EmbedStructureProc(
errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
-1, -1, NULL, NULL);
- Tk_MoveResizeWindow((Tk_Window) containerPtr->embeddedPtr, 0, 0,
- (unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr),
+ Tk_MoveResizeWindow((Tk_Window)containerPtr->embeddedPtr, 0, 0,
+ (unsigned) Tk_Width((Tk_Window)containerPtr->parentPtr),
(unsigned) Tk_Height((Tk_Window)containerPtr->parentPtr));
Tk_DeleteErrorHandler(errHandler);
}
@@ -1048,7 +1048,7 @@ EmbedGeometryRequest(
* if the window's size didn't change then generate a configure event.
*/
- Tk_GeometryRequest((Tk_Window) winPtr, width, height);
+ Tk_GeometryRequest((Tk_Window)winPtr, width, height);
while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {}
if ((winPtr->changes.width != width)
|| (winPtr->changes.height != height)) {
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index ac3bf20..4e383f1 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -451,7 +451,7 @@ TkpFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
{
Tcl_Interp *interp = mainPtr->interp;
- Tk_Window tkwin = (Tk_Window) mainPtr->winPtr;
+ Tk_Window tkwin = (Tk_Window)mainPtr->winPtr;
const struct SystemFontMapEntry *systemFont = systemFontMap;
NSFont *nsFont;
TkFontAttributes fa;
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index ab2400c..51c1e37 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -491,7 +491,7 @@ TkpGetAppName(
static int
TkMacOSXGetAppPathCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 4feb375..078a4fc 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -83,7 +83,7 @@ static NSUInteger textInputModifiers;
if (winPtr->dispPtr->grabFlags || /* global grab */
grabWinPtr->mainPtr == winPtr->mainPtr){ /* same application */
winPtr =winPtr->dispPtr->focusPtr;
- tkwin = (Tk_Window) winPtr;
+ tkwin = (Tk_Window)winPtr;
}
}
@@ -322,7 +322,7 @@ static NSUInteger textInputModifiers;
*/
if (repRange.location == 0) {
- Tk_Window focusWin = (Tk_Window) winPtr->dispPtr->focusPtr;
+ Tk_Window focusWin = (Tk_Window)winPtr->dispPtr->focusPtr;
TkSendVirtualEvent(focusWin, "TkAccentBackspace", NULL);
}
@@ -393,7 +393,7 @@ static NSUInteger textInputModifiers;
replacementRange: (NSRange)repRange
{
TkWindow *winPtr = (TkWindow *)Tk_MacOSXGetTkWindow([self window]);
- Tk_Window focusWin = (Tk_Window) winPtr->dispPtr->focusPtr;
+ Tk_Window focusWin = (Tk_Window)winPtr->dispPtr->focusPtr;
NSString *temp;
NSString *str;
@@ -498,7 +498,7 @@ static NSUInteger textInputModifiers;
processingCompose = NO;
if (aSelector == @selector (deleteBackward:)) {
TkWindow *winPtr = (TkWindow *)Tk_MacOSXGetTkWindow([self window]);
- Tk_Window focusWin = (Tk_Window) winPtr->dispPtr->focusPtr;
+ Tk_Window focusWin = (Tk_Window)winPtr->dispPtr->focusPtr;
TkSendVirtualEvent(focusWin, "TkAccentBackspace", NULL);
}
}
diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c
index 320c070..2fad3cb 100644
--- a/macosx/tkMacOSXMenubutton.c
+++ b/macosx/tkMacOSXMenubutton.c
@@ -703,7 +703,7 @@ MenuButtonEventProc(
mbPtr->flags &= ~ACTIVE;
}
if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) buttonPtr);
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, buttonPtr);
buttonPtr->flags |= REDRAW_PENDING;
}
}
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index 0ca9eee..8833eb0 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.c
@@ -415,7 +415,7 @@ GenerateEditEvent(
if (!winPtr) {
return;
}
- tkwin = (Tk_Window) winPtr->dispPtr->focusPtr;
+ tkwin = (Tk_Window)winPtr->dispPtr->focusPtr;
if (!tkwin) {
return;
}
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 6a9437c..d59d39b 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -179,11 +179,11 @@ enum {
for (tkwin2 = tkEventWindow;
!Tk_IsTopLevel(tkwin2);
tkwin2 = Tk_Parent(tkwin2)) {
- if (tkwin2 == (Tk_Window) grabWinPtr) {
+ if (tkwin2 == (Tk_Window)grabWinPtr) {
break;
}
}
- if (tkwin2 != (Tk_Window) grabWinPtr) {
+ if (tkwin2 != (Tk_Window)grabWinPtr) {
return theEvent;
}
}
@@ -648,7 +648,7 @@ TkpSetCapture(
winPtr = winPtr->parentPtr;
}
[NSEvent stopPeriodicEvents];
- captureWinPtr = (Tk_Window) winPtr;
+ captureWinPtr = (Tk_Window)winPtr;
}
/*
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index e0fe290..4c02fe3 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -236,7 +236,6 @@ MODULE_SCOPE OSStatus TkMacOSHIShapeUnion(HIShapeRef inShape1,
* Prototypes of TkAqua internal procs.
*/
-MODULE_SCOPE NSWindow * TkMacOSXGetNSWindowForDrawable(Drawable drawable);
MODULE_SCOPE NSView * TkMacOSXGetNSViewForDrawable(Drawable drawable);
MODULE_SCOPE CGContextRef TkMacOSXGetCGContextForDrawable(Drawable drawable);
MODULE_SCOPE void * TkMacOSXGetNamedSymbol(const char *module,
@@ -260,6 +259,7 @@ MODULE_SCOPE void TkMacOSXRestoreDrawingContext(
TkMacOSXDrawingContext *dcPtr);
MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel,
CGContextRef context);
+#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow*)TkMacOSXDrawable(drawable))
MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view,
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index f782d82..e6bac40 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -68,7 +68,7 @@ XDestroyWindow(
if (!Tk_IsTopLevel(macWin->winPtr)) {
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
if (macWin->winPtr->parentPtr != NULL) {
- TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)macWin->winPtr->parentPtr);
}
if (macWin->visRgn) {
CFRelease(macWin->visRgn);
@@ -187,11 +187,11 @@ XMapWindow(
* the window.
*/
- TkMacOSXInvalClipRgns((Tk_Window) contWinPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)contWinPtr);
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
}
- TkMacOSXInvalClipRgns((Tk_Window) winPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)winPtr);
/*
* We only need to send the MapNotify event for toplevel windows.
@@ -221,7 +221,7 @@ XMapWindow(
* and redisplay the window.
*/
- TkMacOSXInvalClipRgns((Tk_Window) winPtr->parentPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)winPtr->parentPtr);
}
TKContentView *view = [win contentView];
@@ -309,7 +309,7 @@ XUnmapWindow(
winPtr->wmInfoPtr->hints.initial_state!=IconicState) {
[win orderOut:nil];
}
- TkMacOSXInvalClipRgns((Tk_Window) winPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)winPtr);
/*
* We only need to send the UnmapNotify event for toplevel windows.
@@ -343,7 +343,7 @@ XUnmapWindow(
NSView *view = TkMacOSXGetNSViewForDrawable(parentPtr->window);
TkMacOSXInvalidateViewRegion(view, parentPtr->privatePtr->visRgn);
}
- TkMacOSXInvalClipRgns((Tk_Window) parentPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)parentPtr);
TkMacOSXUpdateClipRgn(parentPtr);
}
winPtr->flags &= ~TK_MAPPED;
@@ -514,7 +514,7 @@ MoveResizeWindow(
{
int deltaX = 0, deltaY = 0, parentBorderwidth = 0;
MacDrawable *macParent = NULL;
- NSWindow *macWindow = TkMacOSXGetNSWindowForDrawable((Drawable) macWin);
+ NSWindow *macWindow = TkMacOSXGetNSWindowForDrawable((Drawable)macWin);
/*
* Find the Parent window, for an embedded window it will be its container.
@@ -551,7 +551,7 @@ MoveResizeWindow(
if (macWindow) {
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
if (macParent) {
- TkMacOSXInvalClipRgns((Tk_Window) macParent->winPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)macParent->winPtr);
}
}
UpdateOffsets(macWin->winPtr, deltaX, deltaY);
@@ -716,8 +716,8 @@ XConfigureWindow(
NSView *view = TkMacOSXGetNSViewForDrawable(w);
if (view) {
- TkMacOSXInvalClipRgns((Tk_Window) winPtr->parentPtr);
- TkpRedrawWidget((Tk_Window) winPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)winPtr->parentPtr);
+ TkpRedrawWidget((Tk_Window)winPtr);
}
}
@@ -869,7 +869,7 @@ TkMacOSXUpdateClipRgn(
TkRegion r = TkCreateRegion();
HIShapeRef visRgn;
- tkMacOSXEmbedHandler->getClipProc((Tk_Window) winPtr, r);
+ tkMacOSXEmbedHandler->getClipProc((Tk_Window)winPtr, r);
visRgn = TkMacOSXGetNativeRegion(r);
ChkErr(HIShapeIntersect, visRgn, rgn, rgn);
CFRelease(visRgn);
@@ -1083,8 +1083,8 @@ TkMacOSXInvalidateWindow(
*----------------------------------------------------------------------
*/
-NSWindow *
-TkMacOSXGetNSWindowForDrawable(
+void *
+TkMacOSXDrawable(
Drawable drawable)
{
MacDrawable *macWin = (MacDrawable *)drawable;
@@ -1103,29 +1103,11 @@ TkMacOSXGetNSWindowForDrawable(
TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
if (contWinPtr) {
- result = TkMacOSXGetNSWindowForDrawable(contWinPtr->window);
+ result = TkMacOSXGetNSWindowForDrawable((Drawable)contWinPtr->privatePtr);
}
}
return result;
}
-
-void *
-Tk_MacOSXGetNSWindowForDrawable(
- Drawable drawable)
-{
- return TkMacOSXGetNSWindowForDrawable(drawable);
-}
-
-/*
- * The obsolete version of the same stub.
- */
-
-void *
-TkMacOSXDrawable(
- Drawable drawable)
-{
- return TkMacOSXGetNSWindowForDrawable(drawable);
-}
/*
*----------------------------------------------------------------------
@@ -1250,7 +1232,7 @@ TkMacOSXInvalClipRgns(
childPtr = winPtr->childList;
while (childPtr) {
if (!Tk_IsTopLevel(childPtr)) {
- TkMacOSXInvalClipRgns((Tk_Window) childPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)childPtr);
}
childPtr = childPtr->nextPtr;
}
@@ -1263,7 +1245,7 @@ TkMacOSXInvalClipRgns(
childPtr = TkpGetOtherWindow(winPtr);
if (childPtr) {
- TkMacOSXInvalClipRgns((Tk_Window) childPtr);
+ TkMacOSXInvalClipRgns((Tk_Window)childPtr);
}
/*
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index c70ecd5..434504f 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -266,7 +266,7 @@ PressButtonObjCmd(
static int
InjectKeyEventObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index de96771..68547e6 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -95,7 +95,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
*/
flags |= TK_MACOSX_HANDLE_EVENT_IMMEDIATELY;
- TkGenWMConfigureEvent((Tk_Window) winPtr, x, y, width, height, flags);
+ TkGenWMConfigureEvent((Tk_Window)winPtr, x, y, width, height, flags);
}
}
@@ -111,7 +111,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
if (winPtr) {
winPtr->wmInfoPtr->hints.initial_state =
TkMacOSXIsWindowZoomed(winPtr) ? ZoomState : NormalState;
- Tk_MapWindow((Tk_Window) winPtr);
+ Tk_MapWindow((Tk_Window)winPtr);
/*
* Process all Tk events generated by Tk_MapWindow().
@@ -252,7 +252,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
TkWindow *winPtr = (TkWindow *)Tk_MacOSXGetTkWindow(w);
if (winPtr) {
- //Tk_UnmapWindow((Tk_Window) winPtr);
+ //Tk_UnmapWindow((Tk_Window)winPtr);
}
}
@@ -823,7 +823,7 @@ TkWmProtocolEventProc(
if (result != TCL_OK) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (command for \"%s\" window manager protocol)",
- Tk_GetAtomName((Tk_Window) winPtr, protocol)));
+ Tk_GetAtomName((Tk_Window)winPtr, protocol)));
Tcl_BackgroundException(interp, result);
}
Tcl_Release(interp);
@@ -837,8 +837,8 @@ TkWmProtocolEventProc(
* message then just destroy the window.
*/
- if (protocol == Tk_InternAtom((Tk_Window) winPtr, "WM_DELETE_WINDOW")) {
- Tk_DestroyWindow((Tk_Window) winPtr);
+ if (protocol == Tk_InternAtom((Tk_Window)winPtr, "WM_DELETE_WINDOW")) {
+ Tk_DestroyWindow((Tk_Window)winPtr);
}
}
@@ -967,7 +967,7 @@ ConfigureRestrictProc(
[super setFrameSize: newsize];
NSWindow *w = [self window];
TkWindow *winPtr = (TkWindow *)Tk_MacOSXGetTkWindow(w);
- Tk_Window tkwin = (Tk_Window) winPtr;
+ Tk_Window tkwin = (Tk_Window)winPtr;
if (![self inLiveResize] &&
[w respondsToSelector: @selector (tkLayoutChanged)]) {
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index c5e5e33..05b4787 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -729,7 +729,7 @@ TkWmNewWindow(
* detect size and position changes caused by window managers.
*/
- Tk_CreateEventHandler((Tk_Window) winPtr, StructureNotifyMask,
+ Tk_CreateEventHandler((Tk_Window)winPtr, StructureNotifyMask,
TopLevelEventProc, winPtr);
/*
@@ -737,7 +737,7 @@ TkWmNewWindow(
* window manager.
*/
- Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0);
+ Tk_ManageGeometry((Tk_Window)winPtr, &wmMgrType, NULL);
}
/*
@@ -784,7 +784,7 @@ TkWmMapWindow(
* Generate configure event when we first map the window.
*/
- TkGenWMConfigureEvent((Tk_Window) winPtr, wmPtr->x, wmPtr->y, -1, -1,
+ TkGenWMConfigureEvent((Tk_Window)winPtr, wmPtr->x, wmPtr->y, -1, -1,
TK_LOCATION_CHANGED);
/*
@@ -896,8 +896,8 @@ TkWmDeadWindow(
*/
RemoveTransient(winPtr);
- Tk_ManageGeometry((Tk_Window) winPtr, NULL, NULL);
- Tk_DeleteEventHandler((Tk_Window) winPtr, StructureNotifyMask,
+ Tk_ManageGeometry((Tk_Window)winPtr, NULL, NULL);
+ Tk_DeleteEventHandler((Tk_Window)winPtr, StructureNotifyMask,
TopLevelEventProc, winPtr);
if (wmPtr->hints.flags & IconPixmapHint) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
@@ -1094,7 +1094,7 @@ Tk_WmObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
static const char *const optionStrings[] = {
"aspect", "attributes", "client", "colormapwindows",
"command", "deiconify", "focusmodel", "forget",
@@ -1529,7 +1529,7 @@ WmAttributesCmd(
NSWindow *macWindow;
if (winPtr->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
+ Tk_MakeWindowExist((Tk_Window)winPtr);
}
if (!TkMacOSXHostToplevelExists(winPtr)) {
TkMacOSXMakeRealWindowExist(winPtr);
@@ -1663,7 +1663,7 @@ WmColormapwindowsCmd(
return TCL_ERROR;
}
if (objc == 3) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
+ Tk_MakeWindowExist((Tk_Window)winPtr);
resultObj = Tcl_NewObj();
for (i = 0; i < wmPtr->cmapCount; i++) {
if ((i == (wmPtr->cmapCount-1))
@@ -1671,7 +1671,7 @@ WmColormapwindowsCmd(
break;
}
Tcl_ListObjAppendElement(NULL, resultObj,
- TkNewWindowObj((Tk_Window) wmPtr->cmapList[i]));
+ TkNewWindowObj((Tk_Window)wmPtr->cmapList[i]));
}
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
@@ -1691,7 +1691,7 @@ WmColormapwindowsCmd(
gotToplevel = 1;
}
if (winPtr2->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr2);
+ Tk_MakeWindowExist((Tk_Window)winPtr2);
}
cmapList[i] = winPtr2;
}
@@ -1931,7 +1931,7 @@ WmForgetCmd(
TCL_UNUSED(int), /* Number of arguments. */
TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */
{
- Tk_Window frameWin = (Tk_Window) winPtr;
+ Tk_Window frameWin = (Tk_Window)winPtr;
if (Tk_IsTopLevel(frameWin)) {
MacDrawable *macWin;
@@ -2007,7 +2007,7 @@ WmFrameCmd(
}
window = wmPtr->reparent;
if (window == None) {
- window = Tk_WindowId((Tk_Window) winPtr);
+ window = Tk_WindowId((Tk_Window)winPtr);
}
sprintf(buf, "0x%" TCL_Z_MODIFIER "x", (size_t)window);
Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
@@ -2166,7 +2166,7 @@ WmGridCmd(
errorMsg = "heightInc can't be <= 0";
goto error;
}
- Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
+ Tk_SetGrid((Tk_Window)winPtr, reqWidth, reqHeight, widthInc,
heightInc);
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
@@ -2287,14 +2287,13 @@ WmIconbitmapCmd(
}
str = Tcl_GetStringFromObj(objv[3], &len);
if (winPtr->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
+ Tk_MakeWindowExist((Tk_Window)winPtr);
}
if (!TkMacOSXHostToplevelExists(winPtr)) {
TkMacOSXMakeRealWindowExist(winPtr);
}
- if (WmSetAttribute(winPtr,
- TkMacOSXGetNSWindowForDrawable(winPtr->window), interp,
- WMATT_TITLEPATH, objv[3]) == TCL_OK) {
+ if (WmSetAttribute(winPtr, TkMacOSXGetNSWindowForDrawable(winPtr->window), interp,
+ WMATT_TITLEPATH, objv[3]) == TCL_OK) {
if (!len) {
if (wmPtr->hints.icon_pixmap != None) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
@@ -2303,7 +2302,7 @@ WmIconbitmapCmd(
wmPtr->hints.flags &= ~IconPixmapHint;
}
} else {
- pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, Tk_GetUid(str));
+ pixmap = Tk_GetBitmap(interp, (Tk_Window)winPtr, Tk_GetUid(str));
if (pixmap == None) {
return TCL_ERROR;
}
@@ -2344,7 +2343,7 @@ WmIconifyCmd(
return TCL_ERROR;
}
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ if (Tk_Attributes((Tk_Window)winPtr)->override_redirect) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify \"%s\": override-redirect flag is set",
winPtr->pathName));
@@ -2741,7 +2740,7 @@ WmIconwindowCmd(
wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
wmPtr->hints.flags |= IconWindowHint;
wmPtr->icon = tkwin2;
- wmPtr2->iconFor = (Tk_Window) winPtr;
+ wmPtr2->iconFor = (Tk_Window)winPtr;
if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
/*
* If the window is in normal or zoomed state, the icon should be
@@ -2782,7 +2781,7 @@ WmManageCmd(
TCL_UNUSED(int), /* Number of arguments. */
TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */
{
- Tk_Window frameWin = (Tk_Window) winPtr;
+ Tk_Window frameWin = (Tk_Window)winPtr;
WmInfo *wmPtr = winPtr->wmInfoPtr;
if (!Tk_IsTopLevel(frameWin)) {
@@ -2801,7 +2800,7 @@ WmManageCmd(
if (wmPtr == NULL) {
TkWmNewWindow(winPtr);
if (winPtr->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
+ Tk_MakeWindowExist((Tk_Window)winPtr);
macWin = (MacDrawable *) winPtr->window;
}
}
@@ -2965,7 +2964,7 @@ WmOverrideredirectCmd(
if (objc == 3) {
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- Tk_Attributes((Tk_Window) winPtr)->override_redirect));
+ Tk_Attributes((Tk_Window)winPtr)->override_redirect));
return TCL_OK;
}
@@ -2973,7 +2972,7 @@ WmOverrideredirectCmd(
return TCL_ERROR;
}
atts.override_redirect = flag ? True : False;
- Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect, &atts);
+ Tk_ChangeWindowAttributes((Tk_Window)winPtr, CWOverrideRedirect, &atts);
ApplyContainerOverrideChanges(winPtr, win);
return TCL_OK;
}
@@ -3096,7 +3095,7 @@ WmProtocolCmd(
return TCL_OK;
}
- protocol = Tk_InternAtom((Tk_Window) winPtr, Tcl_GetString(objv[3]));
+ protocol = Tk_InternAtom((Tk_Window)winPtr, Tcl_GetString(objv[3]));
if (objc == 4) {
/*
* Return the command to handle a given protocol.
@@ -3334,7 +3333,7 @@ WmStackorderCmd(
resultObj = Tcl_NewObj();
for (windowPtr = windows; *windowPtr ; windowPtr++) {
Tcl_ListObjAppendElement(NULL, resultObj,
- TkNewWindowObj((Tk_Window) *windowPtr));
+ TkNewWindowObj((Tk_Window)*windowPtr));
}
Tcl_SetObjResult(interp, resultObj);
ckfree(windows);
@@ -3483,7 +3482,7 @@ WmStateCmd(
break;
case OPT_ICONIC:
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ if (Tk_Attributes((Tk_Window)winPtr)->override_redirect) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify \"%s\": override-redirect flag is set",
winPtr->pathName));
@@ -3699,7 +3698,7 @@ WmTransientCmd(
transient->flags |= WITHDRAWN_BY_CONTAINER;
}
- wmPtr->master = (Tk_Window) containerPtr;
+ wmPtr->master = (Tk_Window)containerPtr;
}
ApplyContainerOverrideChanges(winPtr, NULL);
return TCL_OK;
@@ -4040,7 +4039,7 @@ TopLevelEventProc(
Tk_ErrorHandler handler = Tk_CreateErrorHandler(winPtr->display,
-1, -1, -1, NULL, NULL);
- Tk_DestroyWindow((Tk_Window) winPtr);
+ Tk_DestroyWindow((Tk_Window)winPtr);
Tk_DeleteErrorHandler(handler);
}
if (wmTracing) {
@@ -4254,7 +4253,7 @@ UpdateGeometryInfo(
wmPtr->x = wmPtr->y = 0;
wmPtr->flags &= ~(WM_NEGATIVE_X|WM_NEGATIVE_Y);
- Tk_GeometryRequest((Tk_Window) contWinPtr, width, height);
+ Tk_GeometryRequest((Tk_Window)contWinPtr, width, height);
}
return;
}
@@ -4544,7 +4543,7 @@ Tk_GetRootCoords(
x -= winPtr->changes.x + winPtr->changes.border_width;
y -= winPtr->changes.y + winPtr->changes.border_width;
- tkMacOSXEmbedHandler->getOffsetProc((Tk_Window) winPtr,
+ tkMacOSXEmbedHandler->getOffsetProc((Tk_Window)winPtr,
&theOffset);
x += theOffset.h;
@@ -4674,7 +4673,7 @@ Tk_CoordsToWindow(
if (winPtr->mainPtr != ((TkWindow *)tkwin)->mainPtr) {
return NULL;
}
- return (Tk_Window) winPtr;
+ return (Tk_Window)winPtr;
}
/*
@@ -4767,7 +4766,7 @@ Tk_TopCoordsToWindow(
}
*newX = x;
*newY = y;
- return (Tk_Window) winPtr;
+ return (Tk_Window)winPtr;
}
/*
@@ -5617,7 +5616,7 @@ TkUnsupported1ObjCmd(
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- TkMacOSXInDarkMode((Tk_Window) winPtr)));
+ TkMacOSXInDarkMode((Tk_Window)winPtr)));
return TCL_OK;
default:
return TCL_ERROR;
@@ -6047,7 +6046,7 @@ TkMacOSXMakeRealWindowExist(
WmInfo *wmPtr = winPtr->wmInfoPtr;
MacDrawable *macWin;
WindowClass macClass;
- Bool overrideRedirect = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
+ Bool overrideRedirect = Tk_Attributes((Tk_Window)winPtr)->override_redirect;
if (TkMacOSXHostToplevelExists(winPtr)) {
return;
@@ -6074,7 +6073,7 @@ TkMacOSXMakeRealWindowExist(
Tcl_Panic("TkMacOSXMakeRealWindowExist could not find container");
}
if (tkMacOSXEmbedHandler->containerExistProc &&
- tkMacOSXEmbedHandler->containerExistProc((Tk_Window) winPtr)
+ tkMacOSXEmbedHandler->containerExistProc((Tk_Window)winPtr)
!= TCL_OK) {
Tcl_Panic("ContainerExistProc could not make container");
}
@@ -6163,7 +6162,7 @@ TkMacOSXMakeRealWindowExist(
XSetWindowAttributes atts;
atts.override_redirect = True;
- Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect, &atts);
+ Tk_ChangeWindowAttributes((Tk_Window)winPtr, CWOverrideRedirect, &atts);
ApplyContainerOverrideChanges(winPtr, NULL);
}
}
@@ -6408,7 +6407,7 @@ TkpWmSetState(
macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window);
if (state == WithdrawnState) {
- Tk_UnmapWindow((Tk_Window) winPtr);
+ Tk_UnmapWindow((Tk_Window)winPtr);
} else if (state == IconicState) {
/*
@@ -6420,9 +6419,9 @@ TkpWmSetState(
![macWin isMiniaturized]) {
[macWin miniaturize:NSApp];
}
- Tk_UnmapWindow((Tk_Window) winPtr);
+ Tk_UnmapWindow((Tk_Window)winPtr);
} else if (state == NormalState || state == ZoomState) {
- Tk_MapWindow((Tk_Window) winPtr);
+ Tk_MapWindow((Tk_Window)winPtr);
[macWin deminiaturize:NSApp];
[macWin orderFront:NSApp];
TkMacOSXZoomToplevel(macWin, state == NormalState ? inZoomIn : inZoomOut);
@@ -6636,8 +6635,7 @@ WmStackorderToplevelWrapperMap(
if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr)
&& (winPtr->display == display)) {
hPtr = Tcl_CreateHashEntry(table,
- (char*) TkMacOSXGetNSWindowForDrawable(winPtr->window),
- &newEntry);
+ (void *)TkMacOSXGetNSWindowForDrawable(winPtr->window), &newEntry);
Tcl_SetHashValue(hPtr, winPtr);
}
@@ -6757,7 +6755,7 @@ ApplyWindowAttributeFlagChanges(
if (!create) {
return;
}
- Tk_MakeWindowExist((Tk_Window) winPtr);
+ Tk_MakeWindowExist((Tk_Window)winPtr);
}
if (!TkMacOSXHostToplevelExists(winPtr)) {
if (!create) {
@@ -7014,7 +7012,7 @@ ApplyContainerOverrideChanges(
if (containerWinPtr && (containerWinPtr->window != None)
&& TkMacOSXHostToplevelExists(containerWinPtr)) {
NSWindow *containerMacWin = TkMacOSXGetNSWindowForDrawable(
- containerWinPtr->window);
+ containerWinPtr->window);
/*
* Try to add the transient window as a child window of the
diff --git a/tests/safe.test b/tests/safe.test
index 64cd64c..a31e029 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -28,23 +28,35 @@ namespace import -force tcltest::test
# This probably means that tk wasn't installed properly.
## it indicates that something went wrong sourcing tk.tcl.
-## Ensure that any changes that occured to tk.tcl will work or are properly
+## Ensure that any changes that occurred to tk.tcl will work or are properly
## prevented in a safe interpreter. -- hobbs
# The set of hidden commands is platform dependent:
-set hidden_cmds {bell cd clipboard encoding exec exit fconfigure glob grab load menu open pwd selection socket source tcl:encoding:dirs toplevel unload wm}
-lappend hidden_cmds {*}[apply {{} {
+set hidden_cmds [list bell cd clipboard encoding exec exit \
+ fconfigure glob grab load menu open pwd selection \
+ socket source tcl:encoding:dirs toplevel unload wm]
+if {[package vsatisfies [package provide Tcl] 8.7-]} {
+ lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir
foreach cmd {
- atime attributes copy delete dirname executable exists extension
- isdirectory isfile link lstat mkdir mtime nativename normalize owned
- readable readlink rename rootname size stat tail tempfile type
- volumes writable
- } {lappend result tcl:file:$cmd}; return $result
-}}]
+ cmdtype nameofexecutable
+ } {lappend hidden_cmds tcl:info:$cmd}
+ foreach cmd {
+ autopurge list purge status
+ } {lappend hidden_cmds tcl:process:$cmd}
+ foreach cmd {
+ lmkimg lmkzip mkimg mkkey mkzip mount mount_data unmount
+ } {lappend hidden_cmds tcl:zipfs:$cmd}
+}
+foreach cmd {
+ atime attributes copy delete dirname executable exists extension
+ isdirectory isfile link lstat mkdir mtime nativename normalize
+ owned readable readlink rename rootname size stat tail tempfile
+ type volumes writable
+} {lappend hidden_cmds tcl:file:$cmd}
if {[tk windowingsystem] ne "x11"} {
- lappend hidden_cmds tk_chooseColor tk_chooseDirectory tk_getOpenFile \
- tk_getSaveFile tk_messageBox
+ lappend hidden_cmds tk_chooseColor tk_chooseDirectory \
+ tk_getOpenFile tk_getSaveFile tk_messageBox
}
if {[llength [info commands send]]} {
lappend hidden_cmds send