summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/tk_mac.n10
-rw-r--r--library/text.tcl2
-rw-r--r--library/tk.tcl3
-rw-r--r--macosx/README2
-rw-r--r--macosx/tkMacOSXHLEvents.c6
-rw-r--r--macosx/tkMacOSXInit.c30
-rw-r--r--win/tkWinClipboard.c17
-rw-r--r--win/tkWinDialog.c4
-rw-r--r--win/tkWinFont.c2
-rw-r--r--win/tkWinInit.c11
-rw-r--r--win/tkWinInt.h10
-rw-r--r--win/tkWinTest.c6
12 files changed, 31 insertions, 72 deletions
diff --git a/doc/tk_mac.n b/doc/tk_mac.n
index 4f9e2b2..be7298e 100644
--- a/doc/tk_mac.n
+++ b/doc/tk_mac.n
@@ -149,15 +149,15 @@ set).
.TP
\fB::tk::mac::PerformService\fR
.
-Executes a Tcl procedure called from the macOS
-.QW Services
+Executes a Tcl procedure called from the macOS
+.QW Services
menu in the Application menu item. The
.QW Services
menu item allows for inter-application communication; data from one
application, such as selected text, can be sent to another application
for processing, for example to Safari as a search item for Google, or
to TextEdit to be appended to a file. An example of the proc is below,
-and should be rewritten in an application script for customization:
+and should be rewritten in an application script for customization:
.RS
.PP
.CS
@@ -168,7 +168,7 @@ proc ::tk::mac::PerformService {} {
.CE
.RE
Note that the mechanism for retrieving the data is from the clipboard;
-there is no other supported way to obtain the data. If the Services
+there is no other supported way to obtain the data. If the Services
process is not desired, the NSServices keys can be deleted from
the application's Info.plist file. The underlying code supporting this
command also allows the text, entry and ttk::entry widgets to access
@@ -187,7 +187,7 @@ URL, although it can defined as such. Wish includes a stub URL scheme
of
.QW foo://
in the CFBundleURLSchemes key of its Info.plist file; this should be customized for the specific URL
-scheme the developer wants to support.
+scheme the developer wants to support.
.TP
\fB::tk::mac::GetAppPath\fR
.
diff --git a/library/text.tcl b/library/text.tcl
index 9ccf90c..788a6b9 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -1212,7 +1212,7 @@ proc ::tk::TextScanDrag {w x y} {
}
if {[info exists Priv(mouseMoved)] && $Priv(mouseMoved)} {
$w scan dragto $x $y
- }
+ }
}
# ::tk::TextUndoRedoProcessMarks --
diff --git a/library/tk.tcl b/library/tk.tcl
index 372752b..67aedf9 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -676,7 +676,7 @@ proc ::tk::mcmaxamp {args} {
return $maxlen
}
-# For now, turn off the custom mdef proc for the mac:
+# For now, turn off the custom mdef proc for the Mac:
if {[tk windowingsystem] eq "aqua"} {
namespace eval ::tk::mac {
@@ -691,7 +691,6 @@ proc ::tk::RegisterServiceWidget {w} {
}
}
-
# Run the Ttk themed widget set initialization
if {$::ttk::library ne ""} {
uplevel \#0 [list source $::ttk::library/ttk.tcl]
diff --git a/macosx/README b/macosx/README
index 3451385..c2fa040 100644
--- a/macosx/README
+++ b/macosx/README
@@ -703,7 +703,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/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index fa52613..147101e 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -113,7 +113,7 @@ static void RunSimpleTclCommand(Tcl_Interp *interp,
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);
@@ -264,7 +264,7 @@ static void RunSimpleTclCommand(Tcl_Interp *interp,
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);
@@ -467,7 +467,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..946bf30 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -392,10 +392,10 @@ TkpInit(
/*
* 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;
@@ -462,23 +462,23 @@ int TkMacOSXGetAppPath(
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/win/tkWinClipboard.c b/win/tkWinClipboard.c
index 37e1603..a14ec47 100644
--- a/win/tkWinClipboard.c
+++ b/win/tkWinClipboard.c
@@ -334,7 +334,6 @@ TkWinClipboardRender(
* encoding before placing it on the clipboard.
*/
-#ifdef UNICODE
Tcl_DStringInit(&ds);
Tcl_UtfToUniCharDString(rawText, -1, &ds);
ckfree(rawText);
@@ -350,22 +349,6 @@ TkWinClipboardRender(
GlobalUnlock(handle);
Tcl_DStringFree(&ds);
SetClipboardData(CF_UNICODETEXT, handle);
-#else
- Tcl_UtfToExternalDString(NULL, rawText, -1, &ds);
- ckfree(rawText);
- handle = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,
- (unsigned) Tcl_DStringLength(&ds) + 1);
- if (!handle) {
- Tcl_DStringFree(&ds);
- return;
- }
- buffer = GlobalLock(handle);
- memcpy(buffer, Tcl_DStringValue(&ds),
- (unsigned) Tcl_DStringLength(&ds) + 1);
- GlobalUnlock(handle);
- Tcl_DStringFree(&ds);
- SetClipboardData(CF_TEXT, handle);
-#endif
}
/*
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 14f442b..95ff1b6 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -41,11 +41,7 @@
#endif
#ifndef BFFM_VALIDATEFAILED
-#ifdef UNICODE
#define BFFM_VALIDATEFAILED 4
-#else
-#define BFFM_VALIDATEFAILED 3
-#endif
#endif /* BFFM_VALIDATEFAILED */
typedef struct ThreadSpecificData {
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 33faede..dedd017 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1826,7 +1826,7 @@ AllocFontFamily(
}
if (encoding == NULL) {
- encoding = Tcl_GetEncoding(NULL, "unicode");
+ encoding = TkWinGetUnicodeEncoding();
familyPtr->textOutProc =
(BOOL (WINAPI *)(HDC, int, int, WCHAR *, int)) TextOutW;
familyPtr->getTextExtentPoint32Proc =
diff --git a/win/tkWinInit.c b/win/tkWinInit.c
index b2d5ba4..f36a879 100644
--- a/win/tkWinInit.c
+++ b/win/tkWinInit.c
@@ -181,9 +181,7 @@ TkWin32ErrorObj(
LPTSTR lpBuffer = NULL, p = NULL;
WCHAR sBuffer[30];
Tcl_Obj* errPtr = NULL;
-#ifdef _UNICODE
Tcl_DString ds;
-#endif
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)hrError,
@@ -194,18 +192,14 @@ TkWin32ErrorObj(
wsprintf(sBuffer, L"Error Code: %08lX", hrError);
}
- if ((p = wcsrchr(lpBuffer, L'\r')) != NULL) {
- *p = L'\0';
+ if ((p = wcsrchr(lpBuffer, '\r')) != NULL) {
+ *p = '\0';
}
-#ifdef _UNICODE
Tcl_DStringInit(&ds);
Tcl_UniCharToUtfDString(lpBuffer, wcslen(lpBuffer), &ds);
errPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
Tcl_DStringFree(&ds);
-#else
- errPtr = Tcl_NewStringObj(lpBuffer, (int)strlen(lpBuffer));
-#endif /* _UNICODE */
if (lpBuffer != sBuffer) {
LocalFree((HLOCAL)lpBuffer);
@@ -213,7 +207,6 @@ TkWin32ErrorObj(
return errPtr;
}
-
/*
* Local Variables:
diff --git a/win/tkWinInt.h b/win/tkWinInt.h
index f1c2ee4..c118477 100644
--- a/win/tkWinInt.h
+++ b/win/tkWinInt.h
@@ -217,13 +217,8 @@ MODULE_SCOPE Tcl_Obj * TkWin32ErrorObj(HRESULT hrError);
# define GetClassLongPtrW GetClassLongW
# define SetClassLongPtrA SetClassLongA
# define SetClassLongPtrW SetClassLongW
-# ifdef UNICODE
# define GetClassLongPtr GetClassLongPtrW
# define SetClassLongPtr SetClassLongPtrW
-# else
-# define GetClassLongPtr GetClassLongPtrA
-# define SetClassLongPtr SetClassLongPtrA
-# endif /* !UNICODE */
#endif /* !GetClassLongPtr */
#ifndef GCLP_HICON
# define GCLP_HICON GCL_HICON
@@ -237,13 +232,8 @@ MODULE_SCOPE Tcl_Obj * TkWin32ErrorObj(HRESULT hrError);
# define GetWindowLongPtrW GetWindowLongW
# define SetWindowLongPtrA SetWindowLongA
# define SetWindowLongPtrW SetWindowLongW
-# ifdef UNICODE
# define GetWindowLongPtr GetWindowLongPtrW
# define SetWindowLongPtr SetWindowLongPtrW
-# else
-# define GetWindowLongPtr GetWindowLongPtrW
-# define SetWindowLongPtr SetWindowLongPtrW
-# endif /* !UNICODE */
#endif /* !GetWindowLongPtr */
#ifndef GWLP_WNDPROC
#define GWLP_WNDPROC GWL_WNDPROC
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index 14e5433..f3ec298 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -175,12 +175,10 @@ AppendSystemError(
}
msg = msgBuf;
} else {
- Tcl_Encoding encoding;
char *msgPtr;
- encoding = Tcl_GetEncoding(NULL, "unicode");
- Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds);
- Tcl_FreeEncoding(encoding);
+ Tcl_DStringInit(&ds);
+ Tcl_UniCharToUtfDString(wMsgPtr, wcslen(wMsgPtr), &ds);
LocalFree(wMsgPtr);
msgPtr = Tcl_DStringValue(&ds);