summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-23 14:46:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-23 14:46:22 (GMT)
commite0911ec4c26de1730f2f00b8d32a5e1980211dea (patch)
tree8f06b01a46f98cbd69ef3cfefa941daa32481766
parentc3894d8f32c0386305c5ead33eff1e8fceb377f2 (diff)
downloadtk-e0911ec4c26de1730f2f00b8d32a5e1980211dea.zip
tk-e0911ec4c26de1730f2f00b8d32a5e1980211dea.tar.gz
tk-e0911ec4c26de1730f2f00b8d32a5e1980211dea.tar.bz2
If Tk is compiled with -DTK_NO_DEPRECATED=1, remove some deprecated code (pack subcommands) and other stuff which is not used any more.
And fix a few typos. Remove rmd.bat and rmd.bat, which are also not used any more.
-rw-r--r--.fossil-settings/crlf-glob2
-rw-r--r--.fossil-settings/crnl-glob2
-rw-r--r--.fossil-settings/encoding-glob2
-rw-r--r--changes2
-rw-r--r--generic/tk.h3
-rw-r--r--generic/tkIntXlibDecls.h8
-rw-r--r--generic/tkPack.c15
-rw-r--r--generic/tkPanedWindow.c22
-rw-r--r--macosx/Tk.xcode/project.pbxproj3
-rw-r--r--macosx/Tk.xcodeproj/project.pbxproj4
-rw-r--r--win/mkd.bat12
-rw-r--r--win/rmd.bat20
-rw-r--r--win/rules.vc20
13 files changed, 40 insertions, 75 deletions
diff --git a/.fossil-settings/crlf-glob b/.fossil-settings/crlf-glob
index 7175730..ad7795f 100644
--- a/.fossil-settings/crlf-glob
+++ b/.fossil-settings/crlf-glob
@@ -1,6 +1,4 @@
win/buildall.vc.bat
win/makefile.bc
win/makefile.vc
-win/mkd.bat
-win/rmd.bat
win/rules.vc
diff --git a/.fossil-settings/crnl-glob b/.fossil-settings/crnl-glob
index 7175730..ad7795f 100644
--- a/.fossil-settings/crnl-glob
+++ b/.fossil-settings/crnl-glob
@@ -1,6 +1,4 @@
win/buildall.vc.bat
win/makefile.bc
win/makefile.vc
-win/mkd.bat
-win/rmd.bat
win/rules.vc
diff --git a/.fossil-settings/encoding-glob b/.fossil-settings/encoding-glob
index 7175730..ad7795f 100644
--- a/.fossil-settings/encoding-glob
+++ b/.fossil-settings/encoding-glob
@@ -1,6 +1,4 @@
win/buildall.vc.bat
win/makefile.bc
win/makefile.vc
-win/mkd.bat
-win/rmd.bat
win/rules.vc
diff --git a/changes b/changes
index bf3e62e..3f1b43d 100644
--- a/changes
+++ b/changes
@@ -1315,7 +1315,7 @@ ISO Latin-1 character set.
result across the execution of binding scripts. Otherwise if an event
triggers in the middle of some other script (e.g. a destroy event during
window creation, because there was an error in the creation command),
-the intepreter's result gets lost.
+the interpreter's result gets lost.
2/19/94 (bug fix) Fixed bug in dealing with results of sent command
that could cause them to get lost in some situations.
diff --git a/generic/tk.h b/generic/tk.h
index 658b11e..a0fbba9 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -748,9 +748,10 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
(((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE)
#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
-/* Tk_InternalBorderWidth is deprecated */
+#ifndef TK_NO_DEPRECATED
#define Tk_InternalBorderWidth(tkwin) \
(((Tk_FakeWin *) (tkwin))->internalBorderLeft)
+#endif /* !TK_NO_DEPRECATED */
#define Tk_InternalBorderLeft(tkwin) \
(((Tk_FakeWin *) (tkwin))->internalBorderLeft)
#define Tk_InternalBorderRight(tkwin) \
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index ce9752f..67b7c39 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -36,8 +36,12 @@
#undef XUnionRegion
#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLEXPORT
+#else
+# ifndef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLIMPORT
+# endif
#endif
typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 88a4b2d..8257b43 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -122,8 +122,10 @@ static int ConfigureSlaves(Tcl_Interp *interp, Tk_Window tkwin,
int objc, Tcl_Obj *const objv[]);
static void DestroyPacker(void *memPtr);
static Packer * GetPacker(Tk_Window tkwin);
+#ifndef TK_NO_DEPRECATED
static int PackAfter(Tcl_Interp *interp, Packer *prevPtr,
Packer *masterPtr, int objc,Tcl_Obj *const objv[]);
+#endif /* !TK_NO_DEPRECATED */
static void PackStructureProc(ClientData clientData,
XEvent *eventPtr);
static void Unlink(Packer *packPtr);
@@ -197,11 +199,14 @@ Tk_PackObjCmd(
Tk_Window tkwin = clientData;
const char *argv2;
static const char *const optionStrings[] = {
- /* after, append, before and unpack are deprecated */
+#ifndef TK_NO_DEPRECATED
"after", "append", "before", "unpack",
+#endif /* !TK_NO_DEPRECATED */
"configure", "forget", "info", "propagate", "slaves", NULL };
enum options {
+#ifndef TK_NO_DEPRECATED
PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK,
+#endif /* !TK_NO_DEPRECATED */
PACK_CONFIGURE, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES };
int index;
@@ -219,6 +224,7 @@ Tk_PackObjCmd(
if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
sizeof(char *), "option", 0, &index) != TCL_OK) {
+#ifndef TK_NO_DEPRECATED
/*
* Call it again without the deprecated ones to get a proper error
* message. This works well since there can't be any ambiguity between
@@ -228,11 +234,13 @@ Tk_PackObjCmd(
Tcl_ResetResult(interp);
Tcl_GetIndexFromObjStruct(interp, objv[1], &optionStrings[4],
sizeof(char *), "option", 0, &index);
+#endif /* TK_NO_DEPRECATED */
return TCL_ERROR;
}
argv2 = Tcl_GetString(objv[2]);
switch ((enum options) index) {
+#ifndef TK_NO_DEPRECATED
case PACK_AFTER: {
Packer *prevPtr;
Tk_Window tkwin2;
@@ -297,6 +305,7 @@ Tk_PackObjCmd(
}
return PackAfter(interp, prevPtr, masterPtr, objc-3, objv+3);
}
+#endif /* !TK_NO_DEPRECATED */
case PACK_CONFIGURE:
if (argv2[0] != '.') {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -458,6 +467,7 @@ Tk_PackObjCmd(
Tcl_SetObjResult(interp, resultObj);
break;
}
+#ifndef TK_NO_DEPRECATED
case PACK_UNPACK: {
Tk_Window tkwin2;
Packer *packPtr;
@@ -481,6 +491,7 @@ Tk_PackObjCmd(
}
break;
}
+#endif /* !TK_NO_DEPRECATED */
}
return TCL_OK;
@@ -1087,6 +1098,7 @@ GetPacker(
*------------------------------------------------------------------------
*/
+#ifndef TK_NO_DEPRECATED
static int
PackAfter(
Tcl_Interp *interp, /* Interpreter for error reporting. */
@@ -1307,6 +1319,7 @@ PackAfter(
}
return TCL_OK;
}
+#endif /* !TK_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index f350d0a..4bfc695 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -1484,10 +1484,10 @@ DisplayPanedWindow(
*/
if (horizontal) {
- sashHeight = Tk_Height(tkwin) - (2 * Tk_InternalBorderWidth(tkwin));
+ sashHeight = Tk_Height(tkwin) - (2 * Tk_InternalBorderLeft(tkwin));
sashWidth = pwPtr->sashWidth;
} else {
- sashWidth = Tk_Width(tkwin) - (2 * Tk_InternalBorderWidth(tkwin));
+ sashWidth = Tk_Width(tkwin) - (2 * Tk_InternalBorderLeft(tkwin));
sashHeight = pwPtr->sashWidth;
}
@@ -1754,7 +1754,7 @@ ArrangePanes(
*/
paneDynSize = paneDynMinSize = 0;
- internalBW = Tk_InternalBorderWidth(pwPtr->tkwin);
+ internalBW = Tk_InternalBorderLeft(pwPtr->tkwin);
pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW);
pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW);
x = y = internalBW;
@@ -2184,7 +2184,7 @@ ComputeGeometry(
pwPtr->flags |= REQUESTED_RELAYOUT;
- x = y = internalBw = Tk_InternalBorderWidth(pwPtr->tkwin);
+ x = y = internalBw = Tk_InternalBorderLeft(pwPtr->tkwin);
reqWidth = reqHeight = 0;
/*
@@ -2890,7 +2890,7 @@ PanedWindowProxyCommand(
return TCL_ERROR;
}
- internalBW = Tk_InternalBorderWidth(pwPtr->tkwin);
+ internalBW = Tk_InternalBorderLeft(pwPtr->tkwin);
if (pwPtr->orient == ORIENT_HORIZONTAL) {
if (x < 0) {
x = 0;
@@ -2899,10 +2899,10 @@ PanedWindowProxyCommand(
if (x > pwWidth) {
x = pwWidth;
}
- y = Tk_InternalBorderWidth(pwPtr->tkwin);
+ y = Tk_InternalBorderLeft(pwPtr->tkwin);
sashWidth = pwPtr->sashWidth;
sashHeight = Tk_Height(pwPtr->tkwin) -
- (2 * Tk_InternalBorderWidth(pwPtr->tkwin));
+ (2 * Tk_InternalBorderLeft(pwPtr->tkwin));
} else {
if (y < 0) {
y = 0;
@@ -2911,10 +2911,10 @@ PanedWindowProxyCommand(
if (y > pwHeight) {
y = pwHeight;
}
- x = Tk_InternalBorderWidth(pwPtr->tkwin);
+ x = Tk_InternalBorderLeft(pwPtr->tkwin);
sashHeight = pwPtr->sashWidth;
sashWidth = Tk_Width(pwPtr->tkwin) -
- (2 * Tk_InternalBorderWidth(pwPtr->tkwin));
+ (2 * Tk_InternalBorderLeft(pwPtr->tkwin));
}
if (sashWidth < 1) {
@@ -3053,7 +3053,7 @@ PanedWindowIdentifyCoords(
} else {
sashHeight = Tk_ReqHeight(pwPtr->tkwin);
}
- sashHeight -= 2 * Tk_InternalBorderWidth(pwPtr->tkwin);
+ sashHeight -= 2 * Tk_InternalBorderLeft(pwPtr->tkwin);
if (pwPtr->showHandle && pwPtr->handleSize > pwPtr->sashWidth) {
sashWidth = pwPtr->handleSize;
lpad = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
@@ -3081,7 +3081,7 @@ PanedWindowIdentifyCoords(
} else {
sashWidth = Tk_ReqWidth(pwPtr->tkwin);
}
- sashWidth -= 2 * Tk_InternalBorderWidth(pwPtr->tkwin);
+ sashWidth -= 2 * Tk_InternalBorderLeft(pwPtr->tkwin);
lpad = rpad = 0;
}
diff --git a/macosx/Tk.xcode/project.pbxproj b/macosx/Tk.xcode/project.pbxproj
index eee37a2..f919a71 100644
--- a/macosx/Tk.xcode/project.pbxproj
+++ b/macosx/Tk.xcode/project.pbxproj
@@ -1215,13 +1215,11 @@
F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = "<group>"; };
F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = "<group>"; };
- F966BC9B08F27A3E005CB29B /* mkd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mkd.bat; sourceTree = "<group>"; };
F966BC9C08F27A3E005CB29B /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = "<group>"; };
F966BCEE08F27A3E005CB29B /* tk.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.rc; sourceTree = "<group>"; };
F966BCEF08F27A3E005CB29B /* tk_base.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk_base.rc; sourceTree = "<group>"; };
F966BCF208F27A3E005CB29B /* wish.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = wish.rc; sourceTree = "<group>"; };
F966BCF308F27A3E005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
- F966BCF408F27A3E005CB29B /* rmd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rmd.bat; sourceTree = "<group>"; };
F966BCF508F27A3F005CB29B /* rules.vc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rules.vc; sourceTree = "<group>"; };
F966BCF608F27A3F005CB29B /* stubs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stubs.c; sourceTree = "<group>"; };
F966BCF708F27A3F005CB29B /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
@@ -2794,7 +2792,6 @@
F966BC9808F27A3E005CB29B /* makefile.bc */,
F966BC9908F27A3E005CB29B /* Makefile.in */,
F966BC9A08F27A3E005CB29B /* makefile.vc */,
- F966BC9B08F27A3E005CB29B /* mkd.bat */,
F966BC9C08F27A3E005CB29B /* nmakehlp.c */,
F966BC9D08F27A3E005CB29B /* rc */,
F966BCF308F27A3E005CB29B /* README */,
diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj
index 2f7edba..a873432 100644
--- a/macosx/Tk.xcodeproj/project.pbxproj
+++ b/macosx/Tk.xcodeproj/project.pbxproj
@@ -1215,13 +1215,11 @@
F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = "<group>"; };
F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = "<group>"; };
- F966BC9B08F27A3E005CB29B /* mkd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mkd.bat; sourceTree = "<group>"; };
F966BC9C08F27A3E005CB29B /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = "<group>"; };
F966BCEE08F27A3E005CB29B /* tk.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.rc; sourceTree = "<group>"; };
F966BCEF08F27A3E005CB29B /* tk_base.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk_base.rc; sourceTree = "<group>"; };
F966BCF208F27A3E005CB29B /* wish.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = wish.rc; sourceTree = "<group>"; };
F966BCF308F27A3E005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
- F966BCF408F27A3E005CB29B /* rmd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rmd.bat; sourceTree = "<group>"; };
F966BCF508F27A3F005CB29B /* rules.vc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rules.vc; sourceTree = "<group>"; };
F966BCF608F27A3F005CB29B /* stubs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stubs.c; sourceTree = "<group>"; };
F966BCF708F27A3F005CB29B /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
@@ -2794,11 +2792,9 @@
F966BC9808F27A3E005CB29B /* makefile.bc */,
F966BC9908F27A3E005CB29B /* Makefile.in */,
F966BC9A08F27A3E005CB29B /* makefile.vc */,
- F966BC9B08F27A3E005CB29B /* mkd.bat */,
F966BC9C08F27A3E005CB29B /* nmakehlp.c */,
F966BC9D08F27A3E005CB29B /* rc */,
F966BCF308F27A3E005CB29B /* README */,
- F966BCF408F27A3E005CB29B /* rmd.bat */,
F966BCF508F27A3F005CB29B /* rules.vc */,
F966BCF608F27A3F005CB29B /* stubs.c */,
F966BCF708F27A3F005CB29B /* tcl.m4 */,
diff --git a/win/mkd.bat b/win/mkd.bat
deleted file mode 100644
index 1bd5ccb..0000000
--- a/win/mkd.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-@echo off
-
-if exist %1\nul goto end
-
-md %1
-if errorlevel 1 goto end
-
-echo Created directory %1
-
-:end
-
-
diff --git a/win/rmd.bat b/win/rmd.bat
deleted file mode 100644
index 820b76f..0000000
--- a/win/rmd.bat
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-
-if not exist %1\nul goto end
-
-echo Removing directory %1
-
-if "%OS%" == "Windows_NT" goto winnt
-
-deltree /y %1
-if errorlevel 1 goto end
-goto success
-
-:winnt
-rmdir /s /q %1
-if errorlevel 1 goto end
-
-:success
-echo Deleted directory %1
-
-:end
diff --git a/win/rules.vc b/win/rules.vc
index 2cd711b..fbbe705 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -33,7 +33,6 @@ _INSTALLDIR = $(INSTALLDIR:/=\)
# "delete all" method.
#----------------------------------------------------------
-!if "$(OS)" == "Windows_NT"
RMDIR = rmdir /S /Q
ERRNULL = 2>NUL
!if ![ver | find "4.0" > nul]
@@ -43,13 +42,6 @@ COPY = copy >NUL
CPY = xcopy /i /y >NUL
COPY = copy /y >NUL
!endif
-!else # "$(OS)" != "Windows_NT"
-CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here.
-COPY = copy >_JUNK.OUT # On Win98 NUL does not work here.
-RMDIR = deltree /Y
-NULL = \NUL # Used in testing directory existence
-ERRNULL = >NUL # Win9x shell cannot redirect stderr
-!endif
MKDIR = mkdir
#------------------------------------------------------------------------------
@@ -405,14 +397,14 @@ TCL_COMPILE_DEBUG = 0
#----------------------------------------------------------
!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
-TCL_NO_DEPRECATED = 0
+TK_NO_DEPRECATED = 0
WARNINGS = -W3
!else
!if [nmakehlp -f $(CHECKS) "nodep"]
!message *** Doing nodep check
-TCL_NO_DEPRECATED = 1
+TK_NO_DEPRECATED = 1
!else
-TCL_NO_DEPRECATED = 0
+TK_NO_DEPRECATED = 0
!endif
!if [nmakehlp -f $(CHECKS) "fullwarn"]
!message *** Doing full warnings check
@@ -451,7 +443,7 @@ This compiler does not support profile guided optimization.
# Set our defines now armed with our options.
#----------------------------------------------------------
-OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS
+OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS -DTCL_NO_DEPRECATED
!if $(TCL_MEM_DEBUG)
OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG
@@ -468,8 +460,8 @@ OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
!if $(STATIC_BUILD)
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
!endif
-!if $(TCL_NO_DEPRECATED)
-OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED
+!if $(TK_NO_DEPRECATED)
+OPTDEFINES = $(OPTDEFINES) -DTK_NO_DEPRECATED
!endif
!if !$(DEBUG)