summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-30 11:35:13 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-30 11:35:13 (GMT)
commita0517e3492a1daa156cc249ee91c76740133cd4e (patch)
tree4944c0eabf279deb8a9cc35f703c60c312334738
parent2b3b6f6334373b0e5eec61731bf83e629235d3ed (diff)
parent5df223b1771334dc89bf52818f093a795506dfe2 (diff)
downloadtk-a0517e3492a1daa156cc249ee91c76740133cd4e.zip
tk-a0517e3492a1daa156cc249ee91c76740133cd4e.tar.gz
tk-a0517e3492a1daa156cc249ee91c76740133cd4e.tar.bz2
Merge 9.0. More progress
-rw-r--r--doc/ConfigWidg.336
-rw-r--r--doc/CrtItemType.333
-rw-r--r--generic/tk.decls8
-rw-r--r--generic/tk.h10
-rw-r--r--generic/tkCanvArc.c4
-rw-r--r--generic/tkCanvBmap.c4
-rw-r--r--generic/tkCanvImg.c4
-rw-r--r--generic/tkCanvLine.c4
-rw-r--r--generic/tkCanvPoly.c4
-rw-r--r--generic/tkCanvPs.c4
-rw-r--r--generic/tkCanvText.c4
-rw-r--r--generic/tkCanvWind.c4
-rw-r--r--generic/tkCanvas.c141
-rw-r--r--generic/tkConsole.c2
-rw-r--r--generic/tkDecls.h28
-rw-r--r--generic/tkIcu.c2
-rw-r--r--generic/tkImgBmap.c10
-rw-r--r--generic/tkImgPNG.c2
-rw-r--r--generic/tkImgPhoto.c10
-rw-r--r--generic/tkInt.decls8
-rw-r--r--generic/tkIntPlatDecls.h12
-rw-r--r--generic/tkMain.c2
-rw-r--r--generic/tkOldConfig.c40
-rw-r--r--generic/tkRectOval.c6
-rw-r--r--generic/tkScrollbar.c10
-rw-r--r--generic/tkStubInit.c4
-rw-r--r--generic/tkTest.c2
-rw-r--r--generic/tkText.c25
-rw-r--r--generic/tkWindow.c2
-rw-r--r--macosx/tkMacOSXFont.c40
-rw-r--r--tests/cluster.test32
-rw-r--r--unix/Makefile.in2
32 files changed, 184 insertions, 315 deletions
diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3
index 6fa6de4..e4046a1 100644
--- a/doc/ConfigWidg.3
+++ b/doc/ConfigWidg.3
@@ -15,7 +15,7 @@ Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- proce
\fB#include <tk.h>\fR
.sp
int
-\fBTk_ConfigureWidget(\fIinterp, tkwin, specs, argc, argv, widgRec, flags\fB)\fR
+\fBTk_ConfigureWidget(\fIinterp, tkwin, specs, objc, objv, widgRec, flags\fB)\fR
.sp
int
\fBTk_ConfigureInfo(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR
@@ -25,7 +25,7 @@ int
.sp
\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR
.SH ARGUMENTS
-.AS char *widgRec in/out
+.AS void *widgRec in/out
.AP Tcl_Interp *interp in
Interpreter to use for returning error messages.
.AP Tk_Window tkwin in
@@ -33,9 +33,9 @@ Window used to represent widget (needed to set up X resources).
.AP "const Tk_ConfigSpec" *specs in
Pointer to table specifying legal configuration options for this
widget.
-.AP int argc in
-Number of arguments in \fIargv\fR.
-.AP "const char" **argv in
+.AP int objc in
+Number of arguments in \fIobjv\fR.
+.AP "Tcl_Obj *const *" objv in
Command-line options for configuring widget.
.AP char *widgRec in/out
Points to widget record structure. Fields in this structure get
@@ -75,16 +75,16 @@ It is typically
invoked when widgets are created, and again when the \fBconfigure\fR
command is invoked for a widget.
Although intended primarily for widgets, \fBTk_ConfigureWidget\fR
-can be used in other situations where \fIargc-argv\fR information
+can be used in other situations where \fIobjc-objv\fR information
is to be used to fill in a record structure, such as configuring
graphical elements for a canvas widget or entries of a menu.
.PP
\fBTk_ConfigureWidget\fR processes
a table specifying the configuration options that are supported
-(\fIspecs\fR) and a collection of command-line arguments (\fIargc\fR and
-\fIargv\fR) to fill in fields of a record (\fIwidgRec\fR).
+(\fIspecs\fR) and a collection of command-line arguments (\fIobjc\fR and
+\fIobjv\fR) to fill in fields of a record (\fIwidgRec\fR).
It uses the option database and defaults specified in \fIspecs\fR
-to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
+to fill in fields of \fIwidgRec\fR that are not specified in \fIobjv\fR.
\fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this
case it does not modify \fIinterp\fR.
If an error
@@ -120,12 +120,12 @@ The \fIargvName\fR field is a string such as
.QW \-font
or
.QW \-bg ,
-which is compared with the values in \fIargv\fR (if \fIargvName\fR is
+which is compared with the values in \fIobjv\fR (if \fIargvName\fR is
NULL it means this is a grouped entry; see \fBGROUPED ENTRIES\fR below). The
\fIdbName\fR and \fIdbClass\fR fields are used to look up a value
for this option in the option database. The \fIdefValue\fR field
specifies a default value for this configuration option if no
-value is specified in either \fIargv\fR or the option database.
+value is specified in either \fIobjv\fR or the option database.
\fIOffset\fR indicates where in \fIwidgRec\fR to store information
about this option, and \fIspecFlags\fR contains additional information
to control the processing of this configuration option (see FLAGS
@@ -133,14 +133,14 @@ below).
The last field, \fIcustomPtr\fR, is only used if \fItype\fR is
\fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below.
.PP
-\fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which
+\fBTk_ConfigureWidget\fR first processes \fIobjv\fR to see which
(if any) configuration options are specified there. \fIArgv\fR
must contain an even number of fields; the first of each pair
of fields must match the \fIargvName\fR of some entry in \fIspecs\fR
(unique abbreviations are acceptable),
and the second field of the pair contains the value for that
configuration option. If there are entries in \fIspec\fR for which
-there were no matching entries in \fIargv\fR,
+there were no matching entries in \fIobjv\fR,
\fBTk_ConfigureWidget\fR uses the \fIdbName\fR and \fIdbClass\fR
fields of the \fIspecs\fR entry to probe the option database; if
a value is found, then it is used as the value for the option.
@@ -149,7 +149,7 @@ Finally, if no entry is found in the option database, the
value for the configuration option. If the \fIdefValue\fR is
NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in
\fIflags\fR, then there is no default value and this \fIspecs\fR entry
-will be ignored if no value is specified in \fIargv\fR or the
+will be ignored if no value is specified in \fIobjv\fR or the
option database.
.PP
Once a string value has been determined for a configuration option,
@@ -333,13 +333,13 @@ freed by passing it to \fBTcl_Free\fR.
.TP
\fBTK_CONFIG_SYNONYM\fR
This \fItype\fR value identifies special entries in \fIspecs\fR that
-are synonyms for other entries. If an \fIargv\fR value matches the
+are synonyms for other entries. If an \fIobjv\fR value matches the
\fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used
directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR
for another entry whose \fIargvName\fR is the same as the \fIdbName\fR
field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just
-as if its \fIargvName\fR had matched the \fIargv\fR value. The
-synonym mechanism allows multiple \fIargv\fR values to be used for
+as if its \fIargvName\fR had matched the \fIobjv\fR value. The
+synonym mechanism allows multiple \fIobjv\fR values to be used for
a single configuration option, such as
.QW \-background
and
@@ -384,7 +384,7 @@ First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has
the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0),
then the option database and
\fIdefValue\fR fields are not used. In this case, if an entry in
-\fIspecs\fR does not match a field in \fIargv\fR then nothing happens:
+\fIspecs\fR does not match a field in \fIobjv\fR then nothing happens:
the corresponding target is not modified. This feature is useful
when the goal is to modify certain configuration options while
leaving others in their current state, such as when a \fBconfigure\fR
diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3
index cd270f4..85320d6 100644
--- a/doc/CrtItemType.3
+++ b/doc/CrtItemType.3
@@ -71,7 +71,7 @@ typedef struct Tk_ItemType {
Tk_ItemCoordProc *\fIcoordProc\fR;
Tk_ItemDeleteProc *\fIdeleteProc\fR;
Tk_ItemDisplayProc *\fIdisplayProc\fR;
- int \fIalwaysRedraw\fR;
+ int \fIflags\fR;
Tk_ItemPointProc *\fIpointProc\fR;
Tk_ItemAreaProc *\fIareaProc\fR;
Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
@@ -169,25 +169,17 @@ If there already existed an item type by this name then
the new item type replaces the old one.
.SS "FLAGS (IN ALWAYSREDRAW)"
.PP
-The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons)
+The \fItypePtr\->flags\fR field
contains a collection of flag bits that modify how the canvas core interacts
with the item. The following bits are defined:
.TP
-\fB1\fR
+\fBTK_ALWAYS_REDRAW\fR
.
Indicates that the item should always be redrawn when any part of the canvas
is redrawn, rather than only when the bounding box of the item overlaps the
area being redrawn. This is used by window items, for example, which need to
unmap subwindows that are not on the screen.
.TP
-\fBTK_CONFIG_OBJS\fR
-.
-Indicates that operations which would otherwise take a string (or array of
-strings) actually take a Tcl_Obj reference (or an array of such references).
-The operations to which this applies are the \fIconfigProc\fR, the
-\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the
-\fIinsertProc\fR.
-.TP
\fBTK_MOVABLE_POINTS\fR
.VS 8.6
Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and
@@ -229,9 +221,6 @@ Tk has already initialized the item's header (the first
The \fIobjc\fR and \fIobjv\fR arguments describe all of the
arguments to the \fBcreate\fR command after the \fItype\fR
argument.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
-contain a pointer to an array of constant strings.
For example, in the widget command:
.PP
.CS
@@ -285,9 +274,6 @@ The \fIinterp\fR argument identifies the interpreter in which the
widget command was invoked, \fIcanvas\fR is a handle for the canvas
widget, and \fIitemPtr\fR is a pointer to the item being configured.
\fIobjc\fR and \fIobjv\fR contain the configuration options.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
-contain a pointer to an array of constant strings.
For example, if the following command is invoked:
.PP
.CS
@@ -324,9 +310,6 @@ typedef int \fBTk_ItemCoordProc\fR(
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
describe the coordinate arguments.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
-contain a pointer to an array of constant strings.
For example, if the following widget command is invoked:
.PP
.CS
@@ -401,9 +384,9 @@ of \fIdst\fR.
.PP
Normally an item's \fIdisplayProc\fR is only invoked if the item
overlaps the area being displayed.
-However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1,
+However, if bit zero of \fItypePtr\->flags\fR is 1,
(i.e.\|
-.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" )
+.QW "\fItypePtr\->flags & 1 == 1\fR" )
then \fIdisplayProc\fR is invoked during every redisplay operation,
even if the item does not overlap the area of redisplay; this is useful for
cases such as window items, where the subwindow needs to be unmapped when it
@@ -616,9 +599,6 @@ have the usual meaning.
\fIindexObj\fR contains a textual description of an index,
and \fIindexPtr\fR points to an integer value that should be
filled in with a numerical index.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will
-actually contain a pointer to a constant string.
It is up to the type manager to decide what forms of index
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
\fBend\fR, etc.).
@@ -702,9 +682,6 @@ typedef void \fBTk_ItemInsertProc\fR(
previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR
contains new text to insert just before the character given
by \fIindex\fR.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will
-actually contain a pointer to a constant string to be inserted.
If the item supports modification of the coordinates list by this
.PP
The type manager should insert the text and recompute the bounding
diff --git a/generic/tk.decls b/generic/tk.decls
index e6c534f..ae693d3 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -136,17 +136,17 @@ declare 26 {
declare 27 {
int Tk_ConfigureInfo(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- char *widgRec, const char *argvName, int flags)
+ void *widgRec, const char *argvName, int flags)
}
declare 28 {
int Tk_ConfigureValue(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- char *widgRec, const char *argvName, int flags)
+ void *widgRec, const char *argvName, int flags)
}
declare 29 {
int Tk_ConfigureWidget(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- Tcl_Size argc, const char **argv, char *widgRec,
+ Tcl_Size objc, Tcl_Obj *const *objv, void *widgRec,
int flags)
}
declare 30 {
@@ -318,7 +318,7 @@ declare 73 {
}
declare 74 {
void Tk_FreeOptions(const Tk_ConfigSpec *specs,
- char *widgRec, Display *display, int needFlags)
+ void *widgRec, Display *display, int needFlags)
}
declare 75 {
void Tk_FreePixmap(Display *display, Pixmap pixmap)
diff --git a/generic/tk.h b/generic/tk.h
index 52e0e8a..4f4d157 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -1067,9 +1067,7 @@ typedef struct Tk_ItemType {
* type. */
Tk_ItemDisplayProc *displayProc;
/* Procedure to display items of this type. */
- int alwaysRedraw; /* Non-zero means displayProc should be called
- * even when the item has been moved
- * off-screen. */
+ int flags; /* Combination of TK_ALWAYS_REDRAW/TK_MOVABLE_POINTS */
Tk_ItemPointProc *pointProc;/* Computes distance from item to a given
* point. */
Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside,
@@ -1106,11 +1104,11 @@ typedef struct Tk_ItemType {
} Tk_ItemType;
/*
- * Flag (used in the alwaysRedraw field) to say whether an item supports
- * point-level manipulation like the line and polygon items.
+ * Possible flags for 'flags' field.
*/
-#define TK_MOVABLE_POINTS 2
+#define TK_ALWAYS_REDRAW 1 /* item should be redrawn always*/
+#define TK_MOVABLE_POINTS 2 /* item supports point-level manipulation */
#endif /* __NO_OLD_CONFIG */
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index a730eb9..a7bcfb3 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -234,7 +234,7 @@ Tk_ItemType tkArcType = {
ArcCoords, /* coordProc */
DeleteArc, /* deleteProc */
DisplayArc, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
ArcToPoint, /* pointProc */
ArcToArea, /* areaProc */
ArcToPostscript, /* postscriptProc */
@@ -452,7 +452,7 @@ ConfigureArc(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) {
+ objv, arcPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index 49e73cb..f2f2ca5 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -128,7 +128,7 @@ Tk_ItemType tkBitmapType = {
BitmapCoords, /* coordProc */
DeleteBitmap, /* deleteProc */
DisplayBitmap, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
BitmapToPoint, /* pointProc */
BitmapToArea, /* areaProc */
BitmapToPostscript, /* postscriptProc */
@@ -324,7 +324,7 @@ ConfigureBitmap(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) {
+ objv, bmapPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index 0d45dcb..9a105d9 100644
--- a/generic/tkCanvImg.c
+++ b/generic/tkCanvImg.c
@@ -116,7 +116,7 @@ Tk_ItemType tkImageType = {
ImageCoords, /* coordProc */
DeleteImage, /* deleteProc */
DisplayImage, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
ImageToPoint, /* pointProc */
ImageToArea, /* areaProc */
ImageToPostscript, /* postscriptProc */
@@ -302,7 +302,7 @@ ConfigureImage(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) {
+ objv, imgPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index 8f2595f..861c8ba 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -234,7 +234,7 @@ Tk_ItemType tkLineType = {
LineCoords, /* coordProc */
DeleteLine, /* deleteProc */
DisplayLine, /* displayProc */
- TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */
+ TK_MOVABLE_POINTS, /* flags */
LineToPoint, /* pointProc */
LineToArea, /* areaProc */
LineToPostscript, /* postscriptProc */
@@ -486,7 +486,7 @@ ConfigureLine(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
+ objv, linePtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 3d93afa..f0d6031 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -199,7 +199,7 @@ Tk_ItemType tkPolygonType = {
PolygonCoords, /* coordProc */
DeletePolygon, /* deleteProc */
DisplayPolygon, /* displayProc */
- TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */
+ TK_MOVABLE_POINTS, /* flags */
PolygonToPoint, /* pointProc */
PolygonToArea, /* areaProc */
PolygonToPostscript, /* postscriptProc */
@@ -446,7 +446,7 @@ ConfigurePolygon(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) {
+ objv, polyPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index d9759d7..f5b9a8b 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -236,8 +236,8 @@ TkCanvPostscriptObjCmd(
psInfo.prolog = 1;
psInfo.tkwin = tkwin;
Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS);
- result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, (const char **)objv+2,
- (char *) &psInfo, TK_CONFIG_ARGV_ONLY|TK_CONFIG_OBJS);
+ result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, objv+2,
+ &psInfo, TK_CONFIG_ARGV_ONLY);
if (result != TCL_OK) {
goto cleanup;
}
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 0203343..e57e0f1 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -272,7 +272,7 @@ Tk_ItemType tkTextType = {
TextCoords, /* coordProc */
DeleteText, /* deleteProc */
DisplayCanvText, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
TextToPoint, /* pointProc */
TextToArea, /* areaProc */
TextToPostscript, /* postscriptProc */
@@ -494,7 +494,7 @@ ConfigureText(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) {
+ objv, textPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index e614b92..050ba3e 100644
--- a/generic/tkCanvWind.c
+++ b/generic/tkCanvWind.c
@@ -120,7 +120,7 @@ Tk_ItemType tkWindowType = {
WinItemCoords, /* coordProc */
DeleteWinItem, /* deleteProc */
DisplayWinItem, /* displayProc */
- 1|TK_CONFIG_OBJS, /* flags */
+ TK_ALWAYS_REDRAW, /* flags */
WinItemToPoint, /* pointProc */
WinItemToArea, /* areaProc */
WinItemToPostscript, /* postscriptProc */
@@ -316,7 +316,7 @@ ConfigureWinItem(
oldWindow = winItemPtr->tkwin;
canvasTkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc,
- (const char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) {
+ objv, winItemPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 2b5568d..26941b0 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -260,9 +260,6 @@ static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr,
Tcl_Obj *const *objv, Tk_Uid uid, int enclosed);
static double GridAlign(double coord, double spacing);
-#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9)
-static const char** TkGetStringsFromObjs(Tcl_Size objc, Tcl_Obj *const *objv);
-#endif
static void InitCanvas(void);
static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr);
static Tcl_Obj * ScrollFractions(int screen1,
@@ -328,7 +325,7 @@ static inline int
AlwaysRedraw(
Tk_Item *itemPtr)
{
- return itemPtr->typePtr->alwaysRedraw & 1;
+ return itemPtr->typePtr->flags & TK_ALWAYS_REDRAW;
}
static inline int
@@ -339,25 +336,9 @@ ItemConfigure(
Tcl_Obj *const objv[])
{
Tcl_Interp *interp = canvasPtr->interp;
- int result;
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- const char **args = TkGetStringsFromObjs(objc, objv);
-
- result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY);
- if (args != NULL) {
- ckfree(args);
- }
-#endif
- }
- return result;
+ return itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY);
}
static inline int
@@ -367,7 +348,7 @@ ItemConfigInfo(
Tcl_Obj *fieldName)
{
return Tk_ConfigureInfo(canvasPtr->interp, canvasPtr->tkwin,
- itemPtr->typePtr->configSpecs, (char *) itemPtr,
+ itemPtr->typePtr->configSpecs, itemPtr,
(fieldName ? Tcl_GetString(fieldName) : NULL), 0);
}
@@ -378,7 +359,7 @@ ItemConfigValue(
Tcl_Obj *fieldName)
{
return Tk_ConfigureValue(canvasPtr->interp, canvasPtr->tkwin,
- itemPtr->typePtr->configSpecs, (char *) itemPtr,
+ itemPtr->typePtr->configSpecs, itemPtr,
Tcl_GetString(fieldName), 0);
}
@@ -394,21 +375,9 @@ ItemCoords(
if (itemPtr->typePtr->coordProc == NULL) {
result = TCL_OK;
- } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, objv);
} else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- const char **args = TkGetStringsFromObjs(objc, objv);
-
result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, (Tcl_Obj **) args);
- if (args != NULL) {
- ckfree(args);
- }
-#endif
+ itemPtr, objc, objv);
}
return result;
}
@@ -422,25 +391,9 @@ ItemCreate(
Tcl_Obj *const objv[])
{
Tcl_Interp *interp = canvasPtr->interp;
- int result;
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
+ return itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
itemPtr, objc-3, objv+3);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- const char **args = TkGetStringsFromObjs(objc-3, objv+3);
-
- result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc-3, (Tcl_Obj **) args);
- if (args != NULL) {
- ckfree(args);
- }
-#endif
- }
- return result;
}
static inline void
@@ -494,18 +447,9 @@ ItemIndex(
if (itemPtr->typePtr->indexProc == NULL) {
return TCL_OK;
- } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objPtr, indexPtr);
- } else {
-#if defined(TK_NO_DEPRECATED)
- Tcl_AppendResult(interp, "Flag TK_CONFIG_OBJS is mandatory", (void *)NULL);
- return TCL_ERROR;
-#else
- return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, (Tcl_Obj *) Tcl_GetString(objPtr), indexPtr);
-#endif
}
+ return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objPtr, indexPtr);
}
static inline void
@@ -515,17 +459,8 @@ ItemInsert(
int beforeThis,
Tcl_Obj *toInsert)
{
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
- beforeThis, toInsert);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
- beforeThis, (Tcl_Obj *) Tcl_GetString(toInsert));
-#endif
- }
+ itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
+ beforeThis, toInsert);
}
static inline int
@@ -1164,15 +1099,15 @@ CanvasWidgetCmd(
goto done;
}
result = Tk_ConfigureValue(interp, canvasPtr->tkwin, configSpecs,
- (char *) canvasPtr, Tcl_GetString(objv[2]), 0);
+ canvasPtr, Tcl_GetString(objv[2]), 0);
break;
case CANV_CONFIGURE:
if (objc == 2) {
result = Tk_ConfigureInfo(interp, canvasPtr->tkwin, configSpecs,
- (char *) canvasPtr, NULL, 0);
+ canvasPtr, NULL, 0);
} else if (objc == 3) {
result = Tk_ConfigureInfo(interp, canvasPtr->tkwin, configSpecs,
- (char *) canvasPtr, Tcl_GetString(objv[2]), 0);
+ canvasPtr, Tcl_GetString(objv[2]), 0);
} else {
result = ConfigureCanvas(interp, canvasPtr, objc-2, objv+2,
TK_CONFIG_ARGV_ONLY);
@@ -1231,7 +1166,7 @@ CanvasWidgetCmd(
*/
if (itemPtr == NULL ||
- !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) {
+ !(itemPtr->typePtr->flags & TK_MOVABLE_POINTS)) {
continue;
}
@@ -2286,7 +2221,7 @@ DestroyCanvas(
if (canvasPtr->bindingTable != NULL) {
Tk_DeleteBindingTable(canvasPtr->bindingTable);
}
- Tk_FreeOptions(configSpecs, (char *) canvasPtr, canvasPtr->display, 0);
+ Tk_FreeOptions(configSpecs, canvasPtr, canvasPtr->display, 0);
canvasPtr->tkwin = NULL;
ckfree(canvasPtr);
}
@@ -2325,8 +2260,8 @@ ConfigureCanvas(
Tk_State old_canvas_state=canvasPtr->canvas_state;
if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs,
- objc, (const char **) objv, (char *) canvasPtr,
- flags|TK_CONFIG_OBJS) != TCL_OK) {
+ objc, objv, canvasPtr,
+ flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -3361,8 +3296,8 @@ CanvasEventProc(
/*
* Special hack: if the canvas is unmapped, then must notify all items
- * with "alwaysRedraw" set, so that they know that they are no longer
- * displayed.
+ * with flag TK_ALWAYS_REDRAW set, so that they know that they are no
+ * longer displayed.
*/
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
@@ -6091,43 +6026,7 @@ CanvasSetOrigin(
canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin),
canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin));
}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkGetStringsFromObjs --
- *
- * Results:
- * Converts object list into string list.
- *
- * Side effects:
- * Memory is allocated for the objv array, which must be freed using
- * ckfree() when no longer needed.
- *
- *----------------------------------------------------------------------
- */
-
-#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9)
-static const char **
-TkGetStringsFromObjs(
- Tcl_Size objc,
- Tcl_Obj *const objv[])
-{
- Tcl_Size i;
- const char **argv;
- if (objc <= 0) {
- return NULL;
- }
- argv = (const char **)ckalloc((objc+1) * sizeof(char *));
- for (i = 0; i < objc; i++) {
- argv[i] = Tcl_GetString(objv[i]);
- }
- argv[objc] = 0;
- return argv;
-}
-#endif
-
/*
*--------------------------------------------------------------
*
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 88aacd4..aa9c476 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -224,7 +224,7 @@ Tk_InitConsoleChannels(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return;
}
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 1a72f99..cb39e7b 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -132,18 +132,18 @@ EXTERN int Tk_ClipboardClear(Tcl_Interp *interp,
Tk_Window tkwin);
/* 27 */
EXTERN int Tk_ConfigureInfo(Tcl_Interp *interp, Tk_Window tkwin,
- const Tk_ConfigSpec *specs, char *widgRec,
+ const Tk_ConfigSpec *specs, void *widgRec,
const char *argvName, int flags);
/* 28 */
EXTERN int Tk_ConfigureValue(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- char *widgRec, const char *argvName,
+ void *widgRec, const char *argvName,
int flags);
/* 29 */
EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- Tcl_Size argc, const char **argv,
- char *widgRec, int flags);
+ Tcl_Size objc, Tcl_Obj *const *objv,
+ void *widgRec, int flags);
/* 30 */
EXTERN void Tk_ConfigureWindow(Tk_Window tkwin,
unsigned int valueMask,
@@ -282,7 +282,7 @@ EXTERN void Tk_FreeGC(Display *display, GC gc);
EXTERN void Tk_FreeImage(Tk_Image image);
/* 74 */
EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs,
- char *widgRec, Display *display,
+ void *widgRec, Display *display,
int needFlags);
/* 75 */
EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap);
@@ -926,9 +926,9 @@ typedef struct TkStubs {
void (*tk_ClearSelection) (Tk_Window tkwin, Atom selection); /* 24 */
int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer); /* 25 */
int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */
- int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 27 */
- int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 28 */
- int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size argc, const char **argv, char *widgRec, int flags); /* 29 */
+ int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 27 */
+ int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 28 */
+ int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size objc, Tcl_Obj *const *objv, void *widgRec, int flags); /* 29 */
void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */
Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */
Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */
@@ -973,7 +973,7 @@ typedef struct TkStubs {
void (*tk_FreeFont) (Tk_Font f); /* 71 */
void (*tk_FreeGC) (Display *display, GC gc); /* 72 */
void (*tk_FreeImage) (Tk_Image image); /* 73 */
- void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, char *widgRec, Display *display, int needFlags); /* 74 */
+ void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 74 */
void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */
void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */
void (*reserved77)(void);
@@ -1791,6 +1791,16 @@ EXTERN int Tk_Init(Tcl_Interp *interp);
EXTERN int Tk_SafeInit(Tcl_Interp *interp);
EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
+#if TK_MAJOR_VERSION < 9
+/* Restore 8.x signature of Tk_ConfigureWidget, but panic if TK_CONFIG_OBJS flag is not set */
+#undef Tk_ConfigureWidget
+#define Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags) \
+ ((int (*)(Tcl_Interp *, Tk_Window, const Tk_ConfigSpec *, \
+ int, const char **, char *, int))(void *)(tkStubsPtr->tk_ConfigureWidget)) \
+ (((flags & TK_CONFIG_OBJS) ? interp : (Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory in Tk_ConfigureWidget"), \
+ NULL)), tkwin, specs, argc, argv, widgRec, flags)
+#endif
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkIcu.c b/generic/tkIcu.c
index 237daf8..3ccb7f6 100644
--- a/generic/tkIcu.c
+++ b/generic/tkIcu.c
@@ -155,7 +155,7 @@ startEndOfCmd(
Tcl_DStringFree(&ds);
if (idx != TCL_INDEX_NONE) {
if (idx > 0 && len != ulen) {
- /* The string contains codepoints > \uFFFF. Determine UTF-16 index */
+ /* The string contains codepoints > \uFFFF. Determine UTF-32 index */
Tcl_Size newIdx = 1;
for (Tcl_Size i = 1; i < idx; i++) {
if (((ustr[i-1]&0xFFC0) != 0xD800) || ((ustr[i]&0xFFC0) != 0xDC00)) newIdx++;
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 9344777..2fad264 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -240,7 +240,7 @@ ImgBmapConfigureModel(
int maskWidth, maskHeight, dummy1, dummy2;
if (Tk_ConfigureWidget(modelPtr->interp, Tk_MainWindow(modelPtr->interp),
- configSpecs, objc, (const char **) objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ configSpecs, objc, objv, modelPtr, flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -768,14 +768,14 @@ ImgBmapCmd(
return TCL_ERROR;
}
return Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs,
- (char *) modelPtr, Tcl_GetString(objv[2]), 0);
+ modelPtr, Tcl_GetString(objv[2]), 0);
case 1: /* configure */
if (objc == 2) {
return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) modelPtr, NULL, 0);
+ configSpecs, modelPtr, NULL, 0);
} else if (objc == 3) {
return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) modelPtr,
+ configSpecs, modelPtr,
Tcl_GetString(objv[2]), 0);
} else {
return ImgBmapConfigureModel(modelPtr, objc-2, objv+2,
@@ -1017,7 +1017,7 @@ ImgBmapDelete(
if (modelPtr->maskData != NULL) {
ckfree(modelPtr->maskData);
}
- Tk_FreeOptions(configSpecs, (char *) modelPtr, NULL, 0);
+ Tk_FreeOptions(configSpecs, modelPtr, NULL, 0);
ckfree(modelPtr);
}
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index 499ffed..5eb85a7 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -481,7 +481,7 @@ ReadBase64(
0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
- 0x83, 0x83
+ 0x83, 0x83, 0x83
};
/*
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 79b1363..4a7d4ed 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -485,7 +485,7 @@ ImgPhotoCmd(
}
} else {
Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs,
- (char *) modelPtr, Tcl_GetString(objv[2]), 0);
+ modelPtr, Tcl_GetString(objv[2]), 0);
}
return TCL_OK;
}
@@ -499,7 +499,7 @@ ImgPhotoCmd(
Tcl_Obj *obj, *subobj;
result = Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) modelPtr, NULL, 0);
+ configSpecs, modelPtr, NULL, 0);
if (result != TCL_OK) {
return result;
}
@@ -575,7 +575,7 @@ ImgPhotoCmd(
return TCL_OK;
} else {
return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) modelPtr, arg, 0);
+ configSpecs, modelPtr, arg, 0);
}
} else {
return ImgPhotoConfigureModel(interp, modelPtr, objc-2, objv+2,
@@ -1973,7 +1973,7 @@ ImgPhotoConfigureModel(
*/
if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs,
- objc, (const char **)objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ objc, objv, modelPtr, flags) != TCL_OK) {
goto errorExit;
}
@@ -2388,7 +2388,7 @@ ImgPhotoDelete(
if (modelPtr->metadata != NULL) {
Tcl_DecrRefCount(modelPtr->metadata);
}
- Tk_FreeOptions(configSpecs, (char *) modelPtr, NULL, 0);
+ Tk_FreeOptions(configSpecs, modelPtr, NULL, 0);
ckfree(modelPtr);
}
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index e16a72b..aaa32c6 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -951,10 +951,10 @@ declare 51 aqua {
declare 52 aqua {
void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag)
}
-# For Canvas3d, requested by Sean Woods
-declare 54 aqua {
- void *TkMacOSXDrawable(Drawable drawable)
-}
+# Made public as Tk_MacOSXGetNSWindowForDrawable
+#declare 54 aqua {
+# void *TkMacOSXDrawable(Drawable drawable)
+#}
##############################################################################
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index e470575..a684b21 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -248,9 +248,6 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window,
EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin);
/* 52 */
EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
-/* Slot 53 is reserved */
-/* 54 */
-EXTERN void * TkMacOSXDrawable(Drawable drawable);
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
/* 0 */
@@ -424,8 +421,6 @@ typedef struct TkIntPlatStubs {
int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */
void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */
void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */
- void (*reserved53)(void);
- void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
void (*tkCreateXEventSource) (void); /* 0 */
@@ -680,9 +675,6 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
(tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */
#define TkMacOSXSetDrawingEnabled \
(tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */
-/* Slot 53 is reserved */
-#define TkMacOSXDrawable \
- (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
#define TkCreateXEventSource \
@@ -749,6 +741,10 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
/* !END!: Do not edit above this line. */
+#ifndef TK_NO_DEPRECATED
+# define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable
+#endif
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkMain.c b/generic/tkMain.c
index af1c550..c41715b 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -187,7 +187,7 @@ Tk_MainEx(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
abort();
} else {
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index bb44763..7e902db 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -61,7 +61,7 @@ static void DeleteSpecCacheTable(void *clientData,
* will hold an error message.
*
* Side effects:
- * The fields of widgRec get filled in with information from argc/argv
+ * The fields of widgRec get filled in with information from objc/objv
* and the option database. Old information in widgRec's fields gets
* recycled. A copy of the spec-table is taken with (some of) the char*
* fields converted into Tk_Uid fields; this copy will be released when
@@ -76,9 +76,9 @@ Tk_ConfigureWidget(
Tk_Window tkwin, /* Window containing widget (needed to set up
* X resources). */
const Tk_ConfigSpec *specs, /* Describes legal options. */
- Tcl_Size argc, /* Number of elements in argv. */
- const char **argv, /* Command-line options. */
- char *widgRec, /* Record whose fields are to be modified.
+ Tcl_Size objc, /* Number of elements in objv. */
+ Tcl_Obj *const *objv, /* Command-line options. */
+ void *widgRec, /* Record whose fields are to be modified.
* Values must be properly initialized. */
int flags) /* Used to specify additional flags that must
* be present in config specs for them to be
@@ -125,18 +125,10 @@ Tk_ConfigureWidget(
* match entries in the specs.
*/
- for ( ; argc > 0; argc -= 2, argv += 2) {
+ for ( ; objc > 0; objc -= 2, objv += 2) {
const char *arg;
- if (flags & TK_CONFIG_OBJS) {
- arg = Tcl_GetString((Tcl_Obj *) *argv);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- arg = *argv;
-#endif
- }
+ arg = Tcl_GetString(*objv);
specPtr = FindConfigSpec(interp, staticSpecs, arg, needFlags, hateFlags);
if (specPtr == NULL) {
return TCL_ERROR;
@@ -146,21 +138,13 @@ Tk_ConfigureWidget(
* Process the entry.
*/
- if (argc < 2) {
+ if (objc < 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"value for \"%s\" missing", arg));
Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", NULL);
return TCL_ERROR;
}
- if (flags & TK_CONFIG_OBJS) {
- arg = Tcl_GetString((Tcl_Obj *) argv[1]);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- arg = argv[1];
-#endif
- }
+ arg = Tcl_GetString(objv[1]);
if (DoConfig(interp, tkwin, specPtr, arg, 0, widgRec) != TCL_OK) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (processing \"%.40s\" option)",specPtr->argvName));
@@ -608,7 +592,7 @@ Tk_ConfigureInfo(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Window corresponding to widgRec. */
const Tk_ConfigSpec *specs, /* Describes legal options. */
- char *widgRec, /* Record whose fields contain current values
+ void *widgRec, /* Record whose fields contain current values
* for options. */
const char *argvName, /* If non-NULL, indicates a single option
* whose info is to be returned. Otherwise
@@ -922,7 +906,7 @@ Tk_ConfigureValue(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Window corresponding to widgRec. */
const Tk_ConfigSpec *specs, /* Describes legal options. */
- char *widgRec, /* Record whose fields contain current values
+ void *widgRec, /* Record whose fields contain current values
* for options. */
const char *argvName, /* Gives the command-line name for the option
* whose value is to be returned. */
@@ -990,7 +974,7 @@ Tk_ConfigureValue(
void
Tk_FreeOptions(
const Tk_ConfigSpec *specs, /* Describes legal options. */
- char *widgRec, /* Record whose fields contain current values
+ void *widgRec, /* Record whose fields contain current values
* for options. */
Display *display, /* X display; needed for freeing some
* resources. */
@@ -1008,7 +992,7 @@ Tk_FreeOptions(
if (specPtr->offset < 0) {
continue;
}
- ptr = widgRec + specPtr->offset;
+ ptr = (char *)widgRec + specPtr->offset;
switch (specPtr->type) {
case TK_CONFIG_STRING:
if (*((char **) ptr) != NULL) {
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 67b9d2b..626451c 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -171,7 +171,7 @@ Tk_ItemType tkRectangleType = {
RectOvalCoords, /* coordProc */
DeleteRectOval, /* deleteProc */
DisplayRectOval, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
RectToPoint, /* pointProc */
RectToArea, /* areaProc */
RectOvalToPostscript, /* postscriptProc */
@@ -196,7 +196,7 @@ Tk_ItemType tkOvalType = {
RectOvalCoords, /* coordProc */
DeleteRectOval, /* deleteProc */
DisplayRectOval, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
OvalToPoint, /* pointProc */
OvalToArea, /* areaProc */
RectOvalToPostscript, /* postscriptProc */
@@ -416,7 +416,7 @@ ConfigureRectOval(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
+ objv, rectOvalPtr, flags)) {
return TCL_ERROR;
}
state = itemPtr->state;
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index dbe2c62..f21af6e 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -287,16 +287,16 @@ ScrollbarWidgetObjCmd(
goto error;
}
result = Tk_ConfigureValue(interp, scrollPtr->tkwin,
- configSpecs, (char *) scrollPtr, Tcl_GetString(objv[2]), 0);
+ configSpecs, scrollPtr, Tcl_GetString(objv[2]), 0);
break;
}
case COMMAND_CONFIGURE: {
if (objc == 2) {
result = Tk_ConfigureInfo(interp, scrollPtr->tkwin,
- configSpecs, (char *) scrollPtr, NULL, 0);
+ configSpecs, scrollPtr, NULL, 0);
} else if (objc == 3) {
result = Tk_ConfigureInfo(interp, scrollPtr->tkwin,
- configSpecs, (char *) scrollPtr, Tcl_GetString(objv[2]), 0);
+ configSpecs, scrollPtr, Tcl_GetString(objv[2]), 0);
} else {
result = ConfigureScrollbar(interp, scrollPtr, objc-2,
objv+2, TK_CONFIG_ARGV_ONLY);
@@ -474,7 +474,7 @@ ConfigureScrollbar(
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, objc,
- (const char **)objv, (char *) scrollPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ objv, scrollPtr, flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -548,7 +548,7 @@ TkScrollbarEventProc(
* Tk_FreeOptions handle all the standard option-related stuff.
*/
- Tk_FreeOptions(configSpecs, (char*) scrollPtr, scrollPtr->display, 0);
+ Tk_FreeOptions(configSpecs, scrollPtr, scrollPtr->display, 0);
Tcl_EventuallyFree(scrollPtr, TCL_DYNAMIC);
} else if (eventPtr->type == ConfigureNotify) {
TkpComputeScrollbarGeometry(scrollPtr);
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index dc7947f..a5c6460 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -42,8 +42,6 @@ MODULE_SCOPE const TkStubs tkStubs;
#undef TkPutImage
#undef XPutImage
-#define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable
-
#if !defined(MAC_OSX_TK)
static int
doNothing(void)
@@ -535,8 +533,6 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkGenerateButtonEvent, /* 50 */
TkGenWMDestroyEvent, /* 51 */
TkMacOSXSetDrawingEnabled, /* 52 */
- 0, /* 53 */
- TkMacOSXDrawable, /* 54 */
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
TkCreateXEventSource, /* 0 */
diff --git a/generic/tkTest.c b/generic/tkTest.c
index e776bbf..e688a7e 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -240,7 +240,7 @@ Tktest_Init(
{
static int initialized = 0;
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return TCL_ERROR;
}
if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
diff --git a/generic/tkText.c b/generic/tkText.c
index 51fa2a0..ff58398 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -27,16 +27,6 @@
#include "tkWinInt.h"
#endif
-/*
- * For compatibility with Tk 4.0 through 8.4.x, we allow tabs to be
- * mis-specified with non-increasing values. These are converted into tabs
- * which are the equivalent of at least a character width apart.
- */
-
-#if (TK_MAJOR_VERSION < 9)
-#define _TK_ALLOW_DECREASING_TABS
-#endif
-
#include "tkText.h"
/*
@@ -4568,27 +4558,12 @@ TkTextGetTabs(
* illegal.
*/
-#ifdef _TK_ALLOW_DECREASING_TABS
- /*
- * Force the tab to be a typical character width to the right of
- * the previous one, and update the 'lastStop' with the changed
- * position.
- */
-
- if (textPtr->charWidth > 0) {
- tabPtr->location = (tabPtr-1)->location + textPtr->charWidth;
- } else {
- tabPtr->location = (tabPtr-1)->location + 8;
- }
- lastStop = tabPtr->location;
-#else
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"tabs must be monotonically increasing, but \"%s\" is "
"smaller than or equal to the previous tab",
Tcl_GetString(objv[i])));
Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", NULL);
goto error;
-#endif /* _TK_ALLOW_DECREASING_TABS */
}
tabArrayPtr->numTabs++;
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index b3731bf..4aa903d 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3181,7 +3181,7 @@ Initialize(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return TCL_ERROR;
}
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index bbbae78..8a2e0a8 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -460,21 +460,38 @@ startOfClusterObjCmd(
if (stringArg == NULL) {
return TCL_ERROR;
}
+ Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:numBytes];
- if (TkGetIntForIndex(objv[2], [S length] - 1, 0, &index) != TCL_OK) {
+ if (TkGetIntForIndex(objv[2], ulen - 1, 0, &index) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"",
Tcl_GetString(objv[2])));
Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL);
return TCL_ERROR;
}
+ if (index > 0 && (Tcl_Size)[S length] != ulen) {
+ /* The string contains codepoints > \uFFFF. Determine UTF-16 index */
+ Tcl_Size newIdx = 1;
+ for (Tcl_Size i = 1; i < index; i++) {
+ newIdx += 1 + ((([S characterAtIndex:newIdx-1]&0xFFC0) == 0xD800) && (([S characterAtIndex:newIdx]&0xFFC0) == 0xDC00));
+ }
+ index = newIdx;
+ }
if (index >= 0) {
- if ((size_t)index >= [S length]) {
+ if (index >= (Tcl_Size)[S length]) {
index = (Tcl_Size)[S length];
} else {
NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:index];
index = range.location;
}
+ if (index > 0 && (Tcl_Size)[S length] != ulen) {
+ /* The string contains codepoints > \uFFFF. Determine UTF-32 index */
+ Tcl_Size newIdx = 1;
+ for (Tcl_Size i = 1; i < index; i++) {
+ if ((([S characterAtIndex:i-1]&0xFFC0) != 0xD800) || (([S characterAtIndex:i]&0xFFC0) != 0xDC00)) newIdx++;
+ }
+ index = newIdx;
+ }
Tcl_SetObjResult(interp, TkNewIndexObj(index));
}
return TCL_OK;
@@ -499,14 +516,23 @@ endOfClusterObjCmd(
if (stringArg == NULL) {
return TCL_ERROR;
}
+ Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:numBytes];
- if (TkGetIntForIndex(objv[2], [S length] - 1, 0, &index) != TCL_OK) {
+ if (TkGetIntForIndex(objv[2], ulen - 1, 0, &index) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"",
Tcl_GetString(objv[2])));
Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL);
return TCL_ERROR;
}
+ if (index > 0 && (Tcl_Size)[S length] != ulen) {
+ /* The string contains codepoints > \uFFFF. Determine UTF-16 index */
+ Tcl_Size newIdx = 1;
+ for (Tcl_Size i = 1; i < index; i++) {
+ newIdx += 1 + ((([S characterAtIndex:newIdx-1]&0xFFC0) == 0xD800) && (([S characterAtIndex:newIdx]&0xFFC0) == 0xDC00));
+ }
+ index = newIdx;
+ }
if ((size_t)index + 1 <= [S length]) {
if (index < 0) {
index = 0;
@@ -514,6 +540,14 @@ endOfClusterObjCmd(
NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:index];
index = range.location + range.length;
}
+ if (index > 0 && (Tcl_Size)[S length] != ulen) {
+ /* The string contains codepoints > \uFFFF. Determine UTF-32 index */
+ Tcl_Size newIdx = 1;
+ for (Tcl_Size i = 1; i < index; i++) {
+ if ((([S characterAtIndex:i-1]&0xFFC0) != 0xD800) || (([S characterAtIndex:i]&0xFFC0) != 0xDC00)) newIdx++;
+ }
+ index = newIdx;
+ }
Tcl_SetObjResult(interp, TkNewIndexObj(index));
}
return TCL_OK;
diff --git a/tests/cluster.test b/tests/cluster.test
index 724283a..1ef9424 100644
--- a/tests/cluster.test
+++ b/tests/cluster.test
@@ -15,53 +15,53 @@ testConstraint needsICU [expr {[catch {info body ::tk::startOfCluster}]}]
test cluster-1.0 {::tk::startOfCluster} -body {
- ::tk::startOfCluster 🤡 -1
+ ::tk::startOfCluster é -1
} -result {}
test cluster-1.1 {::tk::startOfCluster} -body {
- ::tk::startOfCluster 🤡 0
+ ::tk::startOfCluster é 0
} -result 0
test cluster-1.2 {::tk::startOfCluster} -constraints needsICU -body {
- ::tk::startOfCluster 🤡 1
+ ::tk::startOfCluster é 1
} -result 0
test cluster-1.3 {::tk::startOfCluster} -constraints needsICU -body {
- ::tk::startOfCluster 🤡 2
+ ::tk::startOfCluster é 2
} -result 2
test cluster-1.4 {::tk::startOfCluster} -constraints needsICU -body {
- ::tk::startOfCluster 🤡 3
+ ::tk::startOfCluster é 3
} -result 2
test cluster-1.5 {::tk::startOfCluster} -constraints needsICU -body {
- ::tk::startOfCluster 🤡 end
+ ::tk::startOfCluster é end
} -result 0
test cluster-1.6 {::tk::startOfCluster} -body {
- ::tk::startOfCluster 🤡 {}
+ ::tk::startOfCluster é {}
} -result {}
test cluster-1.7 {::tk::startOfCluster} -constraints needsICU -body {
- ::tk::startOfCluster 🤡 end-1
+ ::tk::startOfCluster é end-1
} -result 0
test cluster-2.0 {::tk::endOfCluster} -body {
- ::tk::endOfCluster 🤡 -1
+ ::tk::endOfCluster é -1
} -result 0
test cluster-2.1 {::tk::endOfCluster} -constraints needsICU -body {
- ::tk::endOfCluster 🤡 0
+ ::tk::endOfCluster é 0
} -result 2
test cluster-2.2 {::tk::endOfCluster} -constraints needsICU -body {
- ::tk::endOfCluster 🤡 1
+ ::tk::endOfCluster é 1
} -result 2
test cluster-2.3 {::tk::endOfCluster} -body {
- ::tk::endOfCluster 🤡 2
+ ::tk::endOfCluster é 2
} -result {}
test cluster-2.4 {::tk::endOfCluster} -body {
- ::tk::endOfCluster 🤡 3
+ ::tk::endOfCluster é 3
} -result {}
test cluster-2.5 {::tk::endOfCluster} -constraints needsICU -body {
- ::tk::endOfCluster 🤡 end
+ ::tk::endOfCluster é end
} -result 2
test cluster-2.6 {::tk::endOfCluster} -body {
- ::tk::endOfCluster 🤡 {}
+ ::tk::endOfCluster é {}
} -result 0
test cluster-2.7 {::tk::endOfCluster} -constraints needsICU -body {
- ::tk::endOfCluster 🤡 end-1
+ ::tk::endOfCluster é end-1
} -result 2
test cluster-3.0 {::tk::endOfWord} -body {
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 9724995..cf274c3 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1793,7 +1793,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC
$(TEST_DIR)/README $(TEST_DIR)/*.{gif,png,ppm,xbm} \
$(TEST_DIR)/option.file* $(DISTDIR)/tests
$(INSTALL_DATA_DIR) $(DISTDIR)/tests/ttk
- $(DIST_INSTALL_DATA) $(TEST_DIR)/ttk/*.{test,tcl} $(DISTDIR)/tests/ttk
+ $(DIST_INSTALL_DATA) $(TEST_DIR)/ttk/*.{svg,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