summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkImgPhInstance.c2
-rw-r--r--generic/tkTextDisp.c2
-rw-r--r--library/demos/menu.tcl2
-rw-r--r--macosx/README2
-rw-r--r--macosx/tkMacOSXConstants.h4
-rw-r--r--macosx/tkMacOSXDefault.h5
-rw-r--r--macosx/tkMacOSXEmbed.c2
-rw-r--r--macosx/tkMacOSXImage.c8
-rw-r--r--macosx/tkMacOSXInit.c8
-rw-r--r--macosx/tkMacOSXSubwindows.c2
-rw-r--r--macosx/tkMacOSXWm.c19
-rw-r--r--win/tkWinDialog.c7
12 files changed, 27 insertions, 36 deletions
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c
index 75f11f0..ec9ee04 100644
--- a/generic/tkImgPhInstance.c
+++ b/generic/tkImgPhInstance.c
@@ -599,7 +599,7 @@ BlendComplexAlpha(
g = ALPHA_BLEND(ga, g, alpha, unalpha);
b = ALPHA_BLEND(ba, b, alpha, unalpha);
}
-#ifndef MAC_OSX_TK
+#ifndef MAC_OSX_TK
XPutPixel(bgImg, x, y, RGB(r, g, b));
#else
XPutPixel(bgImg, x, y, RGBA(r, g, b, alpha));
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 238ae1a..126b631 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4468,7 +4468,7 @@ DisplayText(
#else
} else if (dlPtr->chunkPtr != NULL && ((dlPtr->y < 0)
|| (dlPtr->y + dlPtr->height > dInfoPtr->maxY))) {
- /*
+ /*
* On platforms other than the Mac:
*
* It's the first or last DLine which are also overlapping the
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index 557bf45..a788a65 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -115,7 +115,7 @@ $w.menu add cascade -label "Icons" -menu $m -underline 0
menu $m -tearoff 0
# Main widget program sets variable tk_demoDirectory
image create photo lilearth -file [file join $tk_demoDirectory \
-images earthmenu.png]
+images earthmenu.png]
$m add command -image lilearth \
-hidemargin 1 -command [list \
tk_dialog $w.pattern {Bitmap Menu Entry} \
diff --git a/macosx/README b/macosx/README
index cea3847..2822968 100644
--- a/macosx/README
+++ b/macosx/README
@@ -385,7 +385,7 @@ The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3.
4. Details regarding the macOS port of Tk.
-------------------------------------------
-
+
4.1 About the event loop
~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h
index 1ee85a6..95983dd 100644
--- a/macosx/tkMacOSXConstants.h
+++ b/macosx/tkMacOSXConstants.h
@@ -4,7 +4,7 @@
* Macros which map the names of NS constants used in the Tk code to
* the new name that Apple came up with for subsequent versions of the
* operating system. (Each new OS release seems to come with a new
- * naming convention for the same old constants.)
+ * naming convention for the same old constants.)
*
* Copyright (c) 2017 Marc Culler
*
@@ -53,7 +53,7 @@
#define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask
#define NSCommandKeyMask NSEventModifierFlagCommand
#define NSShiftKeyMask NSEventModifierFlagShift
-#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
+#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
#define NSAlternateKeyMask NSEventModifierFlagOption
#define NSControlKeyMask NSEventModifierFlagControl
#define NSNumericPadKeyMask NSEventModifierFlagNumericPad
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index 65762b7..5a53bdd 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -325,11 +325,6 @@
#define DEF_MENU_SELECT_COLOR "systemMenuActive"
#define DEF_MENU_SELECT_MONO BLACK
#define DEF_MENU_TAKE_FOCUS "0"
-
-/*
- * FIXME: Turn the default back to 1 when we make tearoff menus work again.
- */
-
#define DEF_MENU_TEAROFF "0"
#define DEF_MENU_TEAROFF_CMD ((char *) NULL)
#define DEF_MENU_TITLE ""
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 0c2ca69..edcd064 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -193,7 +193,7 @@ TkpMakeWindow(
int
TkpScanWindowId(
Tcl_Interp *interp,
- CONST char * string,
+ const char * string,
Window *idPtr)
{
int code;
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 2436e60..096faac 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -212,7 +212,7 @@ XGetImage(
CFRelease(bitmap_rep);
return NULL;
}
-
+
if (macDraw->flags & TK_USE_XIMAGE_ALPHA) {
/*
* When called by TkImgPhotoDisplay we are being asked to return a
@@ -230,7 +230,7 @@ XGetImage(
memcpy(bitmap, (char *)[bitmap_rep bitmapData], size);
}
CFRelease(bitmap_rep);
-
+
/*
* When Apple extracts a bitmap from an NSView, it may be in
* either BGRA or ABGR format. For an XImage we need RGBA.
@@ -243,7 +243,7 @@ XGetImage(
G = *(bitmap + m + pixel.g);
B = *(bitmap + m + pixel.b);
A = *(bitmap + m + pixel.a);
-
+
*(bitmap + m) = R;
*(bitmap + m + 1) = G;
*(bitmap + m + 2) = B;
@@ -543,7 +543,7 @@ TkPutImage(
{
TkMacOSXDrawingContext dc;
MacDrawable *macDraw = ((MacDrawable*)drawable);
-
+
display->request++;
if (!TkMacOSXSetupDrawingContext(drawable, gc, 1, &dc)) {
return BadDrawable;
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index d2ae147..bd0b872 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -115,7 +115,7 @@ long tkMacOSXMacOSXVersion = 0;
*/
_defaultMainMenu = nil;
[self _setupMenus];
-
+
/*
* Set the application icon. This is unnecessary when running Wish.app
* but it is easier than testing for that situation to just do it.
@@ -153,7 +153,7 @@ long tkMacOSXMacOSXVersion = 0;
- (void) _setup: (Tcl_Interp *) interp
{
- /*
+ /*
* Remember our interpreter.
*/
_eventInterp = interp;
@@ -290,7 +290,7 @@ TkpInit(
TkMacOSXDbgMsg("Tcl_MacOSXOpenVersionedBundleResources failed");
}
#endif
-
+
/*
* FIXME: Close stdin & stdout for remote debugging otherwise we will
* fight with gdb for stdin & stdout
@@ -305,7 +305,7 @@ TkpInit(
* Instantiate our NSApplication object. This needs to be
* done before we check whether to open a console window.
*/
-
+
NSAutoreleasePool *pool = [NSAutoreleasePool new];
[[NSUserDefaults standardUserDefaults] registerDefaults:
[NSDictionary dictionaryWithObjectsAndKeys:
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 2c036bb..3d5e986 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -156,7 +156,7 @@ XMapWindow(
* before applicationDidFinishLaunching returns. Forcing
* the app to activate too early can make the menu bar
* unresponsive.
- */
+ */
[NSApp activateIgnoringOtherApps:NO];
if ( [win canBecomeKeyWindow] ) {
[win makeKeyAndOrderFront:NSApp];
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 9f39e4c..b51fb6b 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -189,7 +189,7 @@ static const Tk_GeomMgr wmMgrType = {
* The following keeps state for Aqua dock icon bounce notification.
*/
-static int tkMacOSXWmAttrNotifyVal = 0;
+static int tkMacOSXWmAttrNotifyVal = 0;
/*
* Hash table for Mac Window -> TkWindow mapping.
@@ -776,7 +776,7 @@ TkWmMapWindow(
/*Add window to Window menu.*/
NSWindow *win = TkMacOSXDrawableWindow(winPtr->window);
- [win setExcludedFromWindowsMenu:NO];
+ [win setExcludedFromWindowsMenu:NO];
}
@@ -913,7 +913,7 @@ TkWmDeadWindow(
WmInfo *wmPtr = winPtr2->wmInfoPtr;
BOOL minimized = (wmPtr->hints.initial_state == IconicState ||
wmPtr->hints.initial_state == WithdrawnState);
- /*
+ /*
* If no windows are left on the screen and the next
* window is iconified or withdrawn, we don't want to
* make it be the KeyWindow because that would cause
@@ -1966,7 +1966,7 @@ WmGridCmd(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int reqWidth, reqHeight, widthInc, heightInc;
- char *errorMsg;
+ const char *errorMsg;
if ((objc != 3) && (objc != 7)) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -2345,7 +2345,7 @@ WmIconnameCmd(
* WmIconphotoCmd --
*
* This procedure is invoked to process the "wm iconphoto" Tcl command.
- * See the user documentation for details on what it does.
+ * See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -2356,6 +2356,7 @@ WmIconnameCmd(
*
*----------------------------------------------------------------------
*/
+
static int
WmIconphotoCmd(
Tk_Window tkwin, /* Main window of the application. */
@@ -2385,7 +2386,7 @@ WmIconphotoCmd(
/*Get icon name. We only use the first icon name because macOS does not
support multiple images in Tk photos.*/
- char *icon;
+ char *icon;
if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) {
icon = Tcl_GetString(objv[4]);
} else {
@@ -2401,7 +2402,7 @@ WmIconphotoCmd(
Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", "PHOTO", NULL);
return TCL_ERROR;
}
-
+
NSImage *newIcon;
Tk_SizeOfImage(tk_icon, &width, &height);
newIcon = TkMacOSXGetNSImageWithTkImage(winPtr->display, tk_icon, width, height);
@@ -3514,8 +3515,8 @@ WmWithdrawCmd(
TkpWmSetState(winPtr, WithdrawnState);
/*Remove window from Window menu.*/
NSWindow *win = TkMacOSXDrawableWindow(winPtr->window);
- [win setExcludedFromWindowsMenu:YES];
-
+ [win setExcludedFromWindowsMenu:YES];
+
return TCL_OK;
}
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 5be6776..f97d813 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -644,12 +644,7 @@ static void LoadShellProcs()
if (shell32_handle != NULL)
return; /* We have already been through here. */
- /*
- * XXX - Note we never call FreeLibrary. There is no point because
- * shell32.dll is loaded at startup anyways and stays for the duration
- * of the process so why bother with keeping track of when to unload
- */
- shell32_handle = LoadLibrary(TEXT("shell32.dll"));
+ shell32_handle = GetModuleHandle(TEXT("shell32.dll"));
if (shell32_handle == NULL) /* Should never happen but check anyways. */
return;