summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-12-28 19:22:52 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-12-28 19:22:52 (GMT)
commitab8581447860fd932b9cddaaad15482ec5b2a8ff (patch)
tree50bdd655b4ab69601f8e3e9bf2499c3ab23706c4
parent08e8b8259e502b560e6170dbc1ab6b88bcebaf45 (diff)
parent4c9bbf09763b8979ce09b90c8d9521685a1154a6 (diff)
downloadtk-ab8581447860fd932b9cddaaad15482ec5b2a8ff.zip
tk-ab8581447860fd932b9cddaaad15482ec5b2a8ff.tar.gz
tk-ab8581447860fd932b9cddaaad15482ec5b2a8ff.tar.bz2
merge core-8-6-branch
-rw-r--r--.github/workflows/linux-build.yml10
-rw-r--r--.github/workflows/win-build.yml20
-rw-r--r--generic/tkMain.c8
-rw-r--r--generic/ttk/ttkCache.c1
-rw-r--r--generic/ttk/ttkElements.c1
-rw-r--r--generic/ttk/ttkImage.c1
-rw-r--r--generic/ttk/ttkInit.c1
-rw-r--r--generic/ttk/ttkLayout.c1
-rw-r--r--generic/ttk/ttkManager.c1
-rw-r--r--generic/ttk/ttkNotebook.c3
-rw-r--r--generic/ttk/ttkPanedwindow.c1
-rw-r--r--generic/ttk/ttkProgress.c10
-rw-r--r--generic/ttk/ttkScale.c2
-rw-r--r--generic/ttk/ttkState.c1
-rw-r--r--generic/ttk/ttkTagSet.c1
-rw-r--r--generic/ttk/ttkTreeview.c2
-rw-r--r--generic/ttk/ttkWidget.c1
-rw-r--r--library/ttk/aquaTheme.tcl2
-rw-r--r--macosx/tkMacOSXBitmap.c2
-rw-r--r--macosx/tkMacOSXColor.c11
-rw-r--r--macosx/tkMacOSXCursor.c4
-rw-r--r--macosx/tkMacOSXDialog.c4
-rw-r--r--macosx/tkMacOSXDraw.c2
-rw-r--r--macosx/tkMacOSXFont.c7
-rw-r--r--macosx/tkMacOSXImage.c10
-rw-r--r--macosx/tkMacOSXKeyEvent.c2
-rw-r--r--macosx/tkMacOSXMenu.c6
-rw-r--r--macosx/tkMacOSXNotify.c4
-rw-r--r--macosx/tkMacOSXPrivate.h1
-rw-r--r--macosx/tkMacOSXWm.c2
-rw-r--r--macosx/ttkMacOSXTheme.c54
-rw-r--r--tests/butGeom2.tcl2
-rw-r--r--tests/font.test4
-rw-r--r--tests/pack.test2
-rw-r--r--tests/place.test2
-rw-r--r--tests/send.test6
-rwxr-xr-xtests/winDialog.test17
-rw-r--r--unix/Makefile.in5
-rwxr-xr-xunix/installManPage2
-rw-r--r--unix/tkConfig.h.in22
-rw-r--r--unix/tkUnixRFont.c1
-rw-r--r--win/rules-ext.vc4
-rw-r--r--win/rules.vc290
-rw-r--r--win/tkWinFont.c4
44 files changed, 279 insertions, 258 deletions
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml
index 7bbbef9..70bbd5e 100644
--- a/.github/workflows/linux-build.yml
+++ b/.github/workflows/linux-build.yml
@@ -143,15 +143,13 @@ jobs:
}
- name: Run Tests
run: |
- xvfb-run --auto-servernum make test-classic | tee out-classic.txt || {
+ xvfb-run --auto-servernum make test-classic | tee out-classic.txt
+ xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt
+ grep -q "Failed 0" out-classic.txt || {
echo "::error::Failure during Test"
exit 1
}
- xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt || {
- echo "::error::Failure during Test"
- exit 1
- }
- cat out-classic.txt out-ttk.txt | grep -q "Failed 0" || {
+ grep -q "Failed 0" out-ttk.txt || {
echo "::error::Failure during Test"
exit 1
}
diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml
index 5893fb6..2f0b328 100644
--- a/.github/workflows/win-build.yml
+++ b/.github/workflows/win-build.yml
@@ -21,6 +21,8 @@ jobs:
repository: tcltk/tcl
ref: core-8-6-branch
path: tcl
+ - name: Init MSVC
+ uses: ilammy/msvc-dev-cmd@v1
- name: Make Install Location
working-directory: tcl
run: |
@@ -29,8 +31,6 @@ jobs:
mkdir install
cd install
echo "INSTALLDIR=`pwd`" >> $GITHUB_ENV
- - name: Init MSVC
- uses: ilammy/msvc-dev-cmd@v1
- name: Build Tcl
run: |
&nmake -f makefile.vc release install
@@ -60,7 +60,11 @@ jobs:
echo "::error::Failure during Test"
exit 1
}
- cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && {
+ grep -q "Failed 0" out-classic.txt || {
+ echo "::error::Failure during Test"
+ exit 1
+ }
+ grep -q "Failed 0" out-ttk.txt || {
echo "::error::Failure during Test"
exit 1
}
@@ -142,15 +146,13 @@ jobs:
}
- name: Run Tests
run: |
- make test-classic | tee out-classic.txt || {
- echo "::error::Failure during Test"
- exit 1
- }
- make test-ttk | tee out-ttk.txt || {
+ make test-classic | tee out-classic.txt
+ make test-ttk | tee out-ttk.txt
+ grep -q "Failed 0" out-classic.txt || {
echo "::error::Failure during Test"
exit 1
}
- cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && {
+ grep -q "Failed 0" out-ttk.txt || {
echo "::error::Failure during Test"
exit 1
}
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 32006b3..953a54f 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -15,14 +15,6 @@
*/
#include "tkInt.h"
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef NO_STDLIB_H
-# include "../compat/stdlib.h"
-#else
-# include <stdlib.h>
-#endif
extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *);
diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c
index e7f885f..c29007c 100644
--- a/generic/ttk/ttkCache.c
+++ b/generic/ttk/ttkCache.c
@@ -28,7 +28,6 @@
* but this will be a transient effect.
*/
-#include <stdio.h> /* for sprintf */
#include "tkInt.h"
#include "ttkTheme.h"
diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c
index c4469dc..4dd2adb 100644
--- a/generic/ttk/ttkElements.c
+++ b/generic/ttk/ttkElements.c
@@ -6,7 +6,6 @@
*/
#include "tkInt.h"
-#include <string.h>
#include "ttkTheme.h"
#include "ttkWidget.h"
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index 5c2a55f..2ef30e0 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -10,7 +10,6 @@
* [style map].
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkTheme.h"
diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c
index f1b6e26..0bda18b 100644
--- a/generic/ttk/ttkInit.c
+++ b/generic/ttk/ttkInit.c
@@ -4,7 +4,6 @@
* Ttk package: initialization routine and miscellaneous utilities.
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkTheme.h"
#include "ttkWidget.h"
diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c
index fdbeacf..ed61a1c 100644
--- a/generic/ttk/ttkLayout.c
+++ b/generic/ttk/ttkLayout.c
@@ -6,7 +6,6 @@
* Copyright (c) 2003 Joe English. Freely redistributable.
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkThemeInt.h"
diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c
index 8cad58c..a47d8dc 100644
--- a/generic/ttk/ttkManager.c
+++ b/generic/ttk/ttkManager.c
@@ -4,7 +4,6 @@
* Support routines for geometry managers.
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkManager.h"
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index 83075bc..ea82ef1 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -3,9 +3,6 @@
*/
#include "tkInt.h"
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
#include "ttkTheme.h"
#include "ttkWidget.h"
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c
index fa0d5c8..4fbbf94 100644
--- a/generic/ttk/ttkPanedwindow.c
+++ b/generic/ttk/ttkPanedwindow.c
@@ -6,7 +6,6 @@
* TODO: track active/pressed sash.
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkManager.h"
#include "ttkTheme.h"
diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c
index ae945ae..f65cb08 100644
--- a/generic/ttk/ttkProgress.c
+++ b/generic/ttk/ttkProgress.c
@@ -4,7 +4,6 @@
* ttk::progressbar widget.
*/
-#include <math.h>
#include "tkInt.h"
#include "ttkTheme.h"
#include "ttkWidget.h"
@@ -102,7 +101,6 @@ static void AnimateProgressProc(ClientData clientData)
Progressbar *pb = (Progressbar *)clientData;
pb->progress.timer = 0;
-
if (AnimationEnabled(pb)) {
int phase = 0;
Tcl_GetIntFromObj(NULL, pb->progress.phaseObj, &phase);
@@ -110,9 +108,11 @@ static void AnimateProgressProc(ClientData clientData)
/*
* Update -phase:
*/
+
++phase;
- if (pb->progress.maxPhase)
- phase %= pb->progress.maxPhase;
+ if (phase > pb->progress.maxPhase) {
+ phase = 0;
+ }
Tcl_DecrRefCount(pb->progress.phaseObj);
pb->progress.phaseObj = Tcl_NewIntObj(phase);
Tcl_IncrRefCount(pb->progress.phaseObj);
@@ -120,9 +120,9 @@ static void AnimateProgressProc(ClientData clientData)
/*
* Reschedule:
*/
+
pb->progress.timer = Tcl_CreateTimerHandler(
pb->progress.period, AnimateProgressProc, clientData);
-
TtkRedisplayWidget(&pb->core);
}
}
diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c
index 4d05f97..a4b2a4e 100644
--- a/generic/ttk/ttkScale.c
+++ b/generic/ttk/ttkScale.c
@@ -4,8 +4,6 @@
* ttk::scale widget.
*/
-#include <string.h>
-#include <stdio.h>
#include "tkInt.h"
#include "ttkTheme.h"
#include "ttkWidget.h"
diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c
index d37f7f6..9e5cf4b 100644
--- a/generic/ttk/ttkState.c
+++ b/generic/ttk/ttkState.c
@@ -5,7 +5,6 @@
*
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkTheme.h"
diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c
index fc026cb..0ce5cea 100644
--- a/generic/ttk/ttkTagSet.c
+++ b/generic/ttk/ttkTagSet.c
@@ -4,7 +4,6 @@
* Copyright (C) 2005, Joe English. Freely redistributable.
*/
-#include <string.h> /* for memset() */
#include "tkInt.h"
#include "ttkTheme.h"
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 0a156a5..41b05e5 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -4,8 +4,6 @@
* ttk::treeview widget implementation.
*/
-#include <string.h>
-#include <stdio.h>
#include "tkInt.h"
#include "ttkTheme.h"
#include "ttkWidget.h"
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index 9992d27..0cfc119 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -4,7 +4,6 @@
* Core widget utilities.
*/
-#include <string.h>
#include "tkInt.h"
#include "ttkTheme.h"
#include "ttkWidget.h"
diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl
index 51c3e49..3ccdd70 100644
--- a/library/ttk/aquaTheme.tcl
+++ b/library/ttk/aquaTheme.tcl
@@ -99,7 +99,7 @@ namespace eval ttk::theme::aqua {
}
# Enable animation for ttk::progressbar widget:
- ttk::style configure TProgressbar -period 100 -maxphase 255
+ ttk::style configure TProgressbar -period 100 -maxphase 120
# For Aqua, labelframe labels should appear outside the border,
# with a 14 pixel inset and 4 pixels spacing between border and label
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index 29bb163..4c77d92 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -178,7 +178,7 @@ TkpCreateNativeBitmap(
NSImage *iconImage = [[NSWorkspace sharedWorkspace]
iconForFileType: iconUTI];
CGSize size = CGSizeMake(builtInIconSize, builtInIconSize);
- Pixmap pixmap = PixmapFromImage(display, iconImage, NSSizeToCGSize(size));
+ Pixmap pixmap = PixmapFromImage(display, iconImage, size);
return pixmap;
}
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 543f1d5..edcd5d3 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -342,13 +342,14 @@ GetRGBA(
[color getComponents: rgba];
#else
{
+ OSStatus err = noErr;
RGBColor rgb;
err = GetThemeTextColor(kThemeTextColorPushButtonActive, 32,
true, &rgb);
if (err == noErr) {
- rgba[0] = (CGFLoat) rgb.red / 65535;
- rgba[1] = (CGFLoat) rgb.green / 65535;
- rgba[2] = (CGFLoat) rgb.blue / 65535;
+ rgba[0] = (CGFloat) rgb.red / 65535;
+ rgba[1] = (CGFloat) rgb.green / 65535;
+ rgba[2] = (CGFloat) rgb.blue / 65535;
}
}
#endif
@@ -546,7 +547,7 @@ TkMacOSXSetColorInContext(
CGColorRef cgColor = nil;
SystemColorDatum *entry = GetEntryFromPixel(pixel);
CGRect rect;
- HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0};;
+ HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0};
if (entry) {
switch (entry->type) {
@@ -618,7 +619,7 @@ TkpGetColor(
Colormap colormap = tkwin ? Tk_Colormap(tkwin) : noColormap;
NSView *view = nil;
static Bool initialized = NO;
- static NSColorSpace* sRGB = NULL;
+ static NSColorSpace* sRGB = nil;
if (!initialized) {
initialized = YES;
diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c
index 4b2de7f..191aa7e 100644
--- a/macosx/tkMacOSXCursor.c
+++ b/macosx/tkMacOSXCursor.c
@@ -271,7 +271,7 @@ FindCursorByName(
break;
case IMAGEBITMAP: {
unsigned char *bitmap = (unsigned char *)(cursorNames[idx].id1);
- NSBitmapImageRep *bitmapImageRep = NULL;
+ NSBitmapImageRep *bitmapImageRep = nil;
CGImageRef img = NULL, mask = NULL, maskedImg = NULL;
static const CGFloat decodeWB[] = {1, 0};
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(
@@ -466,7 +466,7 @@ TkpFreeCursor(
TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr;
[macCursorPtr->macCursor release];
- macCursorPtr->macCursor = NULL;
+ macCursorPtr->macCursor = nil;
if (macCursorPtr == gCurrentCursor) {
gCurrentCursor = NULL;
}
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 52b6e99..89035ab 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -302,7 +302,6 @@ getFileURL(
- (void)selectFormat:(id)sender {
NSPopUpButton *button = (NSPopUpButton *)sender;
filterInfo.fileTypeIndex = [button indexOfSelectedItem];
-
if ([[filterInfo.fileTypeAllowsAll objectAtIndex:filterInfo.fileTypeIndex] boolValue]) {
[openpanel setAllowsOtherFileTypes:YES];
@@ -799,6 +798,7 @@ Tk_GetOpenFileObjCmd(
[label setBezeled:NO];
[label setDrawsBackground:NO];
[popupButton addItemsWithTitles:filterInfo.fileTypeLabels];
+ [popupButton setTarget:NSApp];
[popupButton setAction:@selector(selectFormat:)];
[accessoryView addSubview:label];
[accessoryView addSubview:popupButton];
@@ -1084,8 +1084,8 @@ Tk_GetSaveFileObjCmd(
[popupButton addItemsWithTitles:filterInfo.fileTypeLabels];
[popupButton selectItemAtIndex:filterInfo.fileTypeIndex];
+ [popupButton setTarget:NSApp];
[popupButton setAction:@selector(saveFormat:)];
-
[accessoryView addSubview:label];
[accessoryView addSubview:popupButton];
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 06d1810..22b6a45 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -1345,7 +1345,7 @@ TkMacOSXSetupDrawingContext(
* will get redrawn in the next call to its drawRect method.
*/
- currentBounds = CGContextGetClipBoundingBox(dc.context);
+ currentBounds = NSRectFromCGRect(CGContextGetClipBoundingBox(dc.context));
if (!NSContainsRect(currentBounds, drawingBounds)) {
[view addTkDirtyRect:drawingBounds];
}
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index 37d4eab..ca370f3 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -127,7 +127,7 @@ static int CreateNamedSystemFont(Tcl_Interp *interp,
self = [self init];
if (self) {
_string = [[NSString alloc] initWithString:aString];
- self.UTF8String = _string.UTF8String;
+ _UTF8String = _string.UTF8String;
}
return self;
}
@@ -149,10 +149,6 @@ static int CreateNamedSystemFont(Tcl_Interp *interp,
return [_string characterAtIndex:index];
}
-# ifndef __clang__
-@synthesize DString = _ds;
-#endif
-
- (Tcl_DString)DString
{
if ( _ds.string == NULL) {
@@ -177,6 +173,7 @@ static int CreateNamedSystemFont(Tcl_Interp *interp,
#ifndef __clang__
@synthesize UTF8String = _UTF8String;
+@synthesize DString = _ds;
#endif
@end
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 2604dfa..74c0115 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -414,7 +414,7 @@ XPutImage(
int dest_x, /* Destination X & Y. */
int dest_y,
unsigned int width, /* Same width & height for both */
- unsigned int height) /* distination and source. */
+ unsigned int height) /* destination and source. */
{
TkMacOSXDrawingContext dc;
MacDrawable *macDraw = (MacDrawable *)drawable;
@@ -529,8 +529,8 @@ CreateCGImageFromDrawableRect(
MacDrawable *mac_drawable = (MacDrawable *)drawable;
CGContextRef cg_context = NULL;
CGImageRef cg_image = NULL, result = NULL;
- NSBitmapImageRep *bitmapRep = NULL;
- NSView *view = NULL;
+ NSBitmapImageRep *bitmapRep = nil;
+ NSView *view = nil;
if (mac_drawable->flags & TK_IS_PIXMAP) {
/*
* This MacDrawable is a bitmap, so its view is NULL.
@@ -544,7 +544,7 @@ CreateCGImageFromDrawableRect(
result = CGImageCreateWithImageInRect(cg_image, image_rect);
CGImageRelease(cg_image);
}
- } else if (TkMacOSXGetNSViewForDrawable(mac_drawable) != NULL) {
+ } else if (TkMacOSXGetNSViewForDrawable(mac_drawable) != nil) {
/*
* Convert Tk top-left to NSView bottom-left coordinates.
@@ -642,7 +642,7 @@ XGetImage(
unsigned long plane_mask,
int format)
{
- NSBitmapImageRep* bitmapRep = NULL;
+ NSBitmapImageRep* bitmapRep = nil;
NSUInteger bitmap_fmt = 0;
XImage* imagePtr = NULL;
char* bitmap = NULL;
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index fdf4e66..1dc3982 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -268,7 +268,7 @@ static NSUInteger textInputModifiers;
@implementation TKContentView
@synthesize tkDirtyRect = _tkDirtyRect;
-@synthesize tkNeedsDisplay = _tkNeedsDisplay;;
+@synthesize tkNeedsDisplay = _tkNeedsDisplay;
/*
* Implementation of the NSTextInputClient protocol.
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 9edb724..0604708 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -724,7 +724,7 @@ TkpConfigureMenuEntry(
* The -background and -foreground options are now ignored in Aqua.
* See ticket [635167af14].
*/
-
+
NSDictionary fontAttributes = TkMacOSXNSFontAttributesForFont(
Tk_GetFontFromObj(mePtr->menuPtr->tkwin, fontPtr));
NSMutableDictionary *attributes = [fontAttributes mutableCopy];
@@ -751,10 +751,10 @@ TkpConfigureMenuEntry(
}
#else
-
+
NSDictionary *attributes = TkMacOSXNSFontAttributesForFont(
Tk_GetFontFromObj(mePtr->menuPtr->tkwin, fontPtr));
-
+
#endif
attributedTitle = [[NSAttributedString alloc] initWithString:title
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index b32c635..4b65fd8 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -333,7 +333,7 @@ TkMacOSXNotifyExitHandler(
* None.
*
* Side effects:
- * Parts of windows my get redrawn.
+ * Parts of windows may get redrawn.
*
*----------------------------------------------------------------------
*/
@@ -443,7 +443,7 @@ TkMacOSXEventsSetupProc(
*
* If we have any events waiting or if there is any drawing to be done
* we want Tcl_WaitForEvent to return immediately. So we set the block
- * time to 0 and stop the heatbeat.
+ * time to 0 and stop the heartbeat.
*/
NSEvent *currentEvent =
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index 8e57641..ea53e5f 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -557,6 +557,7 @@ VISIBILITY_HIDDEN
@private
Tcl_DString _ds;
NSString *_string;
+ const char *_UTF8String;
}
@property const char *UTF8String;
@property (readonly) Tcl_DString DString;
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 942a6f8..045d8d2 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -6900,7 +6900,7 @@ ApplyWindowAttributeFlagChanges(
* to the screen size. (For 10.11 and up, only)
*/
- if (@available(macOS 10.11, *)) {
+ if ([NSApp macOSVersion] >= 101100) {
NSSize screenSize = [[macWindow screen] frame].size;
[macWindow setMaxFullScreenContentSize:screenSize];
}
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index b4ba894..1d65b3c 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -31,7 +31,6 @@
#include "tkMacOSXPrivate.h"
#include "ttk/ttkTheme.h"
-#include <math.h>
/*
* Macros for handling drawing contexts.
@@ -1351,7 +1350,7 @@ static void ButtonElementMinSize(
ThemeButtonParams *params = (ThemeButtonParams *)clientData;
if (params->heightMetric != NoThemeMetric) {
- ChkErr(GetThemeMetric, params->heightMetric, minHeight);
+ ChkErr(GetThemeMetric, params->heightMetric, (SInt *) minHeight);
/*
* The theme height does not include the 1-pixel border around
@@ -2290,15 +2289,37 @@ static void PbarElementDraw(
Ttk_State state)
{
PbarElement *pbar = elementRecord;
- int orientation = TTK_ORIENT_HORIZONTAL, phase = 0;
- double value = 0, maximum = 100, factor;
+ int orientation = TTK_ORIENT_HORIZONTAL, phase = 0, kind;
+
+ /*
+ * Using 1000 as the maximum should give better than 1 pixel
+ * resolution for most progress bars.
+ */
+
+ int ivalue, imaximum = 1000;
CGRect bounds;
Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orientation);
- Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value);
- Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum);
- Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase);
- factor = RangeToFactor(maximum);
+ kind = !strcmp("indeterminate", Tcl_GetString(pbar->modeObj)) ?
+ kThemeIndeterminateBar : kThemeProgressBar;
+ if (kind == kThemeIndeterminateBar) {
+ Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase);
+
+ /*
+ * On macOS 11 the fraction of an indeterminate progress bar which is
+ * traversed by the oscillating thumb is value / maximum. The phase
+ * determines the position of the moving thumb in that range and is
+ * apparently expected to vary between 0 and 120. On earlier systems
+ * it is unclear how the phase is used in generating the animation.
+ */
+
+ ivalue = imaximum;
+ } else {
+ double value, maximum;
+ Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value);
+ Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum);
+ ivalue = (value / maximum)*1000;
+ }
/*
* HIThemeTrackDrawInfo uses 2-byte alignment; assigning to a separate
@@ -2308,21 +2329,16 @@ static void PbarElementDraw(
bounds = BoxToRect(d, b);
HIThemeTrackDrawInfo info = {
.version = 0,
- .kind =
- (!strcmp("indeterminate",
- Tcl_GetString(pbar->modeObj)) && value) ?
- kThemeIndeterminateBar : kThemeProgressBar,
+ .kind = kind,
.bounds = bounds,
.min = 0,
- .max = maximum * factor,
- .value = value * factor,
+ .max = imaximum,
+ .value = ivalue,
.attributes = kThemeTrackShowThumb |
- (orientation == TTK_ORIENT_HORIZONTAL ?
- kThemeTrackHorizontal : 0),
+ (orientation == TTK_ORIENT_HORIZONTAL ? kThemeTrackHorizontal : 0),
.enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state),
- .trackInfo.progress.phase = phase,
+ .trackInfo.progress.phase = phase
};
-
BEGIN_DRAWING(d)
if (TkMacOSXInDarkMode(tkwin)) {
bounds = BoxToRect(d, b);
@@ -2869,7 +2885,7 @@ static Ttk_ElementSpec ToolbarBackgroundElementSpec = {
* +++ Field elements --
*
* Used for the Treeview widget. This is like the BackgroundElement
- * except that the fieldbackground color is configureable.
+ * except that the fieldbackground color is configurable.
*/
typedef struct {
diff --git a/tests/butGeom2.tcl b/tests/butGeom2.tcl
index 096225c..844f912 100644
--- a/tests/butGeom2.tcl
+++ b/tests/butGeom2.tcl
@@ -8,7 +8,7 @@ wm iconname .t "Button Geometry"
wm geom .t +0+0
wm minsize .t 1 1
-label .t.l -text {This screen exercises the color options for various flavors of buttons. Select display options below, and they will be applied to the appropiate button widgets.} -wraplength 5i
+label .t.l -text {This screen exercises the color options for various flavors of buttons. Select display options below, and they will be applied to the appropriate button widgets.} -wraplength 5i
pack .t.l -side top -fill both
button .t.quit -text Quit -command {destroy .t}
diff --git a/tests/font.test b/tests/font.test
index cef8df2..6995a7b 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -2340,7 +2340,7 @@ test font-43.1 {FieldSpecified procedure: specified vs. non-specified} -body {
} -result [font actual {times 0} -family]
-test font-44.1 {TkFontGetPixels: size < 0} -constraints failsOnUbuntuNoXft -setup {
+test font-44.1 {TkFontGetPixels: size < 0} -constraints failsOnUbuntu -setup {
set oldscale [tk scaling]
} -body {
tk scaling 0.5
@@ -2364,7 +2364,7 @@ test font-45.1 {TkFontGetAliasList: no match} -body {
test font-45.2 {TkFontGetAliasList: match} -constraints win -body {
font actual {times 10} -family
} -result {Times New Roman}
-test font-45.3 {TkFontGetAliasList: match} -constraints {noExceed} -body {
+test font-45.3 {TkFontGetAliasList: match} -constraints {noExceed failsOnUbuntu} -body {
if {[font actual {{times new roman} 10} -family] eq "Times New Roman"} {
# avoid test failure on systems that have a real "times new roman" font
set res 1
diff --git a/tests/pack.test b/tests/pack.test
index b86fa34..f365959 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1551,7 +1551,7 @@ test pack-17.2 {PackLostContentProc procedure} -setup {
pack info .pack.a
} -returnCodes error -result {window ".pack.a" isn't packed}
-if {[tk windowingsystem] == "win32"} {
+if {[tk windowingsystem] ne "aqua"} {
proc packUpdate {} {
update
}
diff --git a/tests/place.test b/tests/place.test
index 5813ac5..a809095 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -261,7 +261,7 @@ test place-7.10 {ReconfigurePlacement procedure, computing size} -setup {
list [winfo width .t.f2] [winfo height .t.f2]
} -result {30 60}
-if {[tk windowingsystem] == "win32"} {
+if {[tk windowingsystem] ne "aqua"} {
proc placeUpdate {} {
update
}
diff --git a/tests/send.test b/tests/send.test
index f440b80..c75f428 100644
--- a/tests/send.test
+++ b/tests/send.test
@@ -523,10 +523,10 @@ test send-10.19 {SendEventProc procedure, send exits} {secureserver testsend} {
set x
} {1 {target application died}}
-test send-11.1 {AppendPropCarefully and AppendErrorProc procedures} {secureserver testsend} {
+test send-11.1 {AppendPropCarefully and AppendErrorProc procedures} -constraints {secureserver testsend} -body {
testsend prop root InterpRegistry "0x21447 dummy\n"
- list [catch {send dummy foo} msg] $msg
-} {1 {no application named "dummy"}}
+ send dummy foo
+} -returnCodes 1 -match regexp -result {^(target application died|no application named "dummy")$}
test send-11.2 {AppendPropCarefully and AppendErrorProc procedures} {secureserver testsend} {
testsend prop comm Comm "c\n-r0x123 44\n-n tktest\n-s concat a b c\n"
update
diff --git a/tests/winDialog.test b/tests/winDialog.test
index e70ae3f..1384770 100755
--- a/tests/winDialog.test
+++ b/tests/winDialog.test
@@ -591,7 +591,18 @@ test winDialog-5.12.6 {tk_getSaveFile: initial directory: relative} -constraints
string equal $x [file join $dir testfile]
} -result 1
-test winDialog-5.12.7 {tk_getOpenFile: initial directory: ~} -constraints {
+test winDialog-5.12.7 {tk_getOpenFile: initial directory: ~} -setup {
+ # Ensure there's at least one file in the home directory in CI environments
+ set makeEmpty [expr {![llength [glob -nocomplain -type f -directory ~ *]]}]
+ if {$makeEmpty} {
+ for {set i 1} {$i < 1000} {incr i} {
+ # Technically a race condition...
+ set actualFilename [format "~/tkWinDialog5_12_7_%03d" $i]
+ if {![file exists $actualFilename]} break
+ }
+ close [open $actualFilename w]
+ }
+} -constraints {
nt testwinevent
} -body {
set fn [file tail [lindex [glob -types f ~/*] 0]]
@@ -603,6 +614,10 @@ test winDialog-5.12.7 {tk_getOpenFile: initial directory: ~} -constraints {
Click ok
}
string equal $x [file normalize [file join ~ $fn]]
+} -cleanup {
+ if {$makeEmpty} {
+ file delete $actualFilename
+ }
} -result 1
test winDialog-5.12.8 {tk_getOpenFile: initial directory: .} -constraints {
diff --git a/unix/Makefile.in b/unix/Makefile.in
index f8c7309..9cdd864 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1563,7 +1563,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M
$(UNIX_DIR)/tkConfig.sh.in $(UNIX_DIR)/install-sh \
$(UNIX_DIR)/README $(UNIX_DIR)/installManPage \
$(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(DISTDIR)/unix
- chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
+ chmod 775 $(DISTDIR)/unix/configure
mkdir $(DISTDIR)/bitmaps
@(cd $(TOP_DIR); for i in bitmaps/* ; do \
if [ -f $$i ] ; then \
@@ -1668,6 +1668,9 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M
$(TEST_DIR)/option.file* $(DISTDIR)/tests
mkdir $(DISTDIR)/tests/ttk
cp -p $(TEST_DIR)/ttk/*.{test,tcl} $(DISTDIR)/tests/ttk
+ cp -p $(TOP_DIR)/.travis.yml $(DISTDIR)
+ mkdir -p $(DISTDIR)/.github/workflows
+ cp -p $(TOP_DIR)/.github/workflows/*.yml $(DISTDIR)/.github/workflows
alldist: dist
rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)
diff --git a/unix/installManPage b/unix/installManPage
index 00c6cc5..a442892 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -117,7 +117,7 @@ for Target in $Names; do
chmod 644 "$Dir/$First"
$Gzip "$Dir/$First"
else
- ln "$SymOrLoc$First$Gz" "$Dir/$Target$Gz"
+ ln $SymOrLoc"$First$Gz" "$Dir/$Target$Gz"
fi
done
diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in
index 6ffc035..72d97c8 100644
--- a/unix/tkConfig.h.in
+++ b/unix/tkConfig.h.in
@@ -4,9 +4,6 @@
#ifndef _TKCONFIG
#define _TKCONFIG
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
/* Define to 1 if you have the <AvailabilityMacros.h> header file. */
#undef HAVE_AVAILABILITYMACROS_H
@@ -133,9 +130,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -184,17 +178,9 @@
/* Do we want to use the threaded memory allocator? */
#undef USE_THREAD_ALLOC
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
/* Is XKeycodeToKeysym deprecated? */
#undef XKEYCODETOKEYSYM_IS_DEPRECATED
@@ -252,7 +238,7 @@
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> doesn't define. */
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 340b5a9..226445c 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -12,7 +12,6 @@
#include "tkUnixInt.h"
#include "tkFont.h"
#include <X11/Xft/Xft.h>
-#include <ctype.h>
#define MAX_CACHED_COLORS 16
diff --git a/win/rules-ext.vc b/win/rules-ext.vc
index 58c70fa..6da5689 100644
--- a/win/rules-ext.vc
+++ b/win/rules-ext.vc
@@ -31,11 +31,11 @@ macro to the name of the project makefile.
# We extract version numbers using the nmakehlp program. For now use
# the local copy of nmakehlp. Once we locate Tcl, we will use that
# one if it is newer.
-!if [$(CC) -nologo "nmakehlp.c" -link -subsystem:console > nul]
+!if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul]
!endif
# First locate the Tcl directory that we are working with.
-!ifdef TCLDIR
+!if "$(TCLDIR)" != ""
_RULESDIR = $(TCLDIR:/=\)
diff --git a/win/rules.vc b/win/rules.vc
index 76d93cd1..13e3879 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -24,7 +24,7 @@ _RULES_VC = 1
# For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 7
+RULES_VERSION_MINOR = 8
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -652,8 +652,130 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg
!endif
!endif
+
+################################################################
+# 6. Extract various version numbers from headers
+# For Tcl and Tk, version numbers are extracted from tcl.h and tk.h
+# respectively. For extensions, versions are extracted from the
+# configure.in or configure.ac from the TEA configuration if it
+# exists, and unset otherwise.
+# Sets the following macros:
+# TCL_MAJOR_VERSION
+# TCL_MINOR_VERSION
+# TCL_RELEASE_SERIAL
+# TCL_PATCH_LEVEL
+# TCL_PATCH_LETTER
+# TCL_VERSION
+# TK_MAJOR_VERSION
+# TK_MINOR_VERSION
+# TK_RELEASE_SERIAL
+# TK_PATCH_LEVEL
+# TK_PATCH_LETTER
+# TK_VERSION
+# DOTVERSION - set as (for example) 2.5
+# VERSION - set as (for example 25)
+#--------------------------------------------------------------
+
+!if [echo REM = This file is generated from rules.vc > versions.vc]
+!endif
+!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \
+ && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc]
+!endif
+!if [echo TCL_MINOR_VERSION = \>> versions.vc] \
+ && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc]
+!endif
+!if [echo TCL_RELEASE_SERIAL = \>> versions.vc] \
+ && [nmakehlp -V "$(_TCL_H)" TCL_RELEASE_SERIAL >> versions.vc]
+!endif
+!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \
+ && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc]
+!endif
+
+!if defined(_TK_H)
+!if [echo TK_MAJOR_VERSION = \>> versions.vc] \
+ && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc]
+!endif
+!if [echo TK_MINOR_VERSION = \>> versions.vc] \
+ && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc]
+!endif
+!if [echo TK_RELEASE_SERIAL = \>> versions.vc] \
+ && [nmakehlp -V "$(_TK_H)" TK_RELEASE_SERIAL >> versions.vc]
+!endif
+!if [echo TK_PATCH_LEVEL = \>> versions.vc] \
+ && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc]
+!endif
+!endif # _TK_H
+
+!include versions.vc
+
+TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
+TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)
+!if [nmakehlp -f $(TCL_PATCH_LEVEL) "a"]
+TCL_PATCH_LETTER = a
+!elseif [nmakehlp -f $(TCL_PATCH_LEVEL) "b"]
+TCL_PATCH_LETTER = b
+!else
+TCL_PATCH_LETTER = .
+!endif
+
+!if defined(_TK_H)
+
+TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)
+TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)
+!if [nmakehlp -f $(TK_PATCH_LEVEL) "a"]
+TK_PATCH_LETTER = a
+!elseif [nmakehlp -f $(TK_PATCH_LEVEL) "b"]
+TK_PATCH_LETTER = b
+!else
+TK_PATCH_LETTER = .
+!endif
+
+!endif
+
+# Set DOTVERSION and VERSION
+!if $(DOING_TCL)
+
+DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)
+VERSION = $(TCL_VERSION)
+
+!elseif $(DOING_TK)
+
+DOTVERSION = $(TK_DOTVERSION)
+VERSION = $(TK_VERSION)
+
+!else # Doing a non-Tk extension
+
+# If parent makefile has not defined DOTVERSION, try to get it from TEA
+# first from a configure.in file, and then from configure.ac
+!ifndef DOTVERSION
+!if [echo DOTVERSION = \> versions.vc] \
+ || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc]
+!if [echo DOTVERSION = \> versions.vc] \
+ || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc]
+!error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc.
+!endif
+!endif
+!include versions.vc
+!endif # DOTVERSION
+VERSION = $(DOTVERSION:.=)
+
+!endif # $(DOING_TCL) ... etc.
+
+# Windows RC files have 3 version components. Ensure this irrespective
+# of how many components the package has specified. Basically, ensure
+# minimum 4 components by appending 4 0's and then pick out the first 4.
+# Also take care of the fact that DOTVERSION may have "a" or "b" instead
+# of "." separating the version components.
+DOTSEPARATED=$(DOTVERSION:a=.)
+DOTSEPARATED=$(DOTSEPARATED:b=.)
+!if [echo RCCOMMAVERSION = \> versions.vc] \
+ || [for /f "tokens=1,2,3,4,5* delims=." %a in ("$(DOTSEPARATED).0.0.0.0") do echo %a,%b,%c,%d >> versions.vc]
+!error *** Could not generate RCCOMMAVERSION ***
+!endif
+!include versions.vc
+
########################################################################
-# 6. Parse the OPTS macro to work out the requested build configuration.
+# 7. Parse the OPTS macro to work out the requested build configuration.
# Based on this, we will construct the actual switches to be passed to the
# compiler and linker using the macros defined in the previous section.
# The following macros are defined by this section based on OPTS
@@ -725,7 +847,7 @@ MSVCRT = 0
!if [nmakehlp -f $(OPTS) "msvcrt"]
!message *** Doing msvcrt
!else
-!if "$(TCL_MAJOR_VERSION)" == "8" && "$(TCL_MINOR_VERSION)" < "7" && $(STATIC_BUILD)
+!if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 && $(STATIC_BUILD)
MSVCRT = 0
!endif
!endif
@@ -742,7 +864,7 @@ TCL_THREADS = 0
USE_THREAD_ALLOC= 0
!endif
-!if "$(TCL_MAJOR_VERSION)" == "8"
+!if $(TCL_MAJOR_VERSION) == 8
!if [nmakehlp -f $(OPTS) "time64bit"]
!message *** Force 64-bit time_t
_USE_64BIT_TIME_T = 1
@@ -837,7 +959,7 @@ This compiler does not support profile guided optimization.
!endif
################################################################
-# 7. Parse the STATS macro to configure code instrumentation
+# 8. Parse the STATS macro to configure code instrumentation
# The following macros are set by this section:
# TCL_MEM_DEBUG - 1 -> enables memory allocation instrumentation
# 0 -> disables
@@ -867,7 +989,7 @@ TCL_COMPILE_DEBUG = 0
!endif
####################################################################
-# 8. Parse the CHECKS macro to configure additional compiler checks
+# 9. Parse the CHECKS macro to configure additional compiler checks
# The following macros are set by this section:
# WARNINGS - compiler switches that control the warnings level
# TCL_NO_DEPRECATED - 1 -> disable support for deprecated functions
@@ -899,126 +1021,6 @@ WARNINGS = $(WARNINGS) -Wp64
!endif
-################################################################
-# 9. Extract various version numbers
-# For Tcl and Tk, version numbers are extracted from tcl.h and tk.h
-# respectively. For extensions, versions are extracted from the
-# configure.in or configure.ac from the TEA configuration if it
-# exists, and unset otherwise.
-# Sets the following macros:
-# TCL_MAJOR_VERSION
-# TCL_MINOR_VERSION
-# TCL_RELEASE_SERIAL
-# TCL_PATCH_LEVEL
-# TCL_PATCH_LETTER
-# TCL_VERSION
-# TK_MAJOR_VERSION
-# TK_MINOR_VERSION
-# TK_RELEASE_SERIAL
-# TK_PATCH_LEVEL
-# TK_PATCH_LEVEL
-# TK_VERSION
-# DOTVERSION - set as (for example) 2.5
-# VERSION - set as (for example 25)
-#--------------------------------------------------------------
-
-!if [echo REM = This file is generated from rules.vc > versions.vc]
-!endif
-!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \
- && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc]
-!endif
-!if [echo TCL_MINOR_VERSION = \>> versions.vc] \
- && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc]
-!endif
-!if [echo TCL_RELEASE_SERIAL = \>> versions.vc] \
- && [nmakehlp -V "$(_TCL_H)" TCL_RELEASE_SERIAL >> versions.vc]
-!endif
-!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \
- && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc]
-!endif
-
-!if defined(_TK_H)
-!if [echo TK_MAJOR_VERSION = \>> versions.vc] \
- && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc]
-!endif
-!if [echo TK_MINOR_VERSION = \>> versions.vc] \
- && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc]
-!endif
-!if [echo TK_RELEASE_SERIAL = \>> versions.vc] \
- && [nmakehlp -V "$(_TK_H)" TK_RELEASE_SERIAL >> versions.vc]
-!endif
-!if [echo TK_PATCH_LEVEL = \>> versions.vc] \
- && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc]
-!endif
-!endif # _TK_H
-
-!include versions.vc
-
-TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
-TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)
-!if [nmakehlp -f $(TCL_PATCH_LEVEL) "a"]
-TCL_PATCH_LETTER = a
-!elseif [nmakehlp -f $(TCL_PATCH_LEVEL) "b"]
-TCL_PATCH_LETTER = b
-!else
-TCL_PATCH_LETTER = .
-!endif
-
-!if defined(_TK_H)
-
-TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)
-TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)
-!if [nmakehlp -f $(TK_PATCH_LEVEL) "a"]
-TK_PATCH_LETTER = a
-!elseif [nmakehlp -f $(TK_PATCH_LEVEL) "b"]
-TK_PATCH_LETTER = b
-!else
-TK_PATCH_LETTER = .
-!endif
-
-!endif
-
-# Set DOTVERSION and VERSION
-!if $(DOING_TCL)
-
-DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)
-VERSION = $(TCL_VERSION)
-
-!elseif $(DOING_TK)
-
-DOTVERSION = $(TK_DOTVERSION)
-VERSION = $(TK_VERSION)
-
-!else # Doing a non-Tk extension
-
-# If parent makefile has not defined DOTVERSION, try to get it from TEA
-# first from a configure.in file, and then from configure.ac
-!ifndef DOTVERSION
-!if [echo DOTVERSION = \> versions.vc] \
- || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc]
-!if [echo DOTVERSION = \> versions.vc] \
- || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc]
-!error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc.
-!endif
-!endif
-!include versions.vc
-!endif # DOTVERSION
-VERSION = $(DOTVERSION:.=)
-
-!endif # $(DOING_TCL) ... etc.
-
-# Windows RC files have 3 version components. Ensure this irrespective
-# of how many components the package has specified. Basically, ensure
-# minimum 4 components by appending 4 0's and then pick out the first 4.
-# Also take care of the fact that DOTVERSION may have "a" or "b" instead
-# of "." separating the version components.
-DOTSEPARATED=$(DOTVERSION:a=.)
-DOTSEPARATED=$(DOTSEPARATED:b=.)
-!if [echo RCCOMMAVERSION = \> versions.vc] \
- || [for /f "tokens=1,2,3,4,5* delims=." %a in ("$(DOTSEPARATED).0.0.0.0") do echo %a,%b,%c,%d >> versions.vc]
-!error *** Could not generate RCCOMMAVERSION ***
-!endif
-!include versions.vc
################################################################
# 10. Construct output directory and file paths
@@ -1115,14 +1117,29 @@ OUT_DIR = $(TMP_DIR)
# The name of the stubs library for the project being built
STUBPREFIX = $(PROJECT)stub
+#
# Set up paths to various Tcl executables and libraries needed by extensions
-!if $(DOING_TCL)
+#
+# TIP 430. Unused for 8.6 but no harm defining it to allow a common rules.vc
+!if "$(TCL_PATCH_LETTER)" == "."
+TCLSCRIPTZIPNAME = libtcl_$(TCL_MAJOR_VERSION)_$(TCL_MINOR_VERSION)_$(TCL_RELEASE_SERIAL).zip
+!else
+TCLSCRIPTZIPNAME = libtcl_$(TCL_MAJOR_VERSION)_$(TCL_MINOR_VERSION)_$(TCL_PATCH_LETTER)$(TCL_RELEASE_SERIAL).zip
+!endif
+!if "$(TK_PATCH_LETTER)" == "."
+TKSCRIPTZIPNAME = libtk_$(TK_MAJOR_VERSION)_$(TK_MINOR_VERSION)_$(TK_RELEASE_SERIAL).zip
+!else
+TKSCRIPTZIPNAME = libtk_$(TK_MAJOR_VERSION)_$(TK_MINOR_VERSION)_$(TK_PATCH_LETTER)$(TK_RELEASE_SERIAL).zip
+!endif
+
+!if $(DOING_TCL)
TCLSHNAME = $(PROJECT)sh$(VERSION)$(SUFX).exe
TCLSH = $(OUT_DIR)\$(TCLSHNAME)
TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
TCLLIB = $(OUT_DIR)\$(TCLLIBNAME)
+TCLSCRIPTZIP = $(OUT_DIR)\$(TCLSCRIPTZIPNAME)
TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
@@ -1150,6 +1167,7 @@ TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)t$(SUFX:t=).lib
TCL_LIBRARY = $(_TCLDIR)\lib
TCLREGLIB = $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib
TCLDDELIB = $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib
+TCLSCRIPTZIP = $(_TCLDIR)\lib\$(TCLSCRIPTZIPNAME)
TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target
TCL_INCLUDES = -I"$(_TCLDIR)\include"
@@ -1169,6 +1187,7 @@ TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)t$(SUFX:t=).lib
TCL_LIBRARY = $(_TCLDIR)\library
TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib
TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib
+TCLSCRIPTZIP = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLSCRIPTZIPNAME)
TCLTOOLSDIR = $(_TCLDIR)\tools
TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win"
@@ -1201,7 +1220,8 @@ WISH = $(OUT_DIR)\$(WISHNAME)
TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME)
TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME)
TKLIB = $(OUT_DIR)\$(TKLIBNAME)
-TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
+TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
+TKSCRIPTZIP = $(OUT_DIR)\$(TKSCRIPTZIPNAME)
!else # effectively NEED_TK
@@ -1216,7 +1236,10 @@ TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib
TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME)
!endif
TK_INCLUDES = -I"$(_TKDIR)\include"
+TKSCRIPTZIP = $(_TKDIR)\lib\$(TKSCRIPTZIPNAME)
+
!else # Building against Tk sources
+
WISH = $(_TKDIR)\win\$(BUILDDIRTOP)\$(WISHNAME)
TKSTUBLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSTUBLIBNAME)
TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME)
@@ -1227,7 +1250,10 @@ TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib
TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME)
!endif
TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
+TKSCRIPTZIP = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSCRIPTZIPNAME)
+
!endif # TKINSTALL
+
tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)"
!endif # $(DOING_TK)
@@ -1314,7 +1340,7 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include
# define PRJ_LIBS before including rules.rc if additional libs are needed
OPTDEFINES = /DSTDC_HEADERS
-!if $(VCVERSION) >= 1600
+!if $(VCVERSION) > 1600
OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1
!else
OPTDEFINES = $(OPTDEFINES) /DMP_NO_STDINT=1
@@ -1616,6 +1642,8 @@ default-install-pdbs:
@if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)"
@$(CPY) "$(OUT_DIR)\*.pdb" "$(LIB_INSTALL_DIR)\"
+# "emacs font-lock highlighting fix
+
default-install-docs-html:
@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
@if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)"
@@ -1780,8 +1808,8 @@ $<
TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake"
!endif
!else # !$(TCLINSTALL) - building against Tcl source
-!if exist("$(OUT_DIR)\tcl.nmake")
-TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
+!if exist("$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake")
+TCLNMAKECONFIG = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake"
!endif
!endif # TCLINSTALL
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 1e1403f..5eed32c 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1495,7 +1495,7 @@ MultiFontTextOut(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
(int) (p - source), &runString);
- familyPtr->textOutProc(hdc, x-((double)tm.tmOverhang/2), y,
+ familyPtr->textOutProc(hdc, (int)(x-(double)tm.tmOverhang/2.0), y,
(WCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
familyPtr->getTextExtentPoint32Proc(hdc,
@@ -1517,7 +1517,7 @@ MultiFontTextOut(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
(int) (p - source), &runString);
- familyPtr->textOutProc(hdc, x-((double)tm.tmOverhang/2), y,
+ familyPtr->textOutProc(hdc, (int)(x-(double)tm.tmOverhang/2.0), y,
(WCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
Tcl_DStringFree(&runString);