summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/README12
-rw-r--r--macosx/tkMacOSXConstants.h14
-rw-r--r--macosx/tkMacOSXHLEvents.c8
-rw-r--r--macosx/tkMacOSXInit.c34
-rw-r--r--macosx/tkMacOSXPrivate.h2
-rw-r--r--macosx/tkMacOSXServices.c5
-rw-r--r--macosx/tkMacOSXTest.c3
-rw-r--r--macosx/tkMacOSXWm.c2
8 files changed, 32 insertions, 48 deletions
diff --git a/macosx/README b/macosx/README
index bed8d22..7df4893 100644
--- a/macosx/README
+++ b/macosx/README
@@ -26,7 +26,7 @@ before asking on the list, many questions have already been answered).
---------------------------
- There are two versions of Tk available on macOS: TkAqua using the native
-aqua widgets and look&feel, and TkX11 using the traditional unix X11 wigets.
+aqua widgets and look&feel, and TkX11 using the traditional unix X11 widgets.
TkX11 requires an X11 server to be installed, such as Apple's X11 (which is
available as an optional or default install on recent macOS).
TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem].
@@ -490,7 +490,7 @@ The macOS Tk application does not call the [NSApp run] method at
all. Instead it uses the event loop built in to Tk. So the
application must take care to replicate the important features of the
method ourselves. The way that autorelease pools are handled is
-discussed in 4.2 below. Here we discuss the event handling itself.
+discussed in 5.2 below. Here we discuss the event handling itself.
The Tcl event loop simply consists of repeated calls to TclDoOneEvent.
Each call to TclDoOneEvent begins by collecting all pending events from
@@ -523,7 +523,7 @@ event to the Tcl queue.
In order to carry out the job of managing autorelease pools, which
would normally be handled by the [NSApp run] method, a private
-NSAUtoreleasePool* property is added to the TkApplication subclass of
+NSAutoreleasePool* property is added to the TkApplication subclass of
NSApplication. The TkpInit function calls [NSApp _setup] which
initializes this property by creating an NSAutoreleasePool prior to
calling [NSApp finishLaunching]. This mimics the behavior of the
@@ -548,7 +548,7 @@ in nested calls to CheckProc.
One additional minor caveat for developers is that there are several
steps of the Tk initialization which precede the call to TkpInit.
Notably, the font package is initialized first. Since there is no
-NSAUtoreleasePool in scope prior to calling TkpInit, the functions
+NSAutoreleasePool in scope prior to calling TkpInit, the functions
called in these preliminary stages need to create and drain their own
NSAutoreleasePools whenever they call methods of Appkit objects
(e.g. NSFont).
@@ -568,7 +568,7 @@ window. (Normally, the clipping rectangle is the same as the bounding
rectangle, but drawing can be clipped to a smaller rectangle by
calling TkpClipDrawableToRect.) The aboveVisRgn is the intersection of
the window's bounding rectangle with the bounding rectangle of the
-parent window. Much of the code in tkMacOSXSubindows.c is devoted to
+parent window. Much of the code in tkMacOSXSubwindows.c is devoted to
rebuilding these clipping regions whenever something changes in the
layout of the windows. This turns out to be a tricky thing to do and
it is extremely prone to errors which can be difficult to trace.
@@ -702,7 +702,7 @@ that LaunchServices is launching the correct Wish.app. Instructions
for doing this are provided below.
The command line tool which manages the LaunchServices database has
-an amazingly unwieldy path name. So, first, run this command:
+an amazingly unwieldy path name. So, first, run this command:
alias lsregister='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister'
diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h
index 0badf1a..8ef535c 100644
--- a/macosx/tkMacOSXConstants.h
+++ b/macosx/tkMacOSXConstants.h
@@ -79,22 +79,8 @@
#define NSInformationalAlertStyle NSAlertStyleInformational
#define NSCriticalAlertStyle NSAlertStyleCritical
#define NSCenterTextAlignment NSTextAlignmentCenter
-#define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask
-#define NSCommandKeyMask NSEventModifierFlagCommand
-#define NSShiftKeyMask NSEventModifierFlagShift
-#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
-#define NSAlternateKeyMask NSEventModifierFlagOption
-#define NSControlKeyMask NSEventModifierFlagControl
-#define NSNumericPadKeyMask NSEventModifierFlagNumericPad
-#define NSFunctionKeyMask NSEventModifierFlagFunction
-#define NSKeyUp NSEventTypeKeyUp
-#define NSKeyDown NSEventTypeKeyDown
-#define NSFlagsChanged NSEventTypeFlagsChanged
-#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
-#define NSShiftKeyMask NSEventModifierFlagShift
#define NSAnyEventMask NSEventMaskAny
#define NSApplicationDefinedMask NSEventMaskApplicationDefined
-#define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground
#define NSUtilityWindowMask NSWindowStyleMaskUtilityWindow
#define NSNonactivatingPanelMask NSWindowStyleMaskNonactivatingPanel
#define NSDocModalWindowMask NSWindowStyleMaskDocModalWindow
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index d2843a8..0f63ea6 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -126,7 +126,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event
withReplyEvent: (NSAppleEventDescriptor *)replyEvent
{
-
+
NSString* file = [[event paramDescriptorForKeyword:keyDirectObject]
stringValue];
const char *printFile=[file UTF8String];
@@ -134,7 +134,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
Tcl_DStringInit(&print);
if (Tcl_FindCommand(_eventInterp, "::tk::mac::PrintDocument", NULL, 0)) {
Tcl_DStringAppend(&print, "::tk::mac::PrintDocument", -1);
- }
+ }
Tcl_DStringAppendElement(&print, printFile);
int tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&print),
Tcl_DStringLength(&print), TCL_EVAL_GLOBAL);
@@ -272,7 +272,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
Tcl_DStringInit(&launch);
if (Tcl_FindCommand(_eventInterp, "::tk::mac::LaunchURL", NULL, 0)) {
Tcl_DStringAppend(&launch, "::tk::mac::LaunchURL", -1);
- }
+ }
Tcl_DStringAppendElement(&launch, cURL);
int tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&launch),
Tcl_DStringLength(&launch), TCL_EVAL_GLOBAL);
@@ -454,7 +454,7 @@ TkMacOSXInitAppleEvents(
[aeManager setEventHandler:NSApp
andSelector:@selector(handleURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
-
+
}
}
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 3efe0c6..bf0b9f2 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -388,14 +388,14 @@ TkpInit(
TkMacOSXRegisterServiceWidgetObjCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap",
TkMacOSXIconBitmapObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath,(ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath, NULL, NULL);
/*
* Initialize the NSServices object here. Apple's docs say to do this
- * in applicationDidFinishLaunching, but the Tcl interpreter is not
- * initialized until this function call.
+ * in applicationDidFinishLaunching, but the Tcl interpreter is not
+ * initialized until this function call.
*/
-
+
TkMacOSXServices_Init(interp);
return TCL_OK;
@@ -457,28 +457,28 @@ int TkMacOSXGetAppPath(
ClientData cd,
Tcl_Interp *ip,
int objc,
- Tcl_Obj *CONST objv[])
+ Tcl_Obj *const objv[])
{
CFURLRef mainBundleURL = CFBundleCopyBundleURL(CFBundleGetMainBundle());
-
- /*
- * Convert the URL reference into a string reference.
+
+ /*
+ * Convert the URL reference into a string reference.
*/
-
+
CFStringRef appPath = CFURLCopyFileSystemPath(mainBundleURL, kCFURLPOSIXPathStyle);
-
- /*
- * Get the system encoding method.
+
+ /*
+ * Get the system encoding method.
*/
-
+
CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
-
- /*
- * Convert the string reference into a C string.
+
+ /*
+ * Convert the string reference into a C string.
*/
-
+
char *path = (char *) CFStringGetCStringPtr(appPath, encodingMethod);
Tcl_SetResult(ip, path, NULL);
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index a67f894..98ee54f 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -431,7 +431,7 @@ VISIBILITY_HIDDEN
#endif /* _TKMACPRIV */
-int TkMacOSXGetAppPath(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]);
+int TkMacOSXGetAppPath(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *const objv[]);
/*
* Local Variables:
diff --git a/macosx/tkMacOSXServices.c b/macosx/tkMacOSXServices.c
index af40a91..809c708 100644
--- a/macosx/tkMacOSXServices.c
+++ b/macosx/tkMacOSXServices.c
@@ -1,6 +1,6 @@
/*
* tkMacOSXServices.c --
- *
+ *\
* This file allows the integration of Tk and the Cocoa NSServices API.
*
* Copyright (c) 2010-2019 Kevin Walzer/WordTech Communications LLC.
@@ -54,7 +54,6 @@ ServicesEventProc(
NSArray *sendTypes = [NSArray arrayWithObjects:@"NSStringPboardType",
@"NSPasteboardTypeString", nil];
[NSApp registerServicesMenuSendTypes:sendTypes returnTypes:sendTypes];
- NSUpdateDynamicServices();
return;
}
@@ -159,7 +158,7 @@ TkMacOSXRegisterServiceWidgetObjCmd(
ClientData cd,
Tcl_Interp *ip,
int objc,
- Tcl_Obj *CONST objv[])
+ Tcl_Obj *const objv[])
{
/*
* Need proper number of args.
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index eabc14e..f109b7a 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -50,8 +50,7 @@ TkplatformtestInit(
*/
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
- Tcl_CreateObjCommand(interp, "debugger", DebuggerObjCmd,
- (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "debugger", DebuggerObjCmd, NULL, NULL);
#endif
return TCL_OK;
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index e7bcbdf..1353577 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -1015,7 +1015,7 @@ TkWmDeadWindow(
*/
if (winPtr->parentPtr) {
- while (Tk_DoOneEvent(TK_WINDOW_EVENTS|TK_DONT_WAIT)) {}
+ while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {}
}
[NSApp _resetAutoreleasePool];
#if DEBUG_ZOMBIES > 0