summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-08-08 07:23:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-08-08 07:23:18 (GMT)
commit4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05 (patch)
tree359b631c47633e5b071ef0d26465d56d36e7eb3d
parentfca3a144c468de939dced0bcbf211b4228efaec2 (diff)
downloadtk-4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05.zip
tk-4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05.tar.gz
tk-4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05.tar.bz2
Change flag NEW_STYLE_COMMANDS into OLD_STYLE_COMMANDS. This makes it easier to remove the deprecated part in the future.
If building with Tcl > 8, Don't build the compatibility Tk_Photo* (From Tk < 8.4 or so) functions any more.
-rw-r--r--generic/tk.decls8
-rw-r--r--generic/tk.h8
-rw-r--r--generic/tkDecls.h2
-rw-r--r--generic/tkImgPhoto.c2
-rw-r--r--generic/tkIntPlatDecls.h4
-rw-r--r--generic/tkOldConfig.c4
-rw-r--r--generic/tkScrollbar.c16
-rw-r--r--generic/tkScrollbar.h20
-rw-r--r--generic/tkStubInit.c4
9 files changed, 38 insertions, 30 deletions
diff --git a/generic/tk.decls b/generic/tk.decls
index a8d0c58..aa85a30 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -1148,6 +1148,14 @@ export {
const char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, const char *version,
int exact)
}
+export {
+ void Tk_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc,
+ Tcl_Interp *interp)
+}
+export {
+ void Tk_MainExW(int argc, wchar_t **argv,
+ Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
+}
# Local Variables:
# mode: tcl
diff --git a/generic/tk.h b/generic/tk.h
index da58023..c0105d1 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -418,9 +418,9 @@ typedef enum {
#define TK_CONFIG_COLOR_ONLY (1 << 1)
#define TK_CONFIG_MONO_ONLY (1 << 2)
#define TK_CONFIG_DONT_SET_DEFAULT (1 << 3)
-#if !defined(TK_NO_DEPRECATED) || defined(BUILD_tk)
+#ifndef TK_NO_DEPRECATED
# define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
-#endif
+#endif /* !TK_NO_DEPRECATED */
#define TK_CONFIG_USER_BIT 0x100
#endif /* __NO_OLD_CONFIG */
@@ -1572,7 +1572,7 @@ typedef int (Tk_SelectionProc) (ClientData clientData, int offset,
* of what is actually there can be correct.
*/
-#if !defined(TK_NO_DEPRECATED) && !defined(BUILD_tk)
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK
# ifdef Tk_PhotoPutBlock
# undef Tk_PhotoPutBlock
@@ -1605,7 +1605,7 @@ typedef int (Tk_SelectionProc) (ClientData clientData, int offset,
# endif
# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic
#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
-#endif /* !TK_NO_DEPRECATED && !BUILD_tk */
+#endif /* !TK_NO_DEPRECATED */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 2e498af..c265fb8 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -1751,7 +1751,7 @@ extern const TkStubs *tkStubsPtr;
#endif
-#ifdef TK_NO_DEPRECATED
+#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
#undef Tk_PhotoPutBlock_NoComposite
#undef Tk_PhotoPutZoomedBlock_NoComposite
#undef Tk_PhotoExpand_Panic
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 05b3f57..fa58c86 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -4042,7 +4042,7 @@ ImgPhotoPostscript(
*
*----------------------------------------------------------------------
*/
-#ifndef TK_NO_DEPRECATED
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
void
Tk_PhotoPutBlock_NoComposite(
Tk_PhotoHandle handle,
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 5685912..e80b3e4 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -667,8 +667,6 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
#define TCL_STORAGE_CLASS DLLIMPORT
#undef TkWinGetPlatformId
-#if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9
-# define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */
-#endif /* TK_NO_DEPRECATED */
+#define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */
#endif /* _TKINTPLATDECLS */
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 920d93e..f8f5d1c 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -25,6 +25,10 @@
#define INIT 0x20
+#ifndef TK_CONFIG_OPTION_SPECIFIED
+# define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
+#endif
+
/*
* Forward declarations for functions defined later in this file:
*/
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index 9c1ceb8..8ace793 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -380,20 +380,18 @@ ScrollbarWidgetObjCmd(
goto error;
}
#ifndef TK_NO_DEPRECATED
- if (scrollPtr->flags & NEW_STYLE_COMMANDS) {
-#endif /* TK_NO_DEPRECATED */
- resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction);
- resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction);
- Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs));
-#ifndef TK_NO_DEPRECATED
- } else {
+ if (scrollPtr->flags & OLD_STYLE_COMMANDS) {
resObjs[0] = Tcl_NewIntObj(scrollPtr->totalUnits);
resObjs[1] = Tcl_NewIntObj(scrollPtr->windowUnits);
resObjs[2] = Tcl_NewIntObj(scrollPtr->firstUnit);
resObjs[3] = Tcl_NewIntObj(scrollPtr->lastUnit);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs));
+ break;
}
#endif /* TK_NO_DEPRECATED */
+ resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction);
+ resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs));
break;
}
case COMMAND_IDENTIFY: {
@@ -443,7 +441,7 @@ ScrollbarWidgetObjCmd(
scrollPtr->lastFraction = last;
}
#ifndef TK_NO_DEPRECATED
- scrollPtr->flags |= NEW_STYLE_COMMANDS;
+ scrollPtr->flags &= ~OLD_STYLE_COMMANDS;
} else if (objc == 6) {
int totalUnits, windowUnits, firstUnit, lastUnit;
if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) {
@@ -482,7 +480,7 @@ ScrollbarWidgetObjCmd(
scrollPtr->firstFraction = ((double) firstUnit)/totalUnits;
scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits;
}
- scrollPtr->flags &= ~NEW_STYLE_COMMANDS;
+ scrollPtr->flags |= OLD_STYLE_COMMANDS;
#endif /* !TK_NO_DEPRECATED */
} else {
Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction");
diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h
index 66b12b8..99f16a4 100644
--- a/generic/tkScrollbar.h
+++ b/generic/tkScrollbar.h
@@ -93,21 +93,21 @@ typedef struct TkScrollbar {
* form (totalUnits, windowUnits, firstUnit, and lastUnit), or the "new"
* form (firstFraction and lastFraction). FirstFraction and lastFraction
* will always be valid, but the old-style information is only valid if
- * the NEW_STYLE_COMMANDS flag is 0.
+ * the OLD_STYLE_COMMANDS flag is 1.
*/
#ifndef TK_NO_DEPRECATED
int totalUnits; /* Total dimension of application, in units.
- * Valid only if the NEW_STYLE_COMMANDS flag
- * isn't set. */
+ * Valid only if the OLD_STYLE_COMMANDS flag
+ * is set. */
int windowUnits; /* Maximum number of units that can be
* displayed in the window at once. Valid only
- * if the NEW_STYLE_COMMANDS flag isn't set. */
+ * if the OLD_STYLE_COMMANDS flag is set. */
int firstUnit; /* Number of last unit visible in
* application's window. Valid only if the
- * NEW_STYLE_COMMANDS flag isn't set. */
+ * OLD_STYLE_COMMANDS flag is set. */
int lastUnit; /* Index of last unit visible in window.
- * Valid only if the NEW_STYLE_COMMANDS flag
+ * Valid only if the OLD_STYLE_COMMANDS flag
* isn't set. */
#else
int dummy1,dummy2,dummy3,dummy4; /* sizeof(TkScrollbar) should not depend on TK_NO_DEPRECATED */
@@ -148,17 +148,17 @@ typedef struct TkScrollbar {
*
* REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
* already been queued to redraw this window.
- * NEW_STYLE_COMMANDS: Non-zero means the new style of commands
+ * OLD_STYLE_COMMANDS: Non-zero means the old style of commands
* should be used to communicate with the widget:
- * ".t yview scroll 2 lines", instead of
- * ".t yview 40", for example.
+ * ".t yview 40", instead of
+ * ".t yview scroll 2 lines", for example.
* GOT_FOCUS: Non-zero means this window has the input
* focus.
*/
#define REDRAW_PENDING 1
#ifndef TK_NO_DEPRECATED
-#define NEW_STYLE_COMMANDS 2
+# define OLD_STYLE_COMMANDS 2
#endif /* TK_NO_DEPRECATED */
#define GOT_FOCUS 4
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 81bc9ca..ed71d0f 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -43,7 +43,7 @@ MODULE_SCOPE const TkStubs tkStubs;
#undef Tk_GetStyleFromObj
#undef TkWinGetPlatformId
-#if defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8
+#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
#define Tk_MainEx 0
#define Tk_FreeXId 0
#define Tk_FreeStyleFromObj 0
@@ -74,7 +74,7 @@ static int TkWinGetPlatformId(void) {
return 2;
}
#endif /* defined(_WIN32) || defined(__CYGWIN__) */
-#endif /* defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8 */
+#endif /* !TK_NO_DEPRECATED */
#ifdef _WIN32