From 131b229726d38a119f46c849610e2b1830904708 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Nov 2022 21:38:17 +0000 Subject: Get rid of TK_CONFIG_OBJS flag (and change signature of Tk_ConfigureWidgets) --- doc/ConfigWidg.3 | 36 +++++++++++------------ doc/CrtItemType.3 | 23 --------------- generic/tk.decls | 2 +- generic/tkCanvArc.c | 4 +-- generic/tkCanvBmap.c | 4 +-- generic/tkCanvImg.c | 4 +-- generic/tkCanvLine.c | 4 +-- generic/tkCanvPoly.c | 4 +-- generic/tkCanvPs.c | 4 +-- generic/tkCanvText.c | 4 +-- generic/tkCanvWind.c | 4 +-- generic/tkCanvas.c | 81 +++++++-------------------------------------------- generic/tkDecls.h | 6 ++-- generic/tkImgBmap.c | 2 +- generic/tkImgPhoto.c | 2 +- generic/tkMessage.c | 3 +- generic/tkOldConfig.c | 32 +++++--------------- generic/tkRectOval.c | 6 ++-- generic/tkScrollbar.c | 2 +- 19 files changed, 63 insertions(+), 164 deletions(-) diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index e29daa8..7954f14 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -15,7 +15,7 @@ Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- proce \fB#include \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 @@ -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 @@ -433,7 +433,7 @@ once, save the value, and provide it before calling This bit is deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR so that callers could detect what entries were specified in -\fIargv\fR, but it was removed because it was inherently +\fIobjv\fR, but it was removed because it was inherently thread-unsafe. Code that wishes to detect what options were specified should use \fBTk_SetOptions\fR instead. .PP diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index cd270f4..c46ad2d 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -180,14 +180,6 @@ 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 @@ -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 1075977..68da8b5 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -146,7 +146,7 @@ declare 28 { 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 { diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index cfb5d0c..b1c109e 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 6a6de42..d75f869 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 b51a785..9aef37b 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 21b4ada..ace8643 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -230,7 +230,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 */ @@ -482,7 +482,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 eda1c22..24054a8 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 05555ae..500558b 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 f08e388..a222e48 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -278,7 +278,7 @@ Tk_ItemType tkTextType = { TextCoords, /* coordProc */ DeleteText, /* deleteProc */ DisplayCanvText, /* displayProc */ - TK_CONFIG_OBJS, /* flags */ + 0, /* flags */ TextToPoint, /* pointProc */ TextToArea, /* areaProc */ TextToPostscript, /* postscriptProc */ @@ -500,7 +500,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 2ef4a82..4691e63 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 */ + 1, /* 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 c77d33e..82ab17e 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -334,25 +334,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 @@ -389,21 +373,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; } @@ -417,25 +389,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 @@ -489,17 +445,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) || (TK_MAJOR_VERSION > 8) - Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); -#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 @@ -509,17 +457,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 @@ -2325,8 +2264,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; } diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 706d91a..f3c6fb2 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -142,8 +142,8 @@ EXTERN int Tk_ConfigureValue(Tcl_Interp *interp, /* 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, @@ -966,7 +966,7 @@ typedef struct TkStubs { 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_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 */ diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 3ff3a81..6cdd704 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; } diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 6b92831..992f4bd 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -2052,7 +2052,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; } diff --git a/generic/tkMessage.c b/generic/tkMessage.c index a5c3a2f..814e96f 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -442,10 +442,9 @@ ConfigureMessage( * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ - int flags) /* Flags to pass to Tk_ConfigureWidget. */ + TCL_UNUSED(int)) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; - (void)flags; /* * Eliminate any existing trace on a variable monitored by the message. diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index cc52e8c..3770cbd 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -57,7 +57,7 @@ static void DeleteSpecCacheTable(ClientData 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 @@ -72,9 +72,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 @@ -121,18 +121,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; @@ -142,21 +134,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)); diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index e0d591c..3f307aa 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 48e6de1..e0e3c0c 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -532,7 +532,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, (char *) scrollPtr, flags) != TCL_OK) { return TCL_ERROR; } -- cgit v0.12 From a652f87a0bf5145d16cb33a7708a27295e48a910 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Nov 2022 22:15:09 +0000 Subject: Tk version from 8.7 -> 9.1 --- .github/workflows/linux-build.yml | 156 -------------------------------------- .github/workflows/onefiledist.yml | 12 +-- .project | 2 +- README.md | 8 +- generic/tk.h | 19 ++--- library/tk.tcl | 2 +- unix/Makefile.in | 2 +- unix/configure | 38 +++++----- unix/configure.ac | 16 ++-- unix/tcl.m4 | 12 +-- unix/tk.spec | 6 +- win/README | 2 +- win/configure | 26 +++---- win/configure.ac | 10 +-- win/tcl.m4 | 8 +- 15 files changed, 82 insertions(+), 237 deletions(-) delete mode 100644 .github/workflows/linux-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml deleted file mode 100644 index 49ed6ee..0000000 --- a/.github/workflows/linux-build.yml +++ /dev/null @@ -1,156 +0,0 @@ -name: Linux -on: [push] -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v3 - with: - repository: tcltk/tcl - ref: core-8-6-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install tcl8.6-dev libxss-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT --with-tcl=/usr/lib/tcl8.6" --disable-zipfs >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Discover Version ID - if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} - run: | - cd /tmp/dist - echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV - - name: Upload Source Distribution - if: ${{ env.BUILD_CONFIG_ID == 'gcc-no' }} - uses: actions/upload-artifact@v2 - with: - name: Tk ${{ env.VERSION }} Source distribution (snapshot) - path: | - /tmp/dist/tk* - !/tmp/dist/tk*/html/** - - name: Upload Documentation Distribution - if: ${{ env.BUILD_CONFIG_ID == 'gcc-no' }} - uses: actions/upload-artifact@v2 - with: - name: Tk ${{ env.VERSION }} HTML documentation (snapshot) - path: /tmp/dist/tk*/html - test: - runs-on: ubuntu-20.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: tk - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install tcl8.6-dev libxss-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT --with-tcl=/usr/lib/tcl8.6 --disable-zipfs" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - 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 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index e3f9404..245c583 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -17,11 +17,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Setup Environment run: | @@ -81,11 +81,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Checkout create-dmg uses: actions/checkout@v3 @@ -169,11 +169,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Setup Environment run: | diff --git a/.project b/.project index cc5f605..475bbe2 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - tk8.7 + tk9.1 diff --git a/README.md b/README.md index f9fceb6..82c83dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README: Tk -This is the **Tk 8.7a6** source distribution. +This is the **Tk 9.1a0** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). @@ -14,6 +14,10 @@ site](https://sourceforge.net/projects/tcl/files/Tcl/). [![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Amain) [![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Amain) [![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Amain) +9.1 (in development, daily build)) +[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=tip-647)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Atip-647) +[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=tip-647)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Atip-647) +[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=tip-647)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Atip-647) ## 1. Introduction @@ -21,7 +25,7 @@ This directory contains the sources and documentation for Tk, a cross-platform GUI toolkit implemented with the Tcl scripting language. For details on features, incompatibilities, and potential problems with -this release, see [the Tcl/Tk 8.7 Web page](https://www.tcl-lang.org/software/tcltk/8.7.html) +this release, see [the Tcl/Tk 9.0 Web page](https://www.tcl-lang.org/software/tcltk/9.0.html) or refer to the "changes" file in this directory, which contains a historical record of all changes to Tk. diff --git a/generic/tk.h b/generic/tk.h index d59d3af..e1b76b2 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -17,8 +17,8 @@ #define _TK #include -#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) -# error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better +#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) +# error Tk 9.1 must be compiled with tcl.h from Tcl 8.7 or better #endif #ifndef EXTERN @@ -66,17 +66,14 @@ extern "C" { */ #ifndef TK_MAJOR_VERSION -# define TK_MAJOR_VERSION 8 +# define TK_MAJOR_VERSION 9 #endif -#if TK_MAJOR_VERSION != 8 -# error "This header-file is for Tk 8 only" -#endif -#define TK_MINOR_VERSION 7 +#define TK_MINOR_VERSION 1 #define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TK_RELEASE_SERIAL 6 +#define TK_RELEASE_SERIAL 0 -#define TK_VERSION "8.7" -#define TK_PATCH_LEVEL "8.7a6" +#define TK_VERSION "9.1" +#define TK_PATCH_LEVEL "9.1a0" /* * A special definition used to allow this header file to be included from @@ -1382,7 +1379,7 @@ typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, #endif /* USE_OLD_IMAGE */ /* - * The following alternate definitions are used with the Tk8.7 file format + * The following alternate definitions are used with the Tk9.1 file format * supporting a metadata dict, internal dstring and close file flag */ diff --git a/library/tk.tcl b/library/tk.tcl index 75ac9c0..022ad97 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -11,7 +11,7 @@ # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release -package require -exact tk 8.7a6 +package require -exact tk 9.1a0 # Create a ::tk namespace namespace eval ::tk { diff --git a/unix/Makefile.in b/unix/Makefile.in index 8cff89e..ce61732 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -112,7 +112,7 @@ TCL_PLATFORM_DIR = $(TCLDIR)/unix # for this version of Tk: TCL_BIN_DIR = @TCL_BIN_DIR@ -# The linker flags needed to link in the Tcl library (ex: -ltcl8.7) +# The linker flags needed to link in the Tcl library (ex: -ltcl9.0) TCL_LIB_FLAG = @TCL_LIB_FLAG@ # Flag, 1: we're building a shared lib, 0 we're not diff --git a/unix/configure b/unix/configure index 876d417..c96139d 100755 --- a/unix/configure +++ b/unix/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tk 8.7. +# Generated by GNU Autoconf 2.71 for tk 9.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='8.7' -PACKAGE_STRING='tk 8.7' +PACKAGE_VERSION='9.1' +PACKAGE_STRING='tk 9.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1382,7 +1382,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tk 8.7 to adapt to many kinds of systems. +\`configure' configures tk 9.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1448,7 +1448,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 8.7:";; + short | recursive ) echo "Configuration of tk 9.1:";; esac cat <<\_ACEOF @@ -1564,7 +1564,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 8.7 +tk configure 9.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1920,7 +1920,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tk $as_me 8.7, which was +It was created by tk $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2582,10 +2582,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.1 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=1 +TK_PATCH_LEVEL="a0" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -2678,11 +2678,11 @@ printf "%s\n" "$as_me: WARNING: --with-tcl argument should refer to directory co `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl8.7 2>/dev/null` \ + `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" @@ -2781,11 +2781,11 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_MAJOR_VERSION}" -lt 9 ; then if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi -if test "${TCL_MINOR_VERSION}" -lt 6 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +if test "${TCL_MINOR_VERSION}" -lt 7 ; then + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi fi @@ -9535,7 +9535,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tk $as_me 8.7, which was +This file was extended by tk $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9594,7 +9594,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tk config.status 8.7 +tk config.status 9.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/unix/configure.ac b/unix/configure.ac index f803a35..d7439bc 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. -AC_INIT([tk],[8.7]) +AC_INIT([tk],[9.1]) AC_PREREQ([2.69]) dnl This is only used when included from macosx/configure.ac @@ -23,10 +23,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ #endif /* _TKCONFIG */]) ]) -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.1 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=1 +TK_PATCH_LEVEL="a0" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -39,11 +39,11 @@ SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}]) fi -if test "${TCL_MINOR_VERSION}" -lt 6 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +if test "${TCL_MINOR_VERSION}" -lt 7 ; then + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}]) fi fi diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3730343..b3ebda0 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -93,11 +93,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl8.7 2>/dev/null` \ + `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" @@ -226,11 +226,11 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tk8.7 2>/dev/null` \ + `ls -d /usr/lib/tk9.1 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tk8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tk9.1 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tk9.1 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" diff --git a/unix/tk.spec b/unix/tk.spec index 6a6924c..95a4ccf 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -4,15 +4,15 @@ Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.7a6 +Version: 9.1a0 Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: https://www.tcl-lang.org/ Buildroot: /var/tmp/%{name}%{version} -Buildrequires: XFree86-devel tcl >= 8.6.0 -Requires: tcl >= 8.6.0 +Buildrequires: XFree86-devel tcl >= 8.7.0 +Requires: tcl >= 8.7.0 %description The Tcl (Tool Command Language) provides a powerful platform for diff --git a/win/README b/win/README index e371a2c..0e48334 100644 --- a/win/README +++ b/win/README @@ -1,4 +1,4 @@ -Tk 8.7 for Windows +Tk 9.1 for Windows Originally by Scott Stanton while at Sun Microsystems Labs diff --git a/win/configure b/win/configure index bb26d7a..5411b1f 100755 --- a/win/configure +++ b/win/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tk 8.7. +# Generated by GNU Autoconf 2.71 for tk 9.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='8.7' -PACKAGE_STRING='tk 8.7' +PACKAGE_VERSION='9.1' +PACKAGE_STRING='tk 9.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1365,7 +1365,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tk 8.7 to adapt to many kinds of systems. +\`configure' configures tk 9.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1427,7 +1427,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 8.7:";; + short | recursive ) echo "Configuration of tk 9.1:";; esac cat <<\_ACEOF @@ -1525,7 +1525,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 8.7 +tk configure 9.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1729,7 +1729,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tk $as_me 8.7, which was +It was created by tk $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2394,10 +2394,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.1 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=1 +TK_PATCH_LEVEL="a0" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -6551,7 +6551,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tk $as_me 8.7, which was +This file was extended by tk $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6606,7 +6606,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tk config.status 8.7 +tk config.status 9.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/win/configure.ac b/win/configure.ac index ae5a1e3..e1db677 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. -AC_INIT([tk],[8.7]) +AC_INIT([tk],[9.1]) AC_CONFIG_SRCDIR([../generic/tk.h]) AC_PREREQ([2.69]) @@ -12,10 +12,10 @@ AC_PREREQ([2.69]) # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.1 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=1 +TK_PATCH_LEVEL="a0" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/tcl.m4 b/win/tcl.m4 index 8774b94..fa9d4a9 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -1009,13 +1009,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl8.7$1/win; then - TCL_BIN_DEFAULT=../../tcl8.7$1/win + if test -d ../../tcl9.0$1/win; then + TCL_BIN_DEFAULT=../../tcl9.0$1/win else - TCL_BIN_DEFAULT=../../tcl8.7/win + TCL_BIN_DEFAULT=../../tcl9.0/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.7 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.0 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) -- cgit v0.12 From 540245dba27aa20c996d7c5b8288cb0da2c9df65 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Nov 2022 22:21:17 +0000 Subject: Build with either Tcl 8.7 or 9.0 --- .github/workflows/linux-build.yml | 174 ++++++++++++++++++++++++++++ .github/workflows/linux-with-tcl9-build.yml | 174 ---------------------------- .github/workflows/mac-build.yml | 4 +- .github/workflows/win-build.yml | 4 +- 4 files changed, 178 insertions(+), 178 deletions(-) create mode 100644 .github/workflows/linux-build.yml delete mode 100644 .github/workflows/linux-with-tcl9-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 0000000..23eda24 --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,174 @@ +name: Linux +on: [push] +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-shared" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v3 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Discover Version ID + if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} + run: | + cd /tmp/dist + echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV + test: + runs-on: ubuntu-20.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v3 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + 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 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml deleted file mode 100644 index 3f34da5..0000000 --- a/.github/workflows/linux-with-tcl9-build.yml +++ /dev/null @@ -1,174 +0,0 @@ -name: Linux (with Tcl 9.0) -on: [push] -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v3 - with: - repository: tcltk/tcl - ref: main - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure and Build Tcl - run: | - ./configure ${CFGOPT} "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Discover Version ID - if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} - run: | - cd /tmp/dist - echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV - test: - runs-on: ubuntu-20.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v3 - with: - repository: tcltk/tcl - ref: main - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure and Build Tcl - run: | - ./configure ${CFGOPT} "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - 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 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index c1f0d60..ed8ba16 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-6-branch + ref: main path: tcl - name: Prepare checked out repositories run: | @@ -71,7 +71,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-6-branch + ref: main path: tcl - name: Prepare checked out repositories env: diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 6d56b8c..2cf86f7 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Init MSVC uses: ilammy/msvc-dev-cmd@v1 @@ -114,7 +114,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: core-8-6-branch + ref: main path: tcl - name: Prepare run: | -- cgit v0.12 From c850de328148642da972b2a53f232df75dcbbfe1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Nov 2022 23:04:27 +0000 Subject: two more 8.6 -> 8.7 --- unix/Makefile.in | 2 +- win/Makefile.in | 2 +- win/makefile.vc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index ce61732..c0fac18 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -795,7 +795,7 @@ install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE) ${WISH_EXE} echo "Creating package index $(PKG_INDEX)"; \ rm -f "$(PKG_INDEX)"; \ (\ - echo "if {![package vsatisfies [package provide Tcl] 8.6-]} return";\ + echo "if {![package vsatisfies [package provide Tcl] 8.7-]} return";\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ echo "if {[package vsatisfies [package provide Tcl] 9.0]} {";\ diff --git a/win/Makefile.in b/win/Makefile.in index 0550811..2d3c3ea 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -534,7 +534,7 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {![package vsatisfies [package provide Tcl] 8.6-]} return";\ + echo "if {![package vsatisfies [package provide Tcl] 8.7-]} return";\ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\ echo " if {[package vsatisfies [package provide Tcl] 9.0]} {";\ diff --git a/win/makefile.vc b/win/makefile.vc index 25e3a38..0fecad6 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -756,7 +756,7 @@ install-binaries: !if !$(STATIC_BUILD) @echo creating package index @type << > $(OUT_DIR)\pkgIndex.tcl -if {![package vsatisfies [package provide Tcl] 8.6-]} return +if {![package vsatisfies [package provide Tcl] 8.7-]} return if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] || ([info exists ::argv] && ("-display" in $$::argv)))} { if {[package vsatisfies [package provide Tcl] 9.0]} { -- cgit v0.12 From 184a6c52517c826425e6ef06aaa06e3dc1cee92f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Nov 2022 12:41:58 +0000 Subject: wish8.7 -> wish9.1 --- .github/workflows/onefiledist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 245c583..5edb14c 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -51,7 +51,7 @@ jobs: # TODO: need the Tk version separately for distro naming below - name: Package run: | - cp bin/wish8.7 ${BUILD_NAME} + cp bin/wish9.1 ${BUILD_NAME} chmod +x ${BUILD_NAME} tar -cf ${BUILD_NAME}.tar ${BUILD_NAME} working-directory: ${{ env.INST_DIR }} -- cgit v0.12 From ad53ca0af06e1300fb06d68be098a961a06eb05a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Nov 2022 16:28:54 +0000 Subject: alwaysRedraw -> flags --- doc/CrtItemType.3 | 8 ++++---- generic/tk.h | 10 ++++------ generic/tkCanvWind.c | 2 +- generic/tkCanvas.c | 4 ++-- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index c46ad2d..af0eaee 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,7 +169,7 @@ 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 @@ -384,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 diff --git a/generic/tk.h b/generic/tk.h index e1b76b2..167ed56 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1089,9 +1089,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, @@ -1128,11 +1126,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/tkCanvWind.c b/generic/tkCanvWind.c index 4691e63..2472c3f 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -120,7 +120,7 @@ Tk_ItemType tkWindowType = { WinItemCoords, /* coordProc */ DeleteWinItem, /* deleteProc */ DisplayWinItem, /* displayProc */ - 1, /* flags */ + TK_ALWAYS_REDRAW, /* flags */ WinItemToPoint, /* pointProc */ WinItemToArea, /* areaProc */ WinItemToPostscript, /* postscriptProc */ diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 82ab17e..705df64 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -323,7 +323,7 @@ static inline int AlwaysRedraw( Tk_Item *itemPtr) { - return itemPtr->typePtr->alwaysRedraw & 1; + return itemPtr->typePtr->flags & TK_ALWAYS_REDRAW; } static inline int @@ -1164,7 +1164,7 @@ CanvasWidgetCmd( */ if (itemPtr == NULL || - !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) { + !(itemPtr->typePtr->flags & TK_MOVABLE_POINTS)) { continue; } -- cgit v0.12 From cb5e842402977341d53bd2ba71fdc70d9f118991 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Nov 2022 22:58:55 +0000 Subject: TkGetStringsFromObjs() is no longer needed --- generic/tkCanvas.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 705df64..209f01a 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -257,7 +257,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); -static const char** TkGetStringsFromObjs(int objc, Tcl_Obj *const *objv); static void InitCanvas(void); static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr); static Tcl_Obj * ScrollFractions(int screen1, @@ -2032,7 +2031,6 @@ CanvasWidgetCmd( int newX = 0; /* Initialization needed only to prevent gcc * warnings. */ double fraction; - const char **args; if (objc == 2) { Tcl_SetObjResult(interp, ScrollFractions( @@ -2043,11 +2041,7 @@ CanvasWidgetCmd( break; } - args = TkGetStringsFromObjs(objc, objv); type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count); - if (args != NULL) { - ckfree(args); - } switch (type) { case TK_SCROLL_MOVETO: newX = canvasPtr->scrollX1 - canvasPtr->inset @@ -2078,7 +2072,6 @@ CanvasWidgetCmd( int newY = 0; /* Initialization needed only to prevent gcc * warnings. */ double fraction; - const char **args; if (objc == 2) { Tcl_SetObjResult(interp, ScrollFractions( @@ -2089,11 +2082,7 @@ CanvasWidgetCmd( break; } - args = TkGetStringsFromObjs(objc, objv); type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count); - if (args != NULL) { - ckfree(args); - } switch (type) { case TK_SCROLL_MOVETO: newY = canvasPtr->scrollY1 - canvasPtr->inset + (int) ( @@ -6029,41 +6018,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. - * - *---------------------------------------------------------------------- - */ - -static const char ** -TkGetStringsFromObjs( - int objc, - Tcl_Obj *const objv[]) -{ - int 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; -} - /* *-------------------------------------------------------------- * -- cgit v0.12 From 587a2e20fc944a74d01a7cc236d6968e241dea85 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 8 Nov 2022 07:45:07 +0000 Subject: Souce/Documentation distrubion with Tcl 9.0, not 8.7 --- .github/workflows/linux-build.yml | 14 ++++++++++++++ .github/workflows/linux-with-tcl8-build.yml | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 23eda24..c97d9bb 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -103,6 +103,20 @@ jobs: run: | cd /tmp/dist echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV + - name: Upload Source Distribution + if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} + uses: actions/upload-artifact@v2 + with: + name: Tk ${{ env.VERSION }} Source distribution (snapshot) + path: | + /tmp/dist/tk* + !/tmp/dist/tk*/html/** + - name: Upload Documentation Distribution + if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} + uses: actions/upload-artifact@v2 + with: + name: Tk ${{ env.VERSION }} HTML documentation (snapshot) + path: /tmp/dist/tk*/html test: runs-on: ubuntu-20.04 strategy: diff --git a/.github/workflows/linux-with-tcl8-build.yml b/.github/workflows/linux-with-tcl8-build.yml index ff66bc1..272db22 100644 --- a/.github/workflows/linux-with-tcl8-build.yml +++ b/.github/workflows/linux-with-tcl8-build.yml @@ -103,20 +103,6 @@ jobs: run: | cd /tmp/dist echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV - - name: Upload Source Distribution - if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} - uses: actions/upload-artifact@v2 - with: - name: Tk ${{ env.VERSION }} Source distribution (snapshot) - path: | - /tmp/dist/tk* - !/tmp/dist/tk*/html/** - - name: Upload Documentation Distribution - if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} - uses: actions/upload-artifact@v2 - with: - name: Tk ${{ env.VERSION }} HTML documentation (snapshot) - path: /tmp/dist/tk*/html test: runs-on: ubuntu-20.04 strategy: -- cgit v0.12 From 0aac7b40202f295da02ee3a63a0d8637b1aef34c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 8 Nov 2022 13:24:42 +0000 Subject: Tk_ConfigureWidget() signature compatibility with 8.7. More version fixes --- generic/tk.h | 18 ++++++++---------- generic/tkDecls.h | 10 ++++++++++ library/demos/widget | 2 +- unix/Makefile.in | 2 +- unix/configure | 10 +++------- unix/configure.ac | 4 ---- unix/tcl.m4 | 6 +++--- win/configure | 11 +++-------- win/configure.ac | 11 +++-------- win/tcl.m4 | 8 ++++---- 10 files changed, 36 insertions(+), 46 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index 167ed56..5af8d6a 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -68,12 +68,14 @@ extern "C" { #ifndef TK_MAJOR_VERSION # define TK_MAJOR_VERSION 9 #endif -#define TK_MINOR_VERSION 1 -#define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TK_RELEASE_SERIAL 0 - -#define TK_VERSION "9.1" -#define TK_PATCH_LEVEL "9.1a0" +#if TK_MAJOR_VERSION == 9 +# define TK_MINOR_VERSION 1 +# define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE +# define TK_RELEASE_SERIAL 0 + +# define TK_VERSION "9.1" +# define TK_PATCH_LEVEL "9.1a0" +#endif /* TK_MAJOR_VERSION */ /* * A special definition used to allow this header file to be included from @@ -143,10 +145,6 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; */ typedef const char *Tk_Uid; - -#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 6) -# define Tcl_Size int -#endif /* *---------------------------------------------------------------------- diff --git a/generic/tkDecls.h b/generic/tkDecls.h index f3c6fb2..21d1a54 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -1862,6 +1862,16 @@ extern const TkStubs *tkStubsPtr; #undef Tk_CreateOldPhotoImageFormat #endif /* TK_NO_DEPRECATED */ +#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/library/demos/widget b/library/demos/widget index 055dd60..35173da 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"} # separate ".tcl" files is this directory, which are sourced by this script as # needed. -package require Tk 8.5 +package require Tk 8.6- package require msgcat eval destroy [winfo child .] diff --git a/unix/Makefile.in b/unix/Makefile.in index c0fac18..8fd4af5 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -112,7 +112,7 @@ TCL_PLATFORM_DIR = $(TCLDIR)/unix # for this version of Tk: TCL_BIN_DIR = @TCL_BIN_DIR@ -# The linker flags needed to link in the Tcl library (ex: -ltcl9.0) +# The linker flags needed to link in the Tcl library (ex: -ltcl9.1) TCL_LIB_FLAG = @TCL_LIB_FLAG@ # Flag, 1: we're building a shared lib, 0 we're not diff --git a/unix/configure b/unix/configure index c96139d..eddb5d5 100755 --- a/unix/configure +++ b/unix/configure @@ -2678,11 +2678,11 @@ printf "%s\n" "$as_me: WARNING: --with-tcl argument should refer to directory co `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/lib/tcl9.1 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl9.1 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl9.1 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" @@ -2780,10 +2780,6 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ -Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 -fi if test "${TCL_MINOR_VERSION}" -lt 7 ; then as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 diff --git a/unix/configure.ac b/unix/configure.ac index d7439bc..7f433f5 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -38,10 +38,6 @@ SC_PATH_TCLCONFIG SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ -Found config for Tcl ${TCL_VERSION}]) -fi if test "${TCL_MINOR_VERSION}" -lt 7 ; then AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}]) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index b3ebda0..72ae94d 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -93,11 +93,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/lib/tcl9.1 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl9.1 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl9.1 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" diff --git a/win/configure b/win/configure index 5411b1f..5f81c3f 100755 --- a/win/configure +++ b/win/configure @@ -4038,15 +4038,10 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then +if test "${TCL_MINOR_VERSION}" -lt 7; then as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 -fi -if test "${TCL_MINOR_VERSION}" -lt 6; then - as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better." "$LINENO" 5 fi fi diff --git a/win/configure.ac b/win/configure.ac index e1db677..17c5c0a 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -77,15 +77,10 @@ SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then +if test "${TCL_MINOR_VERSION}" -lt 7; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) -fi -if test "${TCL_MINOR_VERSION}" -lt 6; then - AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better.]) fi fi diff --git a/win/tcl.m4 b/win/tcl.m4 index fa9d4a9..9241ade 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -1009,13 +1009,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl9.0$1/win; then - TCL_BIN_DEFAULT=../../tcl9.0$1/win + if test -d ../../tcl9.1$1/win; then + TCL_BIN_DEFAULT=../../tcl9.1$1/win else - TCL_BIN_DEFAULT=../../tcl9.0/win + TCL_BIN_DEFAULT=../../tcl9.1/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.0 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.1 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) -- cgit v0.12 From 0ac0d239102133abed26f5d57d690f0aaa6bd199 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 8 Nov 2022 17:26:17 +0000 Subject: No need for 'VERSION' here any more --- .github/workflows/linux-with-tcl8-build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/linux-with-tcl8-build.yml b/.github/workflows/linux-with-tcl8-build.yml index 272db22..10e5c59 100644 --- a/.github/workflows/linux-with-tcl8-build.yml +++ b/.github/workflows/linux-with-tcl8-build.yml @@ -98,11 +98,6 @@ jobs: echo "::error::Failure during Distribute" exit 1 } - - name: Discover Version ID - if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} - run: | - cd /tmp/dist - echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV test: runs-on: ubuntu-20.04 strategy: -- cgit v0.12 From 50fd4ebd7f402307fdbcf7f1b431d502564c5dcb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 2 Dec 2022 18:07:07 +0000 Subject: Fix linux-with-tcl9-build.yml name --- .github/workflows/linux-with-tcl9-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml index 74b8b4a..b8ec212 100644 --- a/.github/workflows/linux-with-tcl9-build.yml +++ b/.github/workflows/linux-with-tcl9-build.yml @@ -1,4 +1,4 @@ -name: Linux (with Tcl 8.7) +name: Linux (with Tcl 9.0) on: [push] permissions: contents: read -- cgit v0.12 From 8933faa013ff59b405eb5b4b2b62f44edb4115d6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 2 Dec 2022 18:19:14 +0000 Subject: Build with Tcl 9.1 (with TIP #626) on more platforms --- .github/workflows/mac-build.yml | 8 ++++---- .github/workflows/onefiledist.yml | 12 ++++++------ .github/workflows/win-build.yml | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index ed8ba16..833411a 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -16,11 +16,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Check out Tcl + - name: Check out Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Prepare checked out repositories run: | @@ -67,11 +67,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Check out Tcl + - name: Check out Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Prepare checked out repositories env: diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 5edb14c..237c54d 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -17,11 +17,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Setup Environment run: | @@ -81,11 +81,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Checkout create-dmg uses: actions/checkout@v3 @@ -169,11 +169,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Setup Environment run: | diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 2cf86f7..57fd607 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -22,11 +22,11 @@ jobs: uses: actions/checkout@v3 with: path: tk - - name: Checkout Tcl + - name: Checkout Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Init MSVC uses: ilammy/msvc-dev-cmd@v1 @@ -110,11 +110,11 @@ jobs: install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v3 - - name: Checkout Tcl + - name: Checkout Tcl 9.1 uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Prepare run: | -- cgit v0.12 From 13bad419574a433553f9a8a6d6ec49bbeaf552f7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 11 Dec 2022 22:09:35 +0000 Subject: Build with Tcl 8.7 too --- .github/workflows/linux-with-tcl8-build.yml | 170 ++++++++++++++++++++++++++++ generic/tk.h | 2 +- 2 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linux-with-tcl8-build.yml diff --git a/.github/workflows/linux-with-tcl8-build.yml b/.github/workflows/linux-with-tcl8-build.yml new file mode 100644 index 0000000..6b04cbb --- /dev/null +++ b/.github/workflows/linux-with-tcl8-build.yml @@ -0,0 +1,170 @@ +name: Linux (with Tcl 8.7) +on: [push] +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-shared" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v3 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v3 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + 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 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } diff --git a/generic/tk.h b/generic/tk.h index 6cd0943..834848f 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1371,7 +1371,7 @@ typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, #endif /* USE_OLD_IMAGE */ /* - * The following alternate definitions are used with the Tk9.1 file format + * The following alternate definitions are used with the Tk8.7 file format * supporting a metadata dict, internal dstring and close file flag */ -- cgit v0.12 From 772f4eae7bc74750f8338fd75d2a29c4f08e14b1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 12 Dec 2022 15:49:42 +0000 Subject: Fix building of Linux binary --- .github/workflows/onefiledist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index fa18770..8617dba 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -51,7 +51,7 @@ jobs: # TODO: need the Tk version separately for distro naming below - name: Package run: | - cp bin/wish8.7 ${BUILD_NAME} + cp bin/wish9.1 ${BUILD_NAME} chmod +x ${BUILD_NAME} tar -cf ${BUILD_NAME}.tar ${BUILD_NAME} working-directory: ${{ env.INST_DIR }} -- cgit v0.12 From d8b3482a413fb0110797b436efc6ff836ef380da Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 7 Sep 2023 13:25:10 +0000 Subject: Add a new command to ttk::treeview to work with detached items --- generic/ttk/ttkTreeview.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 11de5e0..841855e 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -3245,6 +3245,50 @@ static int TreeviewDetachCommand( return TCL_OK; } +/* Is an item detached? The root is never detached. */ +static int IsDetached(Treeview *tv, TreeItem *item) +{ + return item->next == NULL && item->prev == NULL && + item->parent == NULL && item != tv->tree.root; +} + +/* + $tv detached ?$item? -- + * List detached items (in arbitrary order) or query the detached state of + * $item. + */ +static int TreeviewDetachedCommand( + void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) +{ + Treeview *tv = (Treeview *)recordPtr; + TreeItem *item; + + if (objc == 2) { + /* List detached items */ + Tcl_HashSearch search; + Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(tv->tree.items, &search); + Tcl_Obj *objPtr = Tcl_NewObj(); + + while (entryPtr != NULL) { + item = Tcl_GetHashValue(entryPtr); + entryPtr = Tcl_NextHashEntry(&search); + if (IsDetached(tv, item)) { + Tcl_ListObjAppendElement(NULL, objPtr, ItemID(tv, item)); + } + } + TclSetObjResult(interp, objPtr); + return TCL_OK; + } else if (objc == 3) { + /* Query; the root is never reported as detached */ + if (!(item = FindItem(interp, tv, objv[2]))) { + return TCL_ERROR; + } + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(IsDetached(tv, item))); + return TCL_OK; + } else { + Tcl_WrongNumArgs(interp, 2, objv, "?item?"); + return TCL_ERROR; + } +} /* + $tv delete $items -- * Delete each item in $items. * @@ -4353,6 +4397,7 @@ static const Ttk_Ensemble TreeviewCommands[] = { { "configure", TtkWidgetConfigureCommand,0 }, { "delete", TreeviewDeleteCommand,0 }, { "detach", TreeviewDetachCommand,0 }, + { "detached", TreeviewDetachedCommand,0 }, { "drag", TreeviewDragCommand,0 }, { "drop", TreeviewDropCommand,0 }, { "exists", TreeviewExistsCommand,0 }, -- cgit v0.12 From 61424d8266696b46db3d0a1685b6c13519b84bf3 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 7 Sep 2023 13:39:45 +0000 Subject: Add doc and tests --- doc/ttk_treeview.n | 7 +++++++ tests/ttk/treeview.test | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 757be86..c819093 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -233,6 +233,13 @@ but will not be displayed until that is done. The root item may not be detached. See also: \fBdelete\fR. .TP +\fIpathname \fBdetached \fR?\fIitem\fR? +. +If \fIitem\fR is provided, returns a boolean value indicating whether it is +the name of a detached item (see \fBdetach\fR). Otherwise, returns a list of +all the detached items (in an arbitrary order). The root item is never +detached. +.TP \fIpathname \fBexists \fIitem\fR Returns 1 if the specified \fIitem\fR is present in the tree, 0 otherwise. diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index 5f2cc84..b424dfb 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -191,10 +191,11 @@ test treeview-3.5 "index - exhaustive test" -body { } -result [list 0 1 2 3 4 5 6] test treeview-3.6 "detach" -body { + set before [.tv detached newnode] .tv detach newnode consistencyCheck .tv - .tv children {} -} -result [list newfirstone firstnode anotherone onemore lastnode newlastone] + list [.tv children {}] [.tv detached] $before [.tv detached newnode] +} -result {{newfirstone firstnode anotherone onemore lastnode newlastone} newnode 0 1} # XREF: treeview-2.13 test treeview-3.7 "detach didn't screw up internal links" -body { @@ -229,17 +230,19 @@ test treeview-3.11 "Can't detach root item" -body { } -returnCodes error -result "Cannot detach root item" test treeview-3.12 "Reattach" -body { + set before [.tv detached newnode] .tv move newnode {} end consistencyCheck .tv - .tv children {} -} -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode] + list [.tv children {}] $before [.tv detached newnode] [.tv detached] +} -result {{newfirstone firstnode anotherone onemore lastnode newlastone newnode} 1 0 {}} # Bug # ????? test treeview-3.13 "Re-reattach" -body { + set before [.tv detached newnode] .tv move newnode {} end consistencyCheck .tv - .tv children {} -} -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode] + list [.tv children {}] $before [.tv detached newnode] +} -result {{newfirstone firstnode anotherone onemore lastnode newlastone newnode} 0 0} catch { .tv insert newfirstone end -id x1 -- cgit v0.12 From 048db2dfe0fb2c570130d6224a1364652c88fa86 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 8 Nov 2023 12:08:32 +0000 Subject: Handle branches in CI builds --- .github/workflows/linux-build.yml | 1 + .github/workflows/linux-with-tcl9-build.yml | 1 + .github/workflows/mac-build.yml | 9 +++++---- .github/workflows/onefiledist.yml | 7 ++++--- .github/workflows/win-build.yml | 1 + 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 595c6e8..891aebe 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml index 0fda00c..7e2d6a8 100644 --- a/.github/workflows/linux-with-tcl9-build.yml +++ b/.github/workflows/linux-with-tcl9-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index c8d6df1..0dc2bc7 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" @@ -22,11 +23,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Check out Tcl 8.7 + - name: Check out Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: tip-626 + ref: main path: tcl - name: Prepare checked out repositories run: | @@ -74,11 +75,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Check out Tcl 8.7 + - name: Check out Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: tip-626 + ref: main path: tcl - name: Prepare checked out repositories env: diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 79f9e2f..6a1b3e9 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" @@ -27,7 +28,7 @@ jobs: uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: tip-626 + ref: main path: tcl - name: Setup Environment run: | @@ -91,7 +92,7 @@ jobs: uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: tip-626 + ref: main path: tcl - name: Checkout create-dmg uses: actions/checkout@v4 @@ -179,7 +180,7 @@ jobs: uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: tip-626 + ref: main path: tcl - name: Setup Environment run: | diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 5a12c0f..851774f 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" -- cgit v0.12 From b68dac494c3cbaae6426ecc3bf9d94404fd3a43b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 8 Nov 2023 15:49:46 +0000 Subject: update github actions --- .github/workflows/linux-build.yml | 4 ++-- .github/workflows/linux-with-tcl9-build.yml | 4 ++-- .github/workflows/onefiledist.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 891aebe..7a39e2f 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -43,7 +43,7 @@ jobs: path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | - sudo apt-get install libxss-dev + sudo apt-get install libxss-dev libxft-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV @@ -147,7 +147,7 @@ jobs: path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | - sudo apt-get install libxss-dev xvfb libicu-dev + sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml index 0e55a87..4672b54 100644 --- a/.github/workflows/linux-with-tcl9-build.yml +++ b/.github/workflows/linux-with-tcl9-build.yml @@ -43,7 +43,7 @@ jobs: path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | - sudo apt-get install libxss-dev + sudo apt-get install libxss-dev libxft-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV @@ -128,7 +128,7 @@ jobs: path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | - sudo apt-get install libxss-dev xvfb libicu-dev + sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 6a1b3e9..37f4895 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -32,7 +32,7 @@ jobs: path: tcl - name: Setup Environment run: | - sudo apt-get install libxss-dev + sudo apt-get install libxss-dev libxft-dev touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c touch tk/generic/tkStubInit.c echo "INST_DIR=$(cd install;pwd)" >> $GITHUB_ENV -- cgit v0.12 From 46f37f765a6fb9c6ceb94797b9cd4081174d2627 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 11 Nov 2023 09:21:50 +0000 Subject: Unbreak the build. --- generic/ttk/ttkTreeview.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 841855e..1197932 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -3265,7 +3265,7 @@ static int TreeviewDetachedCommand( if (objc == 2) { /* List detached items */ Tcl_HashSearch search; - Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(tv->tree.items, &search); + Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(&tv->tree.items, &search); Tcl_Obj *objPtr = Tcl_NewObj(); while (entryPtr != NULL) { @@ -3275,7 +3275,7 @@ static int TreeviewDetachedCommand( Tcl_ListObjAppendElement(NULL, objPtr, ItemID(tv, item)); } } - TclSetObjResult(interp, objPtr); + Tcl_SetObjResult(interp, objPtr); return TCL_OK; } else if (objc == 3) { /* Query; the root is never reported as detached */ -- cgit v0.12 From f43f72e2784d0139fb1610485983dac14bbf99e5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 12 Nov 2023 18:56:14 +0000 Subject: Prepare "trunk" for Tk 9.0 development --- .github/workflows/linux-build.yml | 5 +- .github/workflows/linux-with-tcl86-build.yml | 177 -------------------------- .github/workflows/linux-with-tcl87-build.yml | 178 +++++++++++++++++++++++++++ .github/workflows/linux-with-tcl9-build.yml | 177 -------------------------- .github/workflows/linux-with-tcl91-build.yml | 1 + .github/workflows/mac-build.yml | 9 +- .github/workflows/onefiledist.yml | 15 +-- .github/workflows/win-build.yml | 9 +- .travis.yml | 1 - README.md | 8 +- generic/tk.h | 31 ++--- library/tk.tcl | 2 +- unix/Makefile.in | 2 +- unix/configure | 49 +++----- unix/configure.ac | 27 ++-- unix/tcl.m4 | 12 +- unix/tk.spec | 6 +- win/README | 2 +- win/configure | 43 +++---- win/configure.ac | 27 ++-- win/tcl.m4 | 8 +- 21 files changed, 284 insertions(+), 505 deletions(-) delete mode 100644 .github/workflows/linux-with-tcl86-build.yml create mode 100644 .github/workflows/linux-with-tcl87-build.yml delete mode 100644 .github/workflows/linux-with-tcl9-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 15273de..7a39e2f 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" @@ -38,7 +39,7 @@ jobs: uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | @@ -142,7 +143,7 @@ jobs: uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | diff --git a/.github/workflows/linux-with-tcl86-build.yml b/.github/workflows/linux-with-tcl86-build.yml deleted file mode 100644 index 769da62..0000000 --- a/.github/workflows/linux-with-tcl86-build.yml +++ /dev/null @@ -1,177 +0,0 @@ -name: Linux (with Tcl 8.6) -on: - push: - branches: - - "main" - - "core-8-6-branch" - tags: - - "core-**" -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: core-8-6-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH --disable-zipfs "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - test: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--disable-xft" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: core-8-6-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - 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 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - timeout-minutes: 15 diff --git a/.github/workflows/linux-with-tcl87-build.yml b/.github/workflows/linux-with-tcl87-build.yml new file mode 100644 index 0000000..557b0e9 --- /dev/null +++ b/.github/workflows/linux-with-tcl87-build.yml @@ -0,0 +1,178 @@ +name: Linux (with Tcl 8.7) +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-shared" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + 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 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + timeout-minutes: 15 diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml deleted file mode 100644 index 6a4dd4e..0000000 --- a/.github/workflows/linux-with-tcl9-build.yml +++ /dev/null @@ -1,177 +0,0 @@ -name: Linux (with Tcl 9.0) -on: - push: - branches: - - "main" - - "core-8-6-branch" - tags: - - "core-**" -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: main - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - test: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--disable-xft" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: main - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - 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 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - timeout-minutes: 15 diff --git a/.github/workflows/linux-with-tcl91-build.yml b/.github/workflows/linux-with-tcl91-build.yml index b40e6eb..4672b54 100644 --- a/.github/workflows/linux-with-tcl91-build.yml +++ b/.github/workflows/linux-with-tcl91-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 43f08d6..0dc2bc7 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" @@ -22,11 +23,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Check out Tcl 8.7 + - name: Check out Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Prepare checked out repositories run: | @@ -74,11 +75,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Check out Tcl 8.7 + - name: Check out Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Prepare checked out repositories env: diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 92bc0ff..37f4895 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" @@ -23,11 +24,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Setup Environment run: | @@ -57,7 +58,7 @@ jobs: # TODO: need the Tk version separately for distro naming below - name: Package run: | - cp bin/wish8.7 ${BUILD_NAME} + cp bin/wish9.0 ${BUILD_NAME} chmod +x ${BUILD_NAME} tar -cf ${BUILD_NAME}.tar ${BUILD_NAME} working-directory: ${{ env.INST_DIR }} @@ -87,11 +88,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Checkout create-dmg uses: actions/checkout@v4 @@ -175,11 +176,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Setup Environment run: | diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index b7b2ae8..851774f 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "core-8-branch" - "core-8-6-branch" tags: - "core-**" @@ -28,11 +29,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Init MSVC uses: ilammy/msvc-dev-cmd@v1 @@ -117,11 +118,11 @@ jobs: install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 - - name: Checkout Tcl 8.7 + - name: Checkout Tcl 9.0 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-branch + ref: main path: tcl - name: Prepare run: | diff --git a/.travis.yml b/.travis.yml index 7268340..1767ecb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ addons: - libnotify-dev - libglib2.0-dev - libxss-dev - - libxft-dev - xvfb homebrew: packages: diff --git a/README.md b/README.md index f9fceb6..eb88ba9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README: Tk -This is the **Tk 8.7a6** source distribution. +This is the **Tk 9.0b1** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). @@ -11,6 +11,10 @@ site](https://sourceforge.net/projects/tcl/files/Tcl/). [![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-6-branch)
8.7 (in development, daily build)) +[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-branch) +[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-branch) +[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-branch) +9.0 (in development, daily build)) [![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Amain) [![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Amain) [![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Amain) @@ -21,7 +25,7 @@ This directory contains the sources and documentation for Tk, a cross-platform GUI toolkit implemented with the Tcl scripting language. For details on features, incompatibilities, and potential problems with -this release, see [the Tcl/Tk 8.7 Web page](https://www.tcl-lang.org/software/tcltk/8.7.html) +this release, see [the Tcl/Tk 9.0 Web page](https://www.tcl-lang.org/software/tcltk/9.0.html) or refer to the "changes" file in this directory, which contains a historical record of all changes to Tk. diff --git a/generic/tk.h b/generic/tk.h index 481714a..241eca5 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -17,8 +17,8 @@ #define _TK #include -#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) -# error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better +#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) +# error Tk 9.0 must be compiled with tcl.h from Tcl 8.7 or better #endif #ifndef EXTERN @@ -66,17 +66,16 @@ extern "C" { */ #ifndef TK_MAJOR_VERSION -# define TK_MAJOR_VERSION 8 +# define TK_MAJOR_VERSION 9 #endif -#if TK_MAJOR_VERSION != 8 -# error "This header-file is for Tk 8 only" -#endif -#define TK_MINOR_VERSION 7 -#define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TK_RELEASE_SERIAL 6 - -#define TK_VERSION "8.7" -#define TK_PATCH_LEVEL "8.7a6" +#if TK_MAJOR_VERSION == 9 +# define TK_MINOR_VERSION 0 +# define TK_RELEASE_LEVEL TCL_BETA_RELEASE +# define TK_RELEASE_SERIAL 0 + +# define TK_VERSION "9.0" +# define TK_PATCH_LEVEL "9.0b1" +#endif /* TK_MAJOR_VERSION */ /* * A special definition used to allow this header file to be included from @@ -146,14 +145,6 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; */ typedef const char *Tk_Uid; - -#if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7) -# ifndef Tcl_Size -# define Tcl_Size int -# endif -# define TCL_SIZE_MAX INT_MAX -# define TCL_SIZE_MODIFIER "" -#endif /* *---------------------------------------------------------------------- diff --git a/library/tk.tcl b/library/tk.tcl index a6dc37c..1fc0ab9 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -11,7 +11,7 @@ # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release -package require -exact tk 8.7a6 +package require -exact tk 9.0b1 # Create a ::tk namespace namespace eval ::tk { diff --git a/unix/Makefile.in b/unix/Makefile.in index 9fce557..82c9480 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -112,7 +112,7 @@ TCL_PLATFORM_DIR = $(TCLDIR)/unix # for this version of Tk: TCL_BIN_DIR = @TCL_BIN_DIR@ -# The linker flags needed to link in the Tcl library (ex: -ltcl8.7) +# The linker flags needed to link in the Tcl library (ex: -ltcl9.0) TCL_LIB_FLAG = @TCL_LIB_FLAG@ # Flag, 1: we're building a shared lib, 0 we're not diff --git a/unix/configure b/unix/configure index 065c0bf..146c35f 100755 --- a/unix/configure +++ b/unix/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tk 8.7. +# Generated by GNU Autoconf 2.71 for tk 9.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='8.7' -PACKAGE_STRING='tk 8.7' +PACKAGE_VERSION='9.0' +PACKAGE_STRING='tk 9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1382,7 +1382,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tk 8.7 to adapt to many kinds of systems. +\`configure' configures tk 9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1448,7 +1448,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 8.7:";; + short | recursive ) echo "Configuration of tk 9.0:";; esac cat <<\_ACEOF @@ -1564,7 +1564,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 8.7 +tk configure 9.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1920,7 +1920,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tk $as_me 8.7, which was +It was created by tk $as_me 9.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2582,10 +2582,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.0 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=0 +TK_PATCH_LEVEL="b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -2678,11 +2678,11 @@ printf "%s\n" "$as_me: WARNING: --with-tcl argument should refer to directory co `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl8.7 2>/dev/null` \ + `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" @@ -2780,12 +2780,8 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 -fi -if test "${TCL_MINOR_VERSION}" -lt 6 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +if test "${TCL_MINOR_VERSION}" -lt 7 ; then + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi fi @@ -8919,17 +8915,8 @@ fi #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} -if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" -else - eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" -if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" -else - TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" -fi -fi eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" @@ -9551,7 +9538,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tk $as_me 8.7, which was +This file was extended by tk $as_me 9.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9610,7 +9597,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tk config.status 8.7 +tk config.status 9.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/unix/configure.ac b/unix/configure.ac index 38eda9d..6c0433a 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. -AC_INIT([tk],[8.7]) +AC_INIT([tk],[9.0]) AC_PREREQ([2.69]) dnl This is only used when included from macosx/configure.ac @@ -23,10 +23,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ #endif /* _TKCONFIG */]) ]) -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.0 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=0 +TK_PATCH_LEVEL="b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -38,12 +38,8 @@ SC_PATH_TCLCONFIG SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}]) -fi -if test "${TCL_MINOR_VERSION}" -lt 6 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +if test "${TCL_MINOR_VERSION}" -lt 7 ; then + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ Found config for Tcl ${TCL_VERSION}]) fi fi @@ -714,17 +710,8 @@ AC_SUBST(INSTALL_MSGS) #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} -if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" -else - eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" -if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" -else - TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" -fi -fi eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" diff --git a/unix/tcl.m4 b/unix/tcl.m4 index a46478c..9e1040c 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -93,11 +93,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl8.7 2>/dev/null` \ + `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" @@ -226,11 +226,11 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tk8.7 2>/dev/null` \ + `ls -d /usr/lib/tk9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tk8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tk9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" diff --git a/unix/tk.spec b/unix/tk.spec index 6a6924c..208877f 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -4,15 +4,15 @@ Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.7a6 +Version: 9.0b1 Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: https://www.tcl-lang.org/ Buildroot: /var/tmp/%{name}%{version} -Buildrequires: XFree86-devel tcl >= 8.6.0 -Requires: tcl >= 8.6.0 +Buildrequires: XFree86-devel tcl >= 8.7.0 +Requires: tcl >= 8.7.0 %description The Tcl (Tool Command Language) provides a powerful platform for diff --git a/win/README b/win/README index e371a2c..b8ac0cc 100644 --- a/win/README +++ b/win/README @@ -1,4 +1,4 @@ -Tk 8.7 for Windows +Tk 9.0 for Windows Originally by Scott Stanton while at Sun Microsystems Labs diff --git a/win/configure b/win/configure index ba80bbb..3798e14 100755 --- a/win/configure +++ b/win/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tk 8.7. +# Generated by GNU Autoconf 2.71 for tk 9.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='8.7' -PACKAGE_STRING='tk 8.7' +PACKAGE_VERSION='9.0' +PACKAGE_STRING='tk 9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1364,7 +1364,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tk 8.7 to adapt to many kinds of systems. +\`configure' configures tk 9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1426,7 +1426,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 8.7:";; + short | recursive ) echo "Configuration of tk 9.0:";; esac cat <<\_ACEOF @@ -1524,7 +1524,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 8.7 +tk configure 9.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1728,7 +1728,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tk $as_me 8.7, which was +It was created by tk $as_me 9.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2393,10 +2393,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.0 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=0 +TK_PATCH_LEVEL="b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -4037,15 +4037,10 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then +if test "${TCL_MINOR_VERSION}" -lt 7; then as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 -fi -if test "${TCL_MINOR_VERSION}" -lt 6; then - as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better." "$LINENO" 5 fi fi @@ -5797,11 +5792,7 @@ else fi fi -if test "${TCL_MAJOR_VERSION}" -gt 8 ; then - eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ; -else - eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" ; -fi +eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ; # FIXME: All of this var junk needs to be done in tcl.m4 !!!! # I left out the other vars that also need to get defined here. # we also need to double check about spaces in path names @@ -6475,7 +6466,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tk $as_me 8.7, which was +This file was extended by tk $as_me 9.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6530,7 +6521,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tk config.status 8.7 +tk config.status 9.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/win/configure.ac b/win/configure.ac index 08e0af7..3c29be1 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. -AC_INIT([tk],[8.7]) +AC_INIT([tk],[9.0]) AC_CONFIG_SRCDIR([../generic/tk.h]) AC_PREREQ([2.69]) @@ -12,10 +12,10 @@ AC_PREREQ([2.69]) # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a6" +TK_VERSION=9.0 +TK_MAJOR_VERSION=9 +TK_MINOR_VERSION=0 +TK_PATCH_LEVEL="b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -77,15 +77,10 @@ SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then +if test "${TCL_MINOR_VERSION}" -lt 7; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) -fi -if test "${TCL_MINOR_VERSION}" -lt 6; then - AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better.]) fi fi @@ -247,11 +242,7 @@ else fi fi -if test "${TCL_MAJOR_VERSION}" -gt 8 ; then - eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ; -else - eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" ; -fi +eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ; # FIXME: All of this var junk needs to be done in tcl.m4 !!!! # I left out the other vars that also need to get defined here. # we also need to double check about spaces in path names diff --git a/win/tcl.m4 b/win/tcl.m4 index fff706b..4bac910 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -985,13 +985,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl8.7$1/win; then - TCL_BIN_DEFAULT=../../tcl8.7$1/win + if test -d ../../tcl9.0$1/win; then + TCL_BIN_DEFAULT=../../tcl9.0$1/win else - TCL_BIN_DEFAULT=../../tcl8.7/win + TCL_BIN_DEFAULT=../../tcl9.0/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.7 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.0 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) -- cgit v0.12 From c1b1d0c3da843d8afd85d7b168d400057912080b Mon Sep 17 00:00:00 2001 From: csaba Date: Mon, 13 Nov 2023 17:25:43 +0000 Subject: Using the application's TkMainInfo struct for sharing the nbTabsStickBit in a thread-safe manner. Thanks Christian W.! --- generic/tkInt.h | 3 ++- generic/ttk/ttkClamTheme.c | 16 +++++++++++++--- generic/ttk/ttkElements.c | 15 +++++++++++++-- generic/ttk/ttkNotebook.c | 21 +++++++++++---------- win/ttkWinTheme.c | 15 +++++++++++++-- win/ttkWinXPTheme.c | 15 +++++++++++++-- 6 files changed, 65 insertions(+), 20 deletions(-) diff --git a/generic/tkInt.h b/generic/tkInt.h index ec6d243..464ef74 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -723,7 +723,8 @@ typedef struct TkMainInfo { * Tcl's version of [update] after Tk is shut * down, in case it's a Tcl_ObjCmdProc2 */ #endif - + unsigned int ttkNbTabsStickBit; + /* Information used by ttk::notebook. */ } TkMainInfo; /* diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index c618278..e17ee82 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -956,12 +956,12 @@ static const Ttk_ElementOptionSpec NotebookElementOptions[] = { { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; -extern Ttk_PositionSpec nbTabsStickBit; /* see ttkNotebook.c */ - static void TabElementSize( void *dummy, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; int borderWidth = 2; (void)dummy; (void)elementRecord; @@ -969,6 +969,10 @@ static void TabElementSize( (void)widthPtr; (void)heightPtr; + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + *paddingPtr = Ttk_UniformPadding((short)borderWidth); switch (nbTabsStickBit) { default: @@ -991,15 +995,21 @@ static void TabElementDraw( void *dummy, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; + int borderWidth = 2, delta = 0; NotebookElement *tab = (NotebookElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj); Display *display = Tk_Display(tkwin); - int borderWidth = 2, delta = 0; int x1, y1, x2, y2; GC gc; const int w = WIN32_XDRAWLINE_HACK; (void)dummy; + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + if (state & TTK_STATE_SELECTED) { delta = borderWidth; } diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 5e8351e..16296b2 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1601,20 +1601,25 @@ static const Ttk_ElementOptionSpec TabElementOptions[] = { {0,TK_OPTION_BOOLEAN,0,0} }; -extern Ttk_PositionSpec nbTabsStickBit; /* see ttkNotebook.c */ - static void TabElementSize( void *dummy, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { TabElement *tab = (TabElement *)elementRecord; int borderWidth = 1; + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; (void)dummy; (void)widthPtr; (void)heightPtr; Tk_GetPixelsFromObj(0, tkwin, tab->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); + + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + switch (nbTabsStickBit) { default: case TTK_STICK_S: @@ -1636,6 +1641,8 @@ static void TabElementDraw( void *dummy, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; TabElement *tab = (TabElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj); int highlight = 0; @@ -1647,6 +1654,10 @@ static void TabElementDraw( int borderWidth = 1; (void)dummy; + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + if (state & TTK_STATE_SELECTED) { /* * Draw slightly outside of the allocated parcel, diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 7bb3683..17ccd3a 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -135,14 +135,11 @@ typedef struct Ttk_Padding padding; /* External padding */ } NotebookStyle; -/* Global variable to be set from within NotebookStyleOptions() to one - * of the values TTK_STICK_S, TTK_STICK_N, TTK_STICK_E, or TTK_STICK_W: - */ -Ttk_PositionSpec nbTabsStickBit; - -static void NotebookStyleOptions(Notebook *nb, NotebookStyle *nbstyle) +static void NotebookStyleOptions( + Notebook *nb, NotebookStyle *nbstyle, Tk_Window tkwin) { Tcl_Obj *objPtr; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; nbstyle->tabPosition = TTK_PACK_TOP | TTK_STICK_W; if ((objPtr = Ttk_QueryOption(nb->core.layout, "-tabposition", 0)) != 0) { @@ -164,9 +161,12 @@ static void NotebookStyleOptions(Notebook *nb, NotebookStyle *nbstyle) TtkGetLabelAnchorFromObj(NULL, objPtr, &nbstyle->tabPlacement); } - /* Save the stick bit in the global variable nbTabsStickBit + /* Save the stick bit for later. One of the values + * TTK_STICK_S, TTK_STICK_N, TTK_STICK_E, or TTK_STICK_W: */ - nbTabsStickBit = (nbstyle->tabPlacement & 0x0f); + if (mainInfoPtr != NULL) { + mainInfoPtr->ttkNbTabsStickBit = (nbstyle->tabPlacement & 0x0f); + } /* Compute tabOrient as function of tabPlacement: */ @@ -395,6 +395,7 @@ static void TabrowSize( static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) { Notebook *nb = (Notebook *)clientData; + Tk_Window nbwin = nb->core.tkwin; NotebookStyle nbstyle; Ttk_Padding padding; Ttk_Element clientNode = Ttk_FindElement(nb->core.layout, "client"); @@ -403,7 +404,7 @@ static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) tabrowWidth = 0, tabrowHeight = 0; Tcl_Size i; - NotebookStyleOptions(nb, &nbstyle); + NotebookStyleOptions(nb, &nbstyle, nbwin); /* Compute max requested size of all content windows: */ @@ -553,7 +554,7 @@ static void NotebookDoLayout(void *recordPtr) NotebookStyle nbstyle; Tcl_Size currentIndex = nb->notebook.currentIndex; - NotebookStyleOptions(nb, &nbstyle); + NotebookStyleOptions(nb, &nbstyle, nbwin); /* Notebook internal padding: */ diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index f914cf7..7ce9024 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -738,8 +738,6 @@ static const Ttk_ElementOptionSpec TabElementOptions[] = { {0,TK_OPTION_BOOLEAN,0,0} }; -extern Ttk_PositionSpec nbTabsStickBit; /* see ttkNotebook.c */ - static void TabElementSize( TCL_UNUSED(void *), void *elementRecord, @@ -750,9 +748,16 @@ static void TabElementSize( { TabElement *tab = (TabElement *)elementRecord; int borderWidth = 1; + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; Tk_GetPixelsFromObj(0, tkwin, tab->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); + + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + switch (nbTabsStickBit) { default: case TTK_STICK_S: @@ -778,6 +783,8 @@ static void TabElementDraw( Ttk_Box b, unsigned int state) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; TabElement *tab = (TabElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj); XPoint pts[6]; @@ -786,6 +793,10 @@ static void TabElementDraw( Display *disp = Tk_Display(tkwin); int borderWidth = 1; + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + if (state & TTK_STATE_SELECTED) { /* * Draw slightly outside of the allocated parcel, diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 358726b..d64a359 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -726,8 +726,6 @@ static const Ttk_ElementSpec PbarElementSpec = * we can use the same statemap no matter what the partId. */ -extern Ttk_PositionSpec nbTabsStickBit; /* see ttkNotebook.c */ - static void TabElementSize( void *clientData, void *elementRecord, @@ -736,6 +734,13 @@ static void TabElementSize( int *heightPtr, Ttk_Padding *paddingPtr) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; + + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + GenericElementSize(clientData, elementRecord, tkwin, widthPtr, heightPtr, paddingPtr); @@ -765,11 +770,17 @@ static void TabElementDraw( Ttk_Box b, unsigned int state) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; ElementData *elementData = (ElementData *)clientData; int partId = elementData->info->partId; int isSelected = (state & TTK_STATE_SELECTED); int stateId = Ttk_StateTableLookup(elementData->info->statemap, state); + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + /* * Correct the members of b if needed */ -- cgit v0.12 From 0b8e693f8fee267c596ede0aa80c2b947925c606 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 15 Nov 2023 20:50:03 +0000 Subject: 2 more ... --- unix/tkUnixFont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 6c45bc4..87863a2 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -2080,7 +2080,7 @@ FontMapLoadPage( int hi, lo; if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src), - TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL, + TCL_ENCODING_PROFILE_STRICT, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } @@ -2354,7 +2354,7 @@ CanUseFallback( numEncodings++; } Tcl_UtfToExternal(NULL, encoding, src, srcLen, - TCL_ENCODING_STOPONERROR, NULL, dst, sizeof(dst), &srcRead, + TCL_ENCODING_PROFILE_STRICT, NULL, dst, sizeof(dst), &srcRead, &dstWrote, NULL); if (dstWrote == 0) { goto crossout; -- cgit v0.12 From b571874acdb6907f92b4bc630a8c5db172a771a8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 08:28:42 +0000 Subject: Give Ttk_GetOrientFromObj the signature it always should have had. --- generic/ttk/ttk.decls | 9 +++++++++ generic/ttk/ttkClamTheme.c | 4 ++-- generic/ttk/ttkClassicTheme.c | 4 ++-- generic/ttk/ttkDecls.h | 26 ++++++++++++++++++++------ generic/ttk/ttkDefaultTheme.c | 4 ++-- generic/ttk/ttkElements.c | 10 +++++----- generic/ttk/ttkInit.c | 2 +- generic/ttk/ttkLabel.c | 8 -------- generic/ttk/ttkNotebook.c | 14 ++++++-------- generic/ttk/ttkProgress.c | 4 ++-- generic/ttk/ttkStubInit.c | 5 +++++ generic/ttk/ttkTheme.h | 3 --- generic/ttk/ttkThemeInt.h | 6 +----- generic/ttk/ttkWidget.c | 2 +- macosx/ttkMacOSXTheme.c | 12 ++++++------ win/ttkWinTheme.c | 4 ++-- 16 files changed, 64 insertions(+), 53 deletions(-) diff --git a/generic/ttk/ttk.decls b/generic/ttk/ttk.decls index e3a788e..7826c99 100644 --- a/generic/ttk/ttk.decls +++ b/generic/ttk/ttk.decls @@ -139,3 +139,12 @@ declare 34 { declare 35 { Tcl_Obj *Ttk_NewBoxObj(Ttk_Box box) } + +# +# Utilities. +# +declare 40 { + int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient) +} + + diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index e17ee82..08d2df9 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -717,7 +717,7 @@ static void ThumbElementDraw( /* * Draw grip: */ - TtkGetOrientFromObj(NULL, sb->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, sb->gripSizeObj, &gripSize); lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d); darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d); @@ -763,7 +763,7 @@ static void SliderElementSize( (void)paddingPtr; length = thickness = SCROLLBAR_THICKNESS; - TtkGetOrientFromObj(NULL, sb->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, sb->sliderlengthObj, &length); if (orient == TTK_ORIENT_VERTICAL) { diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index a9d07ee..e102e7f 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -564,7 +564,7 @@ static void SliderElementSize( (void)dummy; (void)paddingPtr; - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->lengthObj, &length); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); @@ -593,7 +593,7 @@ static void SliderElementDraw( (void)state; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h index 33274aa..9c40904 100644 --- a/generic/ttk/ttkDecls.h +++ b/generic/ttk/ttkDecls.h @@ -13,11 +13,7 @@ extern const char *TtkInitializeStubs( interp, TTK_VERSION, TTK_STUBS_EPOCH, TTK_STUBS_REVISION) #else -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -# define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "Ttk", TTK_VERSION, 0, NULL) -#else -# define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL) -#endif +#define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL) #endif @@ -34,7 +30,7 @@ extern const char *TtkInitializeStubs( /* !BEGIN!: Do not edit below this line. */ #define TTK_STUBS_EPOCH 0 -#define TTK_STUBS_REVISION 30 +#define TTK_STUBS_REVISION 31 #ifdef __cplusplus extern "C" { @@ -138,6 +134,13 @@ TTKAPI Ttk_Box Ttk_PlaceBox(Ttk_Box *cavity, int w, int h, Ttk_Side side, Ttk_Sticky sticky); /* 35 */ TTKAPI Tcl_Obj * Ttk_NewBoxObj(Ttk_Box box); +/* Slot 36 is reserved */ +/* Slot 37 is reserved */ +/* Slot 38 is reserved */ +/* Slot 39 is reserved */ +/* 40 */ +TTKAPI int Ttk_GetOrientFromObj(Tcl_Interp *interp, + Tcl_Obj *objPtr, Ttk_Orient *orient); typedef struct TtkStubs { int magic; @@ -181,6 +184,11 @@ typedef struct TtkStubs { Ttk_Box (*ttk_ExpandBox) (Ttk_Box b, Ttk_Padding p); /* 33 */ Ttk_Box (*ttk_PlaceBox) (Ttk_Box *cavity, int w, int h, Ttk_Side side, Ttk_Sticky sticky); /* 34 */ Tcl_Obj * (*ttk_NewBoxObj) (Ttk_Box box); /* 35 */ + void (*reserved36)(void); + void (*reserved37)(void); + void (*reserved38)(void); + void (*reserved39)(void); + int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient); /* 40 */ } TtkStubs; extern const TtkStubs *ttkStubsPtr; @@ -261,6 +269,12 @@ extern const TtkStubs *ttkStubsPtr; (ttkStubsPtr->ttk_PlaceBox) /* 34 */ #define Ttk_NewBoxObj \ (ttkStubsPtr->ttk_NewBoxObj) /* 35 */ +/* Slot 36 is reserved */ +/* Slot 37 is reserved */ +/* Slot 38 is reserved */ +/* Slot 39 is reserved */ +#define Ttk_GetOrientFromObj \ + (ttkStubsPtr->ttk_GetOrientFromObj) /* 40 */ #endif /* defined(USE_TTK_STUBS) */ diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 431a5af..d15f1c9 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1056,7 +1056,7 @@ static void ThumbElementSize( (void)paddingPtr; Tk_GetPixelsFromObj(NULL, tkwin, thumb->sizeObj, &size); - TtkGetOrientFromObj(NULL, thumb->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient); if (orient == TTK_ORIENT_VERTICAL) { *widthPtr = size; @@ -1147,7 +1147,7 @@ static void SliderElementSize( (void)dummy; (void)paddingPtr; - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 16296b2..cee050f 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -497,7 +497,7 @@ static void GeneralSeparatorElementDraw( SeparatorElement *separator = (SeparatorElement *)elementRecord; Ttk_Orient orient; - TtkGetOrientFromObj(NULL, separator->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, separator->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: HorizontalSeparatorElementDraw( @@ -1199,7 +1199,7 @@ static void TroughElementDraw( Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->grooveWidthObj, &grooveWidth); Tk_GetReliefFromObj(NULL, troughPtr->reliefObj, &relief); - TtkGetOrientFromObj(NULL, troughPtr->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, troughPtr->orientObj, &orient); if (grooveWidth > 0 && grooveWidth < b.height && grooveWidth < b.width) { if (orient == TTK_ORIENT_HORIZONTAL) { @@ -1268,7 +1268,7 @@ static void ThumbElementSize( (void)paddingPtr; Tk_GetPixelsFromObj(NULL, tkwin, thumb->thicknessObj, &thickness); - TtkGetOrientFromObj(NULL, thumb->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient); if (orient == TTK_ORIENT_VERTICAL) { *widthPtr = thickness; @@ -1399,7 +1399,7 @@ static void SliderElementDraw( * Fill the thin trough area preceding the * slider's center with the inner color */ - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: XFillRectangle(disp, d, gc, troughInnerBox.x, troughInnerBox.y, @@ -1535,7 +1535,7 @@ static void PbarElementSize( (void)dummy; (void)paddingPtr; - TtkGetOrientFromObj(NULL, pbar->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, pbar->thicknessObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, pbar->lengthObj, &length); Tk_GetPixelsFromObj(NULL, tkwin, pbar->borderWidthObj, &borderWidth); diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index 7ab55d6..fcc069b 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -55,7 +55,7 @@ const char *const ttkOrientStrings[] = { "horizontal", "vertical", NULL }; -int TtkGetOrientFromObj( +int Ttk_GetOrientFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr) { int orient = (int)TTK_ORIENT_HORIZONTAL; diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index d94cb23..7210c26 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -54,11 +54,7 @@ static const Ttk_ElementOptionSpec TextElementOptions[] = { { "-foreground", TK_OPTION_COLOR, offsetof(TextElement,foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) - offsetof(TextElement,underlineObj), "-1"}, -#else offsetof(TextElement,underlineObj), NULL}, -#endif { "-width", TK_OPTION_INT, offsetof(TextElement,widthObj), "-1"}, { "-anchor", TK_OPTION_ANCHOR, @@ -518,11 +514,7 @@ static const Ttk_ElementOptionSpec LabelElementOptions[] = { { "-foreground", TK_OPTION_COLOR, offsetof(LabelElement,text.foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) offsetof(LabelElement,text.underlineObj), "-1"}, -#else - offsetof(LabelElement,text.underlineObj), NULL}, -#endif { "-width", TK_OPTION_INT, offsetof(LabelElement,text.widthObj), ""}, { "-anchor", TK_OPTION_ANCHOR, diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 17ccd3a..d365c99 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1123,10 +1123,9 @@ static int NotebookIdentifyCommand( } break; case IDENTIFY_TAB: -#if !defined TK_NO_DEPRECATED && (TCL_MAJOR_VERSION < 9) - if (tabIndex >= 0) -#endif - Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex)); + if (tabIndex >= 0) { + Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex)); + } break; } return TCL_OK; @@ -1151,10 +1150,9 @@ static int NotebookIndexCommand( status = FindTabIndex(interp, nb, objv[2], &index); if (status == TCL_OK) { -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) - if (index >= 0) -#endif - Tcl_SetObjResult(interp, TkNewIndexObj(index)); + if (index >= 0) { + Tcl_SetObjResult(interp, TkNewIndexObj(index)); + } } return status; diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index b23c698..2b551b6 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -303,7 +303,7 @@ static int ProgressbarSize(void *recordPtr, int *widthPtr, int *heightPtr) /* Override requested width (height) based on -length and -orient */ Tk_GetPixelsFromObj(NULL, pb->core.tkwin, pb->progress.lengthObj, &length); - TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient); + Ttk_GetOrientFromObj(NULL, pb->progress.orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = length; @@ -376,7 +376,7 @@ static void ProgressbarDoLayout(void *recordPtr) Tcl_GetDoubleFromObj(NULL, pb->progress.valueObj, &value); Tcl_GetDoubleFromObj(NULL, pb->progress.maximumObj, &maximum); - TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient); + Ttk_GetOrientFromObj(NULL, pb->progress.orientObj, &orient); if (pbar) { double fraction = value / maximum; diff --git a/generic/ttk/ttkStubInit.c b/generic/ttk/ttkStubInit.c index f123ec5..9d7d4fc 100644 --- a/generic/ttk/ttkStubInit.c +++ b/generic/ttk/ttkStubInit.c @@ -59,6 +59,11 @@ const TtkStubs ttkStubs = { Ttk_ExpandBox, /* 33 */ Ttk_PlaceBox, /* 34 */ Ttk_NewBoxObj, /* 35 */ + 0, /* 36 */ + 0, /* 37 */ + 0, /* 38 */ + 0, /* 39 */ + Ttk_GetOrientFromObj, /* 40 */ }; /* !END!: Do not edit above this line. */ diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index a00dbc5..b6d7626 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -369,9 +369,6 @@ typedef enum { /* -orient option values */ TTK_ORIENT_VERTICAL } Ttk_Orient; -MODULE_SCOPE int TtkGetOrientFromObj(Tcl_Interp *interp, - Tcl_Obj *objPtr, Ttk_Orient *orient); - /*------------------------------------------------------------------------ * +++ Utilities. */ diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h index 23bbcd6..8758f85 100644 --- a/generic/ttk/ttkThemeInt.h +++ b/generic/ttk/ttkThemeInt.h @@ -43,10 +43,6 @@ MODULE_SCOPE void TtkSetBlinkCursorTimes(Tcl_Interp* interp); MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box); -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) -# define TTK_OPTION_UNDERLINE_DEF(type, field) "-1", offsetof(type, field), TCL_INDEX_NONE, 0, NULL -#else -# define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL -#endif +#define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL #endif /* _TTKTHEMEINT */ diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index d819af7..f967b7e 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -480,7 +480,7 @@ Ttk_Layout TtkWidgetGetOrientedLayout( /* Prefix: */ - TtkGetOrientFromObj(NULL, orientObj, &orient); + Ttk_GetOrientFromObj(NULL, orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) Tcl_DStringAppend(&styleName, "Horizontal.", -1); else diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 504446b..7495741 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -2480,7 +2480,7 @@ static void TrackElementDraw( double from = 0, to = 100, value = 0, fraction, max; CGRect bounds = BoxToRect(d, b); - TtkGetOrientFromObj(NULL, elem->orientObj, &orientation); + Ttk_GetOrientFromObj(NULL, elem->orientObj, &orientation); Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from); Tcl_GetDoubleFromObj(NULL, elem->toObj, &to); Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value); @@ -2622,7 +2622,7 @@ static void PbarElementDraw( int isIndeterminate = !strcmp("indeterminate", Tcl_GetString(pbar->modeObj)); - TtkGetOrientFromObj(NULL, pbar->orientObj, &orientation); + Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orientation); Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value); Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum); Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase); @@ -2697,7 +2697,7 @@ static void TroughElementSize( Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; SInt32 thickness = 15; - TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); ChkErr(GetThemeMetric, kThemeMetricScrollBarWidth, &thickness); if (orientation == TTK_ORIENT_HORIZONTAL) { *minHeight = thickness; @@ -2725,7 +2725,7 @@ static void TroughElementDraw( CGRect bounds = BoxToRect(d, b); GrayColor bgGray; - TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_HORIZONTAL) { bounds = CGRectInset(bounds, 0, 1); } else { @@ -2761,7 +2761,7 @@ static void ThumbElementSize( ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; - TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_VERTICAL) { *minHeight = 18; *minWidth = 8; @@ -2782,7 +2782,7 @@ static void ThumbElementDraw( ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; - TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); /* * In order to make ttk scrollbars work correctly it is necessary to be diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 640573e..3c7bf1d 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -621,7 +621,7 @@ static void ThumbElementSize( ThumbElement *thumbPtr = (ThumbElement *)elementRecord; Ttk_Orient orient; - TtkGetOrientFromObj(NULL, thumbPtr->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, thumbPtr->orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = GetSystemMetrics(SM_CXHTHUMB); *heightPtr = GetSystemMetrics(SM_CYHSCROLL); @@ -686,7 +686,7 @@ static void SliderElementSize( SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); + Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = (GetSystemMetrics(SM_CXHTHUMB) / 2) | 1; *heightPtr = GetSystemMetrics(SM_CYHSCROLL); -- cgit v0.12 From 05ff9d164e5127a86cf2e93236624193fef3135e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 11:08:53 +0000 Subject: Remove some (very old!) Image-related stuff, and unused stub entries --- doc/ConfigWidg.3 | 8 - doc/CrtImgType.3 | 22 -- doc/CrtPhImgFmt.3 | 39 ---- generic/tk.decls | 78 ------- generic/tk.h | 104 --------- generic/tkCanvText.c | 4 - generic/tkDecls.h | 158 ++++---------- generic/tkImage.c | 23 +- generic/tkImgPhoto.c | 126 +---------- generic/tkInt.decls | 3 - generic/tkInt.h | 23 +- generic/tkIntDecls.h | 19 +- generic/tkIntPlatDecls.h | 24 +-- generic/tkOldTest.c | 418 ------------------------------------ generic/tkPlatDecls.h | 22 +- generic/tkStubInit.c | 74 ++----- macosx/Tk.xcodeproj/project.pbxproj | 6 - macosx/tkMacOSXEmbed.c | 2 +- macosx/tkMacOSXNotify.c | 28 --- macosx/tkMacOSXXStubs.c | 11 + tests/imgPhoto.test | 6 - tests/unixEmbed.test | 2 +- tests/unixMenu.test | 2 +- tests/winMenu.test | 2 +- unix/Makefile.in | 7 +- win/Makefile.in | 4 - win/makefile.vc | 4 - win/tkWinWindow.c | 2 +- 28 files changed, 92 insertions(+), 1129 deletions(-) delete mode 100644 generic/tkOldTest.c diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index e29daa8..6fa6de4 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -429,14 +429,6 @@ to process the default string: the client can compute the default once, save the value, and provide it before calling \fBTk_ConfigureWidget\fR. .TP -\fBTK_CONFIG_OPTION_SPECIFIED\fR -This bit is -deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR -so that callers could detect what entries were specified in -\fIargv\fR, but it was removed because it was inherently -thread-unsafe. Code that wishes to detect what options were specified -should use \fBTk_SetOptions\fR instead. -.PP The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically used to specify different default values for monochrome and color displays. This is done by creating two diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index b0a14fc..b1f03dd 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -255,28 +255,6 @@ typedef int \fBTk_ImageCreateProc\fR( Tk_ImageModel \fImodel\fR, ClientData *\fImodelDataPtr\fR); .CE -Legacy programs and libraries dating from those days may still -contain code that defines extended Tk image types using the old -interface. The Tk header file will still support this legacy -interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR -defined. -.PP -When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may -see the routine \fBTk_InitImageArgs\fR in use. This was a migration -tool used to create stub-enabled extensions that could be loaded -into interps containing all versions of Tk 8.1 and later. Tk 8.5 no longer -provides this routine, but uses a macro to convert any attempted -calls of this routine into an empty comment. Any stub-enabled -extension providing an extended image type via the legacy interface -that is compiled against Tk 8.5 headers and linked against the -Tk 8.5 stub library will produce a file that can be loaded only -into interps with Tk 8.5 or later; that is, the normal stub-compatibility -rules. If a developer needs to generate from such code a file -that is loadable into interps with Tk 8.4 or earlier, they must -use Tk 8.4 headers and stub libraries to do so. -.PP -Any new code written today should not make use of the legacy -interfaces. Expect their support to go away in Tk 9. .SH "SEE ALSO" Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage .SH KEYWORDS diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3 index c7accdb..03a4046 100644 --- a/doc/CrtPhImgFmt.3 +++ b/doc/CrtPhImgFmt.3 @@ -457,45 +457,6 @@ typedef int \fBTk_ImageStringWriteProc\fR( Tcl_Obj *\fIformat\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE -.PP -.SH "LEGACY INTERFACE SUPPORT" -.PP -In Tk 8.2 and earlier, the definition of all the function pointer -types stored in fields of a \fBTk_PhotoImageFormat\fR struct were -incompatibly different. Legacy programs and libraries dating from -those days may still contain code that defines extended Tk photo image -formats using the old interface. The Tk header file will still support -this legacy interface if the code is compiled with the -macro \fBUSE_OLD_IMAGE\fR defined. Alternatively, the legacy interfaces -are used if the first character of \fIformatPtr->name\fR is an -uppercase ASCII character (\fBA\fR-\fBZ\fR), and explicit casts -are used to forgive the type mismatch. For example, -.CS -static Tk_PhotoImageFormat myFormat = { - "MyFormat", - (Tk_ImageFileMatchProc *) FileMatch, - NULL, - (Tk_ImageFileReadProc *) FileRead, - NULL, - NULL, - NULL -}; -.CE -would define a minimal \fBTk_PhotoImageFormat\fR that operates provide -only file reading capability, where \fBFileMatch\fR and \fBFileRead\fR -are written according to the legacy interfaces of Tk 8.2 or earlier. -.PP -Any stub-enabled extension providing an extended photo image format -via the legacy interface enabled by the \fBUSE_OLD_IMAGE\fR macro -that is compiled against Tk 8.5 headers and linked against the -Tk 8.5 stub library will produce a file that can be loaded only -into interps with Tk 8.5 or later; that is, the normal stub-compatibility -rules. If a developer needs to generate from such code a file -that is loadable into interps with Tk 8.4 or earlier, they must -use Tk 8.4 headers and stub libraries to do so. -.PP -Any new code written today should not make use of the legacy -interfaces. Expect their support to go away in Tk 9. .SH "SEE ALSO" Tk_FindPhoto, Tk_PhotoPutBlock .SH KEYWORDS diff --git a/generic/tk.decls b/generic/tk.decls index 8d936c7..e6c534f 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -326,9 +326,6 @@ declare 75 { declare 76 { void Tk_FreeTextLayout(Tk_TextLayout textLayout) } -declare 77 {deprecated {function does nothing, call can be removed}} { - void Tk_FreeXId(Display *display, XID xid) -} declare 78 { GC Tk_GCForColor(XColor *colorPtr, Drawable drawable) } @@ -475,9 +472,6 @@ declare 117 { void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight) } -declare 118 { - int Tk_Init(Tcl_Interp *interp) -} declare 119 { Atom Tk_InternAtom(Tk_Window tkwin, const char *name) } @@ -564,32 +558,15 @@ declare 143 { Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags) } -declare 144 {deprecated {function signature changed}} { - void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height) -} -declare 145 {deprecated {function signature changed}} { - void Tk_PhotoPutZoomedBlock_NoComposite(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height, int zoomX, int zoomY, - int subsampleX, int subsampleY) -} declare 146 { int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr) } declare 147 { void Tk_PhotoBlank(Tk_PhotoHandle handle) } -declare 148 {deprecated {function signature changed}} { - void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height ) -} declare 149 { void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr) } -declare 150 {deprecated {function signature changed}} { - void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height) -} declare 151 { int Tk_PointToChar(Tk_TextLayout layout, int x, int y) } @@ -617,9 +594,6 @@ declare 158 { Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr) } -declare 159 { - int Tk_SafeInit(Tcl_Interp *interp) -} declare 160 { const char *Tk_SetAppName(Tk_Window tkwin, const char *name) } @@ -817,9 +791,6 @@ declare 214 { declare 215 { void Tk_InitConsoleChannels(Tcl_Interp *interp) } -declare 216 { - int Tk_CreateConsoleWindow(Tcl_Interp *interp) -} declare 217 { void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method) } @@ -939,17 +910,6 @@ declare 244 { declare 245 { void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height) } -declare 246 {deprecated {function signature changed}} { - void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height, int compRule) -} -declare 247 {deprecated {function signature changed}} { - void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height, int zoomX, int zoomY, - int subsampleX, int subsampleY, int compRule) -} declare 248 { int Tk_CollapseMotionEvents(Display *display, int collapse) } @@ -985,12 +945,6 @@ declare 256 { declare 257 { Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } -declare 258 { - Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr) -} -declare 259 { - void Tk_FreeStyleFromObj(Tcl_Obj *objPtr) -} declare 260 { Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable) @@ -1048,23 +1002,6 @@ declare 271 { Tcl_Interp *Tk_Interp(Tk_Window tkwin) } -# Now that the Tk 8.2 -> 8.3 transition is long past, use more conventional -# means to continue support for extensions using the USE_OLD_IMAGE to -# continue use of their string-based Tcl_ImageTypes and Tcl_PhotoImageFormats. -# -# Note that this restores the usual rules for stub compatibility. Stub-enabled -# extensions compiled against 8.5 headers and linked to the 8.5 stub library -# will produce a file [load]able into an interp with Tk 8.X, for X >= 5. -# It will *not* be [load]able into interps with Tk 8.4 (or Tk 8.2!). -# Developers who need to produce a file [load]able into legacy interps must -# build against legacy sources. -declare 272 { - void Tk_CreateOldImageType(const Tk_ImageType *typePtr) -} -declare 273 { - void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) -} - # TIP#580 declare 274 { int Tk_AlwaysShowSelection(Tk_Window tkwin) @@ -1151,27 +1088,12 @@ declare 2 win { declare 3 win { Tk_Window Tk_HWNDToWindow(HWND hwnd) } -declare 4 win { - void Tk_PointerEvent(HWND hwnd, int x, int y) -} -declare 5 win { - int Tk_TranslateWinEvent(HWND hwnd, - UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result) -} ################################ # Aqua specific functions -# Stub removed because the function no longer exists. -#declare 3 aqua { -# void TkMacOSXInitMenus(Tcl_Interp *interp) -#} declare 4 aqua { void TkMacOSXInitAppleEvents(Tcl_Interp *interp) } -declare 5 aqua { - void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, - int height, int flags) -} declare 6 aqua { void TkMacOSXInvalClipRgns(Tk_Window tkwin) } diff --git a/generic/tk.h b/generic/tk.h index c20065a..32fcc17 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -409,9 +409,6 @@ typedef enum { #define TK_CONFIG_COLOR_ONLY (1 << 1) #define TK_CONFIG_MONO_ONLY (1 << 2) #define TK_CONFIG_DONT_SET_DEFAULT (1 << 3) -#ifndef TK_NO_DEPRECATED -# define TK_CONFIG_OPTION_SPECIFIED (1 << 4) -#endif /* !TK_NO_DEPRECATED */ #define TK_CONFIG_USER_BIT 0x100 #endif /* __NO_OLD_CONFIG */ @@ -1228,15 +1225,9 @@ typedef struct Tk_Outline { */ typedef struct Tk_ImageType Tk_ImageType; -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE) -typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, Tcl_Size argc, - char **argv, Tk_ImageType *typePtr, Tk_ImageModel model, - void **clientDataPtr); -#else typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, Tcl_Size objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); -#endif /* USE_OLD_IMAGE */ typedef void *(Tk_ImageGetProc) (Tk_Window tkwin, void *clientData); typedef void (Tk_ImageDisplayProc) (void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, @@ -1331,22 +1322,6 @@ typedef struct Tk_PhotoImageBlock { */ typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat; -#ifdef USE_OLD_IMAGE -typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName, - char *formatString, int *widthPtr, int *heightPtr); -typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString, - int *widthPtr, int *heightPtr); -typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, - char *fileName, char *formatString, Tk_PhotoHandle imageHandle, - int destX, int destY, int width, int height, int srcX, int srcY); -typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string, - char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY, - int width, int height, int srcX, int srcY); -typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName, - char *formatString, Tk_PhotoImageBlock *blockPtr); -typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, - Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr); -#else typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format, @@ -1361,7 +1336,6 @@ typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); -#endif /* USE_OLD_IMAGE */ /* * The following alternate definitions are used with the Tk8.7 file format @@ -1536,42 +1510,6 @@ typedef struct Tk_ElementSpec { *---------------------------------------------------------------------- */ -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -#define TK_READABLE TCL_READABLE -#define TK_WRITABLE TCL_WRITABLE -#define TK_EXCEPTION TCL_EXCEPTION - -#define TK_DONT_WAIT TCL_DONT_WAIT -#define TK_X_EVENTS TCL_WINDOW_EVENTS -#define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS -#define TK_FILE_EVENTS TCL_FILE_EVENTS -#define TK_TIMER_EVENTS TCL_TIMER_EVENTS -#define TK_IDLE_EVENTS TCL_IDLE_EVENTS -#define TK_ALL_EVENTS TCL_ALL_EVENTS - -#define Tk_IdleProc Tcl_IdleProc -#define Tk_FileProc Tcl_FileProc -#define Tk_TimerProc Tcl_TimerProc -#define Tk_TimerToken Tcl_TimerToken - -#define Tk_BackgroundError Tcl_BackgroundError -#define Tk_CancelIdleCall Tcl_CancelIdleCall -#define Tk_CreateFileHandler Tcl_CreateFileHandler -#define Tk_CreateTimerHandler Tcl_CreateTimerHandler -#define Tk_DeleteFileHandler Tcl_DeleteFileHandler -#define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler -#define Tk_DoOneEvent Tcl_DoOneEvent -#define Tk_DoWhenIdle Tcl_DoWhenIdle -#define Tk_Sleep Tcl_Sleep - -/* Additional stuff that has moved to Tcl: */ - -#define Tk_EventuallyFree Tcl_EventuallyFree -#define Tk_FreeProc Tcl_FreeProc -#define Tk_Preserve Tcl_Preserve -#define Tk_Release Tcl_Release -#endif - /* Removed Tk_Main, use macro instead */ #if defined(_WIN32) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ @@ -1622,13 +1560,6 @@ typedef Tcl_Size (Tk_SelectionProc) (void *clientData, Tcl_Size offset, #include "tkDecls.h" -#ifdef USE_OLD_IMAGE -#undef Tk_CreateImageType -#define Tk_CreateImageType Tk_CreateOldImageType -#undef Tk_CreatePhotoImageFormat -#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat -#endif /* USE_OLD_IMAGE */ - /* *---------------------------------------------------------------------- * @@ -1638,41 +1569,6 @@ typedef Tcl_Size (Tk_SelectionProc) (void *clientData, Tcl_Size offset, * This goes after the inclusion of the stubbed-decls so that the declarations * of what is actually there can be correct. */ - -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK -# ifdef Tk_PhotoPutBlock -# undef Tk_PhotoPutBlock -# endif -# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite -# ifdef Tk_PhotoPutZoomedBlock -# undef Tk_PhotoPutZoomedBlock -# endif -# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite -# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE -#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ -# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE -# ifdef Tk_PhotoPutBlock -# undef Tk_PhotoPutBlock -# endif -# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic -# ifdef Tk_PhotoPutZoomedBlock -# undef Tk_PhotoPutZoomedBlock -# endif -# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic -# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ -#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ -#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE -# ifdef Tk_PhotoExpand -# undef Tk_PhotoExpand -# endif -# define Tk_PhotoExpand Tk_PhotoExpand_Panic -# ifdef Tk_PhotoSetSize -# undef Tk_PhotoSetSize -# endif -# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic -#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ -#endif /* !TK_NO_DEPRECATED */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index abc050c..0203343 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -150,11 +150,7 @@ UnderlinePrintProc( char *p; if (underline == INT_MIN) { -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - p = (char *)"-1"; -#else p = (char *)""; -#endif *freeProcPtr = TCL_STATIC; return p; } else if (underline == INT_MAX) { diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 8acef68..a7ae350 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -288,9 +288,7 @@ EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs, EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap); /* 76 */ EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout); -/* 77 */ -TK_DEPRECATED("function does nothing, call can be removed") -void Tk_FreeXId(Display *display, XID xid); +/* Slot 77 is reserved */ /* 78 */ EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable); /* 79 */ @@ -413,8 +411,7 @@ EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window); EXTERN void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); -/* 118 */ -EXTERN int Tk_Init(Tcl_Interp *interp); +/* Slot 118 is reserved */ /* 119 */ EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name); /* 120 */ @@ -476,34 +473,18 @@ EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection, EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); -/* 144 */ -TK_DEPRECATED("function signature changed") -void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height); -/* 145 */ -TK_DEPRECATED("function signature changed") -void Tk_PhotoPutZoomedBlock_NoComposite( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height, int zoomX, int zoomY, - int subsampleX, int subsampleY); +/* Slot 144 is reserved */ +/* Slot 145 is reserved */ /* 146 */ EXTERN int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 147 */ EXTERN void Tk_PhotoBlank(Tk_PhotoHandle handle); -/* 148 */ -TK_DEPRECATED("function signature changed") -void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, - int width, int height); +/* Slot 148 is reserved */ /* 149 */ EXTERN void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); -/* 150 */ -TK_DEPRECATED("function signature changed") -void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, - int width, int height); +/* Slot 150 is reserved */ /* 151 */ EXTERN int Tk_PointToChar(Tk_TextLayout layout, int x, int y); /* 152 */ @@ -529,8 +510,7 @@ EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, /* 158 */ EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr); -/* 159 */ -EXTERN int Tk_SafeInit(Tcl_Interp *interp); +/* Slot 159 is reserved */ /* 160 */ EXTERN const char * Tk_SetAppName(Tk_Window tkwin, const char *name); /* 161 */ @@ -689,8 +669,7 @@ EXTERN int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, Tk_SavedOptions *savePtr, int *maskPtr); /* 215 */ EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp); -/* 216 */ -EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp); +/* Slot 216 is reserved */ /* 217 */ EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method); @@ -782,17 +761,8 @@ EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin, /* 245 */ EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height); -/* 246 */ -TK_DEPRECATED("function signature changed") -void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height, int compRule); -/* 247 */ -TK_DEPRECATED("function signature changed") -void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, int x, int y, - int width, int height, int zoomX, int zoomY, - int subsampleX, int subsampleY, int compRule); +/* Slot 246 is reserved */ +/* Slot 247 is reserved */ /* 248 */ EXTERN int Tk_CollapseMotionEvents(Display *display, int collapse); @@ -818,10 +788,8 @@ EXTERN const char * Tk_NameOfStyle(Tk_Style style); /* 257 */ EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); -/* 258 */ -EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr); -/* 259 */ -EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr); +/* Slot 258 is reserved */ +/* Slot 259 is reserved */ /* 260 */ EXTERN Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, @@ -869,11 +837,8 @@ EXTERN long Tk_GetUserInactiveTime(Display *dpy); EXTERN void Tk_ResetUserInactiveTime(Display *dpy); /* 271 */ EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin); -/* 272 */ -EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr); -/* 273 */ -EXTERN void Tk_CreateOldPhotoImageFormat( - const Tk_PhotoImageFormat *formatPtr); +/* Slot 272 is reserved */ +/* Slot 273 is reserved */ /* 274 */ EXTERN int Tk_AlwaysShowSelection(Tk_Window tkwin); /* 275 */ @@ -1011,7 +976,7 @@ typedef struct TkStubs { void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, char *widgRec, Display *display, int needFlags); /* 74 */ void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */ void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */ - TCL_DEPRECATED_API("function does nothing, call can be removed") void (*tk_FreeXId) (Display *display, XID xid); /* 77 */ + void (*reserved77)(void); GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */ void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */ Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */ @@ -1052,7 +1017,7 @@ typedef struct TkStubs { void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */ Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */ void (*tk_ImageChanged) (Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */ - int (*tk_Init) (Tcl_Interp *interp); /* 118 */ + void (*reserved118)(void); Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */ int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */ void (*tk_MaintainGeometry) (Tk_Window window, Tk_Window container, int x, int y, int width, int height); /* 121 */ @@ -1078,13 +1043,13 @@ typedef struct TkStubs { Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */ void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 142 */ int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */ - TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */ - TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 145 */ + void (*reserved144)(void); + void (*reserved145)(void); int (*tk_PhotoGetImage) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 146 */ void (*tk_PhotoBlank) (Tk_PhotoHandle handle); /* 147 */ - TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoExpand_Panic) (Tk_PhotoHandle handle, int width, int height); /* 148 */ + void (*reserved148)(void); void (*tk_PhotoGetSize) (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 149 */ - TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoSetSize_Panic) (Tk_PhotoHandle handle, int width, int height); /* 150 */ + void (*reserved150)(void); int (*tk_PointToChar) (Tk_TextLayout layout, int x, int y); /* 151 */ int (*tk_PostscriptFontName) (Tk_Font tkfont, Tcl_DString *dsPtr); /* 152 */ void (*tk_PreserveColormap) (Display *display, Colormap colormap); /* 153 */ @@ -1093,7 +1058,7 @@ typedef struct TkStubs { void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */ int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */ Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, void *arg, void **prevArgPtr); /* 158 */ - int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */ + void (*reserved159)(void); const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */ void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */ void (*tk_SetClass) (Tk_Window tkwin, const char *className); /* 162 */ @@ -1150,7 +1115,7 @@ typedef struct TkStubs { void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */ int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */ void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */ - int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */ + void (*reserved216)(void); void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */ void (*reserved218)(void); void (*reserved219)(void); @@ -1180,8 +1145,8 @@ typedef struct TkStubs { void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */ void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */ void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */ - TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 246 */ - TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 247 */ + void (*reserved246)(void); + void (*reserved247)(void); int (*tk_CollapseMotionEvents) (Display *display, int collapse); /* 248 */ Tk_StyleEngine (*tk_RegisterStyleEngine) (const char *name, Tk_StyleEngine parent); /* 249 */ Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */ @@ -1192,8 +1157,8 @@ typedef struct TkStubs { void (*tk_FreeStyle) (Tk_Style style); /* 255 */ const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */ Tk_Style (*tk_AllocStyleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 257 */ - Tk_Style (*tk_GetStyleFromObj) (Tcl_Obj *objPtr); /* 258 */ - void (*tk_FreeStyleFromObj) (Tcl_Obj *objPtr); /* 259 */ + void (*reserved258)(void); + void (*reserved259)(void); Tk_StyledElement (*tk_GetStyledElement) (Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable); /* 260 */ void (*tk_GetElementSize) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); /* 261 */ void (*tk_GetElementBox) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 262 */ @@ -1206,8 +1171,8 @@ typedef struct TkStubs { long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */ void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */ Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ - void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */ - void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */ + void (*reserved272)(void); + void (*reserved273)(void); int (*tk_AlwaysShowSelection) (Tk_Window tkwin); /* 274 */ unsigned (*tk_GetButtonMask) (unsigned button); /* 275 */ int (*tk_GetDoublePixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 276 */ @@ -1393,8 +1358,7 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_FreePixmap) /* 75 */ #define Tk_FreeTextLayout \ (tkStubsPtr->tk_FreeTextLayout) /* 76 */ -#define Tk_FreeXId \ - (tkStubsPtr->tk_FreeXId) /* 77 */ +/* Slot 77 is reserved */ #define Tk_GCForColor \ (tkStubsPtr->tk_GCForColor) /* 78 */ #define Tk_GeometryRequest \ @@ -1475,8 +1439,7 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_IdToWindow) /* 116 */ #define Tk_ImageChanged \ (tkStubsPtr->tk_ImageChanged) /* 117 */ -#define Tk_Init \ - (tkStubsPtr->tk_Init) /* 118 */ +/* Slot 118 is reserved */ #define Tk_InternAtom \ (tkStubsPtr->tk_InternAtom) /* 119 */ #define Tk_IntersectTextLayout \ @@ -1527,20 +1490,16 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_OwnSelection) /* 142 */ #define Tk_ParseArgv \ (tkStubsPtr->tk_ParseArgv) /* 143 */ -#define Tk_PhotoPutBlock_NoComposite \ - (tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */ -#define Tk_PhotoPutZoomedBlock_NoComposite \ - (tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */ +/* Slot 144 is reserved */ +/* Slot 145 is reserved */ #define Tk_PhotoGetImage \ (tkStubsPtr->tk_PhotoGetImage) /* 146 */ #define Tk_PhotoBlank \ (tkStubsPtr->tk_PhotoBlank) /* 147 */ -#define Tk_PhotoExpand_Panic \ - (tkStubsPtr->tk_PhotoExpand_Panic) /* 148 */ +/* Slot 148 is reserved */ #define Tk_PhotoGetSize \ (tkStubsPtr->tk_PhotoGetSize) /* 149 */ -#define Tk_PhotoSetSize_Panic \ - (tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */ +/* Slot 150 is reserved */ #define Tk_PointToChar \ (tkStubsPtr->tk_PointToChar) /* 151 */ #define Tk_PostscriptFontName \ @@ -1557,8 +1516,7 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_RestackWindow) /* 157 */ #define Tk_RestrictEvents \ (tkStubsPtr->tk_RestrictEvents) /* 158 */ -#define Tk_SafeInit \ - (tkStubsPtr->tk_SafeInit) /* 159 */ +/* Slot 159 is reserved */ #define Tk_SetAppName \ (tkStubsPtr->tk_SetAppName) /* 160 */ #define Tk_SetBackgroundFromBorder \ @@ -1670,8 +1628,7 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_SetOptions) /* 214 */ #define Tk_InitConsoleChannels \ (tkStubsPtr->tk_InitConsoleChannels) /* 215 */ -#define Tk_CreateConsoleWindow \ - (tkStubsPtr->tk_CreateConsoleWindow) /* 216 */ +/* Slot 216 is reserved */ #define Tk_CreateSmoothMethod \ (tkStubsPtr->tk_CreateSmoothMethod) /* 217 */ /* Slot 218 is reserved */ @@ -1728,10 +1685,8 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */ #define Tk_SetCaretPos \ (tkStubsPtr->tk_SetCaretPos) /* 245 */ -#define Tk_PhotoPutBlock_Panic \ - (tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */ -#define Tk_PhotoPutZoomedBlock_Panic \ - (tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 247 */ +/* Slot 246 is reserved */ +/* Slot 247 is reserved */ #define Tk_CollapseMotionEvents \ (tkStubsPtr->tk_CollapseMotionEvents) /* 248 */ #define Tk_RegisterStyleEngine \ @@ -1752,10 +1707,8 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_NameOfStyle) /* 256 */ #define Tk_AllocStyleFromObj \ (tkStubsPtr->tk_AllocStyleFromObj) /* 257 */ -#define Tk_GetStyleFromObj \ - (tkStubsPtr->tk_GetStyleFromObj) /* 258 */ -#define Tk_FreeStyleFromObj \ - (tkStubsPtr->tk_FreeStyleFromObj) /* 259 */ +/* Slot 258 is reserved */ +/* Slot 259 is reserved */ #define Tk_GetStyledElement \ (tkStubsPtr->tk_GetStyledElement) /* 260 */ #define Tk_GetElementSize \ @@ -1780,10 +1733,8 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */ #define Tk_Interp \ (tkStubsPtr->tk_Interp) /* 271 */ -#define Tk_CreateOldImageType \ - (tkStubsPtr->tk_CreateOldImageType) /* 272 */ -#define Tk_CreateOldPhotoImageFormat \ - (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ +/* Slot 272 is reserved */ +/* Slot 273 is reserved */ #define Tk_AlwaysShowSelection \ (tkStubsPtr->tk_AlwaysShowSelection) /* 274 */ #define Tk_GetButtonMask \ @@ -1823,16 +1774,7 @@ extern const TkStubs *tkStubsPtr; /* !END!: Do not edit above this line. */ -/* Functions that don't belong in the stub table */ -#undef Tk_MainEx -#undef Tk_Init -#undef Tk_SafeInit -#undef Tk_CreateConsoleWindow - -#undef Tk_FreeXId -#define Tk_FreeXId(display,xid) -#undef Tk_GetStyleFromObj -#undef Tk_FreeStyleFromObj +#define Tk_FreeXId(display,xid) /* no-op */ #define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj) #define Tk_FreeStyleFromObj(obj) /* no-op */ #define Tk_GetImageMasterData Tk_GetImageModelData @@ -1848,17 +1790,9 @@ EXTERN void Tk_MainEx(Tcl_Size argc, char **argv, EXTERN void Tk_MainExW(Tcl_Size argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif - - -#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 -#undef Tk_PhotoPutBlock_NoComposite -#undef Tk_PhotoPutZoomedBlock_NoComposite -#undef Tk_PhotoExpand_Panic -#undef Tk_PhotoPutBlock_Panic -#undef Tk_PhotoPutZoomedBlock_Panic -#undef Tk_PhotoSetSize_Panic -#undef Tk_CreateOldPhotoImageFormat -#endif /* TK_NO_DEPRECATED */ +EXTERN int Tk_Init(Tcl_Interp *interp); +EXTERN int Tk_SafeInit(Tcl_Interp *interp); +EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp); #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/generic/tkImage.c b/generic/tkImage.c index e34ced4..5290b7e 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -129,7 +129,7 @@ ImageTypeThreadExitProc( /* *---------------------------------------------------------------------- * - * Tk_CreateOldImageType, Tk_CreateImageType -- + * Tk_CreateImageType -- * * This function is invoked by an image manager to tell Tk about a new * kind of image and the functions that manage the new type. The function @@ -146,27 +146,6 @@ ImageTypeThreadExitProc( */ void -Tk_CreateOldImageType( - const Tk_ImageType *typePtr) - /* Structure describing the type. All of the - * fields except "nextPtr" must be filled in - * by caller. */ -{ - Tk_ImageType *copyPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - - if (!tsdPtr->initialized) { - tsdPtr->initialized = 1; - Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL); - } - copyPtr = (Tk_ImageType *)ckalloc(sizeof(Tk_ImageType)); - *copyPtr = *typePtr; - copyPtr->nextPtr = tsdPtr->oldImageTypeList; - tsdPtr->oldImageTypeList = copyPtr; -} - -void Tk_CreateImageType( const Tk_ImageType *typePtr) /* Structure describing the type. All of the diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 757fae4..6ced2a9 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -271,7 +271,7 @@ PhotoFormatThreadExitProc( /* *---------------------------------------------------------------------- * - * Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat, + * Tk_CreatePhotoImageFormat, * Tk_CreatePhotoImageFormatVersion3 -- * * This function is invoked by an image file handler to register a new @@ -288,29 +288,6 @@ PhotoFormatThreadExitProc( *---------------------------------------------------------------------- */ -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -void -Tk_CreateOldPhotoImageFormat( - const Tk_PhotoImageFormat *formatPtr) - /* Structure describing the format. All of the - * fields except "nextPtr" must be filled in - * by caller. */ -{ - Tk_PhotoImageFormat *copyPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - - if (!tsdPtr->initialized) { - tsdPtr->initialized = 1; - Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL); - } - copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat)); - *copyPtr = *formatPtr; - copyPtr->nextPtr = tsdPtr->oldFormatList; - tsdPtr->oldFormatList = copyPtr; -} -#endif - void Tk_CreatePhotoImageFormat( const Tk_PhotoImageFormat *formatPtr) @@ -4531,107 +4508,6 @@ ImgPhotoPostscript( } /* - *---------------------------------------------------------------------- - * - * Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite -- - * - * These backward-compatibility functions just exist to fill slots in stubs - * table. For the behaviour of *_NoComposite, refer to the corresponding - * function without the extra suffix, except that the compositing rule is - * always "overlay" and the function always panics on memory-allocation - * failure. - * - *---------------------------------------------------------------------- - */ -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -void -Tk_PhotoPutBlock_NoComposite( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, - int x, int y, int width, int height) -{ - if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height, - TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) { - Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); - } -} - -void -Tk_PhotoPutZoomedBlock_NoComposite( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, - int x, int y, int width, int height, - int zoomX, int zoomY, int subsampleX, int subsampleY) -{ - if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height, - zoomX, zoomY, subsampleX, subsampleY, - TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) { - Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tk_PhotoExpand_Panic, Tk_PhotoPutBlock_Panic, - * Tk_PhotoPutZoomedBlock_Panic, Tk_PhotoSetSize_Panic - * - * Backward compatibility functions for preserving the old behaviour (i.e. - * panic on memory allocation failure) so that extensions do not need to be - * significantly updated to take account of TIP #116. These call the new - * interface (i.e. the interface without the extra suffix), but panic if an - * error condition is returned. - * - *---------------------------------------------------------------------- - */ - -void -Tk_PhotoExpand_Panic( - Tk_PhotoHandle handle, - int width, int height) -{ - if (Tk_PhotoExpand(NULL, handle, width, height) != TCL_OK) { - Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); - } -} - -void -Tk_PhotoPutBlock_Panic( - Tk_PhotoHandle handle, - Tk_PhotoImageBlock *blockPtr, - int x, int y, int width, int height, int compRule) -{ - if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height, - compRule) != TCL_OK) { - Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); - } -} - -void -Tk_PhotoPutZoomedBlock_Panic( - Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, - int x, int y, int width, int height, - int zoomX, int zoomY, int subsampleX, int subsampleY, - int compRule) -{ - if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height, - zoomX, zoomY, subsampleX, subsampleY, compRule) != TCL_OK) { - Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); - } -} - -void -Tk_PhotoSetSize_Panic( - Tk_PhotoHandle handle, - int width, int height) -{ - if (Tk_PhotoSetSize(NULL, handle, width, height) != TCL_OK) { - Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); - } -} -#endif /* TK_NO_DEPRECATED */ - -/* * Local Variables: * mode: c * c-basic-offset: 4 diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 3d04961..78e6cf2 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -831,9 +831,6 @@ declare 32 win { Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className) } -declare 33 win { - int TkWinGetPlatformId(void) -} # new for 8.4.1 diff --git a/generic/tkInt.h b/generic/tkInt.h index 464ef74..ebfa348 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -75,13 +75,6 @@ # endif #endif -#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) -# define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int len, Tcl_DString *))Tcl_UniCharToUtfDString) -# define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int len, Tcl_DString *))Tcl_UtfToUniCharDString) -# define Tcl_Char16ToUtfDString Tcl_UniCharToUtfDString -# define Tcl_UtfToChar16DString Tcl_UtfToUniCharDString -#endif - #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) # define TKFLEXARRAY #elif defined(__GNUC__) && (__GNUC__ > 2) @@ -90,10 +83,6 @@ # define TKFLEXARRAY 1 #endif -#if !defined(Tcl_GetParent) && (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7) -# define Tcl_GetParent Tcl_GetMaster -#endif - /* * Macros used to cast between pointers and integers (e.g. when storing an int * in ClientData), on 64-bit architectures they avoid gcc warning about "cast @@ -1420,13 +1409,8 @@ MODULE_SCOPE void TkRotatePoint(double originX, double originY, double *yPtr); MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, Tcl_Size, int lastOK, Tcl_Size*); -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) -# define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1) -# define TK_OPTION_UNDERLINE_DEF(type, field) "-1", TCL_INDEX_NONE, offsetof(type, field), 0, NULL -#else -# define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value))) -# define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL -#endif +#define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value))) +#define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL #ifdef _WIN32 @@ -1468,8 +1452,7 @@ MODULE_SCOPE void TkpCopyRegion(TkRegion dst, TkRegion src); # define c_class class #endif -/* Tcl 8.6 has a different definition of Tcl_UniChar than other Tcl versions for TCL_UTF_MAX > 3 */ -#if TCL_UTF_MAX > (3 + (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 6)) +#if TCL_UTF_MAX > 3 # define TkUtfToUniChar(src, ch) (size_t)(((int (*)(const char *, int *))Tcl_UtfToUniChar)(src, ch)) # define TkUniCharToUtf(ch, src) (size_t)(((int (*)(int, char *))Tcl_UniCharToUtf)(ch, src)) #else diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 6eeb6c5..84f360d 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -1178,24 +1178,7 @@ extern const TkIntStubs *tkIntStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#undef TkpCmapStressed_ -#undef TkpSync_ -#undef TkUnixContainerId_ -#undef TkUnixDoOneXEvent_ -#undef TkUnixSetMenubar_ -#undef TkWmCleanup_ -#undef TkSendCleanup_ -#undef TkpTestsendCmd_ -#undef TkSetWindowMenuBar -#undef TkpDrawHighlightBorder -#undef TkpUseWindow -#undef TkpSetMainMenubar -#undef TkpGetOtherWindow -#undef TkpGetSystemDefault -#undef TkpMakeContainer -#undef TkpMakeWindow - -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION == 8) +#if !defined(TK_NO_DEPRECATED) # define TkSetWindowMenuBar Tk_SetWindowMenubar # define TkpDrawHighlightBorder Tk_DrawHighlightBorder # define TkpUseWindow Tk_UseWindow diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index c3164da..48948a0 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -113,8 +113,7 @@ EXTERN void TkWinDialogDebug(int debug); /* 32 */ EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); -/* 33 */ -EXTERN int TkWinGetPlatformId(void); +/* Slot 33 is reserved */ /* 34 */ EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); /* 35 */ @@ -370,7 +369,7 @@ typedef struct TkIntPlatStubs { void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ void (*tkWinDialogDebug) (int debug); /* 31 */ Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */ - int (*tkWinGetPlatformId) (void); /* 33 */ + void (*reserved33)(void); void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ @@ -572,8 +571,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ #define TkWinGetMenuSystemDefault \ (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ -#define TkWinGetPlatformId \ - (tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */ +/* Slot 33 is reserved */ #define TkWinSetHINSTANCE \ (tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */ #define TkWinGetPlatformTheme \ @@ -779,23 +777,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* !END!: Do not edit above this line. */ -#undef TkpCmapStressed_ -#undef TkpSync_ -#undef TkUnixContainerId_ -#undef TkUnixDoOneXEvent_ -#undef TkUnixSetMenubar_ -#undef TkWmCleanup_ -#undef TkSendCleanup_ -#undef TkpTestsendCmd_ -#undef TkGenerateActivateEvents_ -#undef TkMacOSXSetUpClippingRgn -#undef TkMacOSXIsCharacterMissing -#define TkMacOSXIsCharacterMissing(tkfont) ((void)tkfont, 0) - #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#undef TkWinGetPlatformId -#define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */ - #endif /* _TKINTPLATDECLS */ diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c deleted file mode 100644 index d135958..0000000 --- a/generic/tkOldTest.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * tkOldTest.c -- - * - * This file contains C command functions for additional Tcl - * commands that are used to test Tk's support for legacy - * interfaces. These commands are not normally included in Tcl/Tk - * applications; they're only used for testing. - * - * Copyright © 1993-1994 The Regents of the University of California. - * Copyright © 1994-1997 Sun Microsystems, Inc. - * Copyright © 1998-1999 Scriptics Corporation. - * Contributions by Don Porter, NIST, 2007. (not subject to US copyright) - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#define USE_OLD_IMAGE -#ifndef USE_TCL_STUBS -# define USE_TCL_STUBS -#endif -#ifndef USE_TK_STUBS -# define USE_TK_STUBS -#endif -#include "tkInt.h" - -#ifdef _WIN32 -#include "tkWinInt.h" -#endif - -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) -/* - * The following data structure represents the model for a test image: - */ - -typedef struct TImageModel { - Tk_ImageModel model; /* Tk's token for image model. */ - Tcl_Interp *interp; /* Interpreter for application. */ - int width, height; /* Dimensions of image. */ - char *imageName; /* Name of image (malloc-ed). */ - char *varName; /* Name of variable in which to log events for - * image (malloc-ed). */ -} TImageModel; - -/* - * The following data structure represents a particular use of a particular - * test image. - */ - -typedef struct TImageInstance { - TImageModel *modelPtr; /* Pointer to model for image. */ - XColor *fg; /* Foreground color for drawing in image. */ - GC gc; /* Graphics context for drawing in image. */ -} TImageInstance; - -/* - * The type record for test images: - */ - -static int ImageCreate(Tcl_Interp *interp, - char *name, Tcl_Size argc, char **argv, - Tk_ImageType *typePtr, Tk_ImageModel model, - ClientData *clientDataPtr); -static ClientData ImageGet(Tk_Window tkwin, ClientData clientData); -static void ImageDisplay(ClientData clientData, - Display *display, Drawable drawable, - int imageX, int imageY, int width, - int height, int drawableX, - int drawableY); -static void ImageFree(ClientData clientData, Display *display); -static void ImageDelete(ClientData clientData); - -static Tk_ImageType imageType = { - "oldtest", /* name */ - (Tk_ImageCreateProc *) ImageCreate, /* createProc */ - ImageGet, /* getProc */ - ImageDisplay, /* displayProc */ - ImageFree, /* freeProc */ - ImageDelete, /* deleteProc */ - NULL, /* postscriptPtr */ - NULL, /* nextPtr */ - NULL -}; - -/* - * Forward declarations for functions defined later in this file: - */ - -static int ImageObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj * const objv[]); -#endif - -/* - *---------------------------------------------------------------------- - * - * TkOldTestInit -- - * - * This function performs initialization for the Tk test suite - * extensions for testing support for legacy interfaces. - * - * Results: - * Returns a standard Tcl completion code, and leaves an error message in - * the interp's result if an error occurs. - * - * Side effects: - * Creates several test commands. - * - *---------------------------------------------------------------------- - */ - -int -TkOldTestInit( - Tcl_Interp *dummy) -{ - static int initialized = 0; - (void)dummy; - - if (!initialized) { - initialized = 1; -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) - Tk_CreateImageType(&imageType); -#endif - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ImageCreate -- - * - * This function is called by the Tk image code to create "oldtest" images. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * The data structure for a new image is allocated. - * - *---------------------------------------------------------------------- - */ -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) -static int -ImageCreate( - Tcl_Interp *interp, /* Interpreter for application containing - * image. */ - char *name, /* Name to use for image. */ - Tcl_Size argc, /* Number of arguments. */ - char **argv, /* Argument strings for options (doesn't - * include image name or type). */ - Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ - Tk_ImageModel model, /* Token for image, to be used by us in later - * callbacks. */ - ClientData *clientDataPtr) /* Store manager's token for image here; it - * will be returned in later callbacks. */ -{ - TImageModel *timPtr; - const char *varName; - Tcl_Size i; - (void)typePtr; - - varName = "log"; - for (i = 0; i < argc; i += 2) { - if (strcmp(argv[i], "-variable") != 0) { - Tcl_AppendResult(interp, "bad option name \"", - argv[i], "\"", NULL); - return TCL_ERROR; - } - if ((i+1) == argc) { - Tcl_AppendResult(interp, "no value given for \"", - argv[i], "\" option", NULL); - return TCL_ERROR; - } - varName = argv[i+1]; - } - - timPtr = (TImageModel *)ckalloc(sizeof(TImageModel)); - timPtr->model = model; - timPtr->interp = interp; - timPtr->width = 30; - timPtr->height = 15; - timPtr->imageName = (char *)ckalloc(strlen(name) + 1); - strcpy(timPtr->imageName, name); - timPtr->varName = (char *)ckalloc(strlen(varName) + 1); - strcpy(timPtr->varName, varName); - Tcl_CreateObjCommand(interp, name, ImageObjCmd, timPtr, NULL); - *clientDataPtr = timPtr; - Tk_ImageChanged(model, 0, 0, 30, 15, 30, 15); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ImageObjCmd -- - * - * This function implements the commands corresponding to individual - * images. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Forces windows to be created. - * - *---------------------------------------------------------------------- - */ - -static int -ImageObjCmd( - ClientData clientData, /* Main window for application. */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument strings. */ -{ - TImageModel *timPtr = (TImageModel *)clientData; - int x, y, width, height; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); - return TCL_ERROR; - } - if (strcmp(Tcl_GetString(objv[1]), "changed") == 0) { - if (objc != 8) { - Tcl_WrongNumArgs(interp, 1, objv, "changed x y width height" - " imageWidth imageHeight"); - return TCL_ERROR; - } - if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[5], &height) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[6], &timPtr->width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[7], &timPtr->height) != TCL_OK)) { - return TCL_ERROR; - } - Tk_ImageChanged(timPtr->model, x, y, width, height, timPtr->width, - timPtr->height); - } else { - Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), - "\": must be changed", NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ImageGet -- - * - * This function is called by Tk to set things up for using a test image - * in a particular widget. - * - * Results: - * The return value is a token for the image instance, which is used in - * future callbacks to ImageDisplay and ImageFree. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static ClientData -ImageGet( - Tk_Window tkwin, /* Token for window in which image will be - * used. */ - ClientData clientData) /* Pointer to TImageModel for image. */ -{ - TImageModel *timPtr = (TImageModel *)clientData; - TImageInstance *instPtr; - char buffer[100]; - XGCValues gcValues; - - snprintf(buffer, sizeof(buffer), "%s get", timPtr->imageName); - Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); - - instPtr = (TImageInstance *)ckalloc(sizeof(TImageInstance)); - instPtr->modelPtr = timPtr; - instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000"); - gcValues.foreground = instPtr->fg->pixel; - instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues); - return instPtr; -} - -/* - *---------------------------------------------------------------------- - * - * ImageDisplay -- - * - * This function is invoked to redisplay part or all of an image in a - * given drawable. - * - * Results: - * None. - * - * Side effects: - * The image gets partially redrawn, as an "X" that shows the exact - * redraw area. - * - *---------------------------------------------------------------------- - */ - -static void -ImageDisplay( - ClientData clientData, /* Pointer to TImageInstance for image. */ - Display *display, /* Display to use for drawing. */ - Drawable drawable, /* Where to redraw image. */ - int imageX, int imageY, /* Origin of area to redraw, relative to - * origin of image. */ - int width, int height, /* Dimensions of area to redraw. */ - int drawableX, int drawableY) - /* Coordinates in drawable corresponding to - * imageX and imageY. */ -{ - TImageInstance *instPtr = (TImageInstance *)clientData; - char buffer[200 + TCL_INTEGER_SPACE * 6]; - - snprintf(buffer, sizeof(buffer), "%s display %d %d %d %d %d %d", - instPtr->modelPtr->imageName, imageX, imageY, width, height, - drawableX, drawableY); - Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, - buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); - if (width > (instPtr->modelPtr->width - imageX)) { - width = instPtr->modelPtr->width - imageX; - } - if (height > (instPtr->modelPtr->height - imageY)) { - height = instPtr->modelPtr->height - imageY; - } - XDrawRectangle(display, drawable, instPtr->gc, drawableX, drawableY, - (unsigned) (width-1), (unsigned) (height-1)); - XDrawLine(display, drawable, instPtr->gc, drawableX, drawableY, - (int) (drawableX + width - 1), (int) (drawableY + height - 1)); - XDrawLine(display, drawable, instPtr->gc, drawableX, - (int) (drawableY + height - 1), - (int) (drawableX + width - 1), drawableY); -} - -/* - *---------------------------------------------------------------------- - * - * ImageFree -- - * - * This function is called when an instance of an image is no longer - * used. - * - * Results: - * None. - * - * Side effects: - * Information related to the instance is freed. - * - *---------------------------------------------------------------------- - */ - -static void -ImageFree( - ClientData clientData, /* Pointer to TImageInstance for instance. */ - Display *display) /* Display where image was to be drawn. */ -{ - TImageInstance *instPtr = (TImageInstance *)clientData; - char buffer[200]; - - snprintf(buffer, sizeof(buffer), "%s free", instPtr->modelPtr->imageName); - Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, - buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); - Tk_FreeColor(instPtr->fg); - Tk_FreeGC(display, instPtr->gc); - ckfree(instPtr); -} - -/* - *---------------------------------------------------------------------- - * - * ImageDelete -- - * - * This function is called to clean up a test image when an application - * goes away. - * - * Results: - * None. - * - * Side effects: - * Information about the image is deleted. - * - *---------------------------------------------------------------------- - */ - -static void -ImageDelete( - ClientData clientData) /* Pointer to TImageModel for image. When - * this function is called, no more instances - * exist. */ -{ - TImageModel *timPtr = (TImageModel *)clientData; - char buffer[100]; - - snprintf(buffer, sizeof(buffer), "%s delete", timPtr->imageName); - Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); - - Tcl_DeleteCommand(timPtr->interp, timPtr->imageName); - ckfree(timPtr->imageName); - ckfree(timPtr->varName); - ckfree(timPtr); -} -#endif - -/* - * Local Variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * End: - */ diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index 422407f..c546167 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -46,12 +46,6 @@ EXTERN HINSTANCE Tk_GetHINSTANCE(void); EXTERN HWND Tk_GetHWND(Window window); /* 3 */ EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd); -/* 4 */ -EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y); -/* 5 */ -EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam, - LRESULT *result); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ @@ -60,9 +54,7 @@ EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, /* Slot 3 is reserved */ /* 4 */ EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); -/* 5 */ -EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, - int width, int height, int flags); +/* Slot 5 is reserved */ /* 6 */ EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin); /* Slot 7 is reserved */ @@ -94,8 +86,6 @@ typedef struct TkPlatStubs { HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */ - void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */ - int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*reserved0)(void); @@ -103,7 +93,7 @@ typedef struct TkPlatStubs { void (*reserved2)(void); void (*reserved3)(void); void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ - void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ + void (*reserved5)(void); void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ void (*reserved7)(void); void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ @@ -139,10 +129,6 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_GetHWND) /* 2 */ #define Tk_HWNDToWindow \ (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ -#define Tk_PointerEvent \ - (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ -#define Tk_TranslateWinEvent \ - (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ @@ -151,8 +137,7 @@ extern const TkPlatStubs *tkPlatStubsPtr; /* Slot 3 is reserved */ #define TkMacOSXInitAppleEvents \ (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ -#define TkGenWMConfigureEvent_ \ - (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 5 */ +/* Slot 5 is reserved */ #define TkMacOSXInvalClipRgns \ (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */ /* Slot 7 is reserved */ @@ -185,7 +170,6 @@ extern const TkPlatStubs *tkPlatStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#undef TkGenWMConfigureEvent_ #define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl #endif /* _TKPLATDECLS */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 979b496..1a6a481 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -39,29 +39,12 @@ MODULE_SCOPE const TkStubs tkStubs; * Remove macro that might interfere with the definition below. */ -#undef Tk_FreeXId -#undef Tk_FreeStyleFromObj -#undef Tk_GetStyleFromObj -#undef TkWinGetPlatformId #undef TkPutImage #undef XPutImage #define TkMacOSXSetUpClippingRgn (void (*)(Drawable))(void *)doNothing #undef TkMacOSXIsCharacterMissing #define TkMacOSXIsCharacterMissing (int (*)(Tk_Font, unsigned int))(void *)doNothing -#if defined(_WIN32) && !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -# define Tk_TranslateWinEvent TkTranslateWinEvent -# define Tk_PointerEvent TkWinPointerEvent -#define TkWinGetPlatformId winGetPlatformId -static int TkWinGetPlatformId(void) { - return 2; -} -#else -# define Tk_TranslateWinEvent 0 -# define Tk_PointerEvent 0 -# define TkWinGetPlatformId 0 -#endif - #if defined(TK_NO_DEPRECATED) || (TCL_MAJOR_VERSION > 8) # define TkSetWindowMenuBar 0 # define TkpDrawHighlightBorder 0 @@ -79,29 +62,6 @@ doNothing(void) /* dummy implementation, no need to do anything */ return 0; } - -#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 -#define Tk_FreeXId 0 -#define Tk_FreeStyleFromObj 0 -#define Tk_GetStyleFromObj 0 -#define TkWinGetPlatformId 0 -#define Tk_PhotoPutBlock_NoComposite 0 -#define Tk_PhotoPutZoomedBlock_NoComposite 0 -#define Tk_PhotoExpand_Panic 0 -#define Tk_PhotoPutBlock_Panic 0 -#define Tk_PhotoPutZoomedBlock_Panic 0 -#define Tk_PhotoSetSize_Panic 0 -#define Tk_CreateOldPhotoImageFormat 0 -#else -#define Tk_FreeXId ((void (*)(Display *, XID))(void *)doNothing) -#define Tk_FreeStyleFromObj ((void (*)(Tcl_Obj *))(void *)doNothing) -#define Tk_GetStyleFromObj getStyleFromObj -static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) -{ - return Tk_AllocStyleFromObj(NULL, obj); -} -#endif /* !TK_NO_DEPRECATED */ - #define TkpCmapStressed_ TkpCmapStressed #define TkpSync_ TkpSync #define TkUnixContainerId_ TkUnixContainerId @@ -550,7 +510,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkWinSetForegroundWindow, /* 30 */ TkWinDialogDebug, /* 31 */ TkWinGetMenuSystemDefault, /* 32 */ - TkWinGetPlatformId, /* 33 */ + 0, /* 33 */ TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ @@ -1009,8 +969,6 @@ static const TkPlatStubs tkPlatStubs = { Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ Tk_HWNDToWindow, /* 3 */ - Tk_PointerEvent, /* 4 */ - Tk_TranslateWinEvent, /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ 0, /* 0 */ @@ -1018,7 +976,7 @@ static const TkPlatStubs tkPlatStubs = { 0, /* 2 */ 0, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ - TkGenWMConfigureEvent_, /* 5 */ + 0, /* 5 */ TkMacOSXInvalClipRgns, /* 6 */ 0, /* 7 */ TkMacOSXGetRootControl, /* 8 */ @@ -1120,7 +1078,7 @@ const TkStubs tkStubs = { Tk_FreeOptions, /* 74 */ Tk_FreePixmap, /* 75 */ Tk_FreeTextLayout, /* 76 */ - Tk_FreeXId, /* 77 */ + 0, /* 77 */ Tk_GCForColor, /* 78 */ Tk_GeometryRequest, /* 79 */ Tk_Get3DBorder, /* 80 */ @@ -1161,7 +1119,7 @@ const TkStubs tkStubs = { Tk_HandleEvent, /* 115 */ Tk_IdToWindow, /* 116 */ Tk_ImageChanged, /* 117 */ - Tk_Init, /* 118 */ + 0, /* 118 */ Tk_InternAtom, /* 119 */ Tk_IntersectTextLayout, /* 120 */ Tk_MaintainGeometry, /* 121 */ @@ -1187,13 +1145,13 @@ const TkStubs tkStubs = { Tk_NameToWindow, /* 141 */ Tk_OwnSelection, /* 142 */ Tk_ParseArgv, /* 143 */ - Tk_PhotoPutBlock_NoComposite, /* 144 */ - Tk_PhotoPutZoomedBlock_NoComposite, /* 145 */ + 0, /* 144 */ + 0, /* 145 */ Tk_PhotoGetImage, /* 146 */ Tk_PhotoBlank, /* 147 */ - Tk_PhotoExpand_Panic, /* 148 */ + 0, /* 148 */ Tk_PhotoGetSize, /* 149 */ - Tk_PhotoSetSize_Panic, /* 150 */ + 0, /* 150 */ Tk_PointToChar, /* 151 */ Tk_PostscriptFontName, /* 152 */ Tk_PreserveColormap, /* 153 */ @@ -1202,7 +1160,7 @@ const TkStubs tkStubs = { Tk_ResizeWindow, /* 156 */ Tk_RestackWindow, /* 157 */ Tk_RestrictEvents, /* 158 */ - Tk_SafeInit, /* 159 */ + 0, /* 159 */ Tk_SetAppName, /* 160 */ Tk_SetBackgroundFromBorder, /* 161 */ Tk_SetClass, /* 162 */ @@ -1259,7 +1217,7 @@ const TkStubs tkStubs = { Tk_RestoreSavedOptions, /* 213 */ Tk_SetOptions, /* 214 */ Tk_InitConsoleChannels, /* 215 */ - Tk_CreateConsoleWindow, /* 216 */ + 0, /* 216 */ Tk_CreateSmoothMethod, /* 217 */ 0, /* 218 */ 0, /* 219 */ @@ -1289,8 +1247,8 @@ const TkStubs tkStubs = { Tk_SetInternalBorderEx, /* 243 */ Tk_SetMinimumRequestSize, /* 244 */ Tk_SetCaretPos, /* 245 */ - Tk_PhotoPutBlock_Panic, /* 246 */ - Tk_PhotoPutZoomedBlock_Panic, /* 247 */ + 0, /* 246 */ + 0, /* 247 */ Tk_CollapseMotionEvents, /* 248 */ Tk_RegisterStyleEngine, /* 249 */ Tk_GetStyleEngine, /* 250 */ @@ -1301,8 +1259,8 @@ const TkStubs tkStubs = { Tk_FreeStyle, /* 255 */ Tk_NameOfStyle, /* 256 */ Tk_AllocStyleFromObj, /* 257 */ - Tk_GetStyleFromObj, /* 258 */ - Tk_FreeStyleFromObj, /* 259 */ + 0, /* 258 */ + 0, /* 259 */ Tk_GetStyledElement, /* 260 */ Tk_GetElementSize, /* 261 */ Tk_GetElementBox, /* 262 */ @@ -1315,8 +1273,8 @@ const TkStubs tkStubs = { Tk_GetUserInactiveTime, /* 269 */ Tk_ResetUserInactiveTime, /* 270 */ Tk_Interp, /* 271 */ - Tk_CreateOldImageType, /* 272 */ - Tk_CreateOldPhotoImageFormat, /* 273 */ + 0, /* 272 */ + 0, /* 273 */ Tk_AlwaysShowSelection, /* 274 */ Tk_GetButtonMask, /* 275 */ Tk_GetDoublePixelsFromObj, /* 276 */ diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index 47ed01a..e2acb38 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; }; F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; }; F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; }; F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; }; @@ -520,7 +519,6 @@ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEC08F27A39005CB29B /* tkMessage.c */; }; F9FD317D0CC1AD070073837D /* tkObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAED08F27A39005CB29B /* tkObj.c */; }; F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEE08F27A39005CB29B /* tkOldConfig.c */; }; - F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; }; F9FD31800CC1AD070073837D /* tkOption.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEF08F27A39005CB29B /* tkOption.c */; }; F9FD31810CC1AD070073837D /* tkPack.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF008F27A39005CB29B /* tkPack.c */; }; F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF108F27A39005CB29B /* tkPanedWindow.c */; }; @@ -916,7 +914,6 @@ F966BAFB08F27A39005CB29B /* tkSelect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSelect.c; sourceTree = ""; }; F966BAFC08F27A39005CB29B /* tkSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkSelect.h; sourceTree = ""; }; F966BAFD08F27A39005CB29B /* tkSquare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSquare.c; sourceTree = ""; }; - F966BAFE08F27A39005CB29B /* tkOldTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOldTest.c; sourceTree = ""; }; F966BAFF08F27A39005CB29B /* tkStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubInit.c; sourceTree = ""; }; F966BB0008F27A39005CB29B /* tkStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubLib.c; sourceTree = ""; }; F966BB0108F27A39005CB29B /* tkStyle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStyle.c; sourceTree = ""; }; @@ -2417,7 +2414,6 @@ F966BAFB08F27A39005CB29B /* tkSelect.c */, F966BAFC08F27A39005CB29B /* tkSelect.h */, F966BAFD08F27A39005CB29B /* tkSquare.c */, - F966BAFE08F27A39005CB29B /* tkOldTest.c */, F966BAFF08F27A39005CB29B /* tkStubInit.c */, F966BB0008F27A39005CB29B /* tkStubLib.c */, F966BB0108F27A39005CB29B /* tkStyle.c */, @@ -4258,7 +4254,6 @@ F966BE0F08F27A3F005CB29B /* tkMessage.c in Sources */, F966BE1008F27A3F005CB29B /* tkObj.c in Sources */, F966BE1108F27A3F005CB29B /* tkOldConfig.c in Sources */, - F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */, F966BE1208F27A3F005CB29B /* tkOption.c in Sources */, F966BE1308F27A3F005CB29B /* tkPack.c in Sources */, F966BE1408F27A3F005CB29B /* tkPanedWindow.c in Sources */, @@ -4572,7 +4567,6 @@ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */, F9FD317D0CC1AD070073837D /* tkObj.c in Sources */, F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */, - F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */, F9FD31800CC1AD070073837D /* tkOption.c in Sources */, F9FD31810CC1AD070073837D /* tkPack.c in Sources */, F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */, diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 443b34f..7f89a50 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -61,7 +61,7 @@ static void EmbedWindowDeleted(TkWindow *winPtr); /* *---------------------------------------------------------------------- * - * TkpMakeWindow -- + * Tk_MakeWindow -- * * Creates an X Window (Mac subwindow). * diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index f2b7c16..a821f59 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -16,34 +16,6 @@ #include "tkMacOSXPrivate.h" #include "tkMacOSXInt.h" #include "tkMacOSXConstants.h" -#if TCL_MAJOR_VERSION < 9 -#undef Tcl_MacOSXNotifierAddRunLoopMode -#ifdef USE_TCL_STUBS -#ifdef __cplusplus -extern "C" { -#endif -/* Little hack to eliminate the need for "tclInt.h" here: - Just copy a small portion of TclIntPlatStubs, just - enough to make it work. See [600b72bfbc] */ -typedef struct TclIntPlatStubs { - int magic; - void *hooks; - void (*dummy[19]) (void); /* dummy entries 0-18, not used */ - void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */ -} TclIntPlatStubs; -extern const TclIntPlatStubs *tclIntPlatStubsPtr; -#ifdef __cplusplus -} -#endif -#define Tcl_MacOSXNotifierAddRunLoopMode \ - (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */ -#elif TCL_MINOR_VERSION < 7 - extern void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode); -# define Tcl_MacOSXNotifierAddRunLoopMode TclMacOSXNotifierAddRunLoopMode -#else - extern void Tcl_MacOSXNotifierAddRunLoopMode(const void *runLoopMode); -#endif -#endif #import /* This is not used for anything at the moment. */ diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 76b8b33..cb4267b 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -865,6 +865,17 @@ XSetIconName( return Success; } +Bool +XFilterEvent( + XEvent *event, + Window window) +{ + (void)event; + (void)window; + + return 0; +} + int XForceScreenSaver( Display* display, diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 5a88a29..6ca3bc6 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -51,12 +51,6 @@ # ImgGetPhoto: no tests # Tk_PhotoGetImage no tests # ImgPostscriptPhoto no tests -# Tk_PhotoPutBlock_NoComposite no tests, probably none needed -# Tk_PhotoPutZoomedBlock_NoComposite no tests, probably none needed -# Tk_PhotoExpand_Panic no tests, probably none needed -# Tk_PhotoPutBlock_Panic no tests, probably none needed -# Tk_PhotoPutZoomedBlock_Panic no tests, probably none needed -# Tk_PhotoSetSize_Panic no tests, probably none needed # Tk_PhotoGetMetadata: imgPhoto-21.* # Tk_PhotoSetMetadata: imgPhoto-22.* #-------------------------------------------------------------------------- diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 2edd1d2..a66a310 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -963,7 +963,7 @@ test unixEmbed-6.2a {EmbedGeometryRequest procedure, window changes size} -const deleteWindows } -result {{configure .t1 200 200} 200x200+0+0} -# Can't think up any tests for TkpGetOtherWindow procedure. +# Can't think up any tests for Tk_GetOtherWindow procedure. test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constraints { unix notAqua diff --git a/tests/unixMenu.test b/tests/unixMenu.test index dafae08..57b3029 100644 --- a/tests/unixMenu.test +++ b/tests/unixMenu.test @@ -75,7 +75,7 @@ test unixMenu-6.2 {TkpSetWindowMenuBar - menu} -constraints unix -setup { } -returnCodes ok -result {{} {} {}} -test unixMenu-7.1 {TkpSetMainMenubar - nothing to do} -constraints unix -body {} +test unixMenu-7.1 {Tk_SetMainMenubar - nothing to do} -constraints unix -body {} test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} -constraints { diff --git a/tests/winMenu.test b/tests/winMenu.test index 21768ef..2382d13 100644 --- a/tests/winMenu.test +++ b/tests/winMenu.test @@ -562,7 +562,7 @@ test winMenu-12.3 {TkpSetWindowMenuBar - no update pending} -constraints { } -result {0 {} {} {}} -test winMenu-13.1 {TkpSetMainMenubar - nothing to do} -constraints { +test winMenu-13.1 {Tk_SetMainMenubar - nothing to do} -constraints { emptyTest win } -body {} diff --git a/unix/Makefile.in b/unix/Makefile.in index 36b2e54..da17df8 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -348,7 +348,7 @@ ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ WISH_OBJS = tkAppInit.o -TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o tkOldTest.o \ +TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o \ $(@TK_WINDOWINGSYSTEM@_TKTEST_OBJS) WIDG_OBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ @@ -462,7 +462,7 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tkTextImage.c \ $(GENERIC_DIR)/tkTextIndex.c $(GENERIC_DIR)/tkTextMark.c \ $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ - $(GENERIC_DIR)/tkOldConfig.c $(GENERIC_DIR)/tkOldTest.c \ + $(GENERIC_DIR)/tkOldConfig.c \ $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ $(GENERIC_DIR)/tkStubInit.c @@ -1241,9 +1241,6 @@ tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhoto.h tkImgPhInstance.o: $(GENERIC_DIR)/tkImgPhInstance.c $(GENERIC_DIR)/tkImgPhoto.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhInstance.c -tkOldTest.o: $(GENERIC_DIR)/tkOldTest.c - $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkOldTest.c - tkTest.o: $(GENERIC_DIR)/tkTest.c tkUuid.h $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkTest.c diff --git a/win/Makefile.in b/win/Makefile.in index 2d3c3ea..8e2a9dc 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -281,7 +281,6 @@ WISH_OBJS = \ TKTEST_OBJS = \ tkSquare.$(OBJEXT) \ tkTest.$(OBJEXT) \ - tkOldTest.$(OBJEXT) \ tkWinTest.$(OBJEXT) XLIB_OBJS = \ @@ -765,9 +764,6 @@ testMain.$(OBJEXT): winMain.c tkTest.$(OBJEXT): tkTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) -tkOldTest.$(OBJEXT): tkOldTest.c - $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) - tkWinTest.$(OBJEXT): tkWinTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) diff --git a/win/makefile.vc b/win/makefile.vc index 5a5929e..910a0ce 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -153,7 +153,6 @@ TKTESTOBJS = \ $(TMP_DIR)\testMain.obj \ $(TMP_DIR)\tkSquare.obj \ $(TMP_DIR)\tkTest.obj \ - $(TMP_DIR)\tkOldTest.obj \ $(TMP_DIR)\tkWinTest.obj XLIBOBJS = \ @@ -623,9 +622,6 @@ $(TMP_DIR)\tkUuid.h: $(ROOT)\manifest.uuid $(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? -$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c - $(cc32) $(appcflags_nostubs) -Fo$@ $? - $(TMP_DIR)\tkWinTest.obj: $(WIN_DIR)\tkWinTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index b4eed29..53432d7 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -232,7 +232,7 @@ TkpScanWindowId( /* *---------------------------------------------------------------------- * - * TkpMakeWindow -- + * Tk_MakeWindow -- * * Creates a Windows window object based on the current attributes of the * specified TkWindow. -- cgit v0.12 From 079f15d9e398e28651c0185842c5e9842272d6b9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 12:43:54 +0000 Subject: Remove more deprecated stuff. Join "X functions" stub tables for Win and MacOS together as a single platform-independant table --- generic/tk.h | 4 - generic/tkInt.decls | 876 ++++++++------------------------------------- generic/tkInt.h | 11 - generic/tkIntDecls.h | 90 ++--- generic/tkIntPlatDecls.h | 147 ++++---- generic/tkIntXlibDecls.h | 896 ----------------------------------------------- generic/tkPkgConfig.c | 8 - generic/tkStubInit.c | 243 ++----------- tests/embed.test | 10 +- tests/menu.test | 32 +- tests/unixEmbed.test | 18 +- xlib/X11/keysymdef.h | 24 -- 12 files changed, 298 insertions(+), 2061 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index 32fcc17..9678a06 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -743,10 +743,6 @@ 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) -#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/tkInt.decls b/generic/tkInt.decls index 78e6cf2..e056e3f 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -226,9 +226,6 @@ declare 58 { declare 59 { void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name) } -declare 60 {deprecated {renamed to Tk_GetOtherWindow}} { - TkWindow *TkpGetOtherWindow(TkWindow *winPtr) -} declare 61 { TkWindow *TkpGetWrapperWindow(TkWindow *winPtr) } @@ -239,15 +236,9 @@ declare 63 { void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable) } -declare 64 {deprecated {renamed to Tk_MakeContainer}} { - void TkpMakeContainer(Tk_Window tkwin) -} declare 65 { void TkpMakeMenuWindow(Tk_Window tkwin, int transient) } -declare 66 {deprecated {renamed to Tk_MakeWindow}} { - Window TkpMakeWindow(TkWindow *winPtr, Window parent) -} declare 67 { void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName) } @@ -269,15 +260,6 @@ declare 72 { declare 73 { void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr) } -declare 74 {deprecated {renamed to Tk_SetMainMenubar}} { - void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName) -} -declare 75 {deprecated {renamed to Tk_UseWindow}} { - int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) -} -# -# Slot 76 unused (WAS: TkpWindowWasRecentlyDeleted) -# declare 77 { void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } @@ -302,16 +284,6 @@ declare 82 { declare 83 { void TkSelPropProc(XEvent *eventPtr) } - -# Exported publically as Tk_SetClassProcs in 8.4a2 -#declare 84 { -# void TkSetClassProcs(Tk_Window tkwin, -# TkClassProcs *procs, void *instanceData) -#} -declare 85 {deprecated {renamed to Tk_SetWindowMenubar}} { - void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, - const char *oldMenuName, const char *menuName) -} declare 86 { KeySym TkStringToKeysym(const char *name) } @@ -394,10 +366,6 @@ declare 109 { declare 110 { void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont) } -declare 111 {deprecated {renamed to Tk_GetSystemDefault}} { - Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin, - const char *dbName, const char *className) -} declare 112 { void TkpMenuThreadInit(void) } @@ -434,10 +402,6 @@ declare 124 aqua { Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height) } -declare 135 {deprecated {renamed to Tk_DrawHighlightBorder}} { - void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, - int highlightWidth, Drawable drawable) -} declare 136 { void TkSetFocusWin(TkWindow *winPtr, int force) } @@ -666,58 +630,36 @@ declare 0 x11 { declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } -declare 3 x11 { - int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) -} -declare 4 x11 { - void TkpSync(Display *display) -} -declare 5 x11 { - Window TkUnixContainerId(TkWindow *winPtr) -} -declare 6 x11 { - int TkUnixDoOneXEvent(Tcl_Time *timePtr) -} -declare 7 x11 { - void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) -} declare 8 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 9 x11 { void TkWmCleanup(TkDisplay *dispPtr) } -declare 10 x11 { - void TkSendCleanup(TkDisplay *dispPtr) -} declare 12 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } # only needed by tktest: -declare 13 x11 { - int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, Tcl_Size objc, - Tcl_Obj *const objv[]) -} declare 38 x11 { - int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap) + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } declare 39 x11 { - void TkpSync_(Display *display) + void TkpSync(Display *display) } declare 40 x11 { - Window TkUnixContainerId_(TkWindow *winPtr) + Window TkUnixContainerId(TkWindow *winPtr) } declare 41 x11 { - int TkUnixDoOneXEvent_(Tcl_Time *timePtr) + int TkUnixDoOneXEvent(Tcl_Time *timePtr) } declare 42 x11 { - void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar) + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } declare 43 x11 { - void TkWmCleanup_(TkDisplay *dispPtr) + void TkWmCleanup(TkDisplay *dispPtr) } declare 44 x11 { - void TkSendCleanup_(TkDisplay *dispPtr) + void TkSendCleanup(TkDisplay *dispPtr) } # only needed by tktest: declare 45 x11 { @@ -885,11 +827,8 @@ declare 47 win { ################################ # Aqua specific functions -declare 0 aqua { - void TkGenerateActivateEvents(TkWindow *winPtr, int active) -} declare 2 aqua { - void TkGenerateActivateEvents_(TkWindow *winPtr, int active) + void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 3 aqua { void TkPointerDeadWindow(TkWindow *winPtr) @@ -948,9 +887,6 @@ declare 18 aqua { declare 21 aqua { void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag) } -declare 22 aqua { - int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar) -} declare 23 aqua { void TkMacOSXMakeRealWindowExist(TkWindow *winPtr) } @@ -973,9 +909,6 @@ declare 28 aqua { declare 29 aqua { void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag) } -declare 30 aqua { - void TkMacOSXSetUpClippingRgn(Drawable drawable) -} declare 31 aqua { void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort) } @@ -1057,413 +990,413 @@ declare 55 aqua { interface tkIntXlib ################################ -# X functions for Windows +# X functions -declare 0 win { +declare 0 { int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } -declare 1 win { +declare 1 { XModifierKeymap *XGetModifierMapping(Display *d) } -declare 2 win { +declare 2 { XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4) } -declare 3 win { +declare 3 { XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) } -declare 4 win { +declare 4 { char *XGetAtomName(Display *d, Atom a) } -declare 5 win { +declare 5 { char *XKeysymToString(KeySym k) } -declare 6 win { +declare 6 { Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } -declare 7 win { +declare 7 { Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) } -declare 8 win { +declare 8 { Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2) } -declare 9 win { +declare 9 { GContext XGContextFromGC(GC g) } -declare 10 win { +declare 10 { XHostAddress *XListHosts(Display *d, int *i, Bool *b) } # second parameter was of type KeyCode -declare 11 win { +declare 11 { KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) } -declare 12 win { +declare 12 { KeySym XStringToKeysym(_Xconst char *c) } -declare 13 win { +declare 13 { Window XRootWindow(Display *d, int i) } -declare 14 win { +declare 14 { XErrorHandler XSetErrorHandler(XErrorHandler x) } -declare 15 win { +declare 15 { Status XIconifyWindow(Display *d, Window w, int i) } -declare 16 win { +declare 16 { Status XWithdrawWindow(Display *d, Window w, int i) } -declare 17 win { +declare 17 { Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) } -declare 18 win { +declare 18 { Status XAllocColor(Display *d, Colormap c, XColor *xp) } -declare 19 win { +declare 19 { int XBell(Display *d, int i) } -declare 20 win { +declare 20 { int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } -declare 21 win { +declare 21 { int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } -declare 22 win { +declare 22 { int XClearWindow(Display *d, Window w) } -declare 23 win { +declare 23 { int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } -declare 24 win { +declare 24 { int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 25 win { +declare 25 { int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul) } -declare 26 win { +declare 26 { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } -declare 27 win { +declare 27 { int XDefineCursor(Display *d, Window w, Cursor c) } -declare 28 win { +declare 28 { int XDeleteProperty(Display *d, Window w, Atom a) } -declare 29 win { +declare 29 { int XDestroyWindow(Display *d, Window w) } -declare 30 win { +declare 30 { int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 31 win { +declare 31 { int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } -declare 32 win { +declare 32 { int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 33 win { +declare 33 { int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 34 win { +declare 34 { int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } -declare 35 win { +declare 35 { int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } -declare 36 win { +declare 36 { int XForceScreenSaver(Display *d, int i) } -declare 37 win { +declare 37 { int XFreeColormap(Display *d, Colormap c) } -declare 38 win { +declare 38 { int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } -declare 39 win { +declare 39 { int XFreeCursor(Display *d, Cursor c) } -declare 40 win { +declare 40 { int XFreeModifiermap(XModifierKeymap *x) } -declare 41 win { +declare 41 { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4) } -declare 42 win { +declare 42 { int XGetInputFocus(Display *d, Window *w, int *i) } -declare 43 win { +declare 43 { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp) } -declare 44 win { +declare 44 { Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) } -declare 45 win { +declare 45 { int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } -declare 46 win { +declare 46 { int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } -declare 47 win { +declare 47 { KeyCode XKeysymToKeycode(Display *d, KeySym k) } -declare 48 win { +declare 48 { Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2) } -declare 49 win { +declare 49 { int XMapWindow(Display *d, Window w) } -declare 50 win { +declare 50 { int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 51 win { +declare 51 { int XMoveWindow(Display *d, Window w, int i1, int i2) } -declare 52 win { +declare 52 { int XNextEvent(Display *d, XEvent *x) } -declare 53 win { +declare 53 { int XPutBackEvent(Display *d, XEvent *x) } -declare 54 win { +declare 54 { int XQueryColors(Display *d, Colormap c, XColor *x, int i) } -declare 55 win { +declare 55 { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } -declare 56 win { +declare 56 { Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui) } -declare 57 win { +declare 57 { int XRaiseWindow(Display *d, Window w) } -declare 58 win { +declare 58 { int XRefreshKeyboardMapping(XMappingEvent *x) } -declare 59 win { +declare 59 { int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } -declare 60 win { +declare 60 { int XSelectInput(Display *d, Window w, long l) } -declare 61 win { +declare 61 { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } -declare 62 win { +declare 62 { int XSetCommand(Display *d, Window w, char **c, int i) } -declare 63 win { +declare 63 { int XSetIconName(Display *d, Window w, _Xconst char *c) } -declare 64 win { +declare 64 { int XSetInputFocus(Display *d, Window w, int i, Time t) } -declare 65 win { +declare 65 { int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } -declare 66 win { +declare 66 { int XSetWindowBackground(Display *d, Window w, unsigned long ul) } -declare 67 win { +declare 67 { int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } -declare 68 win { +declare 68 { int XSetWindowBorder(Display *d, Window w, unsigned long ul) } -declare 69 win { +declare 69 { int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } -declare 70 win { +declare 70 { int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } -declare 71 win { +declare 71 { int XSetWindowColormap(Display *d, Window w, Colormap c) } -declare 72 win { +declare 72 { Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3) } -declare 73 win { +declare 73 { int XUngrabKeyboard(Display *d, Time t) } -declare 74 win { +declare 74 { int XUngrabPointer(Display *d, Time t) } -declare 75 win { +declare 75 { int XUnmapWindow(Display *d, Window w) } -declare 76 win { +declare 76 { int XWindowEvent(Display *d, Window w, long l, XEvent *x) } -declare 77 win { +declare 77 { void XDestroyIC(XIC x) } -declare 78 win { +declare 78 { Bool XFilterEvent(XEvent *x, Window w) } -declare 79 win { +declare 79 { int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s) } -declare 80 win { +declare 80 { int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } -declare 81 win { +declare 81 { int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering) } -declare 82 win { +declare 82 { Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr) } -declare 83 win { +declare 83 { GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values) } -declare 84 win { +declare 84 { int XFreeGC(Display *display, GC gc) } -declare 85 win { +declare 85 { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } -declare 86 win { +declare 86 { int XSetBackground(Display *display, GC gc, unsigned long foreground) } -declare 87 win { +declare 87 { int XSetForeground(Display *display, GC gc, unsigned long foreground) } -declare 88 win { +declare 88 { int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } -declare 89 win { +declare 89 { int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } -declare 90 win { +declare 90 { int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } -declare 91 win { +declare 91 { int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } -declare 92 win { +declare 92 { int XSetFont(Display *display, GC gc, Font font) } -declare 93 win { +declare 93 { int XSetArcMode(Display *display, GC gc, int arc_mode) } -declare 94 win { +declare 94 { int XSetStipple(Display *display, GC gc, Pixmap stipple) } -declare 95 win { +declare 95 { int XSetFillRule(Display *display, GC gc, int fill_rule) } -declare 96 win { +declare 96 { int XSetFillStyle(Display *display, GC gc, int fill_style) } -declare 97 win { +declare 97 { int XSetFunction(Display *display, GC gc, int function) } -declare 98 win { +declare 98 { int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } -declare 99 win { +declare 99 { int _XInitImageFuncPtrs(XImage *image) } -declare 100 win { +declare 100 { XIC XCreateIC(XIM xim, ...) } -declare 101 win { +declare 101 { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return) } -declare 102 win { +declare 102 { void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop) } -declare 103 win { +declare 103 { Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return) } -declare 104 win { +declare 104 { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } -declare 105 win { +declare 105 { int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy) } -declare 106 win { +declare 106 { int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } # New in Tk 8.6 -declare 107 win { +declare 107 { int XFlush(Display *display) } -declare 108 win { +declare 108 { int XGrabServer(Display *display) } -declare 109 win { +declare 109 { int XUngrabServer(Display *display) } -declare 110 win { +declare 110 { int XFree(void *data) } -declare 111 win { +declare 111 { int XNoOp(Display *display) } -declare 112 win { +declare 112 { XAfterFunction XSynchronize(Display *display, Bool onoff) } -declare 113 win { +declare 113 { int XSync(Display *display, Bool discard) } -declare 114 win { +declare 114 { VisualID XVisualIDFromVisual(Visual *visual) } # For tktreectrl -declare 120 win { +declare 120 { int XOffsetRegion(Region rgn, int dx, int dy) } -declare 121 win { +declare 121 { int XUnionRegion(Region srca, Region srcb, Region dr_return) } # For 3dcanvas -declare 122 win { +declare 122 { Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, @@ -1472,593 +1405,92 @@ declare 122 win { } # Various, e.g. for stub-enabled BLT -declare 129 win { +declare 129 { int XLowerWindow(Display *d, Window w) } -declare 130 win { +declare 130 { int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } -declare 131 win { +declare 131 { int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } -declare 132 win { +declare 132 { int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) } -declare 133 win { +declare 133 { int XDrawSegments(Display *d, Drawable dr, GC gc, XSegment *s, int n) } -declare 134 win { +declare 134 { int XDrawPoint(Display *d, Drawable dr, GC gc, int x, int y) } -declare 135 win { +declare 135 { int XDrawPoints(Display *d, Drawable dr, GC gc, XPoint *p, int n, int m) } -declare 136 win { +declare 136 { int XReparentWindow(Display *d, Window w, Window p, int x, int y) } -declare 137 win { +declare 137 { int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h) } -declare 138 win { +declare 138 { Region XPolygonRegion(XPoint *pts, int n, int rule) } -declare 139 win { +declare 139 { int XPointInRegion(Region rgn, int x, int y) } # For XIM -declare 140 win { +declare 140 { XVaNestedList XVaCreateNestedList(int dummy, ...) } -declare 141 win { +declare 141 { char *XSetICValues(XIC xic, ...) } -declare 142 win { +declare 142 { char *XGetICValues(XIC xic, ...) } -declare 143 win { +declare 143 { void XSetICFocus(XIC xic) } -declare 147 win { +declare 147 { void XFreeFontSet(Display *display, XFontSet fontset) } -declare 148 win { +declare 148 { int XCloseIM(XIM im) } -declare 149 win { +declare 149 { Bool XRegisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data) } -declare 150 win { +declare 150 { Bool XUnregisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data) } -declare 151 win { +declare 151 { char *XSetLocaleModifiers(const char *modifier_list) } -declare 152 win { +declare 152 { XIM XOpenIM(Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, char *res_class) } -declare 153 win { +declare 153 { char *XGetIMValues(XIM im, ...) } -declare 154 win { +declare 154 { char *XSetIMValues(XIM im, ...) } -declare 155 win { +declare 155 { XFontSet XCreateFontSet(Display *display, _Xconst char *base_font_name_list, char ***missing_charset_list, int *missing_charset_count, char **def_string) } -declare 156 win { +declare 156 { void XFreeStringList(char **list) } -declare 157 win { +declare 157 { KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, int i) } -declare 158 win { - Display *XkbOpenDisplay(const char *name, int *ev_rtrn, int *err_rtrn, - int *major_rtrn, int *minor_rtrn, int *reason) -} - -################################ -# X functions for MacOSX - -declare 0 macosx { - int XSetDashes(Display *display, GC gc, int dash_offset, - _Xconst char *dash_list, int n) -} -declare 1 macosx { - XModifierKeymap *XGetModifierMapping(Display *d) -} -declare 2 macosx { - XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, - int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, - int i4) -} -declare 3 macosx { - XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, - unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) -} -declare 4 macosx { - char *XGetAtomName(Display *d, Atom a) -} -declare 5 macosx { - char *XKeysymToString(KeySym k) -} -declare 6 macosx { - Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) -} -declare 7 macosx { - GContext XGContextFromGC(GC g) -} -# second parameter was of type KeyCode -declare 8 macosx { - KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) -} -declare 9 macosx { - KeySym XStringToKeysym(_Xconst char *c) -} -declare 10 macosx { - Window XRootWindow(Display *d, int i) -} -declare 11 macosx { - XErrorHandler XSetErrorHandler(XErrorHandler x) -} -declare 12 macosx { - Status XAllocColor(Display *d, Colormap c, XColor *xp) -} -declare 13 macosx { - int XBell(Display *d, int i) -} -declare 14 macosx { - int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, - int i2, _Xconst unsigned char *c, int i3) -} -declare 15 macosx { - int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, - XSetWindowAttributes *x) -} -declare 16 macosx { - int XConfigureWindow(Display *d, Window w, unsigned int i, - XWindowChanges *x) -} -declare 17 macosx { - int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, - int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) -} -declare 18 macosx { - int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, - int i2, unsigned int ui1, - unsigned int ui2, int i3, int i4, unsigned long ul) -} -declare 19 macosx { - Pixmap XCreateBitmapFromData(Display *display, Drawable d, - _Xconst char *data, unsigned int width, unsigned int height) -} -declare 20 macosx { - int XDefineCursor(Display *d, Window w, Cursor c) -} -declare 21 macosx { - int XDestroyWindow(Display *d, Window w) -} -declare 22 macosx { - int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, int i4) -} -declare 23 macosx { - int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) -} -declare 24 macosx { - int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2) -} -declare 25 macosx { - int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, - unsigned int ui1, unsigned int ui2, int i3, int i4) -} -declare 26 macosx { - int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, - int i1, int i2, int i3) -} -declare 27 macosx { - int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) -} -declare 28 macosx { - int XFreeColormap(Display *d, Colormap c) -} -declare 29 macosx { - int XFreeColors(Display *d, Colormap c, - unsigned long *ulp, int i, unsigned long ul) -} -declare 30 macosx { - int XFreeModifiermap(XModifierKeymap *x) -} -declare 31 macosx { - Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, - int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, - unsigned int *ui4) -} -declare 32 macosx { - int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, - Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, - unsigned long *ulp2, unsigned char **cpp) -} -declare 33 macosx { - int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) -} -declare 34 macosx { - int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, - int i1, int i2, Window w2, Cursor c, Time t) -} -declare 35 macosx { - KeyCode XKeysymToKeycode(Display *d, KeySym k) -} -declare 36 macosx { - int XMapWindow(Display *d, Window w) -} -declare 37 macosx { - int XMoveResizeWindow(Display *d, Window w, int i1, int i2, - unsigned int ui1, unsigned int ui2) -} -declare 38 macosx { - int XMoveWindow(Display *d, Window w, int i1, int i2) -} -declare 39 macosx { - Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, - int *i1, int *i2, int *i3, int *i4, unsigned int *ui) -} -declare 40 macosx { - int XRaiseWindow(Display *d, Window w) -} -declare 41 macosx { - int XRefreshKeyboardMapping(XMappingEvent *x) -} -declare 42 macosx { - int XResizeWindow(Display *d, Window w, unsigned int ui1, - unsigned int ui2) -} -declare 43 macosx { - int XSelectInput(Display *d, Window w, long l) -} -declare 44 macosx { - Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) -} -declare 45 macosx { - int XSetIconName(Display *d, Window w, _Xconst char *c) -} -declare 46 macosx { - int XSetInputFocus(Display *d, Window w, int i, Time t) -} -declare 47 macosx { - int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) -} -declare 48 macosx { - int XSetWindowBackground(Display *d, Window w, unsigned long ul) -} -declare 49 macosx { - int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) -} -declare 50 macosx { - int XSetWindowBorder(Display *d, Window w, unsigned long ul) -} -declare 51 macosx { - int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) -} -declare 52 macosx { - int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) -} -declare 53 macosx { - int XSetWindowColormap(Display *d, Window w, Colormap c) -} -declare 54 macosx { - int XUngrabKeyboard(Display *d, Time t) -} -declare 55 macosx { - int XUngrabPointer(Display *d, Time t) -} -declare 56 macosx { - int XUnmapWindow(Display *d, Window w) -} -declare 57 macosx { - int TkPutImage(unsigned long *colors, int ncolors, Display *display, - Drawable d, GC gc, XImage *image, int src_x, int src_y, - int dest_x, int dest_y, unsigned int width, unsigned int height) -} -declare 58 macosx { - Status XParseColor(Display *display, Colormap map, - _Xconst char *spec, XColor *colorPtr) -} -declare 59 macosx { - GC XCreateGC(Display *display, Drawable d, - unsigned long valuemask, XGCValues *values) -} -declare 60 macosx { - int XFreeGC(Display *display, GC gc) -} -declare 61 macosx { - Atom XInternAtom(Display *display, _Xconst char *atom_name, - Bool only_if_exists) -} -declare 62 macosx { - int XSetBackground(Display *display, GC gc, unsigned long foreground) -} -declare 63 macosx { - int XSetForeground(Display *display, GC gc, unsigned long foreground) -} -declare 64 macosx { - int XSetClipMask(Display *display, GC gc, Pixmap pixmap) -} -declare 65 macosx { - int XSetClipOrigin(Display *display, GC gc, - int clip_x_origin, int clip_y_origin) -} -declare 66 macosx { - int XSetTSOrigin(Display *display, GC gc, - int ts_x_origin, int ts_y_origin) -} -declare 67 macosx { - int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) -} -declare 68 macosx { - int XSetFont(Display *display, GC gc, Font font) -} -declare 69 macosx { - int XSetArcMode(Display *display, GC gc, int arc_mode) -} -declare 70 macosx { - int XSetStipple(Display *display, GC gc, Pixmap stipple) -} -declare 71 macosx { - int XSetFillRule(Display *display, GC gc, int fill_rule) -} -declare 72 macosx { - int XSetFillStyle(Display *display, GC gc, int fill_style) -} -declare 73 macosx { - int XSetFunction(Display *display, GC gc, int function) -} -declare 74 macosx { - int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, - int line_style, int cap_style, int join_style) -} -declare 75 macosx { - int _XInitImageFuncPtrs(XImage *image) -} -declare 76 macosx { - XIC XCreateIC(XIM xim, ...) -} -declare 77 macosx { - XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, - XVisualInfo *vinfo_template, int *nitems_return) -} -declare 78 macosx { - void XSetWMClientMachine(Display *display, Window w, - XTextProperty *text_prop) -} -declare 79 macosx { - Status XStringListToTextProperty(char **list, int count, - XTextProperty *text_prop_return) -} -declare 80 macosx { - int XDrawSegments(Display *display, Drawable d, GC gc, - XSegment *segments, int nsegments) -} -declare 81 macosx { - int XForceScreenSaver(Display *display, int mode) -} -declare 82 macosx { - int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, - int x2, int y2) -} -declare 83 macosx { - int XFillRectangle(Display *display, Drawable d, GC gc, - int x, int y, unsigned int width, unsigned int height) -} -declare 84 macosx { - int XClearWindow(Display *d, Window w) -} -declare 85 macosx { - int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y) -} -declare 86 macosx { - int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, - int npoints, int mode) -} -declare 87 macosx { - int XWarpPointer(Display *display, Window src_w, Window dest_w, - int src_x, int src_y, unsigned int src_width, - unsigned int src_height, int dest_x, int dest_y) -} -declare 88 macosx { - int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out) -} -declare 89 macosx { - int XQueryColors(Display *display, Colormap colormap, - XColor *defs_in_out, int ncolors) -} -declare 90 macosx { - Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, - Window **w4, unsigned int *ui) -} -declare 91 macosx { - int XSync(Display *display, Bool discard) -} -declare 92 macosx { - Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, - int i2, int *i3, int *i4, Window *w3) -} -declare 93 macosx { - int XDeleteProperty(Display *d, Window w, Atom a) -} -declare 94 macosx { - int XFreeCursor(Display *d, Cursor c) -} -declare 95 macosx { - int XGetInputFocus(Display *d, Window *w, int *i) -} -declare 96 macosx { - int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, - KeySym *k, Status *s) -} -declare 97 macosx { - int XNextEvent(Display *d, XEvent *x) -} -declare 98 macosx { - int XPutBackEvent(Display *d, XEvent *x) -} -declare 99 macosx { - int XSetCommand(Display *d, Window w, char **c, int i) -} -declare 100 macosx { - int XWindowEvent(Display *d, Window w, long l, XEvent *x) -} -declare 101 macosx { - Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) -} -declare 102 macosx { - Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) -} -declare 103 macosx { - Status XIconifyWindow(Display *d, Window w, int i) -} -declare 104 macosx { - Status XWithdrawWindow(Display *d, Window w, int i) -} -declare 105 macosx { - XHostAddress *XListHosts(Display *d, int *i, Bool *b) -} -declare 106 macosx { - int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, - int clip_y_origin, XRectangle rectangles[], int n, int ordering) -} -declare 107 macosx { - int XFlush(Display *display) -} -declare 108 macosx { - int XGrabServer(Display *display) -} -declare 109 macosx { - int XUngrabServer(Display *display) -} -declare 110 macosx { - int XFree(void *data) -} -declare 111 macosx { - int XNoOp(Display *display) -} -declare 112 macosx { - XAfterFunction XSynchronize(Display *display, Bool onoff) -} -declare 113 macosx { - Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, - XColor *x1, XColor *x2) -} -declare 114 macosx { - VisualID XVisualIDFromVisual(Visual *visual) -} -declare 120 macosx { - int XOffsetRegion(Region rgn, int dx, int dy) -} -declare 121 macosx { - int XUnionRegion(Region srca, Region srcb, Region dr_return) -} -declare 122 macosx { - Window XCreateWindow(Display *display, Window parent, int x, int y, - unsigned int width, unsigned int height, - unsigned int border_width, int depth, unsigned int clazz, - Visual *visual, unsigned long value_mask, - XSetWindowAttributes *attributes) -} -declare 129 macosx { - int XLowerWindow(Display *d, Window w) -} -declare 130 macosx { - int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) -} -declare 131 macosx { - int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) -} -declare 132 macosx { - int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) -} -declare 136 macosx { - int XReparentWindow(Display *d, Window w, Window p, int x, int y) -} -declare 137 macosx { - int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, - int sx, int sy, int dx, int dy, - unsigned int w, unsigned int h) -} -declare 138 macosx { - Region XPolygonRegion(XPoint *pts, int n, int rule) -} -declare 139 macosx { - int XPointInRegion(Region rgn, int x, int y) -} -declare 140 macosx { - XVaNestedList XVaCreateNestedList(int dummy, ...) -} -declare 141 macosx { - char *XSetICValues(XIC xic, ...) -} -declare 142 macosx { - char *XGetICValues(XIC xic, ...) -} -declare 143 macosx { - void XSetICFocus(XIC xic) -} -declare 144 macosx { - void XDestroyIC(XIC xic) -} -declare 145 macosx { - Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, - XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) -} -declare 146 macosx { - Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, - unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, - XColor _Xconst *x2) -} -declare 147 macosx { - void XFreeFontSet(Display *display, XFontSet fontset) -} -declare 148 macosx { - int XCloseIM(XIM im) -} -declare 149 macosx { - Bool XRegisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, - char *res_name, char *res_class, XIDProc callback, XPointer client_data) -} -declare 150 macosx { - Bool XUnregisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, - char *res_name, char *res_class, XIDProc callback, XPointer client_data) -} -declare 151 macosx { - char *XSetLocaleModifiers(const char *modifier_list) -} -declare 152 macosx { - XIM XOpenIM(Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, - char *res_class) -} -declare 153 macosx { - char *XGetIMValues(XIM im, ...) -} -declare 154 macosx { - char *XSetIMValues(XIM im, ...) -} -declare 155 macosx { - XFontSet XCreateFontSet(Display *display, _Xconst char *base_font_name_list, - char ***missing_charset_list, int *missing_charset_count, char **def_string) -} -declare 156 macosx { - void XFreeStringList(char **list) -} -declare 157 macosx { - KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, int i) -} -declare 158 macosx { +declare 158 { Display *XkbOpenDisplay(const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason) } diff --git a/generic/tkInt.h b/generic/tkInt.h index ebfa348..9f5a31b 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -549,17 +549,6 @@ typedef struct TkDisplay { * The following field were all added for Tk8.3 */ -#if TCL_MAJOR_VERSION < 9 -#if !defined(TK_NO_DEPRECATED) - int mouseButtonState; /* Current mouse button state for this - * display. NOT USED as of 8.6.10 */ - Window mouseButtonWindow; /* Window the button state was set in, added - * in Tk 8.4. */ -#else - int notused1; - XID notused2; -#endif /* !TK_NO_DEPRECATED */ -#endif Tk_Window warpWindow; Tk_Window warpMainwin; /* For finding the root window for warping * purposes. */ diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 84f360d..b6c2543 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -202,9 +202,7 @@ EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force); EXTERN void TkpDisplayWarning(const char *msg, const char *title); /* 59 */ EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name); -/* 60 */ -TK_DEPRECATED("renamed to Tk_GetOtherWindow") -TkWindow * TkpGetOtherWindow(TkWindow *winPtr); +/* Slot 60 is reserved */ /* 61 */ EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr); /* 62 */ @@ -212,14 +210,10 @@ EXTERN int TkpInit(Tcl_Interp *interp); /* 63 */ EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable); -/* 64 */ -TK_DEPRECATED("renamed to Tk_MakeContainer") -void TkpMakeContainer(Tk_Window tkwin); +/* Slot 64 is reserved */ /* 65 */ EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient); -/* 66 */ -TK_DEPRECATED("renamed to Tk_MakeWindow") -Window TkpMakeWindow(TkWindow *winPtr, Window parent); +/* Slot 66 is reserved */ /* 67 */ EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName); @@ -238,14 +232,8 @@ EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr); /* 73 */ EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr); -/* 74 */ -TK_DEPRECATED("renamed to Tk_SetMainMenubar") -void TkpSetMainMenubar(Tcl_Interp *interp, - Tk_Window tkwin, const char *menuName); -/* 75 */ -TK_DEPRECATED("renamed to Tk_UseWindow") -int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, - const char *string); +/* Slot 74 is reserved */ +/* Slot 75 is reserved */ /* Slot 76 is reserved */ /* 77 */ EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr, @@ -270,11 +258,7 @@ EXTERN void TkSelInit(Tk_Window tkwin); /* 83 */ EXTERN void TkSelPropProc(XEvent *eventPtr); /* Slot 84 is reserved */ -/* 85 */ -TK_DEPRECATED("renamed to Tk_SetWindowMenubar") -void TkSetWindowMenuBar(Tcl_Interp *interp, - Tk_Window tkwin, const char *oldMenuName, - const char *menuName); +/* Slot 85 is reserved */ /* 86 */ EXTERN KeySym TkStringToKeysym(const char *name); /* 87 */ @@ -335,10 +319,7 @@ EXTERN const char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 110 */ EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont); -/* 111 */ -TK_DEPRECATED("renamed to Tk_GetSystemDefault") -Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin, - const char *dbName, const char *className); +/* Slot 111 is reserved */ /* 112 */ EXTERN void TkpMenuThreadInit(void); /* 113 */ @@ -384,11 +365,7 @@ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display, /* Slot 132 is reserved */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ -/* 135 */ -TK_DEPRECATED("renamed to Tk_DrawHighlightBorder") -void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, - GC bgGC, int highlightWidth, - Drawable drawable); +/* Slot 135 is reserved */ /* 136 */ EXTERN void TkSetFocusWin(TkWindow *winPtr, int force); /* 137 */ @@ -637,13 +614,13 @@ typedef struct TkIntStubs { void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */ void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */ void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */ - TCL_DEPRECATED_API("renamed to Tk_GetOtherWindow") TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */ + void (*reserved60)(void); TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */ int (*tkpInit) (Tcl_Interp *interp); /* 62 */ void (*tkpInitializeMenuBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 63 */ - TCL_DEPRECATED_API("renamed to Tk_MakeContainer") void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */ + void (*reserved64)(void); void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */ - TCL_DEPRECATED_API("renamed to Tk_MakeWindow") Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */ + void (*reserved66)(void); void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */ TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */ int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */ @@ -651,8 +628,8 @@ typedef struct TkIntStubs { double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */ int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */ void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */ - TCL_DEPRECATED_API("renamed to Tk_SetMainMenubar") void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */ - TCL_DEPRECATED_API("renamed to Tk_UseWindow") int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */ + void (*reserved74)(void); + void (*reserved75)(void); void (*reserved76)(void); void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */ int (*tkReadBitmapFile) (Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return); /* 78 */ @@ -662,7 +639,7 @@ typedef struct TkIntStubs { void (*tkSelInit) (Tk_Window tkwin); /* 82 */ void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */ void (*reserved84)(void); - TCL_DEPRECATED_API("renamed to Tk_SetWindowMenubar") void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */ + void (*reserved85)(void); KeySym (*tkStringToKeysym) (const char *name); /* 86 */ int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */ void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */ @@ -688,7 +665,7 @@ typedef struct TkIntStubs { int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */ const char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */ void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */ - TCL_DEPRECATED_API("renamed to Tk_GetSystemDefault") Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */ + void (*reserved111)(void); void (*tkpMenuThreadInit) (void); /* 112 */ int (*xClipBox) (Region rgn, XRectangle *rect_return); /* 113 */ Region (*xCreateRegion) (void); /* 114 */ @@ -739,7 +716,7 @@ typedef struct TkIntStubs { void (*reserved132)(void); void (*reserved133)(void); void (*reserved134)(void); - TCL_DEPRECATED_API("renamed to Tk_DrawHighlightBorder") void (*tkpDrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 135 */ + void (*reserved135)(void); void (*tkSetFocusWin) (TkWindow *winPtr, int force); /* 136 */ void (*tkpSetKeycodeAndState) (Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 137 */ KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */ @@ -923,20 +900,17 @@ extern const TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkpDisplayWarning) /* 58 */ #define TkpGetAppName \ (tkIntStubsPtr->tkpGetAppName) /* 59 */ -#define TkpGetOtherWindow \ - (tkIntStubsPtr->tkpGetOtherWindow) /* 60 */ +/* Slot 60 is reserved */ #define TkpGetWrapperWindow \ (tkIntStubsPtr->tkpGetWrapperWindow) /* 61 */ #define TkpInit \ (tkIntStubsPtr->tkpInit) /* 62 */ #define TkpInitializeMenuBindings \ (tkIntStubsPtr->tkpInitializeMenuBindings) /* 63 */ -#define TkpMakeContainer \ - (tkIntStubsPtr->tkpMakeContainer) /* 64 */ +/* Slot 64 is reserved */ #define TkpMakeMenuWindow \ (tkIntStubsPtr->tkpMakeMenuWindow) /* 65 */ -#define TkpMakeWindow \ - (tkIntStubsPtr->tkpMakeWindow) /* 66 */ +/* Slot 66 is reserved */ #define TkpMenuNotifyToplevelCreate \ (tkIntStubsPtr->tkpMenuNotifyToplevelCreate) /* 67 */ #define TkpOpenDisplay \ @@ -951,10 +925,8 @@ extern const TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkPositionInTree) /* 72 */ #define TkpRedirectKeyEvent \ (tkIntStubsPtr->tkpRedirectKeyEvent) /* 73 */ -#define TkpSetMainMenubar \ - (tkIntStubsPtr->tkpSetMainMenubar) /* 74 */ -#define TkpUseWindow \ - (tkIntStubsPtr->tkpUseWindow) /* 75 */ +/* Slot 74 is reserved */ +/* Slot 75 is reserved */ /* Slot 76 is reserved */ #define TkQueueEventForAllChildren \ (tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */ @@ -971,8 +943,7 @@ extern const TkIntStubs *tkIntStubsPtr; #define TkSelPropProc \ (tkIntStubsPtr->tkSelPropProc) /* 83 */ /* Slot 84 is reserved */ -#define TkSetWindowMenuBar \ - (tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */ +/* Slot 85 is reserved */ #define TkStringToKeysym \ (tkIntStubsPtr->tkStringToKeysym) /* 86 */ #define TkThickPolyLineToArea \ @@ -1023,8 +994,7 @@ extern const TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkpGetString) /* 109 */ #define TkpGetSubFonts \ (tkIntStubsPtr->tkpGetSubFonts) /* 110 */ -#define TkpGetSystemDefault \ - (tkIntStubsPtr->tkpGetSystemDefault) /* 111 */ +/* Slot 111 is reserved */ #define TkpMenuThreadInit \ (tkIntStubsPtr->tkpMenuThreadInit) /* 112 */ #define XClipBox \ @@ -1065,8 +1035,7 @@ extern const TkIntStubs *tkIntStubsPtr; /* Slot 132 is reserved */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ -#define TkpDrawHighlightBorder \ - (tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */ +/* Slot 135 is reserved */ #define TkSetFocusWin \ (tkIntStubsPtr->tkSetFocusWin) /* 136 */ #define TkpSetKeycodeAndState \ @@ -1178,17 +1147,6 @@ extern const TkIntStubs *tkIntStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#if !defined(TK_NO_DEPRECATED) -# define TkSetWindowMenuBar Tk_SetWindowMenubar -# define TkpDrawHighlightBorder Tk_DrawHighlightBorder -# define TkpUseWindow Tk_UseWindow -# define TkpSetMainMenubar Tk_SetMainMenubar -# define TkpGetOtherWindow ((TkWindow *(*)(TkWindow *))(void *)Tk_GetOtherWindow) -# define TkpGetSystemDefault Tk_GetSystemDefault -# define TkpMakeContainer Tk_MakeContainer -# define TkpMakeWindow ((Window (*)(TkWindow *, Window))(void *)Tk_MakeWindow) -#endif - #if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS) # undef TkpWillDrawWidget # undef TkpRedrawWidget diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 48948a0..aedad62 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -145,12 +145,10 @@ EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, EXTERN Tk_Window TkpGetCapture(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -/* 0 */ -EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, - int active); +/* Slot 0 is reserved */ /* Slot 1 is reserved */ /* 2 */ -EXTERN void TkGenerateActivateEvents_(TkWindow *winPtr, +EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* 3 */ EXTERN void TkPointerDeadWindow(TkWindow *winPtr); @@ -187,9 +185,7 @@ EXTERN void TkMacOSXHandleMenuSelect(short theMenu, /* 21 */ EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag); -/* 22 */ -EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont, - unsigned int searchChar); +/* Slot 22 is reserved */ /* 23 */ EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr); /* 24 */ @@ -203,8 +199,7 @@ EXTERN int TkMacOSXResizable(TkWindow *winPtr); EXTERN void TkMacOSXSetHelpMenuItemCount(void); /* 29 */ EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag); -/* 30 */ -EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable); +/* Slot 30 is reserved */ /* 31 */ EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort); /* 32 */ @@ -265,29 +260,21 @@ EXTERN void TkCreateXEventSource(void); /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); -/* 3 */ -EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); -/* 4 */ -EXTERN void TkpSync(Display *display); -/* 5 */ -EXTERN Window TkUnixContainerId(TkWindow *winPtr); -/* 6 */ -EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); -/* 7 */ -EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +/* Slot 3 is reserved */ +/* Slot 4 is reserved */ +/* Slot 5 is reserved */ +/* Slot 6 is reserved */ +/* Slot 7 is reserved */ /* 8 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); /* 9 */ EXTERN void TkWmCleanup(TkDisplay *dispPtr); -/* 10 */ -EXTERN void TkSendCleanup(TkDisplay *dispPtr); +/* Slot 10 is reserved */ /* Slot 11 is reserved */ /* 12 */ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); -/* 13 */ -EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, - Tcl_Size objc, Tcl_Obj *const objv[]); +/* Slot 13 is reserved */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ @@ -313,19 +300,19 @@ EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* 38 */ -EXTERN int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap); +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ -EXTERN void TkpSync_(Display *display); +EXTERN void TkpSync(Display *display); /* 40 */ -EXTERN Window TkUnixContainerId_(TkWindow *winPtr); +EXTERN Window TkUnixContainerId(TkWindow *winPtr); /* 41 */ -EXTERN int TkUnixDoOneXEvent_(Tcl_Time *timePtr); +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); /* 42 */ -EXTERN void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar); +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); /* 43 */ -EXTERN void TkWmCleanup_(TkDisplay *dispPtr); +EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* 44 */ -EXTERN void TkSendCleanup_(TkDisplay *dispPtr); +EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 45 */ EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); @@ -386,9 +373,9 @@ typedef struct TkIntPlatStubs { Tk_Window (*tkpGetCapture) (void); /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ + void (*reserved0)(void); void (*reserved1)(void); - void (*tkGenerateActivateEvents_) (TkWindow *winPtr, int active); /* 2 */ + void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ @@ -408,7 +395,7 @@ typedef struct TkIntPlatStubs { void (*reserved19)(void); void (*reserved20)(void); void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */ - int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */ + void (*reserved22)(void); void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */ void * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */ void (*tkMacOSXMenuClick) (void); /* 25 */ @@ -416,7 +403,7 @@ typedef struct TkIntPlatStubs { int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */ void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */ void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */ - void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */ + void (*reserved30)(void); void (*tkMacOSXSetUpGraphicsPort) (GC gc, void *destPort); /* 31 */ void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */ void (*reserved33)(void); @@ -447,17 +434,17 @@ typedef struct TkIntPlatStubs { void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ - int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */ - void (*tkpSync) (Display *display); /* 4 */ - Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */ - int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */ - void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */ + void (*reserved3)(void); + void (*reserved4)(void); + void (*reserved5)(void); + void (*reserved6)(void); + void (*reserved7)(void); int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */ void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ - void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */ + void (*reserved10)(void); void (*reserved11)(void); int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ - int (*tkpTestsendCmd_) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 13 */ + void (*reserved13)(void); void (*reserved14)(void); void (*reserved15)(void); void (*reserved16)(void); @@ -482,13 +469,13 @@ typedef struct TkIntPlatStubs { void (*reserved35)(void); void (*reserved36)(void); void (*reserved37)(void); - int (*tkpCmapStressed_) (Tk_Window tkwin, Colormap colormap); /* 38 */ - void (*tkpSync_) (Display *display); /* 39 */ - Window (*tkUnixContainerId_) (TkWindow *winPtr); /* 40 */ - int (*tkUnixDoOneXEvent_) (Tcl_Time *timePtr); /* 41 */ - void (*tkUnixSetMenubar_) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*tkWmCleanup_) (TkDisplay *dispPtr); /* 43 */ - void (*tkSendCleanup_) (TkDisplay *dispPtr); /* 44 */ + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ + void (*tkpSync) (Display *display); /* 39 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ #endif /* X11 */ } TkIntPlatStubs; @@ -601,11 +588,10 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpGetCapture) /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -#define TkGenerateActivateEvents \ - (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */ +/* Slot 0 is reserved */ /* Slot 1 is reserved */ -#define TkGenerateActivateEvents_ \ - (tkIntPlatStubsPtr->tkGenerateActivateEvents_) /* 2 */ +#define TkGenerateActivateEvents \ + (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkPointerDeadWindow \ (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ #define TkpSetCapture \ @@ -639,8 +625,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 20 is reserved */ #define TkMacOSXInvalidateWindow \ (tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */ -#define TkMacOSXIsCharacterMissing \ - (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */ +/* Slot 22 is reserved */ #define TkMacOSXMakeRealWindowExist \ (tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */ #define TkMacOSXMakeStippleMap \ @@ -654,8 +639,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */ #define TkMacOSXSetScrollbarGrow \ (tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */ -#define TkMacOSXSetUpClippingRgn \ - (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */ +/* Slot 30 is reserved */ #define TkMacOSXSetUpGraphicsPort \ (tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */ #define TkMacOSXUpdateClipRgn \ @@ -710,27 +694,20 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ -#define TkpCmapStressed \ - (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */ -#define TkpSync \ - (tkIntPlatStubsPtr->tkpSync) /* 4 */ -#define TkUnixContainerId \ - (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */ -#define TkUnixDoOneXEvent \ - (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */ -#define TkUnixSetMenubar \ - (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */ +/* Slot 3 is reserved */ +/* Slot 4 is reserved */ +/* Slot 5 is reserved */ +/* Slot 6 is reserved */ +/* Slot 7 is reserved */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ #define TkWmCleanup \ (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ -#define TkSendCleanup \ - (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */ +/* Slot 10 is reserved */ /* Slot 11 is reserved */ #define TkpWmSetState \ (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ -#define TkpTestsendCmd_ \ - (tkIntPlatStubsPtr->tkpTestsendCmd_) /* 13 */ +/* Slot 13 is reserved */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ @@ -755,20 +732,20 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ -#define TkpCmapStressed_ \ - (tkIntPlatStubsPtr->tkpCmapStressed_) /* 38 */ -#define TkpSync_ \ - (tkIntPlatStubsPtr->tkpSync_) /* 39 */ -#define TkUnixContainerId_ \ - (tkIntPlatStubsPtr->tkUnixContainerId_) /* 40 */ -#define TkUnixDoOneXEvent_ \ - (tkIntPlatStubsPtr->tkUnixDoOneXEvent_) /* 41 */ -#define TkUnixSetMenubar_ \ - (tkIntPlatStubsPtr->tkUnixSetMenubar_) /* 42 */ -#define TkWmCleanup_ \ - (tkIntPlatStubsPtr->tkWmCleanup_) /* 43 */ -#define TkSendCleanup_ \ - (tkIntPlatStubsPtr->tkSendCleanup_) /* 44 */ +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 39 */ +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #define TkpTestsendCmd \ (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ #endif /* X11 */ diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 360594a..6c247ca 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -56,7 +56,6 @@ extern "C" { * Exported function declarations: */ -#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); @@ -475,436 +474,11 @@ EXTERN KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, EXTERN Display * XkbOpenDisplay(const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason); -#endif /* WIN */ -#ifdef MAC_OSX_TCL /* MACOSX */ -/* 0 */ -EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, - _Xconst char *dash_list, int n); -/* 1 */ -EXTERN XModifierKeymap * XGetModifierMapping(Display *d); -/* 2 */ -EXTERN XImage * XCreateImage(Display *d, Visual *v, unsigned int ui1, - int i1, int i2, char *cp, unsigned int ui2, - unsigned int ui3, int i3, int i4); -/* 3 */ -EXTERN XImage * XGetImage(Display *d, Drawable dr, int i1, int i2, - unsigned int ui1, unsigned int ui2, - unsigned long ul, int i3); -/* 4 */ -EXTERN char * XGetAtomName(Display *d, Atom a); -/* 5 */ -EXTERN char * XKeysymToString(KeySym k); -/* 6 */ -EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v, - int i); -/* 7 */ -EXTERN GContext XGContextFromGC(GC g); -/* 8 */ -EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i); -/* 9 */ -EXTERN KeySym XStringToKeysym(_Xconst char *c); -/* 10 */ -EXTERN Window XRootWindow(Display *d, int i); -/* 11 */ -EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); -/* 12 */ -EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); -/* 13 */ -EXTERN int XBell(Display *d, int i); -/* 14 */ -EXTERN int XChangeProperty(Display *d, Window w, Atom a1, - Atom a2, int i1, int i2, - _Xconst unsigned char *c, int i3); -/* 15 */ -EXTERN int XChangeWindowAttributes(Display *d, Window w, - unsigned long ul, XSetWindowAttributes *x); -/* 16 */ -EXTERN int XConfigureWindow(Display *d, Window w, - unsigned int i, XWindowChanges *x); -/* 17 */ -EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, - GC g, int i1, int i2, unsigned int ui1, - unsigned int ui2, int i3, int i4); -/* 18 */ -EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, - GC g, int i1, int i2, unsigned int ui1, - unsigned int ui2, int i3, int i4, - unsigned long ul); -/* 19 */ -EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, - _Xconst char *data, unsigned int width, - unsigned int height); -/* 20 */ -EXTERN int XDefineCursor(Display *d, Window w, Cursor c); -/* 21 */ -EXTERN int XDestroyWindow(Display *d, Window w); -/* 22 */ -EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, - int i2, unsigned int ui1, unsigned int ui2, - int i3, int i4); -/* 23 */ -EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, - int i1, int i2); -/* 24 */ -EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, - int i2, unsigned int ui1, unsigned int ui2); -/* 25 */ -EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, - int i2, unsigned int ui1, unsigned int ui2, - int i3, int i4); -/* 26 */ -EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, - XPoint *x, int i1, int i2, int i3); -/* 27 */ -EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, - XRectangle *x, int i); -/* 28 */ -EXTERN int XFreeColormap(Display *d, Colormap c); -/* 29 */ -EXTERN int XFreeColors(Display *d, Colormap c, - unsigned long *ulp, int i, unsigned long ul); -/* 30 */ -EXTERN int XFreeModifiermap(XModifierKeymap *x); -/* 31 */ -EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, - int *i1, int *i2, unsigned int *ui1, - unsigned int *ui2, unsigned int *ui3, - unsigned int *ui4); -/* 32 */ -EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, - long l1, long l2, Bool b, Atom a2, Atom *ap, - int *ip, unsigned long *ulp1, - unsigned long *ulp2, unsigned char **cpp); -/* 33 */ -EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1, - int i2, Time t); -/* 34 */ -EXTERN int XGrabPointer(Display *d, Window w1, Bool b, - unsigned int ui, int i1, int i2, Window w2, - Cursor c, Time t); -/* 35 */ -EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k); -/* 36 */ -EXTERN int XMapWindow(Display *d, Window w); -/* 37 */ -EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, - int i2, unsigned int ui1, unsigned int ui2); -/* 38 */ -EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); -/* 39 */ -EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, - Window *w3, int *i1, int *i2, int *i3, - int *i4, unsigned int *ui); -/* 40 */ -EXTERN int XRaiseWindow(Display *d, Window w); -/* 41 */ -EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); -/* 42 */ -EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, - unsigned int ui2); -/* 43 */ -EXTERN int XSelectInput(Display *d, Window w, long l); -/* 44 */ -EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, - XEvent *x); -/* 45 */ -EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); -/* 46 */ -EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); -/* 47 */ -EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, - Time t); -/* 48 */ -EXTERN int XSetWindowBackground(Display *d, Window w, - unsigned long ul); -/* 49 */ -EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, - Pixmap p); -/* 50 */ -EXTERN int XSetWindowBorder(Display *d, Window w, - unsigned long ul); -/* 51 */ -EXTERN int XSetWindowBorderPixmap(Display *d, Window w, - Pixmap p); -/* 52 */ -EXTERN int XSetWindowBorderWidth(Display *d, Window w, - unsigned int ui); -/* 53 */ -EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); -/* 54 */ -EXTERN int XUngrabKeyboard(Display *d, Time t); -/* 55 */ -EXTERN int XUngrabPointer(Display *d, Time t); -/* 56 */ -EXTERN int XUnmapWindow(Display *d, Window w); -/* 57 */ -EXTERN int TkPutImage(unsigned long *colors, int ncolors, - Display *display, Drawable d, GC gc, - XImage *image, int src_x, int src_y, - int dest_x, int dest_y, unsigned int width, - unsigned int height); -/* 58 */ -EXTERN Status XParseColor(Display *display, Colormap map, - _Xconst char *spec, XColor *colorPtr); -/* 59 */ -EXTERN GC XCreateGC(Display *display, Drawable d, - unsigned long valuemask, XGCValues *values); -/* 60 */ -EXTERN int XFreeGC(Display *display, GC gc); -/* 61 */ -EXTERN Atom XInternAtom(Display *display, - _Xconst char *atom_name, Bool only_if_exists); -/* 62 */ -EXTERN int XSetBackground(Display *display, GC gc, - unsigned long foreground); -/* 63 */ -EXTERN int XSetForeground(Display *display, GC gc, - unsigned long foreground); -/* 64 */ -EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); -/* 65 */ -EXTERN int XSetClipOrigin(Display *display, GC gc, - int clip_x_origin, int clip_y_origin); -/* 66 */ -EXTERN int XSetTSOrigin(Display *display, GC gc, - int ts_x_origin, int ts_y_origin); -/* 67 */ -EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, - XGCValues *values); -/* 68 */ -EXTERN int XSetFont(Display *display, GC gc, Font font); -/* 69 */ -EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); -/* 70 */ -EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); -/* 71 */ -EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); -/* 72 */ -EXTERN int XSetFillStyle(Display *display, GC gc, - int fill_style); -/* 73 */ -EXTERN int XSetFunction(Display *display, GC gc, int function); -/* 74 */ -EXTERN int XSetLineAttributes(Display *display, GC gc, - unsigned int line_width, int line_style, - int cap_style, int join_style); -/* 75 */ -EXTERN int _XInitImageFuncPtrs(XImage *image); -/* 76 */ -EXTERN XIC XCreateIC(XIM xim, ...); -/* 77 */ -EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, - XVisualInfo *vinfo_template, - int *nitems_return); -/* 78 */ -EXTERN void XSetWMClientMachine(Display *display, Window w, - XTextProperty *text_prop); -/* 79 */ -EXTERN Status XStringListToTextProperty(char **list, int count, - XTextProperty *text_prop_return); -/* 80 */ -EXTERN int XDrawSegments(Display *display, Drawable d, GC gc, - XSegment *segments, int nsegments); -/* 81 */ -EXTERN int XForceScreenSaver(Display *display, int mode); -/* 82 */ -EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, - int y1, int x2, int y2); -/* 83 */ -EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, - int x, int y, unsigned int width, - unsigned int height); -/* 84 */ -EXTERN int XClearWindow(Display *d, Window w); -/* 85 */ -EXTERN int XDrawPoint(Display *display, Drawable d, GC gc, - int x, int y); -/* 86 */ -EXTERN int XDrawPoints(Display *display, Drawable d, GC gc, - XPoint *points, int npoints, int mode); -/* 87 */ -EXTERN int XWarpPointer(Display *display, Window src_w, - Window dest_w, int src_x, int src_y, - unsigned int src_width, - unsigned int src_height, int dest_x, - int dest_y); -/* 88 */ -EXTERN int XQueryColor(Display *display, Colormap colormap, - XColor *def_in_out); -/* 89 */ -EXTERN int XQueryColors(Display *display, Colormap colormap, - XColor *defs_in_out, int ncolors); -/* 90 */ -EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, - Window *w3, Window **w4, unsigned int *ui); -/* 91 */ -EXTERN int XSync(Display *display, Bool discard); -/* 92 */ -EXTERN Bool XTranslateCoordinates(Display *d, Window w1, - Window w2, int i1, int i2, int *i3, int *i4, - Window *w3); -/* 93 */ -EXTERN int XDeleteProperty(Display *d, Window w, Atom a); -/* 94 */ -EXTERN int XFreeCursor(Display *d, Cursor c); -/* 95 */ -EXTERN int XGetInputFocus(Display *d, Window *w, int *i); -/* 96 */ -EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, - char *c, int i, KeySym *k, Status *s); -/* 97 */ -EXTERN int XNextEvent(Display *d, XEvent *x); -/* 98 */ -EXTERN int XPutBackEvent(Display *d, XEvent *x); -/* 99 */ -EXTERN int XSetCommand(Display *d, Window w, char **c, int i); -/* 100 */ -EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); -/* 101 */ -EXTERN Status XGetWindowAttributes(Display *d, Window w, - XWindowAttributes *x); -/* 102 */ -EXTERN Status XGetWMColormapWindows(Display *d, Window w, - Window **wpp, int *ip); -/* 103 */ -EXTERN Status XIconifyWindow(Display *d, Window w, int i); -/* 104 */ -EXTERN Status XWithdrawWindow(Display *d, Window w, int i); -/* 105 */ -EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b); -/* 106 */ -EXTERN int XSetClipRectangles(Display *display, GC gc, - int clip_x_origin, int clip_y_origin, - XRectangle rectangles[], int n, int ordering); -/* 107 */ -EXTERN int XFlush(Display *display); -/* 108 */ -EXTERN int XGrabServer(Display *display); -/* 109 */ -EXTERN int XUngrabServer(Display *display); -/* 110 */ -EXTERN int XFree(void *data); -/* 111 */ -EXTERN int XNoOp(Display *display); -/* 112 */ -EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); -/* 113 */ -EXTERN Status XLookupColor(Display *d, Colormap c1, - _Xconst char *c2, XColor *x1, XColor *x2); -/* 114 */ -EXTERN VisualID XVisualIDFromVisual(Visual *visual); -/* Slot 115 is reserved */ -/* Slot 116 is reserved */ -/* Slot 117 is reserved */ -/* Slot 118 is reserved */ -/* Slot 119 is reserved */ -/* 120 */ -EXTERN int XOffsetRegion(Region rgn, int dx, int dy); -/* 121 */ -EXTERN int XUnionRegion(Region srca, Region srcb, - Region dr_return); -/* 122 */ -EXTERN Window XCreateWindow(Display *display, Window parent, int x, - int y, unsigned int width, - unsigned int height, - unsigned int border_width, int depth, - unsigned int clazz, Visual *visual, - unsigned long value_mask, - XSetWindowAttributes *attributes); -/* Slot 123 is reserved */ -/* Slot 124 is reserved */ -/* Slot 125 is reserved */ -/* Slot 126 is reserved */ -/* Slot 127 is reserved */ -/* Slot 128 is reserved */ -/* 129 */ -EXTERN int XLowerWindow(Display *d, Window w); -/* 130 */ -EXTERN int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, - int n); -/* 131 */ -EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, - int n); -/* 132 */ -EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc, - XRectangle *r, int n); -/* Slot 133 is reserved */ -/* Slot 134 is reserved */ -/* Slot 135 is reserved */ -/* 136 */ -EXTERN int XReparentWindow(Display *d, Window w, Window p, - int x, int y); -/* 137 */ -EXTERN int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, - int sx, int sy, int dx, int dy, - unsigned int w, unsigned int h); -/* 138 */ -EXTERN Region XPolygonRegion(XPoint *pts, int n, int rule); -/* 139 */ -EXTERN int XPointInRegion(Region rgn, int x, int y); -/* 140 */ -EXTERN XVaNestedList XVaCreateNestedList(int dummy, ...); -/* 141 */ -EXTERN char * XSetICValues(XIC xic, ...); -/* 142 */ -EXTERN char * XGetICValues(XIC xic, ...); -/* 143 */ -EXTERN void XSetICFocus(XIC xic); -/* 144 */ -EXTERN void XDestroyIC(XIC xic); -/* 145 */ -EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, - XColor *x1, XColor *x2, unsigned int ui1, - unsigned int ui2); -/* 146 */ -EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, - unsigned int ui1, unsigned int ui2, - XColor _Xconst *x1, XColor _Xconst *x2); -/* 147 */ -EXTERN void XFreeFontSet(Display *display, XFontSet fontset); -/* 148 */ -EXTERN int XCloseIM(XIM im); -/* 149 */ -EXTERN Bool XRegisterIMInstantiateCallback(Display *dpy, - struct _XrmHashBucketRec *rbd, - char *res_name, char *res_class, - XIDProc callback, XPointer client_data); -/* 150 */ -EXTERN Bool XUnregisterIMInstantiateCallback(Display *dpy, - struct _XrmHashBucketRec *rbd, - char *res_name, char *res_class, - XIDProc callback, XPointer client_data); -/* 151 */ -EXTERN char * XSetLocaleModifiers(const char *modifier_list); -/* 152 */ -EXTERN XIM XOpenIM(Display *dpy, struct _XrmHashBucketRec *rdb, - char *res_name, char *res_class); -/* 153 */ -EXTERN char * XGetIMValues(XIM im, ...); -/* 154 */ -EXTERN char * XSetIMValues(XIM im, ...); -/* 155 */ -EXTERN XFontSet XCreateFontSet(Display *display, - _Xconst char *base_font_name_list, - char ***missing_charset_list, - int *missing_charset_count, - char **def_string); -/* 156 */ -EXTERN void XFreeStringList(char **list); -/* 157 */ -EXTERN KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, - int i); -/* 158 */ -EXTERN Display * XkbOpenDisplay(const char *name, int *ev_rtrn, - int *err_rtrn, int *major_rtrn, - int *minor_rtrn, int *reason); -#endif /* MACOSX */ typedef struct TkIntXlibStubs { int magic; void *hooks; -#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ @@ -1064,168 +638,6 @@ typedef struct TkIntXlibStubs { void (*xFreeStringList) (char **list); /* 156 */ KeySym (*xkbKeycodeToKeysym) (Display *d, unsigned int k, int g, int i); /* 157 */ Display * (*xkbOpenDisplay) (const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason); /* 158 */ -#endif /* WIN */ -#ifdef MAC_OSX_TCL /* MACOSX */ - int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ - XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ - XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ - XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ - char * (*xGetAtomName) (Display *d, Atom a); /* 4 */ - char * (*xKeysymToString) (KeySym k); /* 5 */ - Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ - GContext (*xGContextFromGC) (GC g); /* 7 */ - KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 8 */ - KeySym (*xStringToKeysym) (_Xconst char *c); /* 9 */ - Window (*xRootWindow) (Display *d, int i); /* 10 */ - XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ - Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ - int (*xBell) (Display *d, int i); /* 13 */ - int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ - int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ - int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ - int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ - int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */ - Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ - int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ - int (*xDestroyWindow) (Display *d, Window w); /* 21 */ - int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ - int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ - int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ - int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ - int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ - int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ - int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ - int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ - int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ - Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ - int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */ - int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ - int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 34 */ - KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 35 */ - int (*xMapWindow) (Display *d, Window w); /* 36 */ - int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 37 */ - int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 38 */ - Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 39 */ - int (*xRaiseWindow) (Display *d, Window w); /* 40 */ - int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 41 */ - int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 42 */ - int (*xSelectInput) (Display *d, Window w, long l); /* 43 */ - Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ - int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ - int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ - int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ - int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ - int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ - int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ - int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 51 */ - int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ - int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ - int (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ - int (*xUngrabPointer) (Display *d, Time t); /* 55 */ - int (*xUnmapWindow) (Display *d, Window w); /* 56 */ - int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ - Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ - GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ - int (*xFreeGC) (Display *display, GC gc); /* 60 */ - Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ - int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ - int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ - int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ - int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ - int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ - int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ - int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ - int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ - int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ - int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ - int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ - int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ - int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ - int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ - XIC (*xCreateIC) (XIM xim, ...); /* 76 */ - XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ - void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 78 */ - Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ - int (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ - int (*xForceScreenSaver) (Display *display, int mode); /* 81 */ - int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ - int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ - int (*xClearWindow) (Display *d, Window w); /* 84 */ - int (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ - int (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ - int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ - int (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ - int (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ - Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ - int (*xSync) (Display *display, Bool discard); /* 91 */ - Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 92 */ - int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 93 */ - int (*xFreeCursor) (Display *d, Cursor c); /* 94 */ - int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 95 */ - int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 96 */ - int (*xNextEvent) (Display *d, XEvent *x); /* 97 */ - int (*xPutBackEvent) (Display *d, XEvent *x); /* 98 */ - int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 99 */ - int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 100 */ - Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 101 */ - Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 102 */ - Status (*xIconifyWindow) (Display *d, Window w, int i); /* 103 */ - Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 104 */ - XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 105 */ - int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 106 */ - int (*xFlush) (Display *display); /* 107 */ - int (*xGrabServer) (Display *display); /* 108 */ - int (*xUngrabServer) (Display *display); /* 109 */ - int (*xFree) (void *data); /* 110 */ - int (*xNoOp) (Display *display); /* 111 */ - XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ - Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 113 */ - VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ - void (*reserved115)(void); - void (*reserved116)(void); - void (*reserved117)(void); - void (*reserved118)(void); - void (*reserved119)(void); - int (*xOffsetRegion) (Region rgn, int dx, int dy); /* 120 */ - int (*xUnionRegion) (Region srca, Region srcb, Region dr_return); /* 121 */ - Window (*xCreateWindow) (Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, Visual *visual, unsigned long value_mask, XSetWindowAttributes *attributes); /* 122 */ - void (*reserved123)(void); - void (*reserved124)(void); - void (*reserved125)(void); - void (*reserved126)(void); - void (*reserved127)(void); - void (*reserved128)(void); - int (*xLowerWindow) (Display *d, Window w); /* 129 */ - int (*xFillArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 130 */ - int (*xDrawArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 131 */ - int (*xDrawRectangles) (Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* 132 */ - void (*reserved133)(void); - void (*reserved134)(void); - void (*reserved135)(void); - int (*xReparentWindow) (Display *d, Window w, Window p, int x, int y); /* 136 */ - int (*xPutImage) (Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h); /* 137 */ - Region (*xPolygonRegion) (XPoint *pts, int n, int rule); /* 138 */ - int (*xPointInRegion) (Region rgn, int x, int y); /* 139 */ - XVaNestedList (*xVaCreateNestedList) (int dummy, ...); /* 140 */ - char * (*xSetICValues) (XIC xic, ...); /* 141 */ - char * (*xGetICValues) (XIC xic, ...); /* 142 */ - void (*xSetICFocus) (XIC xic); /* 143 */ - void (*xDestroyIC) (XIC xic); /* 144 */ - Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 145 */ - Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 146 */ - void (*xFreeFontSet) (Display *display, XFontSet fontset); /* 147 */ - int (*xCloseIM) (XIM im); /* 148 */ - Bool (*xRegisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 149 */ - Bool (*xUnregisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 150 */ - char * (*xSetLocaleModifiers) (const char *modifier_list); /* 151 */ - XIM (*xOpenIM) (Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, char *res_class); /* 152 */ - char * (*xGetIMValues) (XIM im, ...); /* 153 */ - char * (*xSetIMValues) (XIM im, ...); /* 154 */ - XFontSet (*xCreateFontSet) (Display *display, _Xconst char *base_font_name_list, char ***missing_charset_list, int *missing_charset_count, char **def_string); /* 155 */ - void (*xFreeStringList) (char **list); /* 156 */ - KeySym (*xkbKeycodeToKeysym) (Display *d, unsigned int k, int g, int i); /* 157 */ - Display * (*xkbOpenDisplay) (const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason); /* 158 */ -#endif /* MACOSX */ } TkIntXlibStubs; extern const TkIntXlibStubs *tkIntXlibStubsPtr; @@ -1240,7 +652,6 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -1545,313 +956,6 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xkbKeycodeToKeysym) /* 157 */ #define XkbOpenDisplay \ (tkIntXlibStubsPtr->xkbOpenDisplay) /* 158 */ -#endif /* WIN */ -#ifdef MAC_OSX_TCL /* MACOSX */ -#define XSetDashes \ - (tkIntXlibStubsPtr->xSetDashes) /* 0 */ -#define XGetModifierMapping \ - (tkIntXlibStubsPtr->xGetModifierMapping) /* 1 */ -#define XCreateImage \ - (tkIntXlibStubsPtr->xCreateImage) /* 2 */ -#define XGetImage \ - (tkIntXlibStubsPtr->xGetImage) /* 3 */ -#define XGetAtomName \ - (tkIntXlibStubsPtr->xGetAtomName) /* 4 */ -#define XKeysymToString \ - (tkIntXlibStubsPtr->xKeysymToString) /* 5 */ -#define XCreateColormap \ - (tkIntXlibStubsPtr->xCreateColormap) /* 6 */ -#define XGContextFromGC \ - (tkIntXlibStubsPtr->xGContextFromGC) /* 7 */ -#define XKeycodeToKeysym \ - (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 8 */ -#define XStringToKeysym \ - (tkIntXlibStubsPtr->xStringToKeysym) /* 9 */ -#define XRootWindow \ - (tkIntXlibStubsPtr->xRootWindow) /* 10 */ -#define XSetErrorHandler \ - (tkIntXlibStubsPtr->xSetErrorHandler) /* 11 */ -#define XAllocColor \ - (tkIntXlibStubsPtr->xAllocColor) /* 12 */ -#define XBell \ - (tkIntXlibStubsPtr->xBell) /* 13 */ -#define XChangeProperty \ - (tkIntXlibStubsPtr->xChangeProperty) /* 14 */ -#define XChangeWindowAttributes \ - (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 15 */ -#define XConfigureWindow \ - (tkIntXlibStubsPtr->xConfigureWindow) /* 16 */ -#define XCopyArea \ - (tkIntXlibStubsPtr->xCopyArea) /* 17 */ -#define XCopyPlane \ - (tkIntXlibStubsPtr->xCopyPlane) /* 18 */ -#define XCreateBitmapFromData \ - (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 19 */ -#define XDefineCursor \ - (tkIntXlibStubsPtr->xDefineCursor) /* 20 */ -#define XDestroyWindow \ - (tkIntXlibStubsPtr->xDestroyWindow) /* 21 */ -#define XDrawArc \ - (tkIntXlibStubsPtr->xDrawArc) /* 22 */ -#define XDrawLines \ - (tkIntXlibStubsPtr->xDrawLines) /* 23 */ -#define XDrawRectangle \ - (tkIntXlibStubsPtr->xDrawRectangle) /* 24 */ -#define XFillArc \ - (tkIntXlibStubsPtr->xFillArc) /* 25 */ -#define XFillPolygon \ - (tkIntXlibStubsPtr->xFillPolygon) /* 26 */ -#define XFillRectangles \ - (tkIntXlibStubsPtr->xFillRectangles) /* 27 */ -#define XFreeColormap \ - (tkIntXlibStubsPtr->xFreeColormap) /* 28 */ -#define XFreeColors \ - (tkIntXlibStubsPtr->xFreeColors) /* 29 */ -#define XFreeModifiermap \ - (tkIntXlibStubsPtr->xFreeModifiermap) /* 30 */ -#define XGetGeometry \ - (tkIntXlibStubsPtr->xGetGeometry) /* 31 */ -#define XGetWindowProperty \ - (tkIntXlibStubsPtr->xGetWindowProperty) /* 32 */ -#define XGrabKeyboard \ - (tkIntXlibStubsPtr->xGrabKeyboard) /* 33 */ -#define XGrabPointer \ - (tkIntXlibStubsPtr->xGrabPointer) /* 34 */ -#define XKeysymToKeycode \ - (tkIntXlibStubsPtr->xKeysymToKeycode) /* 35 */ -#define XMapWindow \ - (tkIntXlibStubsPtr->xMapWindow) /* 36 */ -#define XMoveResizeWindow \ - (tkIntXlibStubsPtr->xMoveResizeWindow) /* 37 */ -#define XMoveWindow \ - (tkIntXlibStubsPtr->xMoveWindow) /* 38 */ -#define XQueryPointer \ - (tkIntXlibStubsPtr->xQueryPointer) /* 39 */ -#define XRaiseWindow \ - (tkIntXlibStubsPtr->xRaiseWindow) /* 40 */ -#define XRefreshKeyboardMapping \ - (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 41 */ -#define XResizeWindow \ - (tkIntXlibStubsPtr->xResizeWindow) /* 42 */ -#define XSelectInput \ - (tkIntXlibStubsPtr->xSelectInput) /* 43 */ -#define XSendEvent \ - (tkIntXlibStubsPtr->xSendEvent) /* 44 */ -#define XSetIconName \ - (tkIntXlibStubsPtr->xSetIconName) /* 45 */ -#define XSetInputFocus \ - (tkIntXlibStubsPtr->xSetInputFocus) /* 46 */ -#define XSetSelectionOwner \ - (tkIntXlibStubsPtr->xSetSelectionOwner) /* 47 */ -#define XSetWindowBackground \ - (tkIntXlibStubsPtr->xSetWindowBackground) /* 48 */ -#define XSetWindowBackgroundPixmap \ - (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 49 */ -#define XSetWindowBorder \ - (tkIntXlibStubsPtr->xSetWindowBorder) /* 50 */ -#define XSetWindowBorderPixmap \ - (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 51 */ -#define XSetWindowBorderWidth \ - (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 52 */ -#define XSetWindowColormap \ - (tkIntXlibStubsPtr->xSetWindowColormap) /* 53 */ -#define XUngrabKeyboard \ - (tkIntXlibStubsPtr->xUngrabKeyboard) /* 54 */ -#define XUngrabPointer \ - (tkIntXlibStubsPtr->xUngrabPointer) /* 55 */ -#define XUnmapWindow \ - (tkIntXlibStubsPtr->xUnmapWindow) /* 56 */ -#define TkPutImage \ - (tkIntXlibStubsPtr->tkPutImage) /* 57 */ -#define XParseColor \ - (tkIntXlibStubsPtr->xParseColor) /* 58 */ -#define XCreateGC \ - (tkIntXlibStubsPtr->xCreateGC) /* 59 */ -#define XFreeGC \ - (tkIntXlibStubsPtr->xFreeGC) /* 60 */ -#define XInternAtom \ - (tkIntXlibStubsPtr->xInternAtom) /* 61 */ -#define XSetBackground \ - (tkIntXlibStubsPtr->xSetBackground) /* 62 */ -#define XSetForeground \ - (tkIntXlibStubsPtr->xSetForeground) /* 63 */ -#define XSetClipMask \ - (tkIntXlibStubsPtr->xSetClipMask) /* 64 */ -#define XSetClipOrigin \ - (tkIntXlibStubsPtr->xSetClipOrigin) /* 65 */ -#define XSetTSOrigin \ - (tkIntXlibStubsPtr->xSetTSOrigin) /* 66 */ -#define XChangeGC \ - (tkIntXlibStubsPtr->xChangeGC) /* 67 */ -#define XSetFont \ - (tkIntXlibStubsPtr->xSetFont) /* 68 */ -#define XSetArcMode \ - (tkIntXlibStubsPtr->xSetArcMode) /* 69 */ -#define XSetStipple \ - (tkIntXlibStubsPtr->xSetStipple) /* 70 */ -#define XSetFillRule \ - (tkIntXlibStubsPtr->xSetFillRule) /* 71 */ -#define XSetFillStyle \ - (tkIntXlibStubsPtr->xSetFillStyle) /* 72 */ -#define XSetFunction \ - (tkIntXlibStubsPtr->xSetFunction) /* 73 */ -#define XSetLineAttributes \ - (tkIntXlibStubsPtr->xSetLineAttributes) /* 74 */ -#define _XInitImageFuncPtrs \ - (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 75 */ -#define XCreateIC \ - (tkIntXlibStubsPtr->xCreateIC) /* 76 */ -#define XGetVisualInfo \ - (tkIntXlibStubsPtr->xGetVisualInfo) /* 77 */ -#define XSetWMClientMachine \ - (tkIntXlibStubsPtr->xSetWMClientMachine) /* 78 */ -#define XStringListToTextProperty \ - (tkIntXlibStubsPtr->xStringListToTextProperty) /* 79 */ -#define XDrawSegments \ - (tkIntXlibStubsPtr->xDrawSegments) /* 80 */ -#define XForceScreenSaver \ - (tkIntXlibStubsPtr->xForceScreenSaver) /* 81 */ -#define XDrawLine \ - (tkIntXlibStubsPtr->xDrawLine) /* 82 */ -#define XFillRectangle \ - (tkIntXlibStubsPtr->xFillRectangle) /* 83 */ -#define XClearWindow \ - (tkIntXlibStubsPtr->xClearWindow) /* 84 */ -#define XDrawPoint \ - (tkIntXlibStubsPtr->xDrawPoint) /* 85 */ -#define XDrawPoints \ - (tkIntXlibStubsPtr->xDrawPoints) /* 86 */ -#define XWarpPointer \ - (tkIntXlibStubsPtr->xWarpPointer) /* 87 */ -#define XQueryColor \ - (tkIntXlibStubsPtr->xQueryColor) /* 88 */ -#define XQueryColors \ - (tkIntXlibStubsPtr->xQueryColors) /* 89 */ -#define XQueryTree \ - (tkIntXlibStubsPtr->xQueryTree) /* 90 */ -#define XSync \ - (tkIntXlibStubsPtr->xSync) /* 91 */ -#define XTranslateCoordinates \ - (tkIntXlibStubsPtr->xTranslateCoordinates) /* 92 */ -#define XDeleteProperty \ - (tkIntXlibStubsPtr->xDeleteProperty) /* 93 */ -#define XFreeCursor \ - (tkIntXlibStubsPtr->xFreeCursor) /* 94 */ -#define XGetInputFocus \ - (tkIntXlibStubsPtr->xGetInputFocus) /* 95 */ -#define XmbLookupString \ - (tkIntXlibStubsPtr->xmbLookupString) /* 96 */ -#define XNextEvent \ - (tkIntXlibStubsPtr->xNextEvent) /* 97 */ -#define XPutBackEvent \ - (tkIntXlibStubsPtr->xPutBackEvent) /* 98 */ -#define XSetCommand \ - (tkIntXlibStubsPtr->xSetCommand) /* 99 */ -#define XWindowEvent \ - (tkIntXlibStubsPtr->xWindowEvent) /* 100 */ -#define XGetWindowAttributes \ - (tkIntXlibStubsPtr->xGetWindowAttributes) /* 101 */ -#define XGetWMColormapWindows \ - (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 102 */ -#define XIconifyWindow \ - (tkIntXlibStubsPtr->xIconifyWindow) /* 103 */ -#define XWithdrawWindow \ - (tkIntXlibStubsPtr->xWithdrawWindow) /* 104 */ -#define XListHosts \ - (tkIntXlibStubsPtr->xListHosts) /* 105 */ -#define XSetClipRectangles \ - (tkIntXlibStubsPtr->xSetClipRectangles) /* 106 */ -#define XFlush \ - (tkIntXlibStubsPtr->xFlush) /* 107 */ -#define XGrabServer \ - (tkIntXlibStubsPtr->xGrabServer) /* 108 */ -#define XUngrabServer \ - (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ -#define XFree \ - (tkIntXlibStubsPtr->xFree) /* 110 */ -#define XNoOp \ - (tkIntXlibStubsPtr->xNoOp) /* 111 */ -#define XSynchronize \ - (tkIntXlibStubsPtr->xSynchronize) /* 112 */ -#define XLookupColor \ - (tkIntXlibStubsPtr->xLookupColor) /* 113 */ -#define XVisualIDFromVisual \ - (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ -/* Slot 115 is reserved */ -/* Slot 116 is reserved */ -/* Slot 117 is reserved */ -/* Slot 118 is reserved */ -/* Slot 119 is reserved */ -#define XOffsetRegion \ - (tkIntXlibStubsPtr->xOffsetRegion) /* 120 */ -#define XUnionRegion \ - (tkIntXlibStubsPtr->xUnionRegion) /* 121 */ -#define XCreateWindow \ - (tkIntXlibStubsPtr->xCreateWindow) /* 122 */ -/* Slot 123 is reserved */ -/* Slot 124 is reserved */ -/* Slot 125 is reserved */ -/* Slot 126 is reserved */ -/* Slot 127 is reserved */ -/* Slot 128 is reserved */ -#define XLowerWindow \ - (tkIntXlibStubsPtr->xLowerWindow) /* 129 */ -#define XFillArcs \ - (tkIntXlibStubsPtr->xFillArcs) /* 130 */ -#define XDrawArcs \ - (tkIntXlibStubsPtr->xDrawArcs) /* 131 */ -#define XDrawRectangles \ - (tkIntXlibStubsPtr->xDrawRectangles) /* 132 */ -/* Slot 133 is reserved */ -/* Slot 134 is reserved */ -/* Slot 135 is reserved */ -#define XReparentWindow \ - (tkIntXlibStubsPtr->xReparentWindow) /* 136 */ -#define XPutImage \ - (tkIntXlibStubsPtr->xPutImage) /* 137 */ -#define XPolygonRegion \ - (tkIntXlibStubsPtr->xPolygonRegion) /* 138 */ -#define XPointInRegion \ - (tkIntXlibStubsPtr->xPointInRegion) /* 139 */ -#define XVaCreateNestedList \ - (tkIntXlibStubsPtr->xVaCreateNestedList) /* 140 */ -#define XSetICValues \ - (tkIntXlibStubsPtr->xSetICValues) /* 141 */ -#define XGetICValues \ - (tkIntXlibStubsPtr->xGetICValues) /* 142 */ -#define XSetICFocus \ - (tkIntXlibStubsPtr->xSetICFocus) /* 143 */ -#define XDestroyIC \ - (tkIntXlibStubsPtr->xDestroyIC) /* 144 */ -#define XCreatePixmapCursor \ - (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 145 */ -#define XCreateGlyphCursor \ - (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 146 */ -#define XFreeFontSet \ - (tkIntXlibStubsPtr->xFreeFontSet) /* 147 */ -#define XCloseIM \ - (tkIntXlibStubsPtr->xCloseIM) /* 148 */ -#define XRegisterIMInstantiateCallback \ - (tkIntXlibStubsPtr->xRegisterIMInstantiateCallback) /* 149 */ -#define XUnregisterIMInstantiateCallback \ - (tkIntXlibStubsPtr->xUnregisterIMInstantiateCallback) /* 150 */ -#define XSetLocaleModifiers \ - (tkIntXlibStubsPtr->xSetLocaleModifiers) /* 151 */ -#define XOpenIM \ - (tkIntXlibStubsPtr->xOpenIM) /* 152 */ -#define XGetIMValues \ - (tkIntXlibStubsPtr->xGetIMValues) /* 153 */ -#define XSetIMValues \ - (tkIntXlibStubsPtr->xSetIMValues) /* 154 */ -#define XCreateFontSet \ - (tkIntXlibStubsPtr->xCreateFontSet) /* 155 */ -#define XFreeStringList \ - (tkIntXlibStubsPtr->xFreeStringList) /* 156 */ -#define XkbKeycodeToKeysym \ - (tkIntXlibStubsPtr->xkbKeycodeToKeysym) /* 157 */ -#define XkbOpenDisplay \ - (tkIntXlibStubsPtr->xkbOpenDisplay) /* 158 */ -#endif /* MACOSX */ #endif /* defined(USE_TK_STUBS) */ diff --git a/generic/tkPkgConfig.c b/generic/tkPkgConfig.c index 5050f8a..2c32a18 100644 --- a/generic/tkPkgConfig.c +++ b/generic/tkPkgConfig.c @@ -95,14 +95,6 @@ #endif static const Tcl_Config cfg[] = { -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - {"debug", CFG_DEBUG}, - {"threaded", CFG_THREADED}, - {"profiled", CFG_PROFILED}, - {"64bit", CFG_64}, - {"optimized", CFG_OPTIMIZED}, - {"mem_debug", CFG_MEMDEBUG}, -#endif {"fontsystem", CFG_FONTSYSTEM}, /* Runtime paths to various stuff */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 1a6a481..ff2cc1c 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -41,40 +41,16 @@ MODULE_SCOPE const TkStubs tkStubs; #undef TkPutImage #undef XPutImage -#define TkMacOSXSetUpClippingRgn (void (*)(Drawable))(void *)doNothing -#undef TkMacOSXIsCharacterMissing -#define TkMacOSXIsCharacterMissing (int (*)(Tk_Font, unsigned int))(void *)doNothing -#if defined(TK_NO_DEPRECATED) || (TCL_MAJOR_VERSION > 8) -# define TkSetWindowMenuBar 0 -# define TkpDrawHighlightBorder 0 -# define TkpUseWindow 0 -# define TkpSetMainMenubar 0 -# define TkpGetOtherWindow 0 -# define TkpGetSystemDefault 0 -# define TkpMakeContainer 0 -# define TkpMakeWindow 0 -#endif +#define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable +#if !defined(MAC_OSX_TK) static int doNothing(void) { /* dummy implementation, no need to do anything */ return 0; } -#define TkpCmapStressed_ TkpCmapStressed -#define TkpSync_ TkpSync -#define TkUnixContainerId_ TkUnixContainerId -#define TkUnixDoOneXEvent_ TkUnixDoOneXEvent -#define TkUnixSetMenubar_ TkUnixSetMenubar -#define TkWmCleanup_ TkWmCleanup -#define TkSendCleanup_ TkSendCleanup -#define TkpTestsendCmd_ TkpTestsendCmd -#define TkGenWMConfigureEvent_ TkGenWMConfigureEvent -#define TkGenerateActivateEvents_ TkGenerateActivateEvents -#define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable - -#if !defined(MAC_OSX_TK) # undef TkpWillDrawWidget # undef TkpRedrawWidget # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) @@ -316,13 +292,13 @@ static const TkIntStubs tkIntStubs = { TkpClaimFocus, /* 57 */ TkpDisplayWarning, /* 58 */ TkpGetAppName, /* 59 */ - TkpGetOtherWindow, /* 60 */ + 0, /* 60 */ TkpGetWrapperWindow, /* 61 */ TkpInit, /* 62 */ TkpInitializeMenuBindings, /* 63 */ - TkpMakeContainer, /* 64 */ + 0, /* 64 */ TkpMakeMenuWindow, /* 65 */ - TkpMakeWindow, /* 66 */ + 0, /* 66 */ TkpMenuNotifyToplevelCreate, /* 67 */ TkpOpenDisplay, /* 68 */ TkPointerEvent, /* 69 */ @@ -330,8 +306,8 @@ static const TkIntStubs tkIntStubs = { TkPolygonToPoint, /* 71 */ TkPositionInTree, /* 72 */ TkpRedirectKeyEvent, /* 73 */ - TkpSetMainMenubar, /* 74 */ - TkpUseWindow, /* 75 */ + 0, /* 74 */ + 0, /* 75 */ 0, /* 76 */ TkQueueEventForAllChildren, /* 77 */ TkReadBitmapFile, /* 78 */ @@ -341,7 +317,7 @@ static const TkIntStubs tkIntStubs = { TkSelInit, /* 82 */ TkSelPropProc, /* 83 */ 0, /* 84 */ - TkSetWindowMenuBar, /* 85 */ + 0, /* 85 */ TkStringToKeysym, /* 86 */ TkThickPolyLineToArea, /* 87 */ TkWmAddToColormapWindows, /* 88 */ @@ -367,7 +343,7 @@ static const TkIntStubs tkIntStubs = { TkGetWindowFromObj, /* 108 */ TkpGetString, /* 109 */ TkpGetSubFonts, /* 110 */ - TkpGetSystemDefault, /* 111 */ + 0, /* 111 */ TkpMenuThreadInit, /* 112 */ XClipBox, /* 113 */ XCreateRegion, /* 114 */ @@ -418,7 +394,7 @@ static const TkIntStubs tkIntStubs = { 0, /* 132 */ 0, /* 133 */ 0, /* 134 */ - TkpDrawHighlightBorder, /* 135 */ + 0, /* 135 */ TkSetFocusWin, /* 136 */ TkpSetKeycodeAndState, /* 137 */ TkpGetKeySym, /* 138 */ @@ -527,9 +503,9 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkpGetCapture, /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - TkGenerateActivateEvents, /* 0 */ + 0, /* 0 */ 0, /* 1 */ - TkGenerateActivateEvents_, /* 2 */ + TkGenerateActivateEvents, /* 2 */ TkPointerDeadWindow, /* 3 */ TkpSetCapture, /* 4 */ TkpSetCursor, /* 5 */ @@ -549,7 +525,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, /* 19 */ 0, /* 20 */ TkMacOSXInvalidateWindow, /* 21 */ - TkMacOSXIsCharacterMissing, /* 22 */ + 0, /* 22 */ TkMacOSXMakeRealWindowExist, /* 23 */ TkMacOSXMakeStippleMap, /* 24 */ TkMacOSXMenuClick, /* 25 */ @@ -557,7 +533,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkMacOSXResizable, /* 27 */ TkMacOSXSetHelpMenuItemCount, /* 28 */ TkMacOSXSetScrollbarGrow, /* 29 */ - TkMacOSXSetUpClippingRgn, /* 30 */ + 0, /* 30 */ TkMacOSXSetUpGraphicsPort, /* 31 */ TkMacOSXUpdateClipRgn, /* 32 */ 0, /* 33 */ @@ -588,17 +564,17 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkCreateXEventSource, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ - TkpCmapStressed, /* 3 */ - TkpSync, /* 4 */ - TkUnixContainerId, /* 5 */ - TkUnixDoOneXEvent, /* 6 */ - TkUnixSetMenubar, /* 7 */ + 0, /* 3 */ + 0, /* 4 */ + 0, /* 5 */ + 0, /* 6 */ + 0, /* 7 */ TkpScanWindowId, /* 8 */ TkWmCleanup, /* 9 */ - TkSendCleanup, /* 10 */ + 0, /* 10 */ 0, /* 11 */ TkpWmSetState, /* 12 */ - TkpTestsendCmd_, /* 13 */ + 0, /* 13 */ 0, /* 14 */ 0, /* 15 */ 0, /* 16 */ @@ -623,13 +599,13 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, /* 35 */ 0, /* 36 */ 0, /* 37 */ - TkpCmapStressed_, /* 38 */ - TkpSync_, /* 39 */ - TkUnixContainerId_, /* 40 */ - TkUnixDoOneXEvent_, /* 41 */ - TkUnixSetMenubar_, /* 42 */ - TkWmCleanup_, /* 43 */ - TkSendCleanup_, /* 44 */ + TkpCmapStressed, /* 38 */ + TkpSync, /* 39 */ + TkUnixContainerId, /* 40 */ + TkUnixDoOneXEvent, /* 41 */ + TkUnixSetMenubar, /* 42 */ + TkWmCleanup, /* 43 */ + TkSendCleanup, /* 44 */ TkpTestsendCmd, /* 45 */ #endif /* X11 */ }; @@ -637,7 +613,6 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, -#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -797,168 +772,6 @@ static const TkIntXlibStubs tkIntXlibStubs = { XFreeStringList, /* 156 */ XkbKeycodeToKeysym, /* 157 */ XkbOpenDisplay, /* 158 */ -#endif /* WIN */ -#ifdef MAC_OSX_TCL /* MACOSX */ - XSetDashes, /* 0 */ - XGetModifierMapping, /* 1 */ - XCreateImage, /* 2 */ - XGetImage, /* 3 */ - XGetAtomName, /* 4 */ - XKeysymToString, /* 5 */ - XCreateColormap, /* 6 */ - XGContextFromGC, /* 7 */ - XKeycodeToKeysym, /* 8 */ - XStringToKeysym, /* 9 */ - XRootWindow, /* 10 */ - XSetErrorHandler, /* 11 */ - XAllocColor, /* 12 */ - XBell, /* 13 */ - XChangeProperty, /* 14 */ - XChangeWindowAttributes, /* 15 */ - XConfigureWindow, /* 16 */ - XCopyArea, /* 17 */ - XCopyPlane, /* 18 */ - XCreateBitmapFromData, /* 19 */ - XDefineCursor, /* 20 */ - XDestroyWindow, /* 21 */ - XDrawArc, /* 22 */ - XDrawLines, /* 23 */ - XDrawRectangle, /* 24 */ - XFillArc, /* 25 */ - XFillPolygon, /* 26 */ - XFillRectangles, /* 27 */ - XFreeColormap, /* 28 */ - XFreeColors, /* 29 */ - XFreeModifiermap, /* 30 */ - XGetGeometry, /* 31 */ - XGetWindowProperty, /* 32 */ - XGrabKeyboard, /* 33 */ - XGrabPointer, /* 34 */ - XKeysymToKeycode, /* 35 */ - XMapWindow, /* 36 */ - XMoveResizeWindow, /* 37 */ - XMoveWindow, /* 38 */ - XQueryPointer, /* 39 */ - XRaiseWindow, /* 40 */ - XRefreshKeyboardMapping, /* 41 */ - XResizeWindow, /* 42 */ - XSelectInput, /* 43 */ - XSendEvent, /* 44 */ - XSetIconName, /* 45 */ - XSetInputFocus, /* 46 */ - XSetSelectionOwner, /* 47 */ - XSetWindowBackground, /* 48 */ - XSetWindowBackgroundPixmap, /* 49 */ - XSetWindowBorder, /* 50 */ - XSetWindowBorderPixmap, /* 51 */ - XSetWindowBorderWidth, /* 52 */ - XSetWindowColormap, /* 53 */ - XUngrabKeyboard, /* 54 */ - XUngrabPointer, /* 55 */ - XUnmapWindow, /* 56 */ - TkPutImage, /* 57 */ - XParseColor, /* 58 */ - XCreateGC, /* 59 */ - XFreeGC, /* 60 */ - XInternAtom, /* 61 */ - XSetBackground, /* 62 */ - XSetForeground, /* 63 */ - XSetClipMask, /* 64 */ - XSetClipOrigin, /* 65 */ - XSetTSOrigin, /* 66 */ - XChangeGC, /* 67 */ - XSetFont, /* 68 */ - XSetArcMode, /* 69 */ - XSetStipple, /* 70 */ - XSetFillRule, /* 71 */ - XSetFillStyle, /* 72 */ - XSetFunction, /* 73 */ - XSetLineAttributes, /* 74 */ - _XInitImageFuncPtrs, /* 75 */ - XCreateIC, /* 76 */ - XGetVisualInfo, /* 77 */ - XSetWMClientMachine, /* 78 */ - XStringListToTextProperty, /* 79 */ - XDrawSegments, /* 80 */ - XForceScreenSaver, /* 81 */ - XDrawLine, /* 82 */ - XFillRectangle, /* 83 */ - XClearWindow, /* 84 */ - XDrawPoint, /* 85 */ - XDrawPoints, /* 86 */ - XWarpPointer, /* 87 */ - XQueryColor, /* 88 */ - XQueryColors, /* 89 */ - XQueryTree, /* 90 */ - XSync, /* 91 */ - XTranslateCoordinates, /* 92 */ - XDeleteProperty, /* 93 */ - XFreeCursor, /* 94 */ - XGetInputFocus, /* 95 */ - XmbLookupString, /* 96 */ - XNextEvent, /* 97 */ - XPutBackEvent, /* 98 */ - XSetCommand, /* 99 */ - XWindowEvent, /* 100 */ - XGetWindowAttributes, /* 101 */ - XGetWMColormapWindows, /* 102 */ - XIconifyWindow, /* 103 */ - XWithdrawWindow, /* 104 */ - XListHosts, /* 105 */ - XSetClipRectangles, /* 106 */ - XFlush, /* 107 */ - XGrabServer, /* 108 */ - XUngrabServer, /* 109 */ - XFree, /* 110 */ - XNoOp, /* 111 */ - XSynchronize, /* 112 */ - XLookupColor, /* 113 */ - XVisualIDFromVisual, /* 114 */ - 0, /* 115 */ - 0, /* 116 */ - 0, /* 117 */ - 0, /* 118 */ - 0, /* 119 */ - XOffsetRegion, /* 120 */ - XUnionRegion, /* 121 */ - XCreateWindow, /* 122 */ - 0, /* 123 */ - 0, /* 124 */ - 0, /* 125 */ - 0, /* 126 */ - 0, /* 127 */ - 0, /* 128 */ - XLowerWindow, /* 129 */ - XFillArcs, /* 130 */ - XDrawArcs, /* 131 */ - XDrawRectangles, /* 132 */ - 0, /* 133 */ - 0, /* 134 */ - 0, /* 135 */ - XReparentWindow, /* 136 */ - XPutImage, /* 137 */ - XPolygonRegion, /* 138 */ - XPointInRegion, /* 139 */ - XVaCreateNestedList, /* 140 */ - XSetICValues, /* 141 */ - XGetICValues, /* 142 */ - XSetICFocus, /* 143 */ - XDestroyIC, /* 144 */ - XCreatePixmapCursor, /* 145 */ - XCreateGlyphCursor, /* 146 */ - XFreeFontSet, /* 147 */ - XCloseIM, /* 148 */ - XRegisterIMInstantiateCallback, /* 149 */ - XUnregisterIMInstantiateCallback, /* 150 */ - XSetLocaleModifiers, /* 151 */ - XOpenIM, /* 152 */ - XGetIMValues, /* 153 */ - XSetIMValues, /* 154 */ - XCreateFontSet, /* 155 */ - XFreeStringList, /* 156 */ - XkbKeycodeToKeysym, /* 157 */ - XkbOpenDisplay, /* 158 */ -#endif /* MACOSX */ }; static const TkPlatStubs tkPlatStubs = { diff --git a/tests/embed.test b/tests/embed.test index 92b8be9..8a61baf 100644 --- a/tests/embed.test +++ b/tests/embed.test @@ -10,7 +10,7 @@ eval tcltest::configure $argv tcltest::loadTestedCommands -test embed-1.1 {TkpUseWindow procedure, bad window identifier} -setup { +test embed-1.1 {Tk_UseWindow procedure, bad window identifier} -setup { deleteWindows } -body { toplevel .t -use xyz @@ -36,7 +36,7 @@ test embed-1.3 {CreateFrame procedure, both -use and -container is invalid} -set } -returnCodes error -result {windows cannot have both the -use and the -container option set} # testing window embedding for win platforms -test embed-1.4.win {TkpUseWindow procedure, -container must be set} -constraints { +test embed-1.4.win {Tk_UseWindow procedure, -container must be set} -constraints { win } -setup { deleteWindows @@ -47,7 +47,7 @@ test embed-1.4.win {TkpUseWindow procedure, -container must be set} -constraints deleteWindows } -returnCodes error -result {the window to use is not a Tk container} # testing window embedding for win platforms -test embed-1.5.win {TkpUseWindow procedure, -container must be set} -constraints { +test embed-1.5.win {Tk_UseWindow procedure, -container must be set} -constraints { win } -setup { deleteWindows @@ -59,7 +59,7 @@ test embed-1.5.win {TkpUseWindow procedure, -container must be set} -constraints } -returnCodes error -result {the window to use is not a Tk container} # testing window embedding for other than win platforms -test embed-1.4.nonwin {TkpUseWindow procedure, -container must be set} -constraints { +test embed-1.4.nonwin {Tk_UseWindow procedure, -container must be set} -constraints { nonwin } -setup { deleteWindows @@ -70,7 +70,7 @@ test embed-1.4.nonwin {TkpUseWindow procedure, -container must be set} -constrai deleteWindows } -returnCodes error -result {window ".container" doesn't have -container option set} # testing window embedding for other than win platforms -test embed-1.5.nonwin {TkpUseWindow procedure, -container must be set} -constraints { +test embed-1.5.nonwin {Tk_UseWindow procedure, -container must be set} -constraints { nonwin } -setup { deleteWindows diff --git a/tests/menu.test b/tests/menu.test index c3fa4e3..6b667fe 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3613,7 +3613,7 @@ test menu-24.3 {TkNewMenuName} -setup { } -result {0 {} {} {} {}} -test menu-25.1 {TkSetWindowMenuBar} -setup { +test menu-25.1 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3621,7 +3621,7 @@ test menu-25.1 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.2 {TkSetWindowMenuBar} -setup { +test menu-25.2 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3629,7 +3629,7 @@ test menu-25.2 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.3 {TkSetWindowMenuBar} -setup { +test menu-25.3 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3639,7 +3639,7 @@ test menu-25.3 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.4 {TkSetWindowMenuBar} -setup { +test menu-25.4 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3650,7 +3650,7 @@ test menu-25.4 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.5 {TkSetWindowMenuBar} -setup { +test menu-25.5 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3662,7 +3662,7 @@ test menu-25.5 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.6 {TkSetWindowMenuBar} -setup { +test menu-25.6 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3674,7 +3674,7 @@ test menu-25.6 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.7 {TkSetWindowMenuBar} -setup { +test menu-25.7 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3687,7 +3687,7 @@ test menu-25.7 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.8 {TkSetWindowMenuBar} -setup { +test menu-25.8 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3701,7 +3701,7 @@ test menu-25.8 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.9 {TkSetWindowMenuBar} -setup { +test menu-25.9 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3716,7 +3716,7 @@ test menu-25.9 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.10 {TkSetWindowMenuBar} -setup { +test menu-25.10 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3731,7 +3731,7 @@ test menu-25.10 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.11 {TkSetWindowMenuBar} -setup { +test menu-25.11 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3746,7 +3746,7 @@ test menu-25.11 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.12 {TkSetWindowMenuBar} -setup { +test menu-25.12 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3755,7 +3755,7 @@ test menu-25.12 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.13 {TkSetWindowMenuBar} -setup { +test menu-25.13 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3763,7 +3763,7 @@ test menu-25.13 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.14 {TkSetWindowMenuBar} -setup { +test menu-25.14 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3772,7 +3772,7 @@ test menu-25.14 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.15 {TkSetWindowMenuBar} -setup { +test menu-25.15 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" @@ -3780,7 +3780,7 @@ test menu-25.15 {TkSetWindowMenuBar} -setup { } -cleanup { deleteWindows } -result {{} {}} -test menu-25.16 {TkSetWindowMenuBar} -setup { +test menu-25.16 {Tk_SetWindowMenuBar} -setup { deleteWindows } -body { . configure -menu "" diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index a66a310..066c30d 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -90,21 +90,21 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} { testConstraint pressbutton [llength [info commands pressbutton]] -test unixEmbed-1.1 {TkpUseWindow procedure, bad window identifier} -constraints { +test unixEmbed-1.1 {Tk_UseWindow procedure, bad window identifier} -constraints { unix } -setup { deleteWindows } -body { toplevel .t -use xyz } -returnCodes error -result {expected integer but got "xyz"} -test unixEmbed-1.2 {TkpUseWindow procedure, bad window identifier} -constraints { +test unixEmbed-1.2 {Tk_UseWindow procedure, bad window identifier} -constraints { unix } -setup { deleteWindows } -body { toplevel .t -use 47 } -returnCodes error -result {couldn't create child of window "47"} -test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints { +test unixEmbed-1.3 {Tk_UseWindow procedure, inheriting colormap} -constraints { unix nonPortable } -setup { deleteWindows @@ -118,7 +118,7 @@ test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints { } -cleanup { deleteWindows } -result 0 -test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints { +test unixEmbed-1.4 {Tk_UseWindow procedure, inheriting colormap} -constraints { unix nonPortable } -setup { deleteWindows @@ -132,7 +132,7 @@ test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints { deleteWindows } -result 1 -test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constraints { +test unixEmbed-1.5 {Tk_UseWindow procedure, creating Container records} -constraints { unix testembed notAqua } -setup { deleteWindows @@ -149,7 +149,7 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constra } -cleanup { deleteWindows } -result {{{XXX {} {} .t}} 0} -test unixEmbed-1.5a {TkpUseWindow procedure, creating Container records} -constraints { +test unixEmbed-1.5a {Tk_UseWindow procedure, creating Container records} -constraints { unix testembed } -setup { deleteWindows @@ -170,7 +170,7 @@ test unixEmbed-1.5a {TkpUseWindow procedure, creating Container records} -constr interp delete child deleteWindows } -result {{{XXX {} {} .t}} 0} -test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constraints { +test unixEmbed-1.6 {Tk_UseWindow procedure, creating Container records} -constraints { unix testembed notAqua } -setup { deleteWindows @@ -189,7 +189,7 @@ test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constra } -cleanup { deleteWindows } -result {{XXX {} {} .t2} {XXX {} {} .t1}} -test unixEmbed-1.6a {TkpUseWindow procedure, creating Container records} -constraints { +test unixEmbed-1.6a {Tk_UseWindow procedure, creating Container records} -constraints { unix testembed } -setup { deleteWindows @@ -212,7 +212,7 @@ test unixEmbed-1.6a {TkpUseWindow procedure, creating Container records} -constr interp delete child deleteWindows } -result {{XXX {} {} .t2} {XXX {} {} .t1}} -test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} -constraints { +test unixEmbed-1.7 {Tk_UseWindow procedure, container and embedded in same app} -constraints { unix testembed } -setup { deleteWindows diff --git a/xlib/X11/keysymdef.h b/xlib/X11/keysymdef.h index 8f1833f..0f031ba 100644 --- a/xlib/X11/keysymdef.h +++ b/xlib/X11/keysymdef.h @@ -182,15 +182,6 @@ SOFTWARE. #define XK_Begin 0xff58 /* BOL */ -#ifndef TK_NO_DEPRECATED -/* Special Windows keyboard keys */ - -#define XK_Win_L 0xFF5B /* Left-hand Windows */ -#define XK_Win_R 0xFF5C /* Right-hand Windows */ -#define XK_App 0xFF5D /* Menu key */ -#endif - - /* Misc functions */ #define XK_Select 0xff60 /* Select, mark */ @@ -1736,18 +1727,3 @@ SOFTWARE. #define XK_braille_dot_9 0xfff9 #define XK_braille_dot_10 0xfffa #endif /* XK_BRAILLE */ - -/* Multimedia keys, defined same as on Linux - * /usr/include/pkg/libxkbcommon/xkbcommon/xkbcommon-keysyms.h - */ - -#ifndef TK_NO_DEPRECATED -#define XK_XF86AudioLowerVolume 0x1008FF11 /* Volume control down */ -#define XK_XF86AudioMute 0x1008FF12 /* Mute sound from the system */ -#define XK_XF86AudioRaiseVolume 0x1008FF13 /* Volume control up */ -#define XK_XF86AudioPlay 0x1008FF14 /* Start playing of audio > */ -#define XK_XF86AudioStop 0x1008FF15 /* Stop playing audio */ -#define XK_XF86AudioPrev 0x1008FF16 /* Previous track */ -#define XK_XF86AudioNext 0x1008FF17 /* Next track */ -#endif /* !TK_NO_DEPRECATED */ - -- cgit v0.12 From aee29839da30f7b46c73f3f2cb41ce97b7f7b16f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 12:50:46 +0000 Subject: Remove TkOldTestInit --- generic/tkInt.h | 1 - generic/tkTest.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/generic/tkInt.h b/generic/tkInt.h index 9f5a31b..dc44576 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1469,7 +1469,6 @@ MODULE_SCOPE int TkUnsupported1ObjCmd(void *clientData, MODULE_SCOPE int SquareObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]); -MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp); #if !(defined(_WIN32) || defined(MAC_OSX_TK)) #define TkplatformtestInit(x) TCL_OK #else diff --git a/generic/tkTest.c b/generic/tkTest.c index dd3764e..e776bbf 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -305,14 +305,6 @@ Tktest_Init( } /* - * Enable testing of legacy interfaces. - */ - - if (TkOldTestInit(interp) != TCL_OK) { - return TCL_ERROR; - } - - /* * And finally add any platform specific test commands. */ -- cgit v0.12 From ef1c0b41419a99d78bf51ed3224dfa63d6968b55 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 13:40:49 +0000 Subject: More legacy "photo" removals. Also the deprecated "-file" argument for wish. --- generic/tkImgPhoto.c | 119 --------------------------------------------------- generic/tkMain.c | 11 ----- 2 files changed, 130 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 6ced2a9..79b1363 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -139,11 +139,6 @@ typedef struct { Tk_PhotoImageFormat *formatList; /* Pointer to the first in the list of known * photo image formats.*/ -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - Tk_PhotoImageFormat *oldFormatList; - /* Pointer to the first in the list of known - * photo image formats.*/ -#endif Tk_PhotoImageFormatVersion3 *formatListVersion3; /* Pointer to the first in the list of known * photo image formats in Version3 format.*/ @@ -247,13 +242,6 @@ PhotoFormatThreadExitProc( ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - while (tsdPtr->oldFormatList != NULL) { - freePtr = tsdPtr->oldFormatList; - tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr; - ckfree(freePtr); - } -#endif while (tsdPtr->formatList != NULL) { freePtr = tsdPtr->formatList; tsdPtr->formatList = tsdPtr->formatList->nextPtr; @@ -305,12 +293,6 @@ Tk_CreatePhotoImageFormat( } copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat)); *copyPtr = *formatPtr; -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - if (isupper((unsigned char) *formatPtr->name)) { - copyPtr->nextPtr = tsdPtr->oldFormatList; - tsdPtr->oldFormatList = copyPtr; - } else -#endif { /* for compatibility with aMSN: make a copy of formatPtr->name */ char *name = (char *)ckalloc(strlen(formatPtr->name) + 1); @@ -812,23 +794,6 @@ ImgPhotoCmd( } } } -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - if (stringWriteProc == NULL) { - oldformat = 1; - for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL; - imageFormat = imageFormat->nextPtr) { - if ((strncasecmp(Tcl_GetString(options.format), - imageFormat->name, - strlen(imageFormat->name)) == 0)) { - matched = 1; - if (imageFormat->stringWriteProc != NULL) { - stringWriteProc = imageFormat->stringWriteProc; - break; - } - } - } - } -#endif if (stringWriteProc == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; @@ -1489,22 +1454,6 @@ readCleanup: } } } -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - if (imageFormat == NULL) { - oldformat = 1; - for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL; - imageFormat = imageFormat->nextPtr) { - if ((fmtString == NULL) - || (strncasecmp(fmtString, imageFormat->name, - strlen(imageFormat->name)) == 0)) { - matched = 1; - if (imageFormat->fileWriteProc != NULL) { - break; - } - } - } - } -#endif if (imageFormat == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; @@ -2755,42 +2704,6 @@ MatchFileFormat( } } } -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 -if (formatPtr == NULL) { - useoldformat = 1; - for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL; - formatPtr = formatPtr->nextPtr) { - if (formatString != NULL) { - if (strncasecmp(formatString, - formatPtr->name, strlen(formatPtr->name)) != 0) { - continue; - } - matched = 1; - if (formatPtr->fileMatchProc == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "-file option isn't supported for %s images", - formatString)); - Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", - "NOT_FILE_FORMAT", NULL); - return TCL_ERROR; - } - } - if (formatPtr->fileMatchProc != NULL) { - (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET); - if (formatPtr->fileMatchProc(chan, fileName, (Tcl_Obj *) - formatString, widthPtr, heightPtr, interp)) { - if (*widthPtr < 1) { - *widthPtr = 1; - } - if (*heightPtr < 1) { - *heightPtr = 1; - } - break; - } - } - } - } -#endif /* * For old and not version 3 format, exit now with success @@ -2988,38 +2901,6 @@ MatchStringFormat( } } -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - if (formatPtr == NULL) { - useoldformat = 1; - for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL; - formatPtr = formatPtr->nextPtr) { - if (formatObj != NULL) { - if (strncasecmp(formatString, - formatPtr->name, strlen(formatPtr->name)) != 0) { - continue; - } - matched = 1; - if (formatPtr->stringMatchProc == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "-data option isn't supported for %s images", - formatString)); - Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", - "NOT_DATA_FORMAT", NULL); - return TCL_ERROR; - } - } - if ((formatPtr->stringMatchProc != NULL) - && (formatPtr->stringReadProc != NULL) - && formatPtr->stringMatchProc( - (Tcl_Obj *) Tcl_GetString(data), - (Tcl_Obj *) formatString, - widthPtr, heightPtr, interp)) { - break; - } - } - } -#endif - if (formatPtr == NULL) { useoldformat = 0; for (formatVersion3Ptr = tsdPtr->formatListVersion3; diff --git a/generic/tkMain.c b/generic/tkMain.c index 949afca..af1c550 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -247,9 +247,6 @@ Tk_MainEx( */ if (NULL == Tcl_GetStartupScript(NULL)) { -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - size_t length; -#endif /* * Check whether first 3 args (argv[1] - argv[3]) look like @@ -273,14 +270,6 @@ Tk_MainEx( Tcl_SetStartupScript(NewNativeObj(argv[1]), NULL); argc--; i++; -#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - } else if ((argc >= 2) && (length = _tcslen(argv[1])) - && (length > 1) && (0 == _tcsncmp(TEXT("-file"), argv[1], length)) - && ('-' != argv[2][0])) { - Tcl_SetStartupScript(NewNativeObj(argv[2]), NULL); - argc -= 2; - i += 2; -#endif } } -- cgit v0.12 From a416d2e8f5cf471d4aaa92c75ca81150dba384c3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 13:57:27 +0000 Subject: Remove legacy "pack" and "scrollbar" syntax --- doc/scrollbar.n | 40 --- generic/tkPack.c | 343 ---------------------- generic/tkScrollbar.c | 58 ---- generic/tkScrollbar.h | 19 -- macosx/Tk.xcodeproj/project.pbxproj | 2 - tests/oldpack.test | 558 ------------------------------------ 6 files changed, 1020 deletions(-) delete mode 100644 tests/oldpack.test diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 4f808f4..838dac1 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -236,46 +236,6 @@ the top or left of the window, or \-1, which means that one unit should scroll off the bottom or right of the window. Fractional numbers are rounded away from 0, so scrolling 0.001 units has the same effect as scrolling 1 unit. -.SH "OLD COMMAND SYNTAX" -.PP -In versions of Tk before 4.0, the \fBset\fR and \fBget\fR widget -commands used a different form. -This form is still supported for backward compatibility, but it -is deprecated. -In the old command syntax, the \fBset\fR widget command has the -following form: -.TP -\fIpathName \fBset \fItotalUnits windowUnits firstUnit lastUnit\fR -In this form the arguments are all integers. -\fITotalUnits\fR gives the total size of the object being displayed in the -associated widget. The meaning of one unit depends on the associated -widget; for example, in a text editor widget units might -correspond to lines of -text. \fIWindowUnits\fR indicates the total number of units that -can fit in the associated window at one time. \fIFirstUnit\fR -and \fIlastUnit\fR give the indices of the first and last units -currently visible in the associated window (zero corresponds to the -first unit of the object). -.LP -Under the old syntax the \fBget\fR widget command returns a list -of four integers, consisting of the \fItotalUnits\fR, \fIwindowUnits\fR, -\fIfirstUnit\fR, and \fIlastUnit\fR values from the last \fBset\fR -widget command. -.PP -The commands generated by scrollbars also have a different form -when the old syntax is being used: -.TP -\fIprefix\fR \fIunit\fR -\fIUnit\fR is an integer that indicates what should appear at -the top or left of the associated widget's window. -It has the same meaning as the \fIfirstUnit\fR and \fIlastUnit\fR -arguments to the \fBset\fR widget command. -.LP -The most recent \fBset\fR widget command determines whether or not -to use the old syntax. -If it is given two real arguments then the new syntax will be -used in the future, and if it is given four integer arguments then -the old syntax will be used. .SH BINDINGS .PP Tk automatically creates class bindings for scrollbars that give them diff --git a/generic/tkPack.c b/generic/tkPack.c index 8dc6284..baf2a70 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -122,10 +122,6 @@ static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); -#ifndef TK_NO_DEPRECATED -static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, - Packer *containerPtr, int objc,Tcl_Obj *const objv[]); -#endif /* !TK_NO_DEPRECATED */ static void PackStructureProc(void *clientData, XEvent *eventPtr); static void Unlink(Packer *packPtr); @@ -199,16 +195,10 @@ Tk_PackObjCmd( Tk_Window tkwin = (Tk_Window)clientData; const char *argv2; static const char *const optionStrings[] = { -#ifndef TK_NO_DEPRECATED - "after", "append", "before", "unpack", -#endif /* !TK_NO_DEPRECATED */ "configure", "content", "forget", "info", "propagate", "slaves", NULL }; static const char *const optionStringsNoDep[] = { "configure", "content", "forget", "info", "propagate", NULL }; enum options { -#ifndef TK_NO_DEPRECATED - PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK, -#endif /* !TK_NO_DEPRECATED */ PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; int index; @@ -239,72 +229,6 @@ Tk_PackObjCmd( argv2 = Tcl_GetString(objv[2]); switch ((enum options) index) { -#ifndef TK_NO_DEPRECATED - case PACK_AFTER: { - Packer *prevPtr; - Tk_Window tkwin2; - - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - prevPtr = GetPacker(tkwin2); - if (prevPtr->containerPtr == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); - return TCL_ERROR; - } - return PackAfter(interp, prevPtr, prevPtr->containerPtr, objc-3, objv+3); - } - case PACK_APPEND: { - Packer *containerPtr; - Packer *prevPtr; - Tk_Window tkwin2; - - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - containerPtr = GetPacker(tkwin2); - prevPtr = containerPtr->contentPtr; - if (prevPtr != NULL) { - while (prevPtr->nextPtr != NULL) { - prevPtr = prevPtr->nextPtr; - } - } - return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); - } - case PACK_BEFORE: { - Packer *packPtr, *containerPtr; - Packer *prevPtr; - Tk_Window tkwin2; - - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - packPtr = GetPacker(tkwin2); - if (packPtr->containerPtr == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); - return TCL_ERROR; - } - containerPtr = packPtr->containerPtr; - prevPtr = containerPtr->contentPtr; - if (prevPtr == packPtr) { - prevPtr = NULL; - } else { - for ( ; ; prevPtr = prevPtr->nextPtr) { - if (prevPtr == NULL) { - Tcl_Panic("\"pack before\" couldn't find predecessor"); - } - if (prevPtr->nextPtr == packPtr) { - break; - } - } - } - return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); - } -#endif /* !TK_NO_DEPRECATED */ case PACK_CONFIGURE: if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -467,31 +391,6 @@ Tk_PackObjCmd( Tcl_SetObjResult(interp, resultObj); break; } -#ifndef TK_NO_DEPRECATED - case PACK_UNPACK: { - Tk_Window tkwin2; - Packer *packPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "window"); - return TCL_ERROR; - } - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - packPtr = GetPacker(tkwin2); - if ((packPtr != NULL) && (packPtr->containerPtr != NULL)) { - Tk_ManageGeometry(tkwin2, NULL, NULL); - if (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin)) { - Tk_UnmaintainGeometry(packPtr->tkwin, - packPtr->containerPtr->tkwin); - } - Unlink(packPtr); - Tk_UnmapWindow(packPtr->tkwin); - } - break; - } -#endif /* !TK_NO_DEPRECATED */ } return TCL_OK; @@ -1078,248 +977,6 @@ GetPacker( } /* - *------------------------------------------------------------------------ - * - * PackAfter -- - * - * This function does most of the real work of adding one or more windows - * into the packing order for its container. - * - * Results: - * A standard Tcl return value. - * - * Side effects: - * The geometry of the specified windows may change, both now and again - * in the future. - * - *------------------------------------------------------------------------ - */ - -#ifndef TK_NO_DEPRECATED -static int -PackAfter( - Tcl_Interp *interp, /* Interpreter for error reporting. */ - Packer *prevPtr, /* Pack windows in argv just after this - * window; NULL means pack as first child of - * containerPtr. */ - Packer *containerPtr, /* Container in which to pack windows. */ - int objc, /* Number of elements in objv. */ - Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements: - * window name and side against which to - * pack. */ -{ - Packer *packPtr; - Tk_Window tkwin, ancestor, parent; - Tcl_Obj **options; - int c; - Tcl_Size index, optionCount; - - /* - * Iterate over all of the window specifiers, each consisting of two - * arguments. The first argument contains the window name and the - * additional arguments contain options such as "top" or "padx 20". - */ - - for ( ; objc > 0; objc -= 2, objv += 2, prevPtr = packPtr) { - if (objc < 2) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "wrong # args: window \"%s\" should be followed by options", - Tcl_GetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); - return TCL_ERROR; - } - - /* - * Find the packer for the window to be packed, and make sure that the - * window in which it will be packed is either its or a descendant of - * its parent. - */ - - if (TkGetWindowFromObj(interp, containerPtr->tkwin, objv[0], &tkwin) - != TCL_OK) { - return TCL_ERROR; - } - - parent = Tk_Parent(tkwin); - for (ancestor = containerPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) { - if (ancestor == parent) { - break; - } - if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) { - badWindow: - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]), - Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); - return TCL_ERROR; - } - } - if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) { - goto badWindow; - } - if (tkwin == containerPtr->tkwin) { - goto badWindow; - } - packPtr = GetPacker(tkwin); - - /* - * Process options for this window. - */ - - if (Tcl_ListObjGetElements(interp, objv[1], &optionCount, &options) - != TCL_OK) { - return TCL_ERROR; - } - packPtr->side = TOP; - packPtr->anchor = TK_ANCHOR_CENTER; - packPtr->padX = packPtr->padY = 0; - packPtr->padLeft = packPtr->padTop = 0; - packPtr->iPadX = packPtr->iPadY = 0; - packPtr->flags &= ~(FILLX|FILLY|EXPAND); - packPtr->flags |= OLD_STYLE; - for (index = 0 ; index < optionCount; index++) { - Tcl_Obj *curOptPtr = options[index]; - Tcl_Size length; - const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length); - - c = curOpt[0]; - - if ((c == 't') - && (strncmp(curOpt, "top", length)) == 0) { - packPtr->side = TOP; - } else if ((c == 'b') - && (strncmp(curOpt, "bottom", length)) == 0) { - packPtr->side = BOTTOM; - } else if ((c == 'l') - && (strncmp(curOpt, "left", length)) == 0) { - packPtr->side = LEFT; - } else if ((c == 'r') - && (strncmp(curOpt, "right", length)) == 0) { - packPtr->side = RIGHT; - } else if ((c == 'e') - && (strncmp(curOpt, "expand", length)) == 0) { - packPtr->flags |= EXPAND; - } else if ((c == 'f') - && (strcmp(curOpt, "fill")) == 0) { - packPtr->flags |= FILLX|FILLY; - } else if ((length == 5) && (strcmp(curOpt, "fillx")) == 0) { - packPtr->flags |= FILLX; - } else if ((length == 5) && (strcmp(curOpt, "filly")) == 0) { - packPtr->flags |= FILLY; - } else if ((c == 'p') && (strcmp(curOpt, "padx")) == 0) { - if (optionCount <= (index+1)) { - missingPad: - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "wrong # args: \"%s\" option must be" - " followed by screen distance", curOpt)); - Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); - return TCL_ERROR; - } - if (TkParsePadAmount(interp, tkwin, options[index+1], - &packPtr->padLeft, &packPtr->padX) != TCL_OK) { - return TCL_ERROR; - } - packPtr->padX /= 2; - packPtr->padLeft /= 2; - packPtr->iPadX = 0; - index++; - } else if ((c == 'p') && (strcmp(curOpt, "pady")) == 0) { - if (optionCount <= (index+1)) { - goto missingPad; - } - if (TkParsePadAmount(interp, tkwin, options[index+1], - &packPtr->padTop, &packPtr->padY) != TCL_OK) { - return TCL_ERROR; - } - packPtr->padY /= 2; - packPtr->padTop /= 2; - packPtr->iPadY = 0; - index++; - } else if ((c == 'f') && (length > 1) - && (strncmp(curOpt, "frame", length) == 0)) { - if (optionCount <= (index+1)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "wrong # args: \"frame\"" - " option must be followed by anchor point", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); - return TCL_ERROR; - } - if (Tk_GetAnchorFromObj(interp, options[index+1], - &packPtr->anchor) != TCL_OK) { - return TCL_ERROR; - } - index++; - } else { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad option \"%s\": should be top, bottom, left," - " right, expand, fill, fillx, filly, padx, pady, or" - " frame", curOpt)); - Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); - return TCL_ERROR; - } - } - - if (packPtr != prevPtr) { - /* - * Unpack this window if it's currently packed. - */ - - if (packPtr->containerPtr != NULL) { - if ((packPtr->containerPtr != containerPtr) && - (packPtr->containerPtr->tkwin - != Tk_Parent(packPtr->tkwin))) { - Tk_UnmaintainGeometry(packPtr->tkwin, - packPtr->containerPtr->tkwin); - } - Unlink(packPtr); - } - - /* - * Add the window in the correct place in its container's packing - * order, then make sure that the window is managed by us. - */ - - packPtr->containerPtr = containerPtr; - if (prevPtr == NULL) { - packPtr->nextPtr = containerPtr->contentPtr; - containerPtr->contentPtr = packPtr; - } else { - packPtr->nextPtr = prevPtr->nextPtr; - prevPtr->nextPtr = packPtr; - } - Tk_ManageGeometry(tkwin, &packerType, packPtr); - - if (!(containerPtr->flags & DONT_PROPAGATE)) { - if (TkSetGeometryContainer(interp, containerPtr->tkwin, "pack") - != TCL_OK) { - Tk_ManageGeometry(tkwin, NULL, NULL); - Unlink(packPtr); - return TCL_ERROR; - } - containerPtr->flags |= ALLOCED_CONTAINER; - } - } - } - - /* - * Arrange for the container to be re-packed at the first idle moment. - */ - - if (containerPtr->abortPtr != NULL) { - *containerPtr->abortPtr = 1; - } - if (!(containerPtr->flags & REQUESTED_REPACK)) { - containerPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, containerPtr); - } - return TCL_OK; -} -#endif /* !TK_NO_DEPRECATED */ - -/* *---------------------------------------------------------------------- * * Unlink -- diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 4fb8b3c..dbe2c62 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -179,12 +179,6 @@ Tk_ScrollbarObjCmd( scrollPtr->sliderLast = 0; scrollPtr->activeField = 0; scrollPtr->activeRelief = TK_RELIEF_RAISED; -#ifndef TK_NO_DEPRECATED - scrollPtr->totalUnits = 0; - scrollPtr->windowUnits = 0; - scrollPtr->firstUnit = 0; - scrollPtr->lastUnit = 0; -#endif /* TK_NO_DEPRECATED */ scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; scrollPtr->cursor = NULL; @@ -379,16 +373,6 @@ ScrollbarWidgetObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "get"); goto error; } -#ifndef TK_NO_DEPRECATED - if (scrollPtr->flags & OLD_STYLE_COMMANDS) { - resObjs[0] = Tcl_NewWideIntObj(scrollPtr->totalUnits); - resObjs[1] = Tcl_NewWideIntObj(scrollPtr->windowUnits); - resObjs[2] = Tcl_NewWideIntObj(scrollPtr->firstUnit); - resObjs[3] = Tcl_NewWideIntObj(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)); @@ -440,48 +424,6 @@ ScrollbarWidgetObjCmd( } else { scrollPtr->lastFraction = last; } -#ifndef TK_NO_DEPRECATED - scrollPtr->flags &= ~OLD_STYLE_COMMANDS; - } else if (objc == 6) { - int totalUnits, windowUnits, firstUnit, lastUnit; - if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) { - goto error; - } - if (totalUnits < 0) { - totalUnits = 0; - } - if (Tcl_GetIntFromObj(interp, objv[3], &windowUnits) != TCL_OK) { - goto error; - } - if (windowUnits < 0) { - windowUnits = 0; - } - if (Tcl_GetIntFromObj(interp, objv[4], &firstUnit) != TCL_OK) { - goto error; - } - if (Tcl_GetIntFromObj(interp, objv[5], &lastUnit) != TCL_OK) { - goto error; - } - if (totalUnits > 0) { - if (lastUnit < firstUnit) { - lastUnit = firstUnit; - } - } else { - firstUnit = lastUnit = 0; - } - scrollPtr->totalUnits = totalUnits; - scrollPtr->windowUnits = windowUnits; - scrollPtr->firstUnit = firstUnit; - scrollPtr->lastUnit = lastUnit; - if (scrollPtr->totalUnits == 0) { - scrollPtr->firstFraction = 0.0; - scrollPtr->lastFraction = 1.0; - } else { - scrollPtr->firstFraction = ((double) firstUnit)/totalUnits; - scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits; - } - scrollPtr->flags |= OLD_STYLE_COMMANDS; -#endif /* !TK_NO_DEPRECATED */ } else { Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction"); goto error; diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 6912e71..3543d4f 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -96,22 +96,6 @@ typedef struct TkScrollbar { * the OLD_STYLE_COMMANDS flag is 1. */ -#ifndef TK_NO_DEPRECATED - int totalUnits; /* Total dimension of application, in units. - * 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 OLD_STYLE_COMMANDS flag is set. */ - int firstUnit; /* Number of last unit visible in - * application's window. Valid only if the - * OLD_STYLE_COMMANDS flag is set. */ - int lastUnit; /* Index of last unit visible in window. - * 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 */ -#endif /* TK_NO_DEPRECATED */ double firstFraction; /* Position of first visible thing in window, * specified as a fraction between 0 and * 1.0. */ @@ -157,9 +141,6 @@ typedef struct TkScrollbar { */ #define REDRAW_PENDING 1 -#ifndef TK_NO_DEPRECATED -# define OLD_STYLE_COMMANDS 2 -#endif /* TK_NO_DEPRECATED */ #define GOT_FOCUS 4 /* diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index e2acb38..c4c3b25 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -1121,7 +1121,6 @@ F966BC3C08F27A3C005CB29B /* message.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = message.test; sourceTree = ""; }; F966BC3D08F27A3C005CB29B /* msgbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.test; sourceTree = ""; }; F966BC3E08F27A3C005CB29B /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = ""; }; - F966BC3F08F27A3C005CB29B /* oldpack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oldpack.test; sourceTree = ""; }; F966BC4008F27A3C005CB29B /* option.file1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file1; sourceTree = ""; }; F966BC4108F27A3C005CB29B /* option.file2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file2; sourceTree = ""; }; F966BC4208F27A3C005CB29B /* option.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = option.test; sourceTree = ""; }; @@ -2676,7 +2675,6 @@ F966BC3C08F27A3C005CB29B /* message.test */, F966BC3D08F27A3C005CB29B /* msgbox.test */, F966BC3E08F27A3C005CB29B /* obj.test */, - F966BC3F08F27A3C005CB29B /* oldpack.test */, F966BC4008F27A3C005CB29B /* option.file1 */, F966BC4108F27A3C005CB29B /* option.file2 */, F966BC4208F27A3C005CB29B /* option.test */, diff --git a/tests/oldpack.test b/tests/oldpack.test deleted file mode 100644 index d8a1bfe..0000000 --- a/tests/oldpack.test +++ /dev/null @@ -1,558 +0,0 @@ -# This file is a Tcl script to test out the old syntax of Tk's -# "pack" command (before release 3.3). It is organized in the -# standard fashion for Tcl tests. -# -# Copyright © 1991-1994 The Regents of the University of California. -# Copyright © 1994 Sun Microsystems, Inc. -# Copyright © 1998-1999 Scriptics Corporation. -# All rights reserved. - -package require tcltest 2.2 -eval tcltest::configure $argv -tcltest::loadTestedCommands -namespace import -force tcltest::test - -# First, test a single window packed in various ways in a parent - -destroy .pack -frame .pack -place .pack -width 100 -height 100 -frame .pack.red -width 10 -height 20 -label .pack.red.l -text R -bd 2 -relief raised -place .pack.red.l -relwidth 1.0 -relheight 1.0 -frame .pack.green -width 30 -height 40 -label .pack.green.l -text G -bd 2 -relief raised -place .pack.green.l -relwidth 1.0 -relheight 1.0 -frame .pack.blue -width 40 -height 40 -label .pack.blue.l -text B -bd 2 -relief raised -place .pack.blue.l -relwidth 1.0 -relheight 1.0 -frame .pack.violet -width 80 -height 20 -label .pack.violet.l -text P -bd 2 -relief raised -place .pack.violet.l -relwidth 1.0 -relheight 1.0 - -if {![catch {pack ap .pack .pack.red top}]} { - -# Don't execute any of this file if Tk is compiled with -DTK_NO_DEPRECATED - - -test oldpack-1.1 {basic positioning} -body { - #pack ap .pack .pack.red top - update - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-1.2 {basic positioning} -body { - pack append .pack .pack.red bottom - update - winfo geometry .pack.red -} -result 10x20+45+80 -test oldpack-1.3 {basic positioning} -body { - pack append .pack .pack.red left - update - winfo geometry .pack.red -} -result 10x20+0+40 -test oldpack-1.4 {basic positioning} -body { - pack append .pack .pack.red right - update - winfo geometry .pack.red -} -result 10x20+90+40 - -# Try adding padding around the window and make sure that the -# window gets a larger frame. - -test oldpack-2.1 {padding} -body { - pack append .pack .pack.red {t padx 20} - update - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-2.2 {padding} -body { - pack append .pack .pack.red {top pady 20} - update - winfo geometry .pack.red -} -result 10x20+45+10 -test oldpack-2.3 {padding} -body { - pack append .pack .pack.red {l padx 20} - update - winfo geometry .pack.red -} -result 10x20+10+40 -test oldpack-2.4 {padding} -body { - pack append .pack .pack.red {left pady 20} - update - winfo geometry .pack.red -} -result 10x20+0+40 - -# Position the window at different positions in its frame to -# make sure they all work. Try two differenet frame locations, -# to make sure that frame offsets are being added in correctly. - -test oldpack-3.1 {framing} -body { - pack append .pack .pack.red {b padx 20 pady 30} - update - winfo geometry .pack.red -} -result 10x20+45+65 -test oldpack-3.2 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fr n} - update - winfo geometry .pack.red -} -result 10x20+45+50 -test oldpack-3.3 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame ne} - update - winfo geometry .pack.red -} -result 10x20+90+50 -test oldpack-3.4 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame e} - update - winfo geometry .pack.red -} -result 10x20+90+65 -test oldpack-3.5 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame se} - update - winfo geometry .pack.red -} -result 10x20+90+80 -test oldpack-3.6 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame s} - update - winfo geometry .pack.red -} -result 10x20+45+80 -test oldpack-3.7 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame sw} - update - winfo geometry .pack.red -} -result 10x20+0+80 -test oldpack-3.8 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame w} - update - winfo geometry .pack.red -} -result 10x20+0+65 -test oldpack-3.9 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame nw} - update - winfo geometry .pack.red -} -result 10x20+0+50 -test oldpack-3.10 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame c} - update - winfo geometry .pack.red -} -result 10x20+45+65 -test oldpack-3.11 {framing} -body { - pack append .pack .pack.red {r padx 20 pady 30} - update - winfo geometry .pack.red -} -result 10x20+80+40 -test oldpack-3.12 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame n} - update - winfo geometry .pack.red -} -result 10x20+80+0 -test oldpack-3.13 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame ne} - update - winfo geometry .pack.red -} -result 10x20+90+0 -test oldpack-3.14 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame e} - update - winfo geometry .pack.red -} -result 10x20+90+40 -test oldpack-3.15 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame se} - update - winfo geometry .pack.red -} -result 10x20+90+80 -test oldpack-3.16 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame s} - update - winfo geometry .pack.red -} -result 10x20+80+80 -test oldpack-3.17 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame sw} - update - winfo geometry .pack.red -} -result 10x20+70+80 -test oldpack-3.18 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame w} - update - winfo geometry .pack.red -} -result 10x20+70+40 -test oldpack-3.19 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame nw} - update - winfo geometry .pack.red -} -result 10x20+70+0 -test oldpack-3.20 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame center} - update - winfo geometry .pack.red -} -result 10x20+80+40 - -# Try out various filling combinations in a couple of different -# frame locations. - -test oldpack-4.1 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fillx} - update - winfo geometry .pack.red -} -result 100x20+0+65 -test oldpack-4.2 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 filly} - update - winfo geometry .pack.red -} -result 10x50+45+50 -test oldpack-4.3 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fill} - update - winfo geometry .pack.red -} -result 100x50+0+50 -test oldpack-4.4 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 fillx} - update - winfo geometry .pack.red -} -result 30x20+70+40 -test oldpack-4.5 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 filly} - update - winfo geometry .pack.red -} -result 10x100+80+0 -test oldpack-4.6 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 fill} - update - winfo geometry .pack.red -} -result 30x100+70+0 - -# Multiple windows: make sure that space is properly subtracted -# from the cavity as windows are positioned inwards from all -# different sides. Also make sure that windows get unmapped if -# there isn't enough space for them. - -pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top -update -test oldpack-5.1 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-5.2 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+35+20 -test oldpack-5.3 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+60 -test oldpack-5.4 {multiple windows} -body { - winfo ismapped .pack.violet -} -result 0 - -pack b .pack.blue .pack.violet top -update -test oldpack-5.5 {multiple windows} -body { - winfo ismapped .pack.violet -} -result 1 -test oldpack-5.6 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+10+60 -test oldpack-5.7 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x20+30+80 - -pack after .pack.blue .pack.red top -update -test oldpack-5.8 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+35+0 -test oldpack-5.9 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+10+40 -test oldpack-5.10 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+60 -test oldpack-5.11 {multiple windows} -body { - winfo ismapped .pack.red -} -result 0 - -pack before .pack.green .pack.red right .pack.blue left -update -test oldpack-5.12 {multiple windows} -body { - winfo ismapped .pack.red -} -result 1 -test oldpack-5.13 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+90+40 -test oldpack-5.14 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+0+30 -test oldpack-5.15 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+50+0 -test oldpack-5.16 {multiple windows} -body { - winfo geometry .pack.violet -} -result 50x20+40+40 - -pack append .pack .pack.violet left .pack.green bottom .pack.red bottom \ - .pack.blue bottom -update -test oldpack-5.17 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+0+40 -test oldpack-5.18 {multiple windows} -body { - winfo geometry .pack.green -} -result 20x40+80+60 -test oldpack-5.19 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+85+40 -test oldpack-5.20 {multiple windows} -body { - winfo geometry .pack.blue -} -result 20x40+80+0 - -pack after .pack.blue .pack.blue top .pack.red right .pack.green right \ - .pack.violet right -update -test oldpack-5.21 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+0 -test oldpack-5.22 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+90+60 -test oldpack-5.23 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+60+50 -test oldpack-5.24 {multiple windows} -body { - winfo geometry .pack.violet -} -result 60x20+0+60 - -pack after .pack.blue .pack.red left .pack.green left .pack.violet left -update -test oldpack-5.25 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+0 -test oldpack-5.26 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+0+60 -test oldpack-5.27 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+10+50 -test oldpack-5.28 {multiple windows} -body { - winfo geometry .pack.violet -} -result 60x20+40+60 - -pack append .pack .pack.violet left .pack.green left .pack.blue left \ - .pack.red left -update -test oldpack-5.29 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+0+40 -test oldpack-5.30 {multiple windows} -body { - winfo geometry .pack.green -} -result 20x40+80+30 -test oldpack-5.31 {multiple windows} -body { - winfo ismapped .pack.blue -} -result 0 -test oldpack-5.32 {multiple windows} -body { - winfo ismapped .pack.red -} -result 0 - - -# Test the ability of the packer to propagate geometry information -# to its parent. Make sure it computes the parent's needs both in -# the direction of packing (width for "left" and "right" windows, -# for example), and perpendicular to the pack direction (height for -# "left" and "right" windows). - -pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top -update -test oldpack-6.1 {geometry propagation} -body { - winfo reqwidth .pack} -result 80 -test oldpack-6.2 {geometry propagation} -body { - winfo reqheight .pack} -result 120 -destroy .pack.violet -update -test oldpack-6.3 {geometry propagation} -body { - winfo reqwidth .pack} -result 40 -test oldpack-6.4 {geometry propagation} -body { - winfo reqheight .pack} -result 100 -frame .pack.violet -width 80 -height 20 -bg violet -label .pack.violet.l -text P -bd 2 -relief raised -place .pack.violet.l -relwidth 1.0 -relheight 1.0 -pack append .pack .pack.red left .pack.green right .pack.blue bottom \ - .pack.violet top -update -test oldpack-6.5 {geometry propagation} -body { - winfo reqwidth .pack} -result 120 -test oldpack-6.6 {geometry propagation} -body { - winfo reqheight .pack} -result 60 -pack append .pack .pack.violet top .pack.green top .pack.blue left \ - .pack.red left -update -test oldpack-6.7 {geometry propagation} -body { - winfo reqwidth .pack} -result 80 -test oldpack-6.8 {geometry propagation} -body { - winfo reqheight .pack} -result 100 - -# Test the "expand" option, and make sure space is evenly divided -# when several windows request expansion. - -pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} -update -test oldpack-7.1 {multiple expanded windows} -body { - pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} - update - list [winfo geometry .pack.green] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} -result {30x40+3+40 40x40+39+40 10x20+86+50} -test oldpack-7.2 {multiple expanded windows} -body { - pack append .pack .pack.green left .pack.violet {bottom expand} \ - .pack.blue {bottom expand} .pack.red {bottom expand} - update - list [winfo geometry .pack.violet] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} -result {70x20+30+77 40x40+45+30 10x20+60+3} -test oldpack-7.3 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.green {left e fill} .pack.red {left expand fill} \ - .pack.blue {top fill} - update - list [winfo geometry .pack.green] [winfo geometry .pack.red] \ - [winfo geometry .pack.blue] -} -result {40x100+0+0 20x100+40+0 40x40+60+0} -test oldpack-7.4 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.red {top expand} .pack.violet {top expand} \ - .pack.blue {right fill} - update - list [winfo geometry .pack.red] [winfo geometry .pack.violet] \ - [winfo geometry .pack.blue] -} -result {10x20+45+5 80x20+10+35 40x40+60+60} -test oldpack-7.5 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.green {right frame s} .pack.red {top expand} - update - list [winfo geometry .pack.green] [winfo geometry .pack.red] -} -result {30x40+70+60 10x20+30+40} -test oldpack-7.6 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.violet {bottom frame e} .pack.red {right expand} - update - list [winfo geometry .pack.violet] [winfo geometry .pack.red] -} -result {80x20+20+80 10x20+45+30} - -# Need more bizarre tests with combinations of expanded windows and -# windows in opposing directions! Also, include padding in expanded -# (and unexpanded) windows. - -# Syntax errors on pack commands - -test oldpack-8.1 {syntax errors} -body { - pack -} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.2 {syntax errors} -body { - pack append -} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.3 {syntax errors} -body { - pack gorp foo -} -returnCodes error -result {bad option "gorp": must be configure, content, forget, info, or propagate} -test oldpack-8.4 {syntax errors} -body { - pack a .pack -} -returnCodes error -result {bad option "a": must be configure, content, forget, info, or propagate} -test oldpack-8.5 {syntax errors} -body { - pack after foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.6 {syntax errors} -setup { - destroy .pack.yellow -} -body { - frame .pack.yellow -bg yellow - pack after .pack.yellow -} -cleanup { - destroy .pack.yellow -} -returnCodes error -result {window ".pack.yellow" isn't packed} -test oldpack-8.7 {syntax errors} -body { - pack append foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.8 {syntax errors} -body { - pack before foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.9 {syntax errors} -setup { - destroy .pack.yellow -} -body { - frame .pack.yellow -bg yellow - pack before .pack.yellow -} -cleanup { - destroy .pack.yellow -} -returnCodes error -result {window ".pack.yellow" isn't packed} -test oldpack-8.10 {syntax errors} -body { - pack info .pack help -} -returnCodes error -result {wrong # args: should be "pack info window"} -test oldpack-8.11 {syntax errors} -body { - pack info foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.12 {syntax errors} -body { - pack append .pack .pack.blue -} -returnCodes error -result {wrong # args: window ".pack.blue" should be followed by options} -test oldpack-8.13 {syntax errors} -body { - pack append . .pack.blue top -} -returnCodes error -result {can't pack ".pack.blue" inside "."} -test oldpack-8.14 {syntax errors} -body { - pack append .pack .pack.blue f -} -returnCodes error -result {bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.15 {syntax errors} -body { - pack append .pack .pack.blue pad -} -returnCodes error -result {bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.16 {syntax errors} -body { - pack append .pack .pack.blue {frame south} -} -returnCodes error -result {bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center} -test oldpack-8.17 {syntax errors} -body { - pack append .pack .pack.blue {padx -2} -} -returnCodes error -result {bad pad value "-2": must be positive screen distance} -test oldpack-8.18 {syntax errors} -body { - pack append .pack .pack.blue {padx} -} -returnCodes error -result {wrong # args: "padx" option must be followed by screen distance} -test oldpack-8.19 {syntax errors} -body { - pack append .pack .pack.blue {pady -2} -} -returnCodes error -result {bad pad value "-2": must be positive screen distance} -test oldpack-8.20 {syntax errors} -body { - pack append .pack .pack.blue {pady} -} -returnCodes error -result {wrong # args: "pady" option must be followed by screen distance} -test oldpack-8.21 {syntax errors} -body { - pack append .pack .pack.blue "\{abc" -} -returnCodes error -result {unmatched open brace in list} -test oldpack-8.22 {syntax errors} -body { - pack append .pack .pack.blue frame -} -returnCodes error -result {wrong # args: "frame" option must be followed by anchor point} - -# Test "pack info" command output. - -test oldpack-9.1 {information output} -body { - pack append .pack .pack.blue {top fillx frame n} \ - .pack.red {bottom filly frame s} .pack.green {left fill frame w} \ - .pack.violet {right expand frame e} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}} -test oldpack-9.2 {information output} -body { - pack append .pack .pack.blue {padx 10 frame nw} \ - .pack.red {pady 20 frame ne} .pack.green {frame se} \ - .pack.violet {frame sw} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} -test oldpack-9.3 {information output} -body { - pack append .pack .pack.blue {frame center} .pack.red {frame center} \ - .pack.green {frame c} .pack.violet {frame c} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} - -} -destroy .pack - -# cleanup -cleanupTests -return - -- cgit v0.12 From d7f53a87a53c33038961f66247a7a0312e684c70 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 14:21:48 +0000 Subject: Remove Tk_FreeXId/Tk_FreeStyleFromObj (doing nothing for ages) and Tk_GetStyleFromObj (undocumented alternative for Tk_AllocStyleFromObj()). No known extension uses any of those. --- doc/FreeXId.3 | 30 ------------------------------ generic/tkDecls.h | 5 ----- 2 files changed, 35 deletions(-) delete mode 100644 doc/FreeXId.3 diff --git a/doc/FreeXId.3 b/doc/FreeXId.3 deleted file mode 100644 index 84fef26..0000000 --- a/doc/FreeXId.3 +++ /dev/null @@ -1,30 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures" -.so man.macros -.BS -.SH NAME -Tk_FreeXId \- make X resource identifier available for reuse -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_FreeXId(\fIdisplay, id\fB)\fR -.SH ARGUMENTS -.AS Display *display out -.AP Display *display in -Display for which \fIid\fR was allocated. -.AP XID id in -Identifier of X resource (window, font, pixmap, cursor, graphics -context, or colormap) that is no longer in use. -.BE -.SH DESCRIPTION -.PP -This function is deprecated, it doesn't do anything since 2008-08-19. -.SH KEYWORDS -resource identifier diff --git a/generic/tkDecls.h b/generic/tkDecls.h index a7ae350..1a72f99 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -1774,9 +1774,6 @@ extern const TkStubs *tkStubsPtr; /* !END!: Do not edit above this line. */ -#define Tk_FreeXId(display,xid) /* no-op */ -#define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj) -#define Tk_FreeStyleFromObj(obj) /* no-op */ #define Tk_GetImageMasterData Tk_GetImageModelData #ifndef MAC_OSX_TK @@ -1797,6 +1794,4 @@ EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp); #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#undef TkUnusedStubEntry - #endif /* _TKDECLS */ -- cgit v0.12 From c42644884af2bc9639c7a0273d8856d1a21d04bb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 15:53:21 +0000 Subject: Get rid of the "Dummy entry for stubs table backwards compatibility" --- generic/tkInt.decls | 72 +++++++++--------------- generic/tkIntDecls.h | 45 ++------------- generic/tkIntPlatDecls.h | 143 +++++++++++++++++++++++------------------------ generic/tkStubInit.c | 70 ++++++++--------------- macosx/tkMacOSXWm.c | 6 +- unix/tkUnixPort.h | 9 --- win/tkWinPort.h | 9 --- 7 files changed, 129 insertions(+), 225 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index e056e3f..bf5e4ed 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -392,13 +392,13 @@ declare 119 { int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return) } -declare 121 aqua { +declare 121 { Pixmap TkpCreateNativeBitmap(Display *display, const void *source) } -declare 122 aqua { +declare 122 { void TkpDefineNativeBitmaps(void) } -declare 124 aqua { +declare 124 { Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height) } @@ -624,20 +624,20 @@ interface tkIntPlat ################################ # Unix specific functions -declare 0 x11 { - void TkCreateXEventSource(void) -} declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } -declare 8 x11 { +declare 6 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } +declare 7 x11 { + int TkpWmSetState(TkWindow *winPtr, int state) +} declare 9 x11 { void TkWmCleanup(TkDisplay *dispPtr) } -declare 12 x11 { - int TkpWmSetState(TkWindow *winPtr, int state) +declare 37 x11 { + void TkCreateXEventSource(void) } # only needed by tktest: declare 38 x11 { @@ -673,6 +673,9 @@ declare 45 x11 { declare 0 win { char *TkAlignImageData(XImage *image, int alignment, int bitOrder) } +declare 1 win { + void TkWinCancelMouseTimer(void) +} declare 2 win { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } @@ -689,20 +692,17 @@ declare 6 win { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 7 win { - void TkpSetCapture(TkWindow *winPtr) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - int TkpWmSetState(TkWindow *winPtr, int state) + void TkpSetCapture(TkWindow *winPtr) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) } -declare 11 win { - void TkWinCancelMouseTimer(void) -} declare 12 win { void TkWinClipboardRender(TkDisplay *dispPtr, UINT format) } @@ -827,37 +827,39 @@ declare 47 win { ################################ # Aqua specific functions +declare 1 aqua { + void TkAboutDlg(void) +} declare 2 aqua { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 3 aqua { - void TkPointerDeadWindow(TkWindow *winPtr) + unsigned long TkpGetMS(void) } declare 4 aqua { - void TkpSetCapture(TkWindow *winPtr) + void TkPointerDeadWindow(TkWindow *winPtr) } declare 5 aqua { void TkpSetCursor(TkpCursor cursor) } declare 6 aqua { - void TkpWmSetState(TkWindow *winPtr, int state) + int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 7 aqua { - void TkAboutDlg(void) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 8 aqua { unsigned int TkMacOSXButtonKeyState(void) } declare 9 aqua { - void TkMacOSXClearMenubarActive(void) + void TkpSetCapture(TkWindow *winPtr) } declare 10 aqua { int TkMacOSXDispatchMenuEvent(int menuID, int index) } -# Now a static function -# declare 11 aqua { -# void TkMacOSXInstallCursor(int resizeOverride) -# } +declare 11 aqua { + void TkMacOSXClearMenubarActive(void) +} declare 12 aqua { void TkMacOSXHandleTearoffMenu(void) } @@ -874,16 +876,6 @@ declare 18 aqua { void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem, int optionKeyPressed) } - -# removed duplicates from tkPlat table(tk.decls) -#declare 19 aqua { -# void TkMacOSXInitAppleEvents(Tcl_Interp *interp) -#} -# -#declare 20 aqua { -# void TkMacOSXInitMenus(Tcl_Interp *interp) -#} - declare 21 aqua { void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag) } @@ -896,10 +888,6 @@ declare 24 aqua { declare 25 aqua { void TkMacOSXMenuClick(void) } -# The corresponding Unregister was not a stub, and this should be static. -#declare 26 aqua { -# void TkMacOSXRegisterOffScreenWindow(Window window, void *portPtr) -#} declare 27 aqua { int TkMacOSXResizable(TkWindow *winPtr) } @@ -915,10 +903,6 @@ declare 31 aqua { declare 32 aqua { void TkMacOSXUpdateClipRgn(TkWindow *winPtr) } -# This was not implemented. Perhaps meant to be OffScreen ? -#declare 33 aqua { -# void TkMacOSXUnregisterMacWindow(void *portPtr) -#} declare 34 aqua { int TkMacOSXUseMenuID(short macID) } @@ -971,16 +955,10 @@ declare 51 aqua { declare 52 aqua { void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) } -declare 53 aqua { - unsigned long TkpGetMS(void) -} # For Canvas3d, requested by Sean Woods declare 54 aqua { void *TkMacOSXDrawable(Drawable drawable) } -declare 55 aqua { - int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) -} ############################################################################## diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index b6c2543..c1ec37f 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -340,21 +340,15 @@ EXTERN int XSetRegion(Display *display, GC gc, Region rgn); EXTERN int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return); /* Slot 120 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ /* 121 */ EXTERN Pixmap TkpCreateNativeBitmap(Display *display, const void *source); -#endif /* AQUA */ -#ifdef MAC_OSX_TK /* AQUA */ /* 122 */ EXTERN void TkpDefineNativeBitmaps(void); -#endif /* AQUA */ /* Slot 123 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ /* 124 */ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height); -#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ @@ -675,37 +669,10 @@ typedef struct TkIntStubs { int (*xSetRegion) (Display *display, GC gc, Region rgn); /* 118 */ int (*xUnionRectWithRegion) (XRectangle *rect, Region src, Region dr_return); /* 119 */ void (*reserved120)(void); -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved121)(void); -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - void (*reserved121)(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */ Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */ -#endif /* AQUA */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved122)(void); -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - void (*reserved122)(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */ void (*tkpDefineNativeBitmaps) (void); /* 122 */ -#endif /* AQUA */ void (*reserved123)(void); -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved124)(void); -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - void (*reserved124)(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */ Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */ -#endif /* AQUA */ void (*reserved125)(void); void (*reserved126)(void); void (*reserved127)(void); @@ -1012,19 +979,13 @@ extern const TkIntStubs *tkIntStubsPtr; #define XUnionRectWithRegion \ (tkIntStubsPtr->xUnionRectWithRegion) /* 119 */ /* Slot 120 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkpCreateNativeBitmap \ (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */ -#endif /* AQUA */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkpDefineNativeBitmaps \ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */ -#endif /* AQUA */ /* Slot 123 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkpGetNativeAppBitmap \ (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */ -#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ @@ -1150,8 +1111,14 @@ extern const TkIntStubs *tkIntStubsPtr; #if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS) # undef TkpWillDrawWidget # undef TkpRedrawWidget +# undef TkpDefineNativeBitmaps +# undef TkpCreateNativeBitmap +# undef TkpGetNativeAppBitmap # define TkpWillDrawWidget(w) 0 # define TkpRedrawWidget(w) +# define TkpDefineNativeBitmaps() +# define TkpCreateNativeBitmap(display, source) None +# define TkpGetNativeAppBitmap(display, name, w, h) None #endif #endif /* _TKINTDECLS */ diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index aedad62..7a0cc65 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -38,7 +38,8 @@ extern "C" { /* 0 */ EXTERN char * TkAlignImageData(XImage *image, int alignment, int bitOrder); -/* Slot 1 is reserved */ +/* 1 */ +EXTERN void TkWinCancelMouseTimer(void); /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); @@ -52,15 +53,14 @@ EXTERN void TkpPrintWindowId(char *buf, Window window); EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); /* 7 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 8 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 9 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 10 */ EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); -/* 11 */ -EXTERN void TkWinCancelMouseTimer(void); +/* Slot 11 is reserved */ /* 12 */ EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format); /* 13 */ @@ -146,27 +146,30 @@ EXTERN Tk_Window TkpGetCapture(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ -/* Slot 1 is reserved */ +/* 1 */ +EXTERN void TkAboutDlg(void); /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* 3 */ -EXTERN void TkPointerDeadWindow(TkWindow *winPtr); +EXTERN unsigned long TkpGetMS(void); /* 4 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN void TkPointerDeadWindow(TkWindow *winPtr); /* 5 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 6 */ -EXTERN void TkpWmSetState(TkWindow *winPtr, int state); +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + const char *string, Window *idPtr); /* 7 */ -EXTERN void TkAboutDlg(void); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 8 */ EXTERN unsigned int TkMacOSXButtonKeyState(void); /* 9 */ -EXTERN void TkMacOSXClearMenubarActive(void); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 10 */ EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); -/* Slot 11 is reserved */ +/* 11 */ +EXTERN void TkMacOSXClearMenubarActive(void); /* 12 */ EXTERN void TkMacOSXHandleTearoffMenu(void); /* Slot 13 is reserved */ @@ -245,17 +248,12 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* 52 */ EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); -/* 53 */ -EXTERN unsigned long TkpGetMS(void); +/* Slot 53 is reserved */ /* 54 */ EXTERN void * TkMacOSXDrawable(Drawable drawable); -/* 55 */ -EXTERN int TkpScanWindowId(Tcl_Interp *interp, - const char *string, Window *idPtr); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -/* 0 */ -EXTERN void TkCreateXEventSource(void); +/* Slot 0 is reserved */ /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, @@ -263,17 +261,17 @@ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, /* Slot 3 is reserved */ /* Slot 4 is reserved */ /* Slot 5 is reserved */ -/* Slot 6 is reserved */ -/* Slot 7 is reserved */ -/* 8 */ +/* 6 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); +/* 7 */ +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +/* Slot 8 is reserved */ /* 9 */ EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* Slot 10 is reserved */ /* Slot 11 is reserved */ -/* 12 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +/* Slot 12 is reserved */ /* Slot 13 is reserved */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ @@ -298,7 +296,8 @@ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ -/* Slot 37 is reserved */ +/* 37 */ +EXTERN void TkCreateXEventSource(void); /* 38 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ @@ -324,17 +323,17 @@ typedef struct TkIntPlatStubs { #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ - void (*reserved1)(void); + void (*tkWinCancelMouseTimer) (void); /* 1 */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ unsigned long (*tkpGetMS) (void); /* 3 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 9 */ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ - void (*tkWinCancelMouseTimer) (void); /* 11 */ + void (*reserved11)(void); void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */ void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */ @@ -374,17 +373,17 @@ typedef struct TkIntPlatStubs { #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*reserved0)(void); - void (*reserved1)(void); + void (*tkAboutDlg) (void); /* 1 */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ - void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ + unsigned long (*tkpGetMS) (void); /* 3 */ + void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ - void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */ - void (*tkAboutDlg) (void); /* 7 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ - void (*tkMacOSXClearMenubarActive) (void); /* 9 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 9 */ int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ - void (*reserved11)(void); + void (*tkMacOSXClearMenubarActive) (void); /* 11 */ void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ void (*reserved13)(void); int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */ @@ -426,24 +425,23 @@ 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 */ - unsigned long (*tkpGetMS) (void); /* 53 */ + void (*reserved53)(void); void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ - int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - void (*tkCreateXEventSource) (void); /* 0 */ + void (*reserved0)(void); void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ void (*reserved3)(void); void (*reserved4)(void); void (*reserved5)(void); - void (*reserved6)(void); - void (*reserved7)(void); - int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ + void (*reserved8)(void); void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ void (*reserved10)(void); void (*reserved11)(void); - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ + void (*reserved12)(void); void (*reserved13)(void); void (*reserved14)(void); void (*reserved15)(void); @@ -468,7 +466,7 @@ typedef struct TkIntPlatStubs { void (*reserved34)(void); void (*reserved35)(void); void (*reserved36)(void); - void (*reserved37)(void); + void (*tkCreateXEventSource) (void); /* 37 */ int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync) (Display *display); /* 39 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ @@ -495,7 +493,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ -/* Slot 1 is reserved */ +#define TkWinCancelMouseTimer \ + (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 1 */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkpGetMS \ @@ -506,16 +505,15 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpPrintWindowId) /* 5 */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 7 */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 8 */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 9 */ #define TkSetPixmapColormap \ (tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */ -#define TkWinCancelMouseTimer \ - (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 11 */ +/* Slot 11 is reserved */ #define TkWinClipboardRender \ (tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */ #define TkWinEmbeddedEventProc \ @@ -589,26 +587,28 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ -/* Slot 1 is reserved */ +#define TkAboutDlg \ + (tkIntPlatStubsPtr->tkAboutDlg) /* 1 */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ +#define TkpGetMS \ + (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ #define TkPointerDeadWindow \ - (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */ + (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */ +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ #define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */ -#define TkAboutDlg \ - (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */ + (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ #define TkMacOSXButtonKeyState \ (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ -#define TkMacOSXClearMenubarActive \ - (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 9 */ #define TkMacOSXDispatchMenuEvent \ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ -/* Slot 11 is reserved */ +#define TkMacOSXClearMenubarActive \ + (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 11 */ #define TkMacOSXHandleTearoffMenu \ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ /* Slot 13 is reserved */ @@ -681,32 +681,28 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ #define TkMacOSXSetDrawingEnabled \ (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ -#define TkpGetMS \ - (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +/* Slot 53 is reserved */ #define TkMacOSXDrawable \ (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ -#define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ +/* Slot 0 is reserved */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ /* Slot 3 is reserved */ /* Slot 4 is reserved */ /* Slot 5 is reserved */ -/* Slot 6 is reserved */ -/* Slot 7 is reserved */ #define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ +/* Slot 8 is reserved */ #define TkWmCleanup \ (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ /* Slot 10 is reserved */ /* Slot 11 is reserved */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ +/* Slot 12 is reserved */ /* Slot 13 is reserved */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ @@ -731,7 +727,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ -/* Slot 37 is reserved */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #define TkpSync \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index ff2cc1c..e32ea2c 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -53,8 +53,14 @@ doNothing(void) } # undef TkpWillDrawWidget # undef TkpRedrawWidget +# undef TkpDefineNativeBitmaps +# undef TkpCreateNativeBitmap +# undef TkpGetNativeAppBitmap # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) # define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing) +# define TkpDefineNativeBitmaps ((void (*)())(void *)doNothing) +# define TkpCreateNativeBitmap ((Pixmap (*)(Display *, const void *))(void *)doNothing) +# define TkpGetNativeAppBitmap ((Pixmap (*)(Display *, const char*, int *, int *))(void *)doNothing) #endif #ifdef _WIN32 @@ -353,37 +359,10 @@ static const TkIntStubs tkIntStubs = { XSetRegion, /* 118 */ XUnionRectWithRegion, /* 119 */ 0, /* 120 */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 121 */ -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - 0, /* 121 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */ TkpCreateNativeBitmap, /* 121 */ -#endif /* AQUA */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 122 */ -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - 0, /* 122 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */ TkpDefineNativeBitmaps, /* 122 */ -#endif /* AQUA */ 0, /* 123 */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 124 */ -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - 0, /* 124 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */ TkpGetNativeAppBitmap, /* 124 */ -#endif /* AQUA */ 0, /* 125 */ 0, /* 126 */ 0, /* 127 */ @@ -454,17 +433,17 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ - 0, /* 1 */ + TkWinCancelMouseTimer, /* 1 */ TkGenerateActivateEvents, /* 2 */ TkpGetMS, /* 3 */ TkPointerDeadWindow, /* 4 */ TkpPrintWindowId, /* 5 */ TkpScanWindowId, /* 6 */ - TkpSetCapture, /* 7 */ + TkpWmSetState, /* 7 */ TkpSetCursor, /* 8 */ - TkpWmSetState, /* 9 */ + TkpSetCapture, /* 9 */ TkSetPixmapColormap, /* 10 */ - TkWinCancelMouseTimer, /* 11 */ + 0, /* 11 */ TkWinClipboardRender, /* 12 */ TkWinEmbeddedEventProc, /* 13 */ TkWinFillRect, /* 14 */ @@ -504,17 +483,17 @@ static const TkIntPlatStubs tkIntPlatStubs = { #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ 0, /* 0 */ - 0, /* 1 */ + TkAboutDlg, /* 1 */ TkGenerateActivateEvents, /* 2 */ - TkPointerDeadWindow, /* 3 */ - TkpSetCapture, /* 4 */ + TkpGetMS, /* 3 */ + TkPointerDeadWindow, /* 4 */ TkpSetCursor, /* 5 */ - TkpWmSetState, /* 6 */ - TkAboutDlg, /* 7 */ + TkpScanWindowId, /* 6 */ + TkpWmSetState, /* 7 */ TkMacOSXButtonKeyState, /* 8 */ - TkMacOSXClearMenubarActive, /* 9 */ + TkpSetCapture, /* 9 */ TkMacOSXDispatchMenuEvent, /* 10 */ - 0, /* 11 */ + TkMacOSXClearMenubarActive, /* 11 */ TkMacOSXHandleTearoffMenu, /* 12 */ 0, /* 13 */ TkMacOSXDoHLEvent, /* 14 */ @@ -556,24 +535,23 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ TkMacOSXSetDrawingEnabled, /* 52 */ - TkpGetMS, /* 53 */ + 0, /* 53 */ TkMacOSXDrawable, /* 54 */ - TkpScanWindowId, /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - TkCreateXEventSource, /* 0 */ + 0, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ 0, /* 3 */ 0, /* 4 */ 0, /* 5 */ - 0, /* 6 */ - 0, /* 7 */ - TkpScanWindowId, /* 8 */ + TkpScanWindowId, /* 6 */ + TkpWmSetState, /* 7 */ + 0, /* 8 */ TkWmCleanup, /* 9 */ 0, /* 10 */ 0, /* 11 */ - TkpWmSetState, /* 12 */ + 0, /* 12 */ 0, /* 13 */ 0, /* 14 */ 0, /* 15 */ @@ -598,7 +576,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, /* 34 */ 0, /* 35 */ 0, /* 36 */ - 0, /* 37 */ + TkCreateXEventSource, /* 37 */ TkpCmapStressed, /* 38 */ TkpSync, /* 39 */ TkUnixContainerId, /* 40 */ diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 547657b..cc8bcd2 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6978,7 +6978,7 @@ TkpGetWrapperWindow( *---------------------------------------------------------------------- */ -void +int TkpWmSetState( TkWindow *winPtr, /* Toplevel window to operate on. */ int state) /* One of IconicState, ZoomState, NormalState, @@ -6989,7 +6989,7 @@ TkpWmSetState( wmPtr->hints.initial_state = state; if (wmPtr->flags & WM_NEVER_MAPPED) { - return; + goto setStateEnd; } macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); @@ -7033,6 +7033,8 @@ TkpWmSetState( */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} +setStateEnd: + return 1; } /* diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 1cd2e8a..097c7b8 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -146,15 +146,6 @@ #endif /* - * These calls implement native bitmaps which are not supported under - * UNIX. The macros eliminate the calls. - */ - -#define TkpDefineNativeBitmaps() -#define TkpCreateNativeBitmap(display, source) None -#define TkpGetNativeAppBitmap(display, name, w, h) None - -/* * This macro stores a representation of the window handle in a string. * This should perhaps use the real size of an XID. */ diff --git a/win/tkWinPort.h b/win/tkWinPort.h index d3471ca..fd43335 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -124,13 +124,4 @@ #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \ | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000) -/* - * These calls implement native bitmaps which are not currently - * supported under Windows. The macros eliminate the calls. - */ - -#define TkpDefineNativeBitmaps() -#define TkpCreateNativeBitmap(display, source) None -#define TkpGetNativeAppBitmap(display, name, w, h) None - #endif /* _WINPORT */ -- cgit v0.12 From 231909c746eb91d932c6723cd0b0f559ec1a93c3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 16 Nov 2023 19:35:44 +0000 Subject: Fix the build. --- generic/tkStubInit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index e32ea2c..00ff9b3 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -58,7 +58,7 @@ doNothing(void) # undef TkpGetNativeAppBitmap # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) # define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing) -# define TkpDefineNativeBitmaps ((void (*)())(void *)doNothing) +# define TkpDefineNativeBitmaps ((void (*))(void *)doNothing) # define TkpCreateNativeBitmap ((Pixmap (*)(Display *, const void *))(void *)doNothing) # define TkpGetNativeAppBitmap ((Pixmap (*)(Display *, const char*, int *, int *))(void *)doNothing) #endif -- cgit v0.12 From e3e93e23861ed2c8e1213f89887559200797eefd Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 16 Nov 2023 19:48:55 +0000 Subject: Remove leftover comments no longer needed after previous commits removing deprecated code. --- generic/tk.h | 13 +------------ generic/tkInt.h | 4 ---- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index 9678a06..52e0e8a 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1500,8 +1500,7 @@ typedef struct Tk_ElementSpec { *---------------------------------------------------------------------- * * The definitions below provide backward compatibility for functions and - * types related to event handling that used to be in Tk but have moved to - * Tcl. + * types that used to be in Tk but have moved to Tcl. * *---------------------------------------------------------------------- */ @@ -1556,16 +1555,6 @@ typedef Tcl_Size (Tk_SelectionProc) (void *clientData, Tcl_Size offset, #include "tkDecls.h" -/* - *---------------------------------------------------------------------- - * - * Allow users to say that they don't want to alter their source to add extra - * arguments to Tk_PhotoPutBlock() et al. - * - * This goes after the inclusion of the stubbed-decls so that the declarations - * of what is actually there can be correct. - */ - #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/generic/tkInt.h b/generic/tkInt.h index dc44576..d503e95 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -545,10 +545,6 @@ typedef struct TkDisplay { * the display when we no longer have any Tk * applications using it. */ - /* - * The following field were all added for Tk8.3 - */ - Tk_Window warpWindow; Tk_Window warpMainwin; /* For finding the root window for warping * purposes. */ -- cgit v0.12 From 285546bf19f7b05f24343d7127cb846b168307d8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 20:11:02 +0000 Subject: Fix the (C++) build --- generic/tkStubInit.c | 2 +- generic/ttk/ttkTreeview.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 00ff9b3..01275f3 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -58,7 +58,7 @@ doNothing(void) # undef TkpGetNativeAppBitmap # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) # define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing) -# define TkpDefineNativeBitmaps ((void (*))(void *)doNothing) +# define TkpDefineNativeBitmaps ((void (*)(void))(void *)doNothing) # define TkpCreateNativeBitmap ((Pixmap (*)(Display *, const void *))(void *)doNothing) # define TkpGetNativeAppBitmap ((Pixmap (*)(Display *, const char*, int *, int *))(void *)doNothing) #endif diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 1197932..4079dc2 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -3269,7 +3269,7 @@ static int TreeviewDetachedCommand( Tcl_Obj *objPtr = Tcl_NewObj(); while (entryPtr != NULL) { - item = Tcl_GetHashValue(entryPtr); + item = (TreeItem *)Tcl_GetHashValue(entryPtr); entryPtr = Tcl_NextHashEntry(&search); if (IsDetached(tv, item)) { Tcl_ListObjAppendElement(NULL, objPtr, ItemID(tv, item)); -- cgit v0.12 From ed03e57742c3c506d5268415d5e054006e6d8c74 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Nov 2023 08:53:59 +0000 Subject: Backout part of [c9a672c28cc8]: joining X11 tables gives symbol conflicts on Linux --- generic/tkInt.decls | 813 ++++++++++++++++++++++++++++++++++-------- generic/tkIntXlibDecls.h | 893 +++++++++++++++++++++++++++++++++++++++++++++++ generic/tkStubInit.c | 163 +++++++++ 3 files changed, 1714 insertions(+), 155 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index bf5e4ed..fbbab54 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -655,9 +655,6 @@ declare 41 x11 { declare 42 x11 { void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } -declare 43 x11 { - void TkWmCleanup(TkDisplay *dispPtr) -} declare 44 x11 { void TkSendCleanup(TkDisplay *dispPtr) } @@ -698,11 +695,14 @@ declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - void TkpSetCapture(TkWindow *winPtr) + void TkWmCleanup(TkDisplay *dispPtr) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) } +declare 11 win { + void TkpSetCapture(TkWindow *winPtr) +} declare 12 win { void TkWinClipboardRender(TkDisplay *dispPtr, UINT format) } @@ -809,9 +809,6 @@ declare 41 win { declare 42 win { void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } -declare 43 win { - void TkWmCleanup(TkDisplay *dispPtr) -} declare 44 win { void TkSendCleanup(TkDisplay *dispPtr) } @@ -852,13 +849,13 @@ declare 8 aqua { unsigned int TkMacOSXButtonKeyState(void) } declare 9 aqua { - void TkpSetCapture(TkWindow *winPtr) + void TkMacOSXClearMenubarActive(void) } declare 10 aqua { int TkMacOSXDispatchMenuEvent(int menuID, int index) } declare 11 aqua { - void TkMacOSXClearMenubarActive(void) + void TkpSetCapture(TkWindow *winPtr) } declare 12 aqua { void TkMacOSXHandleTearoffMenu(void) @@ -968,413 +965,413 @@ declare 54 aqua { interface tkIntXlib ################################ -# X functions +# X functions for Windows -declare 0 { +declare 0 win { int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } -declare 1 { +declare 1 win { XModifierKeymap *XGetModifierMapping(Display *d) } -declare 2 { +declare 2 win { XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4) } -declare 3 { +declare 3 win { XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) } -declare 4 { +declare 4 win { char *XGetAtomName(Display *d, Atom a) } -declare 5 { +declare 5 win { char *XKeysymToString(KeySym k) } -declare 6 { +declare 6 win { Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } -declare 7 { +declare 7 win { Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) } -declare 8 { +declare 8 win { Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2) } -declare 9 { +declare 9 win { GContext XGContextFromGC(GC g) } -declare 10 { +declare 10 win { XHostAddress *XListHosts(Display *d, int *i, Bool *b) } # second parameter was of type KeyCode -declare 11 { +declare 11 win { KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) } -declare 12 { +declare 12 win { KeySym XStringToKeysym(_Xconst char *c) } -declare 13 { +declare 13 win { Window XRootWindow(Display *d, int i) } -declare 14 { +declare 14 win { XErrorHandler XSetErrorHandler(XErrorHandler x) } -declare 15 { +declare 15 win { Status XIconifyWindow(Display *d, Window w, int i) } -declare 16 { +declare 16 win { Status XWithdrawWindow(Display *d, Window w, int i) } -declare 17 { +declare 17 win { Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) } -declare 18 { +declare 18 win { Status XAllocColor(Display *d, Colormap c, XColor *xp) } -declare 19 { +declare 19 win { int XBell(Display *d, int i) } -declare 20 { +declare 20 win { int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } -declare 21 { +declare 21 win { int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } -declare 22 { +declare 22 win { int XClearWindow(Display *d, Window w) } -declare 23 { +declare 23 win { int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } -declare 24 { +declare 24 win { int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 25 { +declare 25 win { int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul) } -declare 26 { +declare 26 win { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } -declare 27 { +declare 27 win { int XDefineCursor(Display *d, Window w, Cursor c) } -declare 28 { +declare 28 win { int XDeleteProperty(Display *d, Window w, Atom a) } -declare 29 { +declare 29 win { int XDestroyWindow(Display *d, Window w) } -declare 30 { +declare 30 win { int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 31 { +declare 31 win { int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } -declare 32 { +declare 32 win { int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 33 { +declare 33 win { int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 34 { +declare 34 win { int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } -declare 35 { +declare 35 win { int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } -declare 36 { +declare 36 win { int XForceScreenSaver(Display *d, int i) } -declare 37 { +declare 37 win { int XFreeColormap(Display *d, Colormap c) } -declare 38 { +declare 38 win { int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } -declare 39 { +declare 39 win { int XFreeCursor(Display *d, Cursor c) } -declare 40 { +declare 40 win { int XFreeModifiermap(XModifierKeymap *x) } -declare 41 { +declare 41 win { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4) } -declare 42 { +declare 42 win { int XGetInputFocus(Display *d, Window *w, int *i) } -declare 43 { +declare 43 win { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp) } -declare 44 { +declare 44 win { Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) } -declare 45 { +declare 45 win { int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } -declare 46 { +declare 46 win { int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } -declare 47 { +declare 47 win { KeyCode XKeysymToKeycode(Display *d, KeySym k) } -declare 48 { +declare 48 win { Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2) } -declare 49 { +declare 49 win { int XMapWindow(Display *d, Window w) } -declare 50 { +declare 50 win { int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 51 { +declare 51 win { int XMoveWindow(Display *d, Window w, int i1, int i2) } -declare 52 { +declare 52 win { int XNextEvent(Display *d, XEvent *x) } -declare 53 { +declare 53 win { int XPutBackEvent(Display *d, XEvent *x) } -declare 54 { +declare 54 win { int XQueryColors(Display *d, Colormap c, XColor *x, int i) } -declare 55 { +declare 55 win { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } -declare 56 { +declare 56 win { Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui) } -declare 57 { +declare 57 win { int XRaiseWindow(Display *d, Window w) } -declare 58 { +declare 58 win { int XRefreshKeyboardMapping(XMappingEvent *x) } -declare 59 { +declare 59 win { int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } -declare 60 { +declare 60 win { int XSelectInput(Display *d, Window w, long l) } -declare 61 { +declare 61 win { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } -declare 62 { +declare 62 win { int XSetCommand(Display *d, Window w, char **c, int i) } -declare 63 { +declare 63 win { int XSetIconName(Display *d, Window w, _Xconst char *c) } -declare 64 { +declare 64 win { int XSetInputFocus(Display *d, Window w, int i, Time t) } -declare 65 { +declare 65 win { int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } -declare 66 { +declare 66 win { int XSetWindowBackground(Display *d, Window w, unsigned long ul) } -declare 67 { +declare 67 win { int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } -declare 68 { +declare 68 win { int XSetWindowBorder(Display *d, Window w, unsigned long ul) } -declare 69 { +declare 69 win { int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } -declare 70 { +declare 70 win { int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } -declare 71 { +declare 71 win { int XSetWindowColormap(Display *d, Window w, Colormap c) } -declare 72 { +declare 72 win { Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3) } -declare 73 { +declare 73 win { int XUngrabKeyboard(Display *d, Time t) } -declare 74 { +declare 74 win { int XUngrabPointer(Display *d, Time t) } -declare 75 { +declare 75 win { int XUnmapWindow(Display *d, Window w) } -declare 76 { +declare 76 win { int XWindowEvent(Display *d, Window w, long l, XEvent *x) } -declare 77 { +declare 77 win { void XDestroyIC(XIC x) } -declare 78 { +declare 78 win { Bool XFilterEvent(XEvent *x, Window w) } -declare 79 { +declare 79 win { int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s) } -declare 80 { +declare 80 win { int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } -declare 81 { +declare 81 win { int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering) } -declare 82 { +declare 82 win { Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr) } -declare 83 { +declare 83 win { GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values) } -declare 84 { +declare 84 win { int XFreeGC(Display *display, GC gc) } -declare 85 { +declare 85 win { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } -declare 86 { +declare 86 win { int XSetBackground(Display *display, GC gc, unsigned long foreground) } -declare 87 { +declare 87 win { int XSetForeground(Display *display, GC gc, unsigned long foreground) } -declare 88 { +declare 88 win { int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } -declare 89 { +declare 89 win { int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } -declare 90 { +declare 90 win { int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } -declare 91 { +declare 91 win { int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } -declare 92 { +declare 92 win { int XSetFont(Display *display, GC gc, Font font) } -declare 93 { +declare 93 win { int XSetArcMode(Display *display, GC gc, int arc_mode) } -declare 94 { +declare 94 win { int XSetStipple(Display *display, GC gc, Pixmap stipple) } -declare 95 { +declare 95 win { int XSetFillRule(Display *display, GC gc, int fill_rule) } -declare 96 { +declare 96 win { int XSetFillStyle(Display *display, GC gc, int fill_style) } -declare 97 { +declare 97 win { int XSetFunction(Display *display, GC gc, int function) } -declare 98 { +declare 98 win { int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } -declare 99 { +declare 99 win { int _XInitImageFuncPtrs(XImage *image) } -declare 100 { +declare 100 win { XIC XCreateIC(XIM xim, ...) } -declare 101 { +declare 101 win { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return) } -declare 102 { +declare 102 win { void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop) } -declare 103 { +declare 103 win { Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return) } -declare 104 { +declare 104 win { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } -declare 105 { +declare 105 win { int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy) } -declare 106 { +declare 106 win { int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } # New in Tk 8.6 -declare 107 { +declare 107 win { int XFlush(Display *display) } -declare 108 { +declare 108 win { int XGrabServer(Display *display) } -declare 109 { +declare 109 win { int XUngrabServer(Display *display) } -declare 110 { +declare 110 win { int XFree(void *data) } -declare 111 { +declare 111 win { int XNoOp(Display *display) } -declare 112 { +declare 112 win { XAfterFunction XSynchronize(Display *display, Bool onoff) } -declare 113 { +declare 113 win { int XSync(Display *display, Bool discard) } -declare 114 { +declare 114 win { VisualID XVisualIDFromVisual(Visual *visual) } # For tktreectrl -declare 120 { +declare 120 win { int XOffsetRegion(Region rgn, int dx, int dy) } -declare 121 { +declare 121 win { int XUnionRegion(Region srca, Region srcb, Region dr_return) } # For 3dcanvas -declare 122 { +declare 122 win { Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, @@ -1383,92 +1380,598 @@ declare 122 { } # Various, e.g. for stub-enabled BLT -declare 129 { +declare 129 win { int XLowerWindow(Display *d, Window w) } -declare 130 { +declare 130 win { int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } -declare 131 { +declare 131 win { int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } -declare 132 { +declare 132 win { int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) } -declare 133 { +declare 133 win { int XDrawSegments(Display *d, Drawable dr, GC gc, XSegment *s, int n) } -declare 134 { +declare 134 win { int XDrawPoint(Display *d, Drawable dr, GC gc, int x, int y) } -declare 135 { +declare 135 win { int XDrawPoints(Display *d, Drawable dr, GC gc, XPoint *p, int n, int m) } -declare 136 { +declare 136 win { int XReparentWindow(Display *d, Window w, Window p, int x, int y) } -declare 137 { +declare 137 win { int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h) } -declare 138 { +declare 138 win { Region XPolygonRegion(XPoint *pts, int n, int rule) } -declare 139 { +declare 139 win { int XPointInRegion(Region rgn, int x, int y) } # For XIM -declare 140 { +declare 140 win { XVaNestedList XVaCreateNestedList(int dummy, ...) } -declare 141 { +declare 141 win { char *XSetICValues(XIC xic, ...) } -declare 142 { +declare 142 win { char *XGetICValues(XIC xic, ...) } -declare 143 { +declare 143 win { void XSetICFocus(XIC xic) } -declare 147 { +declare 147 win { void XFreeFontSet(Display *display, XFontSet fontset) } -declare 148 { +declare 148 win { int XCloseIM(XIM im) } -declare 149 { +declare 149 win { Bool XRegisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data) } -declare 150 { +declare 150 win { Bool XUnregisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data) } -declare 151 { +declare 151 win { char *XSetLocaleModifiers(const char *modifier_list) } -declare 152 { +declare 152 win { XIM XOpenIM(Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, char *res_class) } -declare 153 { +declare 153 win { char *XGetIMValues(XIM im, ...) } -declare 154 { +declare 154 win { char *XSetIMValues(XIM im, ...) } -declare 155 { +declare 155 win { XFontSet XCreateFontSet(Display *display, _Xconst char *base_font_name_list, char ***missing_charset_list, int *missing_charset_count, char **def_string) } -declare 156 { +declare 156 win { void XFreeStringList(char **list) } -declare 157 { +declare 157 win { KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, int i) } -declare 158 { +declare 158 win { + Display *XkbOpenDisplay(const char *name, int *ev_rtrn, int *err_rtrn, + int *major_rtrn, int *minor_rtrn, int *reason) +} + +################################ +# X functions for MacOSX + +declare 0 macosx { + int XSetDashes(Display *display, GC gc, int dash_offset, + _Xconst char *dash_list, int n) +} +declare 1 macosx { + XModifierKeymap *XGetModifierMapping(Display *d) +} +declare 2 macosx { + XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, + int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, + int i4) +} +declare 3 macosx { + XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, + unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) +} +declare 4 macosx { + char *XGetAtomName(Display *d, Atom a) +} +declare 5 macosx { + char *XKeysymToString(KeySym k) +} +declare 6 macosx { + Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) +} +declare 7 macosx { + Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, + XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) +} +declare 8 macosx { + Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, + unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, + XColor _Xconst *x2) +} +declare 9 macosx { + GContext XGContextFromGC(GC g) +} +declare 10 macosx { + XHostAddress *XListHosts(Display *d, int *i, Bool *b) +} +# second parameter was of type KeyCode +declare 11 macosx { + KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) +} +declare 12 macosx { + KeySym XStringToKeysym(_Xconst char *c) +} +declare 13 macosx { + Window XRootWindow(Display *d, int i) +} +declare 14 macosx { + XErrorHandler XSetErrorHandler(XErrorHandler x) +} +declare 15 macosx { + Status XIconifyWindow(Display *d, Window w, int i) +} +declare 16 macosx { + Status XWithdrawWindow(Display *d, Window w, int i) +} +declare 17 macosx { + Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) +} +declare 18 macosx { + Status XAllocColor(Display *d, Colormap c, XColor *xp) +} +declare 19 macosx { + int XBell(Display *d, int i) +} +declare 20 macosx { + int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, + int i2, _Xconst unsigned char *c, int i3) +} +declare 21 macosx { + int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, + XSetWindowAttributes *x) +} +declare 22 macosx { + int XClearWindow(Display *d, Window w) +} +declare 23 macosx { + int XConfigureWindow(Display *d, Window w, unsigned int i, + XWindowChanges *x) +} +declare 24 macosx { + int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) +} +declare 25 macosx { + int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, + int i3, int i4, unsigned long ul) +} +declare 26 macosx { + Pixmap XCreateBitmapFromData(Display *display, Drawable d, + _Xconst char *data, unsigned int width, unsigned int height) +} +declare 27 macosx { + int XDefineCursor(Display *d, Window w, Cursor c) +} +declare 28 macosx { + int XDeleteProperty(Display *d, Window w, Atom a) +} +declare 29 macosx { + int XDestroyWindow(Display *d, Window w) +} +declare 30 macosx { + int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2, int i3, int i4) +} +declare 31 macosx { + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) +} +declare 32 macosx { + int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2) +} +declare 33 macosx { + int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, + unsigned int ui1, unsigned int ui2, int i3, int i4) +} +declare 34 macosx { + int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, + int i1, int i2, int i3) +} +declare 35 macosx { + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) +} +declare 36 macosx { + int XForceScreenSaver(Display *d, int i) +} +declare 37 macosx { + int XFreeColormap(Display *d, Colormap c) +} +declare 38 macosx { + int XFreeColors(Display *d, Colormap c, + unsigned long *ulp, int i, unsigned long ul) +} +declare 39 macosx { + int XFreeCursor(Display *d, Cursor c) +} +declare 40 macosx { + int XFreeModifiermap(XModifierKeymap *x) +} +declare 41 macosx { + Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, + int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, + unsigned int *ui4) +} +declare 42 macosx { + int XGetInputFocus(Display *d, Window *w, int *i) +} +declare 43 macosx { + int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, + Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, + unsigned long *ulp2, unsigned char **cpp) +} +declare 44 macosx { + Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) +} +declare 45 macosx { + int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) +} +declare 46 macosx { + int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, + int i1, int i2, Window w2, Cursor c, Time t) +} +declare 47 macosx { + KeyCode XKeysymToKeycode(Display *d, KeySym k) +} +declare 48 macosx { + Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, + XColor *x1, XColor *x2) +} +declare 49 macosx { + int XMapWindow(Display *d, Window w) +} +declare 50 macosx { + int XMoveResizeWindow(Display *d, Window w, int i1, int i2, + unsigned int ui1, unsigned int ui2) +} +declare 51 macosx { + int XMoveWindow(Display *d, Window w, int i1, int i2) +} +declare 52 macosx { + int XNextEvent(Display *d, XEvent *x) +} +declare 53 macosx { + int XPutBackEvent(Display *d, XEvent *x) +} +declare 54 macosx { + int XQueryColors(Display *d, Colormap c, XColor *x, int i) +} +declare 55 macosx { + Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, + int *i1, int *i2, int *i3, int *i4, unsigned int *ui) +} +declare 56 macosx { + Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, + Window **w4, unsigned int *ui) +} +declare 57 macosx { + int XRaiseWindow(Display *d, Window w) +} +declare 58 macosx { + int XRefreshKeyboardMapping(XMappingEvent *x) +} +declare 59 macosx { + int XResizeWindow(Display *d, Window w, unsigned int ui1, + unsigned int ui2) +} +declare 60 macosx { + int XSelectInput(Display *d, Window w, long l) +} +declare 61 macosx { + Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) +} +declare 62 macosx { + int XSetCommand(Display *d, Window w, char **c, int i) +} +declare 63 macosx { + int XSetIconName(Display *d, Window w, _Xconst char *c) +} +declare 64 macosx { + int XSetInputFocus(Display *d, Window w, int i, Time t) +} +declare 65 macosx { + int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) +} +declare 66 macosx { + int XSetWindowBackground(Display *d, Window w, unsigned long ul) +} +declare 67 macosx { + int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) +} +declare 68 macosx { + int XSetWindowBorder(Display *d, Window w, unsigned long ul) +} +declare 69 macosx { + int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) +} +declare 70 macosx { + int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) +} +declare 71 macosx { + int XSetWindowColormap(Display *d, Window w, Colormap c) +} +declare 72 macosx { + Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, + int i2, int *i3, int *i4, Window *w3) +} +declare 73 macosx { + int XUngrabKeyboard(Display *d, Time t) +} +declare 74 macosx { + int XUngrabPointer(Display *d, Time t) +} +declare 75 macosx { + int XUnmapWindow(Display *d, Window w) +} +declare 76 macosx { + int XWindowEvent(Display *d, Window w, long l, XEvent *x) +} +declare 77 macosx { + void XDestroyIC(XIC x) +} +declare 78 macosx { + Bool XFilterEvent(XEvent *x, Window w) +} +declare 79 macosx { + int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, + KeySym *k, Status *s) +} +declare 80 macosx { + int TkPutImage(unsigned long *colors, int ncolors, Display *display, + Drawable d, GC gc, XImage *image, int src_x, int src_y, + int dest_x, int dest_y, unsigned int width, unsigned int height) +} +declare 81 macosx { + int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, + int clip_y_origin, XRectangle rectangles[], int n, int ordering) +} +declare 82 macosx { + Status XParseColor(Display *display, Colormap map, + _Xconst char *spec, XColor *colorPtr) +} +declare 83 macosx { + GC XCreateGC(Display *display, Drawable d, + unsigned long valuemask, XGCValues *values) +} +declare 84 macosx { + int XFreeGC(Display *display, GC gc) +} +declare 85 macosx { + Atom XInternAtom(Display *display, _Xconst char *atom_name, + Bool only_if_exists) +} +declare 86 macosx { + int XSetBackground(Display *display, GC gc, unsigned long foreground) +} +declare 87 macosx { + int XSetForeground(Display *display, GC gc, unsigned long foreground) +} +declare 88 macosx { + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) +} +declare 89 macosx { + int XSetClipOrigin(Display *display, GC gc, + int clip_x_origin, int clip_y_origin) +} +declare 90 macosx { + int XSetTSOrigin(Display *display, GC gc, + int ts_x_origin, int ts_y_origin) +} +declare 91 macosx { + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) +} +declare 92 macosx { + int XSetFont(Display *display, GC gc, Font font) +} +declare 93 macosx { + int XSetArcMode(Display *display, GC gc, int arc_mode) +} +declare 94 macosx { + int XSetStipple(Display *display, GC gc, Pixmap stipple) +} +declare 95 macosx { + int XSetFillRule(Display *display, GC gc, int fill_rule) +} +declare 96 macosx { + int XSetFillStyle(Display *display, GC gc, int fill_style) +} +declare 97 macosx { + int XSetFunction(Display *display, GC gc, int function) +} +declare 98 macosx { + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style) +} +declare 99 macosx { + int _XInitImageFuncPtrs(XImage *image) +} +declare 100 macosx { + XIC XCreateIC(XIM xim, ...) +} +declare 101 macosx { + XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, int *nitems_return) +} +declare 102 macosx { + void XSetWMClientMachine(Display *display, Window w, + XTextProperty *text_prop) +} +declare 103 macosx { + Status XStringListToTextProperty(char **list, int count, + XTextProperty *text_prop_return) +} +declare 104 macosx { + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int x2, int y2) +} +declare 105 macosx { + int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, + unsigned int sw, unsigned int sh, int dx, int dy) +} +declare 106 macosx { + int XFillRectangle(Display *display, Drawable d, GC gc, + int x, int y, unsigned int width, unsigned int height) +} + +# New in Tk 8.6 +declare 107 macosx { + int XFlush(Display *display) +} +declare 108 macosx { + int XGrabServer(Display *display) +} +declare 109 macosx { + int XUngrabServer(Display *display) +} +declare 110 macosx { + int XFree(void *data) +} +declare 111 macosx { + int XNoOp(Display *display) +} +declare 112 macosx { + XAfterFunction XSynchronize(Display *display, Bool onoff) +} +declare 113 macosx { + int XSync(Display *display, Bool discard) +} +declare 114 macosx { + VisualID XVisualIDFromVisual(Visual *visual) +} + +# For tktreectrl +declare 120 macosx { + int XOffsetRegion(Region rgn, int dx, int dy) +} +declare 121 macosx { + int XUnionRegion(Region srca, Region srcb, Region dr_return) +} + +# For 3dcanvas +declare 122 macosx { + Window XCreateWindow(Display *display, Window parent, int x, int y, + unsigned int width, unsigned int height, + unsigned int border_width, int depth, unsigned int clazz, + Visual *visual, unsigned long value_mask, + XSetWindowAttributes *attributes) +} + +# Various, e.g. for stub-enabled BLT +declare 129 macosx { + int XLowerWindow(Display *d, Window w) +} +declare 130 macosx { + int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) +} +declare 131 macosx { + int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) +} +declare 132 macosx { + int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) +} +declare 133 macosx { + int XDrawSegments(Display *d, Drawable dr, GC gc, XSegment *s, int n) +} +declare 134 macosx { + int XDrawPoint(Display *d, Drawable dr, GC gc, int x, int y) +} +declare 135 macosx { + int XDrawPoints(Display *d, Drawable dr, GC gc, XPoint *p, int n, int m) +} +declare 136 macosx { + int XReparentWindow(Display *d, Window w, Window p, int x, int y) +} +declare 137 macosx { + int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, + int sx, int sy, int dx, int dy, + unsigned int w, unsigned int h) +} +declare 138 macosx { + Region XPolygonRegion(XPoint *pts, int n, int rule) +} +declare 139 macosx { + int XPointInRegion(Region rgn, int x, int y) +} +# For XIM +declare 140 macosx { + XVaNestedList XVaCreateNestedList(int dummy, ...) +} +declare 141 macosx { + char *XSetICValues(XIC xic, ...) +} +declare 142 macosx { + char *XGetICValues(XIC xic, ...) +} +declare 143 macosx { + void XSetICFocus(XIC xic) +} +declare 147 macosx { + void XFreeFontSet(Display *display, XFontSet fontset) +} +declare 148 macosx { + int XCloseIM(XIM im) +} +declare 149 macosx { + Bool XRegisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, + char *res_name, char *res_class, XIDProc callback, XPointer client_data) +} +declare 150 macosx { + Bool XUnregisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, + char *res_name, char *res_class, XIDProc callback, XPointer client_data) +} +declare 151 macosx { + char *XSetLocaleModifiers(const char *modifier_list) +} +declare 152 macosx { + XIM XOpenIM(Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, + char *res_class) +} +declare 153 macosx { + char *XGetIMValues(XIM im, ...) +} +declare 154 macosx { + char *XSetIMValues(XIM im, ...) +} +declare 155 macosx { + XFontSet XCreateFontSet(Display *display, _Xconst char *base_font_name_list, + char ***missing_charset_list, int *missing_charset_count, char **def_string) +} +declare 156 macosx { + void XFreeStringList(char **list) +} +declare 157 macosx { + KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, int i) +} +declare 158 macosx { Display *XkbOpenDisplay(const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason) } diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 6c247ca..2f56d80 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -56,6 +56,7 @@ extern "C" { * Exported function declarations: */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); @@ -474,11 +475,594 @@ EXTERN KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, EXTERN Display * XkbOpenDisplay(const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason); +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ +/* 0 */ +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, + _Xconst char *dash_list, int n); +/* 1 */ +EXTERN XModifierKeymap * XGetModifierMapping(Display *d); +/* 2 */ +EXTERN XImage * XCreateImage(Display *d, Visual *v, unsigned int ui1, + int i1, int i2, char *cp, unsigned int ui2, + unsigned int ui3, int i3, int i4); +/* 3 */ +EXTERN XImage * XGetImage(Display *d, Drawable dr, int i1, int i2, + unsigned int ui1, unsigned int ui2, + unsigned long ul, int i3); +/* 4 */ +EXTERN char * XGetAtomName(Display *d, Atom a); +/* 5 */ +EXTERN char * XKeysymToString(KeySym k); +/* 6 */ +EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v, + int i); +/* 7 */ +EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, + XColor *x1, XColor *x2, unsigned int ui1, + unsigned int ui2); +/* 8 */ +EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, + unsigned int ui1, unsigned int ui2, + XColor _Xconst *x1, XColor _Xconst *x2); +/* 9 */ +EXTERN GContext XGContextFromGC(GC g); +/* 10 */ +EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b); +/* 11 */ +EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i); +/* 12 */ +EXTERN KeySym XStringToKeysym(_Xconst char *c); +/* 13 */ +EXTERN Window XRootWindow(Display *d, int i); +/* 14 */ +EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); +/* 15 */ +EXTERN Status XIconifyWindow(Display *d, Window w, int i); +/* 16 */ +EXTERN Status XWithdrawWindow(Display *d, Window w, int i); +/* 17 */ +EXTERN Status XGetWMColormapWindows(Display *d, Window w, + Window **wpp, int *ip); +/* 18 */ +EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); +/* 19 */ +EXTERN int XBell(Display *d, int i); +/* 20 */ +EXTERN int XChangeProperty(Display *d, Window w, Atom a1, + Atom a2, int i1, int i2, + _Xconst unsigned char *c, int i3); +/* 21 */ +EXTERN int XChangeWindowAttributes(Display *d, Window w, + unsigned long ul, XSetWindowAttributes *x); +/* 22 */ +EXTERN int XClearWindow(Display *d, Window w); +/* 23 */ +EXTERN int XConfigureWindow(Display *d, Window w, + unsigned int i, XWindowChanges *x); +/* 24 */ +EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, + GC g, int i1, int i2, unsigned int ui1, + unsigned int ui2, int i3, int i4); +/* 25 */ +EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, + GC g, int i1, int i2, unsigned int ui1, + unsigned int ui2, int i3, int i4, + unsigned long ul); +/* 26 */ +EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, + _Xconst char *data, unsigned int width, + unsigned int height); +/* 27 */ +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); +/* 28 */ +EXTERN int XDeleteProperty(Display *d, Window w, Atom a); +/* 29 */ +EXTERN int XDestroyWindow(Display *d, Window w); +/* 30 */ +EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, + int i3, int i4); +/* 31 */ +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, + int i1, int i2); +/* 32 */ +EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2); +/* 33 */ +EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, + int i3, int i4); +/* 34 */ +EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, + XPoint *x, int i1, int i2, int i3); +/* 35 */ +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, + XRectangle *x, int i); +/* 36 */ +EXTERN int XForceScreenSaver(Display *d, int i); +/* 37 */ +EXTERN int XFreeColormap(Display *d, Colormap c); +/* 38 */ +EXTERN int XFreeColors(Display *d, Colormap c, + unsigned long *ulp, int i, unsigned long ul); +/* 39 */ +EXTERN int XFreeCursor(Display *d, Cursor c); +/* 40 */ +EXTERN int XFreeModifiermap(XModifierKeymap *x); +/* 41 */ +EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, + int *i1, int *i2, unsigned int *ui1, + unsigned int *ui2, unsigned int *ui3, + unsigned int *ui4); +/* 42 */ +EXTERN int XGetInputFocus(Display *d, Window *w, int *i); +/* 43 */ +EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, + long l1, long l2, Bool b, Atom a2, Atom *ap, + int *ip, unsigned long *ulp1, + unsigned long *ulp2, unsigned char **cpp); +/* 44 */ +EXTERN Status XGetWindowAttributes(Display *d, Window w, + XWindowAttributes *x); +/* 45 */ +EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1, + int i2, Time t); +/* 46 */ +EXTERN int XGrabPointer(Display *d, Window w1, Bool b, + unsigned int ui, int i1, int i2, Window w2, + Cursor c, Time t); +/* 47 */ +EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k); +/* 48 */ +EXTERN Status XLookupColor(Display *d, Colormap c1, + _Xconst char *c2, XColor *x1, XColor *x2); +/* 49 */ +EXTERN int XMapWindow(Display *d, Window w); +/* 50 */ +EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, + int i2, unsigned int ui1, unsigned int ui2); +/* 51 */ +EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); +/* 52 */ +EXTERN int XNextEvent(Display *d, XEvent *x); +/* 53 */ +EXTERN int XPutBackEvent(Display *d, XEvent *x); +/* 54 */ +EXTERN int XQueryColors(Display *d, Colormap c, XColor *x, + int i); +/* 55 */ +EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, + Window *w3, int *i1, int *i2, int *i3, + int *i4, unsigned int *ui); +/* 56 */ +EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, + Window *w3, Window **w4, unsigned int *ui); +/* 57 */ +EXTERN int XRaiseWindow(Display *d, Window w); +/* 58 */ +EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); +/* 59 */ +EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, + unsigned int ui2); +/* 60 */ +EXTERN int XSelectInput(Display *d, Window w, long l); +/* 61 */ +EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, + XEvent *x); +/* 62 */ +EXTERN int XSetCommand(Display *d, Window w, char **c, int i); +/* 63 */ +EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); +/* 64 */ +EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); +/* 65 */ +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, + Time t); +/* 66 */ +EXTERN int XSetWindowBackground(Display *d, Window w, + unsigned long ul); +/* 67 */ +EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, + Pixmap p); +/* 68 */ +EXTERN int XSetWindowBorder(Display *d, Window w, + unsigned long ul); +/* 69 */ +EXTERN int XSetWindowBorderPixmap(Display *d, Window w, + Pixmap p); +/* 70 */ +EXTERN int XSetWindowBorderWidth(Display *d, Window w, + unsigned int ui); +/* 71 */ +EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); +/* 72 */ +EXTERN Bool XTranslateCoordinates(Display *d, Window w1, + Window w2, int i1, int i2, int *i3, int *i4, + Window *w3); +/* 73 */ +EXTERN int XUngrabKeyboard(Display *d, Time t); +/* 74 */ +EXTERN int XUngrabPointer(Display *d, Time t); +/* 75 */ +EXTERN int XUnmapWindow(Display *d, Window w); +/* 76 */ +EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); +/* 77 */ +EXTERN void XDestroyIC(XIC x); +/* 78 */ +EXTERN Bool XFilterEvent(XEvent *x, Window w); +/* 79 */ +EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, + char *c, int i, KeySym *k, Status *s); +/* 80 */ +EXTERN int TkPutImage(unsigned long *colors, int ncolors, + Display *display, Drawable d, GC gc, + XImage *image, int src_x, int src_y, + int dest_x, int dest_y, unsigned int width, + unsigned int height); +/* 81 */ +EXTERN int XSetClipRectangles(Display *display, GC gc, + int clip_x_origin, int clip_y_origin, + XRectangle rectangles[], int n, int ordering); +/* 82 */ +EXTERN Status XParseColor(Display *display, Colormap map, + _Xconst char *spec, XColor *colorPtr); +/* 83 */ +EXTERN GC XCreateGC(Display *display, Drawable d, + unsigned long valuemask, XGCValues *values); +/* 84 */ +EXTERN int XFreeGC(Display *display, GC gc); +/* 85 */ +EXTERN Atom XInternAtom(Display *display, + _Xconst char *atom_name, Bool only_if_exists); +/* 86 */ +EXTERN int XSetBackground(Display *display, GC gc, + unsigned long foreground); +/* 87 */ +EXTERN int XSetForeground(Display *display, GC gc, + unsigned long foreground); +/* 88 */ +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); +/* 89 */ +EXTERN int XSetClipOrigin(Display *display, GC gc, + int clip_x_origin, int clip_y_origin); +/* 90 */ +EXTERN int XSetTSOrigin(Display *display, GC gc, + int ts_x_origin, int ts_y_origin); +/* 91 */ +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, + XGCValues *values); +/* 92 */ +EXTERN int XSetFont(Display *display, GC gc, Font font); +/* 93 */ +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); +/* 94 */ +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); +/* 95 */ +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); +/* 96 */ +EXTERN int XSetFillStyle(Display *display, GC gc, + int fill_style); +/* 97 */ +EXTERN int XSetFunction(Display *display, GC gc, int function); +/* 98 */ +EXTERN int XSetLineAttributes(Display *display, GC gc, + unsigned int line_width, int line_style, + int cap_style, int join_style); +/* 99 */ +EXTERN int _XInitImageFuncPtrs(XImage *image); +/* 100 */ +EXTERN XIC XCreateIC(XIM xim, ...); +/* 101 */ +EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, + int *nitems_return); +/* 102 */ +EXTERN void XSetWMClientMachine(Display *display, Window w, + XTextProperty *text_prop); +/* 103 */ +EXTERN Status XStringListToTextProperty(char **list, int count, + XTextProperty *text_prop_return); +/* 104 */ +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, + int y1, int x2, int y2); +/* 105 */ +EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx, + int sy, unsigned int sw, unsigned int sh, + int dx, int dy); +/* 106 */ +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, + int x, int y, unsigned int width, + unsigned int height); +/* 107 */ +EXTERN int XFlush(Display *display); +/* 108 */ +EXTERN int XGrabServer(Display *display); +/* 109 */ +EXTERN int XUngrabServer(Display *display); +/* 110 */ +EXTERN int XFree(void *data); +/* 111 */ +EXTERN int XNoOp(Display *display); +/* 112 */ +EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); +/* 113 */ +EXTERN int XSync(Display *display, Bool discard); +/* 114 */ +EXTERN VisualID XVisualIDFromVisual(Visual *visual); +/* Slot 115 is reserved */ +/* Slot 116 is reserved */ +/* Slot 117 is reserved */ +/* Slot 118 is reserved */ +/* Slot 119 is reserved */ +/* 120 */ +EXTERN int XOffsetRegion(Region rgn, int dx, int dy); +/* 121 */ +EXTERN int XUnionRegion(Region srca, Region srcb, + Region dr_return); +/* 122 */ +EXTERN Window XCreateWindow(Display *display, Window parent, int x, + int y, unsigned int width, + unsigned int height, + unsigned int border_width, int depth, + unsigned int clazz, Visual *visual, + unsigned long value_mask, + XSetWindowAttributes *attributes); +/* Slot 123 is reserved */ +/* Slot 124 is reserved */ +/* Slot 125 is reserved */ +/* Slot 126 is reserved */ +/* Slot 127 is reserved */ +/* Slot 128 is reserved */ +/* 129 */ +EXTERN int XLowerWindow(Display *d, Window w); +/* 130 */ +EXTERN int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, + int n); +/* 131 */ +EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, + int n); +/* 132 */ +EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc, + XRectangle *r, int n); +/* 133 */ +EXTERN int XDrawSegments(Display *d, Drawable dr, GC gc, + XSegment *s, int n); +/* 134 */ +EXTERN int XDrawPoint(Display *d, Drawable dr, GC gc, int x, + int y); +/* 135 */ +EXTERN int XDrawPoints(Display *d, Drawable dr, GC gc, + XPoint *p, int n, int m); +/* 136 */ +EXTERN int XReparentWindow(Display *d, Window w, Window p, + int x, int y); +/* 137 */ +EXTERN int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, + int sx, int sy, int dx, int dy, + unsigned int w, unsigned int h); +/* 138 */ +EXTERN Region XPolygonRegion(XPoint *pts, int n, int rule); +/* 139 */ +EXTERN int XPointInRegion(Region rgn, int x, int y); +/* 140 */ +EXTERN XVaNestedList XVaCreateNestedList(int dummy, ...); +/* 141 */ +EXTERN char * XSetICValues(XIC xic, ...); +/* 142 */ +EXTERN char * XGetICValues(XIC xic, ...); +/* 143 */ +EXTERN void XSetICFocus(XIC xic); +/* Slot 144 is reserved */ +/* Slot 145 is reserved */ +/* Slot 146 is reserved */ +/* 147 */ +EXTERN void XFreeFontSet(Display *display, XFontSet fontset); +/* 148 */ +EXTERN int XCloseIM(XIM im); +/* 149 */ +EXTERN Bool XRegisterIMInstantiateCallback(Display *dpy, + struct _XrmHashBucketRec *rbd, + char *res_name, char *res_class, + XIDProc callback, XPointer client_data); +/* 150 */ +EXTERN Bool XUnregisterIMInstantiateCallback(Display *dpy, + struct _XrmHashBucketRec *rbd, + char *res_name, char *res_class, + XIDProc callback, XPointer client_data); +/* 151 */ +EXTERN char * XSetLocaleModifiers(const char *modifier_list); +/* 152 */ +EXTERN XIM XOpenIM(Display *dpy, struct _XrmHashBucketRec *rdb, + char *res_name, char *res_class); +/* 153 */ +EXTERN char * XGetIMValues(XIM im, ...); +/* 154 */ +EXTERN char * XSetIMValues(XIM im, ...); +/* 155 */ +EXTERN XFontSet XCreateFontSet(Display *display, + _Xconst char *base_font_name_list, + char ***missing_charset_list, + int *missing_charset_count, + char **def_string); +/* 156 */ +EXTERN void XFreeStringList(char **list); +/* 157 */ +EXTERN KeySym XkbKeycodeToKeysym(Display *d, unsigned int k, int g, + int i); +/* 158 */ +EXTERN Display * XkbOpenDisplay(const char *name, int *ev_rtrn, + int *err_rtrn, int *major_rtrn, + int *minor_rtrn, int *reason); +#endif /* MACOSX */ typedef struct TkIntXlibStubs { int magic; void *hooks; +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ + XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ + XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ + XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ + char * (*xGetAtomName) (Display *d, Atom a); /* 4 */ + char * (*xKeysymToString) (KeySym k); /* 5 */ + Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ + Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */ + Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */ + GContext (*xGContextFromGC) (GC g); /* 9 */ + XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */ + KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */ + KeySym (*xStringToKeysym) (_Xconst char *c); /* 12 */ + Window (*xRootWindow) (Display *d, int i); /* 13 */ + XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 14 */ + Status (*xIconifyWindow) (Display *d, Window w, int i); /* 15 */ + Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */ + Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */ + Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */ + int (*xBell) (Display *d, int i); /* 19 */ + int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ + int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ + int (*xClearWindow) (Display *d, Window w); /* 22 */ + int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ + int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ + int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ + Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ + int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ + int (*xDestroyWindow) (Display *d, Window w); /* 29 */ + int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ + int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ + int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ + int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ + int (*xForceScreenSaver) (Display *d, int i); /* 36 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 37 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ + int (*xFreeCursor) (Display *d, Cursor c); /* 39 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ + Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */ + int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ + int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */ + Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */ + int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */ + int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */ + KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */ + Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */ + int (*xMapWindow) (Display *d, Window w); /* 49 */ + int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ + int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ + int (*xNextEvent) (Display *d, XEvent *x); /* 52 */ + int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ + int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ + Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */ + Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */ + int (*xRaiseWindow) (Display *d, Window w); /* 57 */ + int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ + int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ + int (*xSelectInput) (Display *d, Window w, long l); /* 60 */ + Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */ + int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ + int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ + int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ + int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ + int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ + int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ + int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ + int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ + int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ + Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */ + int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ + int (*xUngrabPointer) (Display *d, Time t); /* 74 */ + int (*xUnmapWindow) (Display *d, Window w); /* 75 */ + int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ + void (*xDestroyIC) (XIC x); /* 77 */ + Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ + int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ + int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 81 */ + Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ + GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ + int (*xFreeGC) (Display *display, GC gc); /* 84 */ + Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ + int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */ + XIC (*xCreateIC) (XIM xim, ...); /* 100 */ + XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */ + void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */ + Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ + int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xFlush) (Display *display); /* 107 */ + int (*xGrabServer) (Display *display); /* 108 */ + int (*xUngrabServer) (Display *display); /* 109 */ + int (*xFree) (void *data); /* 110 */ + int (*xNoOp) (Display *display); /* 111 */ + XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ + int (*xSync) (Display *display, Bool discard); /* 113 */ + VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ + void (*reserved115)(void); + void (*reserved116)(void); + void (*reserved117)(void); + void (*reserved118)(void); + void (*reserved119)(void); + int (*xOffsetRegion) (Region rgn, int dx, int dy); /* 120 */ + int (*xUnionRegion) (Region srca, Region srcb, Region dr_return); /* 121 */ + Window (*xCreateWindow) (Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, Visual *visual, unsigned long value_mask, XSetWindowAttributes *attributes); /* 122 */ + void (*reserved123)(void); + void (*reserved124)(void); + void (*reserved125)(void); + void (*reserved126)(void); + void (*reserved127)(void); + void (*reserved128)(void); + int (*xLowerWindow) (Display *d, Window w); /* 129 */ + int (*xFillArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 130 */ + int (*xDrawArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 131 */ + int (*xDrawRectangles) (Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* 132 */ + int (*xDrawSegments) (Display *d, Drawable dr, GC gc, XSegment *s, int n); /* 133 */ + int (*xDrawPoint) (Display *d, Drawable dr, GC gc, int x, int y); /* 134 */ + int (*xDrawPoints) (Display *d, Drawable dr, GC gc, XPoint *p, int n, int m); /* 135 */ + int (*xReparentWindow) (Display *d, Window w, Window p, int x, int y); /* 136 */ + int (*xPutImage) (Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h); /* 137 */ + Region (*xPolygonRegion) (XPoint *pts, int n, int rule); /* 138 */ + int (*xPointInRegion) (Region rgn, int x, int y); /* 139 */ + XVaNestedList (*xVaCreateNestedList) (int dummy, ...); /* 140 */ + char * (*xSetICValues) (XIC xic, ...); /* 141 */ + char * (*xGetICValues) (XIC xic, ...); /* 142 */ + void (*xSetICFocus) (XIC xic); /* 143 */ + void (*reserved144)(void); + void (*reserved145)(void); + void (*reserved146)(void); + void (*xFreeFontSet) (Display *display, XFontSet fontset); /* 147 */ + int (*xCloseIM) (XIM im); /* 148 */ + Bool (*xRegisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 149 */ + Bool (*xUnregisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 150 */ + char * (*xSetLocaleModifiers) (const char *modifier_list); /* 151 */ + XIM (*xOpenIM) (Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, char *res_class); /* 152 */ + char * (*xGetIMValues) (XIM im, ...); /* 153 */ + char * (*xSetIMValues) (XIM im, ...); /* 154 */ + XFontSet (*xCreateFontSet) (Display *display, _Xconst char *base_font_name_list, char ***missing_charset_list, int *missing_charset_count, char **def_string); /* 155 */ + void (*xFreeStringList) (char **list); /* 156 */ + KeySym (*xkbKeycodeToKeysym) (Display *d, unsigned int k, int g, int i); /* 157 */ + Display * (*xkbOpenDisplay) (const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason); /* 158 */ +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ @@ -638,6 +1222,7 @@ typedef struct TkIntXlibStubs { void (*xFreeStringList) (char **list); /* 156 */ KeySym (*xkbKeycodeToKeysym) (Display *d, unsigned int k, int g, int i); /* 157 */ Display * (*xkbOpenDisplay) (const char *name, int *ev_rtrn, int *err_rtrn, int *major_rtrn, int *minor_rtrn, int *reason); /* 158 */ +#endif /* MACOSX */ } TkIntXlibStubs; extern const TkIntXlibStubs *tkIntXlibStubsPtr; @@ -652,6 +1237,313 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ +#define XSetDashes \ + (tkIntXlibStubsPtr->xSetDashes) /* 0 */ +#define XGetModifierMapping \ + (tkIntXlibStubsPtr->xGetModifierMapping) /* 1 */ +#define XCreateImage \ + (tkIntXlibStubsPtr->xCreateImage) /* 2 */ +#define XGetImage \ + (tkIntXlibStubsPtr->xGetImage) /* 3 */ +#define XGetAtomName \ + (tkIntXlibStubsPtr->xGetAtomName) /* 4 */ +#define XKeysymToString \ + (tkIntXlibStubsPtr->xKeysymToString) /* 5 */ +#define XCreateColormap \ + (tkIntXlibStubsPtr->xCreateColormap) /* 6 */ +#define XCreatePixmapCursor \ + (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 7 */ +#define XCreateGlyphCursor \ + (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 8 */ +#define XGContextFromGC \ + (tkIntXlibStubsPtr->xGContextFromGC) /* 9 */ +#define XListHosts \ + (tkIntXlibStubsPtr->xListHosts) /* 10 */ +#define XKeycodeToKeysym \ + (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 11 */ +#define XStringToKeysym \ + (tkIntXlibStubsPtr->xStringToKeysym) /* 12 */ +#define XRootWindow \ + (tkIntXlibStubsPtr->xRootWindow) /* 13 */ +#define XSetErrorHandler \ + (tkIntXlibStubsPtr->xSetErrorHandler) /* 14 */ +#define XIconifyWindow \ + (tkIntXlibStubsPtr->xIconifyWindow) /* 15 */ +#define XWithdrawWindow \ + (tkIntXlibStubsPtr->xWithdrawWindow) /* 16 */ +#define XGetWMColormapWindows \ + (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 17 */ +#define XAllocColor \ + (tkIntXlibStubsPtr->xAllocColor) /* 18 */ +#define XBell \ + (tkIntXlibStubsPtr->xBell) /* 19 */ +#define XChangeProperty \ + (tkIntXlibStubsPtr->xChangeProperty) /* 20 */ +#define XChangeWindowAttributes \ + (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 21 */ +#define XClearWindow \ + (tkIntXlibStubsPtr->xClearWindow) /* 22 */ +#define XConfigureWindow \ + (tkIntXlibStubsPtr->xConfigureWindow) /* 23 */ +#define XCopyArea \ + (tkIntXlibStubsPtr->xCopyArea) /* 24 */ +#define XCopyPlane \ + (tkIntXlibStubsPtr->xCopyPlane) /* 25 */ +#define XCreateBitmapFromData \ + (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 26 */ +#define XDefineCursor \ + (tkIntXlibStubsPtr->xDefineCursor) /* 27 */ +#define XDeleteProperty \ + (tkIntXlibStubsPtr->xDeleteProperty) /* 28 */ +#define XDestroyWindow \ + (tkIntXlibStubsPtr->xDestroyWindow) /* 29 */ +#define XDrawArc \ + (tkIntXlibStubsPtr->xDrawArc) /* 30 */ +#define XDrawLines \ + (tkIntXlibStubsPtr->xDrawLines) /* 31 */ +#define XDrawRectangle \ + (tkIntXlibStubsPtr->xDrawRectangle) /* 32 */ +#define XFillArc \ + (tkIntXlibStubsPtr->xFillArc) /* 33 */ +#define XFillPolygon \ + (tkIntXlibStubsPtr->xFillPolygon) /* 34 */ +#define XFillRectangles \ + (tkIntXlibStubsPtr->xFillRectangles) /* 35 */ +#define XForceScreenSaver \ + (tkIntXlibStubsPtr->xForceScreenSaver) /* 36 */ +#define XFreeColormap \ + (tkIntXlibStubsPtr->xFreeColormap) /* 37 */ +#define XFreeColors \ + (tkIntXlibStubsPtr->xFreeColors) /* 38 */ +#define XFreeCursor \ + (tkIntXlibStubsPtr->xFreeCursor) /* 39 */ +#define XFreeModifiermap \ + (tkIntXlibStubsPtr->xFreeModifiermap) /* 40 */ +#define XGetGeometry \ + (tkIntXlibStubsPtr->xGetGeometry) /* 41 */ +#define XGetInputFocus \ + (tkIntXlibStubsPtr->xGetInputFocus) /* 42 */ +#define XGetWindowProperty \ + (tkIntXlibStubsPtr->xGetWindowProperty) /* 43 */ +#define XGetWindowAttributes \ + (tkIntXlibStubsPtr->xGetWindowAttributes) /* 44 */ +#define XGrabKeyboard \ + (tkIntXlibStubsPtr->xGrabKeyboard) /* 45 */ +#define XGrabPointer \ + (tkIntXlibStubsPtr->xGrabPointer) /* 46 */ +#define XKeysymToKeycode \ + (tkIntXlibStubsPtr->xKeysymToKeycode) /* 47 */ +#define XLookupColor \ + (tkIntXlibStubsPtr->xLookupColor) /* 48 */ +#define XMapWindow \ + (tkIntXlibStubsPtr->xMapWindow) /* 49 */ +#define XMoveResizeWindow \ + (tkIntXlibStubsPtr->xMoveResizeWindow) /* 50 */ +#define XMoveWindow \ + (tkIntXlibStubsPtr->xMoveWindow) /* 51 */ +#define XNextEvent \ + (tkIntXlibStubsPtr->xNextEvent) /* 52 */ +#define XPutBackEvent \ + (tkIntXlibStubsPtr->xPutBackEvent) /* 53 */ +#define XQueryColors \ + (tkIntXlibStubsPtr->xQueryColors) /* 54 */ +#define XQueryPointer \ + (tkIntXlibStubsPtr->xQueryPointer) /* 55 */ +#define XQueryTree \ + (tkIntXlibStubsPtr->xQueryTree) /* 56 */ +#define XRaiseWindow \ + (tkIntXlibStubsPtr->xRaiseWindow) /* 57 */ +#define XRefreshKeyboardMapping \ + (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 58 */ +#define XResizeWindow \ + (tkIntXlibStubsPtr->xResizeWindow) /* 59 */ +#define XSelectInput \ + (tkIntXlibStubsPtr->xSelectInput) /* 60 */ +#define XSendEvent \ + (tkIntXlibStubsPtr->xSendEvent) /* 61 */ +#define XSetCommand \ + (tkIntXlibStubsPtr->xSetCommand) /* 62 */ +#define XSetIconName \ + (tkIntXlibStubsPtr->xSetIconName) /* 63 */ +#define XSetInputFocus \ + (tkIntXlibStubsPtr->xSetInputFocus) /* 64 */ +#define XSetSelectionOwner \ + (tkIntXlibStubsPtr->xSetSelectionOwner) /* 65 */ +#define XSetWindowBackground \ + (tkIntXlibStubsPtr->xSetWindowBackground) /* 66 */ +#define XSetWindowBackgroundPixmap \ + (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 67 */ +#define XSetWindowBorder \ + (tkIntXlibStubsPtr->xSetWindowBorder) /* 68 */ +#define XSetWindowBorderPixmap \ + (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 69 */ +#define XSetWindowBorderWidth \ + (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 70 */ +#define XSetWindowColormap \ + (tkIntXlibStubsPtr->xSetWindowColormap) /* 71 */ +#define XTranslateCoordinates \ + (tkIntXlibStubsPtr->xTranslateCoordinates) /* 72 */ +#define XUngrabKeyboard \ + (tkIntXlibStubsPtr->xUngrabKeyboard) /* 73 */ +#define XUngrabPointer \ + (tkIntXlibStubsPtr->xUngrabPointer) /* 74 */ +#define XUnmapWindow \ + (tkIntXlibStubsPtr->xUnmapWindow) /* 75 */ +#define XWindowEvent \ + (tkIntXlibStubsPtr->xWindowEvent) /* 76 */ +#define XDestroyIC \ + (tkIntXlibStubsPtr->xDestroyIC) /* 77 */ +#define XFilterEvent \ + (tkIntXlibStubsPtr->xFilterEvent) /* 78 */ +#define XmbLookupString \ + (tkIntXlibStubsPtr->xmbLookupString) /* 79 */ +#define TkPutImage \ + (tkIntXlibStubsPtr->tkPutImage) /* 80 */ +#define XSetClipRectangles \ + (tkIntXlibStubsPtr->xSetClipRectangles) /* 81 */ +#define XParseColor \ + (tkIntXlibStubsPtr->xParseColor) /* 82 */ +#define XCreateGC \ + (tkIntXlibStubsPtr->xCreateGC) /* 83 */ +#define XFreeGC \ + (tkIntXlibStubsPtr->xFreeGC) /* 84 */ +#define XInternAtom \ + (tkIntXlibStubsPtr->xInternAtom) /* 85 */ +#define XSetBackground \ + (tkIntXlibStubsPtr->xSetBackground) /* 86 */ +#define XSetForeground \ + (tkIntXlibStubsPtr->xSetForeground) /* 87 */ +#define XSetClipMask \ + (tkIntXlibStubsPtr->xSetClipMask) /* 88 */ +#define XSetClipOrigin \ + (tkIntXlibStubsPtr->xSetClipOrigin) /* 89 */ +#define XSetTSOrigin \ + (tkIntXlibStubsPtr->xSetTSOrigin) /* 90 */ +#define XChangeGC \ + (tkIntXlibStubsPtr->xChangeGC) /* 91 */ +#define XSetFont \ + (tkIntXlibStubsPtr->xSetFont) /* 92 */ +#define XSetArcMode \ + (tkIntXlibStubsPtr->xSetArcMode) /* 93 */ +#define XSetStipple \ + (tkIntXlibStubsPtr->xSetStipple) /* 94 */ +#define XSetFillRule \ + (tkIntXlibStubsPtr->xSetFillRule) /* 95 */ +#define XSetFillStyle \ + (tkIntXlibStubsPtr->xSetFillStyle) /* 96 */ +#define XSetFunction \ + (tkIntXlibStubsPtr->xSetFunction) /* 97 */ +#define XSetLineAttributes \ + (tkIntXlibStubsPtr->xSetLineAttributes) /* 98 */ +#define _XInitImageFuncPtrs \ + (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 99 */ +#define XCreateIC \ + (tkIntXlibStubsPtr->xCreateIC) /* 100 */ +#define XGetVisualInfo \ + (tkIntXlibStubsPtr->xGetVisualInfo) /* 101 */ +#define XSetWMClientMachine \ + (tkIntXlibStubsPtr->xSetWMClientMachine) /* 102 */ +#define XStringListToTextProperty \ + (tkIntXlibStubsPtr->xStringListToTextProperty) /* 103 */ +#define XDrawLine \ + (tkIntXlibStubsPtr->xDrawLine) /* 104 */ +#define XWarpPointer \ + (tkIntXlibStubsPtr->xWarpPointer) /* 105 */ +#define XFillRectangle \ + (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ +/* Slot 115 is reserved */ +/* Slot 116 is reserved */ +/* Slot 117 is reserved */ +/* Slot 118 is reserved */ +/* Slot 119 is reserved */ +#define XOffsetRegion \ + (tkIntXlibStubsPtr->xOffsetRegion) /* 120 */ +#define XUnionRegion \ + (tkIntXlibStubsPtr->xUnionRegion) /* 121 */ +#define XCreateWindow \ + (tkIntXlibStubsPtr->xCreateWindow) /* 122 */ +/* Slot 123 is reserved */ +/* Slot 124 is reserved */ +/* Slot 125 is reserved */ +/* Slot 126 is reserved */ +/* Slot 127 is reserved */ +/* Slot 128 is reserved */ +#define XLowerWindow \ + (tkIntXlibStubsPtr->xLowerWindow) /* 129 */ +#define XFillArcs \ + (tkIntXlibStubsPtr->xFillArcs) /* 130 */ +#define XDrawArcs \ + (tkIntXlibStubsPtr->xDrawArcs) /* 131 */ +#define XDrawRectangles \ + (tkIntXlibStubsPtr->xDrawRectangles) /* 132 */ +#define XDrawSegments \ + (tkIntXlibStubsPtr->xDrawSegments) /* 133 */ +#define XDrawPoint \ + (tkIntXlibStubsPtr->xDrawPoint) /* 134 */ +#define XDrawPoints \ + (tkIntXlibStubsPtr->xDrawPoints) /* 135 */ +#define XReparentWindow \ + (tkIntXlibStubsPtr->xReparentWindow) /* 136 */ +#define XPutImage \ + (tkIntXlibStubsPtr->xPutImage) /* 137 */ +#define XPolygonRegion \ + (tkIntXlibStubsPtr->xPolygonRegion) /* 138 */ +#define XPointInRegion \ + (tkIntXlibStubsPtr->xPointInRegion) /* 139 */ +#define XVaCreateNestedList \ + (tkIntXlibStubsPtr->xVaCreateNestedList) /* 140 */ +#define XSetICValues \ + (tkIntXlibStubsPtr->xSetICValues) /* 141 */ +#define XGetICValues \ + (tkIntXlibStubsPtr->xGetICValues) /* 142 */ +#define XSetICFocus \ + (tkIntXlibStubsPtr->xSetICFocus) /* 143 */ +/* Slot 144 is reserved */ +/* Slot 145 is reserved */ +/* Slot 146 is reserved */ +#define XFreeFontSet \ + (tkIntXlibStubsPtr->xFreeFontSet) /* 147 */ +#define XCloseIM \ + (tkIntXlibStubsPtr->xCloseIM) /* 148 */ +#define XRegisterIMInstantiateCallback \ + (tkIntXlibStubsPtr->xRegisterIMInstantiateCallback) /* 149 */ +#define XUnregisterIMInstantiateCallback \ + (tkIntXlibStubsPtr->xUnregisterIMInstantiateCallback) /* 150 */ +#define XSetLocaleModifiers \ + (tkIntXlibStubsPtr->xSetLocaleModifiers) /* 151 */ +#define XOpenIM \ + (tkIntXlibStubsPtr->xOpenIM) /* 152 */ +#define XGetIMValues \ + (tkIntXlibStubsPtr->xGetIMValues) /* 153 */ +#define XSetIMValues \ + (tkIntXlibStubsPtr->xSetIMValues) /* 154 */ +#define XCreateFontSet \ + (tkIntXlibStubsPtr->xCreateFontSet) /* 155 */ +#define XFreeStringList \ + (tkIntXlibStubsPtr->xFreeStringList) /* 156 */ +#define XkbKeycodeToKeysym \ + (tkIntXlibStubsPtr->xkbKeycodeToKeysym) /* 157 */ +#define XkbOpenDisplay \ + (tkIntXlibStubsPtr->xkbOpenDisplay) /* 158 */ +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -956,6 +1848,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xkbKeycodeToKeysym) /* 157 */ #define XkbOpenDisplay \ (tkIntXlibStubsPtr->xkbOpenDisplay) /* 158 */ +#endif /* MACOSX */ #endif /* defined(USE_TK_STUBS) */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 01275f3..faff8d8 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -591,6 +591,168 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, +#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ + XSetDashes, /* 0 */ + XGetModifierMapping, /* 1 */ + XCreateImage, /* 2 */ + XGetImage, /* 3 */ + XGetAtomName, /* 4 */ + XKeysymToString, /* 5 */ + XCreateColormap, /* 6 */ + XCreatePixmapCursor, /* 7 */ + XCreateGlyphCursor, /* 8 */ + XGContextFromGC, /* 9 */ + XListHosts, /* 10 */ + XKeycodeToKeysym, /* 11 */ + XStringToKeysym, /* 12 */ + XRootWindow, /* 13 */ + XSetErrorHandler, /* 14 */ + XIconifyWindow, /* 15 */ + XWithdrawWindow, /* 16 */ + XGetWMColormapWindows, /* 17 */ + XAllocColor, /* 18 */ + XBell, /* 19 */ + XChangeProperty, /* 20 */ + XChangeWindowAttributes, /* 21 */ + XClearWindow, /* 22 */ + XConfigureWindow, /* 23 */ + XCopyArea, /* 24 */ + XCopyPlane, /* 25 */ + XCreateBitmapFromData, /* 26 */ + XDefineCursor, /* 27 */ + XDeleteProperty, /* 28 */ + XDestroyWindow, /* 29 */ + XDrawArc, /* 30 */ + XDrawLines, /* 31 */ + XDrawRectangle, /* 32 */ + XFillArc, /* 33 */ + XFillPolygon, /* 34 */ + XFillRectangles, /* 35 */ + XForceScreenSaver, /* 36 */ + XFreeColormap, /* 37 */ + XFreeColors, /* 38 */ + XFreeCursor, /* 39 */ + XFreeModifiermap, /* 40 */ + XGetGeometry, /* 41 */ + XGetInputFocus, /* 42 */ + XGetWindowProperty, /* 43 */ + XGetWindowAttributes, /* 44 */ + XGrabKeyboard, /* 45 */ + XGrabPointer, /* 46 */ + XKeysymToKeycode, /* 47 */ + XLookupColor, /* 48 */ + XMapWindow, /* 49 */ + XMoveResizeWindow, /* 50 */ + XMoveWindow, /* 51 */ + XNextEvent, /* 52 */ + XPutBackEvent, /* 53 */ + XQueryColors, /* 54 */ + XQueryPointer, /* 55 */ + XQueryTree, /* 56 */ + XRaiseWindow, /* 57 */ + XRefreshKeyboardMapping, /* 58 */ + XResizeWindow, /* 59 */ + XSelectInput, /* 60 */ + XSendEvent, /* 61 */ + XSetCommand, /* 62 */ + XSetIconName, /* 63 */ + XSetInputFocus, /* 64 */ + XSetSelectionOwner, /* 65 */ + XSetWindowBackground, /* 66 */ + XSetWindowBackgroundPixmap, /* 67 */ + XSetWindowBorder, /* 68 */ + XSetWindowBorderPixmap, /* 69 */ + XSetWindowBorderWidth, /* 70 */ + XSetWindowColormap, /* 71 */ + XTranslateCoordinates, /* 72 */ + XUngrabKeyboard, /* 73 */ + XUngrabPointer, /* 74 */ + XUnmapWindow, /* 75 */ + XWindowEvent, /* 76 */ + XDestroyIC, /* 77 */ + XFilterEvent, /* 78 */ + XmbLookupString, /* 79 */ + TkPutImage, /* 80 */ + XSetClipRectangles, /* 81 */ + XParseColor, /* 82 */ + XCreateGC, /* 83 */ + XFreeGC, /* 84 */ + XInternAtom, /* 85 */ + XSetBackground, /* 86 */ + XSetForeground, /* 87 */ + XSetClipMask, /* 88 */ + XSetClipOrigin, /* 89 */ + XSetTSOrigin, /* 90 */ + XChangeGC, /* 91 */ + XSetFont, /* 92 */ + XSetArcMode, /* 93 */ + XSetStipple, /* 94 */ + XSetFillRule, /* 95 */ + XSetFillStyle, /* 96 */ + XSetFunction, /* 97 */ + XSetLineAttributes, /* 98 */ + _XInitImageFuncPtrs, /* 99 */ + XCreateIC, /* 100 */ + XGetVisualInfo, /* 101 */ + XSetWMClientMachine, /* 102 */ + XStringListToTextProperty, /* 103 */ + XDrawLine, /* 104 */ + XWarpPointer, /* 105 */ + XFillRectangle, /* 106 */ + XFlush, /* 107 */ + XGrabServer, /* 108 */ + XUngrabServer, /* 109 */ + XFree, /* 110 */ + XNoOp, /* 111 */ + XSynchronize, /* 112 */ + XSync, /* 113 */ + XVisualIDFromVisual, /* 114 */ + 0, /* 115 */ + 0, /* 116 */ + 0, /* 117 */ + 0, /* 118 */ + 0, /* 119 */ + XOffsetRegion, /* 120 */ + XUnionRegion, /* 121 */ + XCreateWindow, /* 122 */ + 0, /* 123 */ + 0, /* 124 */ + 0, /* 125 */ + 0, /* 126 */ + 0, /* 127 */ + 0, /* 128 */ + XLowerWindow, /* 129 */ + XFillArcs, /* 130 */ + XDrawArcs, /* 131 */ + XDrawRectangles, /* 132 */ + XDrawSegments, /* 133 */ + XDrawPoint, /* 134 */ + XDrawPoints, /* 135 */ + XReparentWindow, /* 136 */ + XPutImage, /* 137 */ + XPolygonRegion, /* 138 */ + XPointInRegion, /* 139 */ + XVaCreateNestedList, /* 140 */ + XSetICValues, /* 141 */ + XGetICValues, /* 142 */ + XSetICFocus, /* 143 */ + 0, /* 144 */ + 0, /* 145 */ + 0, /* 146 */ + XFreeFontSet, /* 147 */ + XCloseIM, /* 148 */ + XRegisterIMInstantiateCallback, /* 149 */ + XUnregisterIMInstantiateCallback, /* 150 */ + XSetLocaleModifiers, /* 151 */ + XOpenIM, /* 152 */ + XGetIMValues, /* 153 */ + XSetIMValues, /* 154 */ + XCreateFontSet, /* 155 */ + XFreeStringList, /* 156 */ + XkbKeycodeToKeysym, /* 157 */ + XkbOpenDisplay, /* 158 */ +#endif /* WIN */ +#ifdef MAC_OSX_TCL /* MACOSX */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -750,6 +912,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { XFreeStringList, /* 156 */ XkbKeycodeToKeysym, /* 157 */ XkbOpenDisplay, /* 158 */ +#endif /* MACOSX */ }; static const TkPlatStubs tkPlatStubs = { -- cgit v0.12 From 2289bae37280a207daadd8d4510a2b73fddc7129 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Nov 2023 09:55:46 +0000 Subject: Re-generate internal stubs --- generic/tkIntPlatDecls.h | 48 +++++++++++++++++++++++------------------------- generic/tkStubInit.c | 12 ++++++------ 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 7a0cc65..474deba 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -57,10 +57,11 @@ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 8 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 9 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* 10 */ EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); -/* Slot 11 is reserved */ +/* 11 */ +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 12 */ EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format); /* 13 */ @@ -133,8 +134,7 @@ EXTERN Window TkUnixContainerId(TkWindow *winPtr); EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); /* 42 */ EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); -/* 43 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); +/* Slot 43 is reserved */ /* 44 */ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 45 */ @@ -165,11 +165,11 @@ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 8 */ EXTERN unsigned int TkMacOSXButtonKeyState(void); /* 9 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN void TkMacOSXClearMenubarActive(void); /* 10 */ EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); /* 11 */ -EXTERN void TkMacOSXClearMenubarActive(void); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 12 */ EXTERN void TkMacOSXHandleTearoffMenu(void); /* Slot 13 is reserved */ @@ -308,8 +308,7 @@ EXTERN Window TkUnixContainerId(TkWindow *winPtr); EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); /* 42 */ EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); -/* 43 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); +/* Slot 43 is reserved */ /* 44 */ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 45 */ @@ -331,9 +330,9 @@ typedef struct TkIntPlatStubs { int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 9 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ - void (*reserved11)(void); + void (*tkpSetCapture) (TkWindow *winPtr); /* 11 */ void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */ void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */ @@ -365,7 +364,7 @@ typedef struct TkIntPlatStubs { Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ + void (*reserved43)(void); void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ void (*reserved46)(void); @@ -381,9 +380,9 @@ typedef struct TkIntPlatStubs { int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 9 */ + void (*tkMacOSXClearMenubarActive) (void); /* 9 */ int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ - void (*tkMacOSXClearMenubarActive) (void); /* 11 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 11 */ void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ void (*reserved13)(void); int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */ @@ -472,7 +471,7 @@ typedef struct TkIntPlatStubs { Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ + void (*reserved43)(void); void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ #endif /* X11 */ @@ -509,11 +508,12 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 8 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 9 */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ #define TkSetPixmapColormap \ (tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */ -/* Slot 11 is reserved */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 11 */ #define TkWinClipboardRender \ (tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */ #define TkWinEmbeddedEventProc \ @@ -575,8 +575,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ #define TkUnixSetMenubar \ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ +/* Slot 43 is reserved */ #define TkSendCleanup \ (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #define TkpTestsendCmd \ @@ -603,12 +602,12 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ #define TkMacOSXButtonKeyState \ (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 9 */ +#define TkMacOSXClearMenubarActive \ + (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ #define TkMacOSXDispatchMenuEvent \ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ -#define TkMacOSXClearMenubarActive \ - (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 11 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 11 */ #define TkMacOSXHandleTearoffMenu \ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ /* Slot 13 is reserved */ @@ -739,8 +738,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ #define TkUnixSetMenubar \ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ +/* Slot 43 is reserved */ #define TkSendCleanup \ (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #define TkpTestsendCmd \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index faff8d8..f733637 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -441,9 +441,9 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkpScanWindowId, /* 6 */ TkpWmSetState, /* 7 */ TkpSetCursor, /* 8 */ - TkpSetCapture, /* 9 */ + TkWmCleanup, /* 9 */ TkSetPixmapColormap, /* 10 */ - 0, /* 11 */ + TkpSetCapture, /* 11 */ TkWinClipboardRender, /* 12 */ TkWinEmbeddedEventProc, /* 13 */ TkWinFillRect, /* 14 */ @@ -475,7 +475,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkUnixContainerId, /* 40 */ TkUnixDoOneXEvent, /* 41 */ TkUnixSetMenubar, /* 42 */ - TkWmCleanup, /* 43 */ + 0, /* 43 */ TkSendCleanup, /* 44 */ TkpTestsendCmd, /* 45 */ 0, /* 46 */ @@ -491,9 +491,9 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkpScanWindowId, /* 6 */ TkpWmSetState, /* 7 */ TkMacOSXButtonKeyState, /* 8 */ - TkpSetCapture, /* 9 */ + TkMacOSXClearMenubarActive, /* 9 */ TkMacOSXDispatchMenuEvent, /* 10 */ - TkMacOSXClearMenubarActive, /* 11 */ + TkpSetCapture, /* 11 */ TkMacOSXHandleTearoffMenu, /* 12 */ 0, /* 13 */ TkMacOSXDoHLEvent, /* 14 */ @@ -582,7 +582,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkUnixContainerId, /* 40 */ TkUnixDoOneXEvent, /* 41 */ TkUnixSetMenubar, /* 42 */ - TkWmCleanup, /* 43 */ + 0, /* 43 */ TkSendCleanup, /* 44 */ TkpTestsendCmd, /* 45 */ #endif /* X11 */ -- cgit v0.12 From ebaefdb7a46e5e843ef135029041fdfbfa1c1a49 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Nov 2023 14:33:24 +0000 Subject: Remove pack-old.n too --- doc/pack-old.n | 195 ------------------------------------ macosx/Tk.xcodeproj/project.pbxproj | 2 - 2 files changed, 197 deletions(-) delete mode 100644 doc/pack-old.n diff --git a/doc/pack-old.n b/doc/pack-old.n deleted file mode 100644 index 5ef5da1..0000000 --- a/doc/pack-old.n +++ /dev/null @@ -1,195 +0,0 @@ -'\" -'\" Copyright (c) 1990-1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.TH pack-old n 4.0 Tk "Tk Built-In Commands" -.so man.macros -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -pack-old \- Obsolete syntax for packer geometry manager -.SH SYNOPSIS -\fBpack after \fIsibling \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack append \fIparent \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack before \fIsibling \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack unpack \fIwindow\fR -.BE -.SH DESCRIPTION -.PP -\fINote: this manual entry describes the syntax for the \fBpack\fI -command as it existed before Tk version 3.3. -Although this syntax continues to be supported for backward -compatibility, it is obsolete and should not be used anymore. -At some point in the future it may cease to be supported.\fR -.PP -The packer is a geometry manager that arranges the -children of a parent by packing them in order around the edges of -the parent. The first child is placed against one side of -the window, occupying the entire span of the window along that -side. This reduces the space remaining for other children as -if the side had been moved in by the size of the first child. -Then the next child is placed against one side of the remaining -cavity, and so on until all children have been placed or there -is no space left in the cavity. -.PP -The \fBbefore\fR, \fBafter\fR, and \fBappend\fR forms of the \fBpack\fR -command are used to insert one or more children into the packing order -for their parent. The \fBbefore\fR form inserts the children before -window \fIsibling\fR in the order; all of the other windows must be -siblings of \fIsibling\fR. The \fBafter\fR form inserts the windows -after \fIsibling\fR, and the \fBappend\fR form appends one or more -windows to the end of the packing order for \fIparent\fR. If a -\fIwindow\fR named in any of these commands is already packed in -its parent, it is removed from its current position in the packing -order and repositioned as indicated by the command. All of these -commands return an empty string as result. -.PP -The \fBunpack\fR form of the \fBpack\fR command removes \fIwindow\fR -from the packing order of its parent and unmaps it. After the -execution of this command the packer will no longer manage -\fIwindow\fR's geometry. -.PP -The placement of each child is actually a four-step process; -the \fIoptions\fR argument following each \fIwindow\fR consists of -a list of one or more fields that govern the placement of that -window. In the discussion below, the term \fIcavity\fR refers -to the space left in a parent when a particular child is placed -(i.e. all the space that was not claimed by earlier children in -the packing order). The term \fIparcel\fR refers to the space -allocated to a particular child; this is not necessarily the -same as the child window's final geometry. -.PP -The first step in placing a child is to determine which side of -the cavity it will lie against. Any one of the following options -may be used to specify a side: -.TP -\fBtop\fR -Position the child's parcel against the top of the cavity, -occupying the full width of the cavity. -.TP -\fBbottom\fR -Position the child's parcel against the bottom of the cavity, -occupying the full width of the cavity. -.TP -\fBleft\fR -Position the child's parcel against the left side of the cavity, -occupying the full height of the cavity. -.TP -\fBright\fR -Position the child's parcel against the right side of the cavity, -occupying the full height of the cavity. -.LP -At most one of these options should be specified for any given window. -If no side is specified, then the default is \fBtop\fR. -.PP -The second step is to decide on a parcel for the child. For \fBtop\fR -and \fBbottom\fR windows, the desired parcel width is normally the cavity -width and the desired parcel height is the window's requested height, -as passed to \fBTk_GeometryRequest\fR. For \fBleft\fR and \fBright\fR -windows, the desired parcel height is normally the cavity height and the -desired width is the window's requested width. However, extra -space may be requested for the window using any of the following -options: -.TP 12 -\fBpadx \fInum\fR -Add \fInum\fR pixels to the window's requested width before computing -the parcel size as described above. -.TP 12 -\fBpady \fInum\fR -Add \fInum\fR pixels to the window's requested height before computing -the parcel size as described above. -.TP 12 -\fBexpand\fR -This option requests that the window's parcel absorb any extra space left over -in the parent's cavity after packing all the children. -The amount of space left over depends on the sizes requested by the -other children, and may be zero. If several windows have all specified -\fBexpand\fR then the extra width will be divided equally among all the -\fBleft\fR and \fBright\fR windows that specified \fBexpand\fR and -the extra height will be divided equally among all the \fBtop\fR and -\fBbottom\fR windows that specified \fBexpand\fR. -.LP -If the desired width or height for a parcel is larger than the corresponding -dimension of the cavity, then the cavity's dimension is used instead. -.PP -The third step in placing the window is to decide on the window's -width and height. The default is for the window to receive either -its requested width and height or the those of the parcel, whichever -is smaller. If the parcel is larger than the window's requested -size, then the following options may be used to expand the -window to partially or completely fill the parcel: -.TP -\fBfill\fR -Set the window's size to equal the parcel size. -.TP -\fBfillx\fR -Increase the window's width to equal the parcel's width, but retain -the window's requested height. -.TP -\fBfilly\fR -Increase the window's height to equal the parcel's height, but retain -the window's requested width. -.PP -The last step is to decide the window's location within its parcel. -If the window's size equals the parcel's size, then the window simply -fills the entire parcel. If the parcel is larger than the window, -then one of -the following options may be used to specify where the window should -be positioned within its parcel: -.TP 15 -\fBframe center\fR -Center the window in its parcel. This is the default if no framing -option is specified. -.TP 15 -\fBframe n\fR -Position the window with its top edge centered on the top edge of -the parcel. -.TP 15 -\fBframe ne\fR -Position the window with its upper-right corner at the upper-right corner -of the parcel. -.TP 15 -\fBframe e\fR -Position the window with its right edge centered on the right edge of -the parcel. -.TP 15 -\fBframe se\fR -Position the window with its lower-right corner at the lower-right corner -of the parcel. -.TP 15 -\fBframe s\fR -Position the window with its bottom edge centered on the bottom edge of -the parcel. -.TP 15 -\fBframe sw\fR -Position the window with its lower-left corner at the lower-left corner -of the parcel. -.TP 15 -\fBframe w\fR -Position the window with its left edge centered on the left edge of -the parcel. -.TP 15 -\fBframe nw\fR -Position the window with its upper-left corner at the upper-left corner -of the parcel. -.PP -The packer manages the mapped/unmapped state of all the packed -children windows. It automatically maps the windows when it packs -them, and it unmaps any windows for which there was no space left -in the cavity. -.PP -The packer makes geometry requests on behalf of the parent windows -it manages. For each parent window it requests a size large enough -to accommodate all the options specified by all the packed children, -such that zero space would be leftover for \fBexpand\fR options. -.SH KEYWORDS -geometry manager, location, packer, parcel, size -'\" Local Variables: -'\" mode: nroff -'\" End: diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index c4c3b25..c5b66d5 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -790,7 +790,6 @@ F966BA7908F27A38005CB29B /* optionMenu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = optionMenu.n; sourceTree = ""; }; F966BA7A08F27A38005CB29B /* options.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = options.n; sourceTree = ""; }; F966BA7B08F27A38005CB29B /* OwnSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OwnSelect.3; sourceTree = ""; }; - F966BA7C08F27A38005CB29B /* pack-old.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = "pack-old.n"; sourceTree = ""; }; F966BA7D08F27A38005CB29B /* pack.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pack.n; sourceTree = ""; }; F966BA7E08F27A38005CB29B /* palette.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = palette.n; sourceTree = ""; }; F966BA7F08F27A38005CB29B /* panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = panedwindow.n; sourceTree = ""; }; @@ -2257,7 +2256,6 @@ F966BA7908F27A38005CB29B /* optionMenu.n */, F966BA7A08F27A38005CB29B /* options.n */, F966BA7B08F27A38005CB29B /* OwnSelect.3 */, - F966BA7C08F27A38005CB29B /* pack-old.n */, F966BA7D08F27A38005CB29B /* pack.n */, F966BA7E08F27A38005CB29B /* palette.n */, F966BA7F08F27A38005CB29B /* panedwindow.n */, -- cgit v0.12 From e91354a1f438857414146b91cc7bed3ed9e22643 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Nov 2023 15:23:21 +0000 Subject: unnecessary type-cast --- generic/tkScrollbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 4c0ef99..130edc3 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -532,7 +532,7 @@ ConfigureScrollbar( int flags) /* Flags to pass to Tk_ConfigureWidget. */ { if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, objc, - objv, (char *) scrollPtr, flags) != TCL_OK) { + objv, scrollPtr, flags) != TCL_OK) { return TCL_ERROR; } -- cgit v0.12 From c57617d6e3b8b231eb25649e5c1bf49d831404a3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Nov 2023 15:27:20 +0000 Subject: Shuffle (internal) stub-entries, so now same functionnames occupy the same stub-entry number, independant from platform. --- generic/tkInt.decls | 35 ++++++++-------- generic/tkIntPlatDecls.h | 106 +++++++++++++++++++++++------------------------ generic/tkStubInit.c | 26 ++++++------ 3 files changed, 83 insertions(+), 84 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index fbbab54..e16a72b 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -624,20 +624,17 @@ interface tkIntPlat ################################ # Unix specific functions +declare 0 x11 { + void TkCreateXEventSource(void) +} declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 6 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } -declare 7 x11 { - int TkpWmSetState(TkWindow *winPtr, int state) -} declare 9 x11 { - void TkWmCleanup(TkDisplay *dispPtr) -} -declare 37 x11 { - void TkCreateXEventSource(void) + int TkpWmSetState(TkWindow *winPtr, int state) } # only needed by tktest: declare 38 x11 { @@ -655,6 +652,9 @@ declare 41 x11 { declare 42 x11 { void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } +declare 43 x11 { + void TkWmCleanup(TkDisplay *dispPtr) +} declare 44 x11 { void TkSendCleanup(TkDisplay *dispPtr) } @@ -668,10 +668,7 @@ declare 45 x11 { # Windows specific functions declare 0 win { - char *TkAlignImageData(XImage *image, int alignment, int bitOrder) -} -declare 1 win { - void TkWinCancelMouseTimer(void) + void TkCreateXEventSource(void) } declare 2 win { void TkGenerateActivateEvents(TkWindow *winPtr, int active) @@ -689,19 +686,19 @@ declare 6 win { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 7 win { - int TkpWmSetState(TkWindow *winPtr, int state) + void TkpSetCapture(TkWindow *winPtr) } declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - void TkWmCleanup(TkDisplay *dispPtr) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) } declare 11 win { - void TkpSetCapture(TkWindow *winPtr) + void TkWinCancelMouseTimer(void) } declare 12 win { void TkWinClipboardRender(TkDisplay *dispPtr, UINT format) @@ -773,6 +770,9 @@ declare 32 win { Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className) } +declare 33 win { + char *TkAlignImageData(XImage *image, int alignment, int bitOrder) +} # new for 8.4.1 @@ -790,10 +790,6 @@ declare 36 win { UINT message, WPARAM wParam, LPARAM lParam) } -# new for 8.4.20+/8.5.12+, Cygwin only -declare 37 win { - void TkCreateXEventSource(void) -} declare 38 win { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } @@ -809,6 +805,9 @@ declare 41 win { declare 42 win { void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } +declare 43 win { + void TkWmCleanup(TkDisplay *dispPtr) +} declare 44 win { void TkSendCleanup(TkDisplay *dispPtr) } diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 474deba..e470575 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -36,10 +36,8 @@ extern "C" { #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN char * TkAlignImageData(XImage *image, int alignment, - int bitOrder); -/* 1 */ -EXTERN void TkWinCancelMouseTimer(void); +EXTERN void TkCreateXEventSource(void); +/* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); @@ -53,15 +51,15 @@ EXTERN void TkpPrintWindowId(char *buf, Window window); EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); /* 7 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 8 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 9 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 10 */ EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); /* 11 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN void TkWinCancelMouseTimer(void); /* 12 */ EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format); /* 13 */ @@ -114,7 +112,9 @@ EXTERN void TkWinDialogDebug(int debug); /* 32 */ EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); -/* Slot 33 is reserved */ +/* 33 */ +EXTERN char * TkAlignImageData(XImage *image, int alignment, + int bitOrder); /* 34 */ EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); /* 35 */ @@ -122,8 +122,7 @@ EXTERN int TkWinGetPlatformTheme(void); /* 36 */ EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); -/* 37 */ -EXTERN void TkCreateXEventSource(void); +/* Slot 37 is reserved */ /* 38 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ @@ -134,7 +133,8 @@ EXTERN Window TkUnixContainerId(TkWindow *winPtr); EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); /* 42 */ EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); -/* Slot 43 is reserved */ +/* 43 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* 44 */ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 45 */ @@ -253,7 +253,8 @@ EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); EXTERN void * TkMacOSXDrawable(Drawable drawable); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -/* Slot 0 is reserved */ +/* 0 */ +EXTERN void TkCreateXEventSource(void); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, @@ -264,11 +265,10 @@ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, /* 6 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); -/* 7 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +/* Slot 7 is reserved */ /* Slot 8 is reserved */ /* 9 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* Slot 10 is reserved */ /* Slot 11 is reserved */ /* Slot 12 is reserved */ @@ -296,8 +296,7 @@ EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ -/* 37 */ -EXTERN void TkCreateXEventSource(void); +/* Slot 37 is reserved */ /* 38 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ @@ -308,7 +307,8 @@ EXTERN Window TkUnixContainerId(TkWindow *winPtr); EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); /* 42 */ EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); -/* Slot 43 is reserved */ +/* 43 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* 44 */ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 45 */ @@ -321,18 +321,18 @@ typedef struct TkIntPlatStubs { void *hooks; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ - char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ - void (*tkWinCancelMouseTimer) (void); /* 1 */ + void (*tkCreateXEventSource) (void); /* 0 */ + void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ unsigned long (*tkpGetMS) (void); /* 3 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 11 */ + void (*tkWinCancelMouseTimer) (void); /* 11 */ void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */ void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */ @@ -354,17 +354,17 @@ typedef struct TkIntPlatStubs { void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ void (*tkWinDialogDebug) (int debug); /* 31 */ Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */ - void (*reserved33)(void); + char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 33 */ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ - void (*tkCreateXEventSource) (void); /* 37 */ + void (*reserved37)(void); int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync) (Display *display); /* 39 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*reserved43)(void); + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ void (*reserved46)(void); @@ -428,16 +428,16 @@ typedef struct TkIntPlatStubs { void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved0)(void); + void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ void (*reserved3)(void); void (*reserved4)(void); void (*reserved5)(void); int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ + void (*reserved7)(void); void (*reserved8)(void); - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ void (*reserved10)(void); void (*reserved11)(void); void (*reserved12)(void); @@ -465,13 +465,13 @@ typedef struct TkIntPlatStubs { void (*reserved34)(void); void (*reserved35)(void); void (*reserved36)(void); - void (*tkCreateXEventSource) (void); /* 37 */ + void (*reserved37)(void); int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync) (Display *display); /* 39 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*reserved43)(void); + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ #endif /* X11 */ @@ -490,10 +490,9 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ -#define TkAlignImageData \ - (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ -#define TkWinCancelMouseTimer \ - (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 1 */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ +/* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkpGetMS \ @@ -504,16 +503,16 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpPrintWindowId) /* 5 */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 7 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 8 */ -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ #define TkSetPixmapColormap \ (tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 11 */ +#define TkWinCancelMouseTimer \ + (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 11 */ #define TkWinClipboardRender \ (tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */ #define TkWinEmbeddedEventProc \ @@ -556,15 +555,15 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ #define TkWinGetMenuSystemDefault \ (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ -/* Slot 33 is reserved */ +#define TkAlignImageData \ + (tkIntPlatStubsPtr->tkAlignImageData) /* 33 */ #define TkWinSetHINSTANCE \ (tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */ #define TkWinGetPlatformTheme \ (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ #define TkWinChildProc \ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +/* Slot 37 is reserved */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #define TkpSync \ @@ -575,7 +574,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ #define TkUnixSetMenubar \ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ -/* Slot 43 is reserved */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ #define TkSendCleanup \ (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #define TkpTestsendCmd \ @@ -685,7 +685,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -/* Slot 0 is reserved */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ @@ -694,11 +695,10 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 5 is reserved */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ +/* Slot 7 is reserved */ /* Slot 8 is reserved */ -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ /* Slot 10 is reserved */ /* Slot 11 is reserved */ /* Slot 12 is reserved */ @@ -726,8 +726,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +/* Slot 37 is reserved */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #define TkpSync \ @@ -738,7 +737,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ #define TkUnixSetMenubar \ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ -/* Slot 43 is reserved */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ #define TkSendCleanup \ (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #define TkpTestsendCmd \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index f733637..dc7947f 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -432,18 +432,18 @@ static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ - TkAlignImageData, /* 0 */ - TkWinCancelMouseTimer, /* 1 */ + TkCreateXEventSource, /* 0 */ + 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ TkpGetMS, /* 3 */ TkPointerDeadWindow, /* 4 */ TkpPrintWindowId, /* 5 */ TkpScanWindowId, /* 6 */ - TkpWmSetState, /* 7 */ + TkpSetCapture, /* 7 */ TkpSetCursor, /* 8 */ - TkWmCleanup, /* 9 */ + TkpWmSetState, /* 9 */ TkSetPixmapColormap, /* 10 */ - TkpSetCapture, /* 11 */ + TkWinCancelMouseTimer, /* 11 */ TkWinClipboardRender, /* 12 */ TkWinEmbeddedEventProc, /* 13 */ TkWinFillRect, /* 14 */ @@ -465,17 +465,17 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkWinSetForegroundWindow, /* 30 */ TkWinDialogDebug, /* 31 */ TkWinGetMenuSystemDefault, /* 32 */ - 0, /* 33 */ + TkAlignImageData, /* 33 */ TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ - TkCreateXEventSource, /* 37 */ + 0, /* 37 */ TkpCmapStressed, /* 38 */ TkpSync, /* 39 */ TkUnixContainerId, /* 40 */ TkUnixDoOneXEvent, /* 41 */ TkUnixSetMenubar, /* 42 */ - 0, /* 43 */ + TkWmCleanup, /* 43 */ TkSendCleanup, /* 44 */ TkpTestsendCmd, /* 45 */ 0, /* 46 */ @@ -539,16 +539,16 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkMacOSXDrawable, /* 54 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 0 */ + TkCreateXEventSource, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ 0, /* 3 */ 0, /* 4 */ 0, /* 5 */ TkpScanWindowId, /* 6 */ - TkpWmSetState, /* 7 */ + 0, /* 7 */ 0, /* 8 */ - TkWmCleanup, /* 9 */ + TkpWmSetState, /* 9 */ 0, /* 10 */ 0, /* 11 */ 0, /* 12 */ @@ -576,13 +576,13 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, /* 34 */ 0, /* 35 */ 0, /* 36 */ - TkCreateXEventSource, /* 37 */ + 0, /* 37 */ TkpCmapStressed, /* 38 */ TkpSync, /* 39 */ TkUnixContainerId, /* 40 */ TkUnixDoOneXEvent, /* 41 */ TkUnixSetMenubar, /* 42 */ - 0, /* 43 */ + TkWmCleanup, /* 43 */ TkSendCleanup, /* 44 */ TkpTestsendCmd, /* 45 */ #endif /* X11 */ -- cgit v0.12 From e9364d0365702f33a67678bad05b3f0dea2b429f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 25 Nov 2023 22:35:53 +0000 Subject: Follow-up legacy removals --- doc/menubar.n | 38 -------- library/obsolete.tcl | 178 ------------------------------------ library/tclIndex | 3 - macosx/Tk.xcodeproj/project.pbxproj | 4 - 4 files changed, 223 deletions(-) delete mode 100644 doc/menubar.n delete mode 100644 library/obsolete.tcl diff --git a/doc/menubar.n b/doc/menubar.n deleted file mode 100644 index eeeb208..0000000 --- a/doc/menubar.n +++ /dev/null @@ -1,38 +0,0 @@ -'\" -'\" Copyright (c) 1992 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.TH tk_menuBar n "" Tk "Tk Built-In Commands" -.so man.macros -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tk_menuBar, tk_bindForTraversal \- Obsolete support for menu bars -.SH SYNOPSIS -\fBtk_menuBar \fIframe \fR?\fImenu menu ...\fR? -.sp -\fBtk_bindForTraversal \fIarg ... \fR -.BE -.SH DESCRIPTION -.PP -These procedures were used in Tk 3.6 and earlier releases to help -manage pulldown menus and to implement keyboard traversal of menus. -In Tk 4.0 and later releases they are no -longer needed. Stubs for these procedures have been retained for -backward compatibility, but they have no effect. You should remove -calls to these procedures from your code, since eventually the -procedures will go away. -.PP -From Tk 8.0 onwards, you should instead construct your menubar as a -normal \fBmenu\fR and then attach it to the \fBtoplevel\fR of your -choice using the \fB\-menu\fR option of that widget. -.SH "SEE ALSO" -menu(n), toplevel(n) -.SH KEYWORDS -keyboard traversal, menu, menu bar, post -'\" Local Variables: -'\" mode: nroff -'\" End: diff --git a/library/obsolete.tcl b/library/obsolete.tcl deleted file mode 100644 index a31884d..0000000 --- a/library/obsolete.tcl +++ /dev/null @@ -1,178 +0,0 @@ -# obsolete.tcl -- -# -# This file contains obsolete procedures that people really shouldn't -# be using anymore, but which are kept around for backward compatibility. -# -# Copyright © 1994 The Regents of the University of California. -# Copyright © 1994 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -# The procedures below are here strictly for backward compatibility with -# Tk version 3.6 and earlier. The procedures are no longer needed, so -# they are no-ops. You should not use these procedures anymore, since -# they may be removed in some future release. - -proc tk_menuBar args {} -proc tk_bindForTraversal args {} - -# ::tk::classic::restore -- -# -# Restore the pre-8.5 (Tk classic) look as the widget defaults for classic -# Tk widgets. -# -# The value following an 'option add' call is the new 8.5 value. -# -namespace eval ::tk::classic { - # This may need to be adjusted for some window managers that are - # more aggressive with their own Xdefaults (like KDE and CDE) - variable prio "widgetDefault" -} - -proc ::tk::classic::restore {args} { - # Restore classic (8.4) look to classic Tk widgets - variable prio - - if {[llength $args]} { - foreach what $args { - ::tk::classic::restore_$what - } - } else { - foreach cmd [info procs restore_*] { - $cmd - } - } -} - -proc ::tk::classic::restore_font {args} { - # Many widgets were adjusted from hard-coded defaults to using the - # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...) - # For restoring compatibility, we only correct size and weighting changes, - # as the fonts themselves remained mostly the same. - if {[tk windowingsystem] eq "x11"} { - font configure TkDefaultFont -weight bold ; # normal - font configure TkFixedFont -size -12 ; # -10 - } - # Add these with prio 21 to override value in dialog/msgbox.tcl - if {[tk windowingsystem] eq "aqua"} { - option add *Dialog.msg.font system 21; # TkCaptionFont - option add *Dialog.dtl.font system 21; # TkCaptionFont - option add *ErrorDialog*Label.font system 21; # TkCaptionFont - } else { - option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont - option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont - option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont - } -} - -proc ::tk::classic::restore_button {args} { - variable prio - if {[tk windowingsystem] eq "x11"} { - foreach cls {Button Radiobutton Checkbutton} { - option add *$cls.borderWidth 2 $prio; # 1 - } - } -} - -proc ::tk::classic::restore_entry {args} { - variable prio - # Entry and Spinbox share core defaults - foreach cls {Entry Spinbox} { - if {[tk windowingsystem] ne "aqua"} { - option add *$cls.borderWidth 2 $prio; # 1 - } - if {[tk windowingsystem] eq "x11"} { - option add *$cls.background "#d9d9d9" $prio; # "white" - option add *$cls.selectBorderWidth 1 $prio; # 0 - } - } -} - -proc ::tk::classic::restore_listbox {args} { - variable prio - if {[tk windowingsystem] ne "win32"} { - option add *Listbox.background "#d9d9d9" $prio; # "white" - option add *Listbox.activeStyle "underline" $prio; # "dotbox" - } - if {[tk windowingsystem] ne "aqua"} { - option add *Listbox.borderWidth 2 $prio; # 1 - } - if {[tk windowingsystem] eq "x11"} { - option add *Listbox.selectBorderWidth 1 $prio; # 0 - } - # Remove focus into Listbox added for 8.5 - bind Listbox { - if {[winfo exists %W]} { - tk::ListboxBeginSelect %W [%W index @%x,%y] - } - } -} - -proc ::tk::classic::restore_menu {args} { - variable prio - if {[tk windowingsystem] eq "x11"} { - option add *Menu.activeBorderWidth 2 $prio; # 1 - option add *Menu.borderWidth 2 $prio; # 1 - option add *Menu.clickToFocus true $prio - option add *Menu.useMotifHelp true $prio - } - if {[tk windowingsystem] ne "aqua"} { - option add *Menu.font "TkDefaultFont" $prio; # "TkMenuFont" - } -} - -proc ::tk::classic::restore_menubutton {args} { - variable prio - option add *Menubutton.borderWidth 2 $prio; # 1 -} - -proc ::tk::classic::restore_message {args} { - variable prio - option add *Message.borderWidth 2 $prio; # 1 -} - -proc ::tk::classic::restore_panedwindow {args} { - variable prio - option add *Panedwindow.borderWidth 2 $prio; # 1 - option add *Panedwindow.sashWidth 2 $prio; # 3 - option add *Panedwindow.sashPad 2 $prio; # 0 - option add *Panedwindow.sashRelief raised $prio; # flat - option add *Panedwindow.opaqueResize 0 $prio; # 1 - if {[tk windowingsystem] ne "win32"} { - option add *Panedwindow.showHandle 1 $prio; # 0 - } -} - -proc ::tk::classic::restore_scale {args} { - variable prio - option add *Scale.borderWidth 2 $prio; # 1 - if {[tk windowingsystem] eq "x11"} { - option add *Scale.troughColor "#c3c3c3" $prio; # "#b3b3b3" - } -} - -proc ::tk::classic::restore_scrollbar {args} { - variable prio - if {[tk windowingsystem] eq "x11"} { - option add *Scrollbar.borderWidth 2 $prio; # 1 - option add *Scrollbar.highlightThickness 1 $prio; # 0 - option add *Scrollbar.width 15 $prio; # 11 - option add *Scrollbar.troughColor "#c3c3c3" $prio; # "#b3b3b3" - } -} - -proc ::tk::classic::restore_text {args} { - variable prio - if {[tk windowingsystem] ne "aqua"} { - option add *Text.borderWidth 2 $prio; # 1 - } - if {[tk windowingsystem] eq "win32"} { - option add *Text.font "TkDefaultFont" $prio; # "TkFixedFont" - } - if {[tk windowingsystem] eq "x11"} { - option add *Text.background "#d9d9d9" $prio; # white - option add *Text.selectBorderWidth 1 $prio; # 0 - } -} diff --git a/library/tclIndex b/library/tclIndex index 06f31b2..bf5ebac 100644 --- a/library/tclIndex +++ b/library/tclIndex @@ -122,9 +122,6 @@ set auto_index(::tk::GenerateMenuSelect) [list source [file join $dir menu.tcl]] set auto_index(tk_popup) [list source [file join $dir menu.tcl]] set auto_index(::tk::ensure_psenc_is_loaded) [list source [file join $dir mkpsenc.tcl]] set auto_index(::tk::MessageBox) [list source [file join $dir msgbox.tcl]] -set auto_index(tk_menuBar) [list source [file join $dir obsolete.tcl]] -set auto_index(tk_bindForTraversal) [list source [file join $dir obsolete.tcl]] -set auto_index(::tk::classic::restore) [list source [file join $dir obsolete.tcl]] set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]] set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]] set auto_index(::tk::RecolorTree) [list source [file join $dir palette.tcl]] diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index c5b66d5..2a5af3e 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -779,7 +779,6 @@ F966BA6E08F27A38005CB29B /* MapWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MapWindow.3; sourceTree = ""; }; F966BA6F08F27A38005CB29B /* MeasureChar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MeasureChar.3; sourceTree = ""; }; F966BA7008F27A38005CB29B /* menu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menu.n; sourceTree = ""; }; - F966BA7108F27A38005CB29B /* menubar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menubar.n; sourceTree = ""; }; F966BA7208F27A38005CB29B /* menubutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menubutton.n; sourceTree = ""; }; F966BA7308F27A38005CB29B /* message.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = message.n; sourceTree = ""; }; F966BA7408F27A38005CB29B /* messageBox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = messageBox.n; sourceTree = ""; }; @@ -1002,7 +1001,6 @@ F966BB7408F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = ""; }; F966BB7508F27A3A005CB29B /* mkpsenc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mkpsenc.tcl; sourceTree = ""; }; F966BB7608F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = ""; }; - F966BB8608F27A3A005CB29B /* obsolete.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obsolete.tcl; sourceTree = ""; }; F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = ""; }; F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = ""; }; F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = ""; }; @@ -2245,7 +2243,6 @@ F966BA6E08F27A38005CB29B /* MapWindow.3 */, F966BA6F08F27A38005CB29B /* MeasureChar.3 */, F966BA7008F27A38005CB29B /* menu.n */, - F966BA7108F27A38005CB29B /* menubar.n */, F966BA7208F27A38005CB29B /* menubutton.n */, F966BA7308F27A38005CB29B /* message.n */, F966BA7408F27A38005CB29B /* messageBox.n */, @@ -2455,7 +2452,6 @@ F966BB7408F27A3A005CB29B /* menu.tcl */, F966BB7508F27A3A005CB29B /* mkpsenc.tcl */, F966BB7608F27A3A005CB29B /* msgbox.tcl */, - F966BB8608F27A3A005CB29B /* obsolete.tcl */, F966BB8708F27A3A005CB29B /* optMenu.tcl */, F966BB8808F27A3A005CB29B /* palette.tcl */, F966BB8908F27A3B005CB29B /* panedwindow.tcl */, -- cgit v0.12 From 6a7dea21842d8a1ebab4cf679c098bae5ac093e8 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 26 Nov 2023 08:14:52 +0000 Subject: Following [536fea2e], remove deprecated scrollbar tests. Note: we have 3 tests still constrained by 'deprecated' in the codebase. --- tests/scrollbar.test | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/tests/scrollbar.test b/tests/scrollbar.test index edf263c..c84ce58 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -316,10 +316,6 @@ destroy .t test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} { list [catch {.s get a} msg] $msg } {1 {wrong # args: should be ".s get"}} -test scrollbar-3.44 {ScrollbarWidgetCmd procedure, "get" option} deprecated { - .s set 100 10 13 14 - .s get -} {100 10 13 14} test scrollbar-3.45 {ScrollbarWidgetCmd procedure, "get" option} { .s set 0.6 0.8 set result {} @@ -401,30 +397,6 @@ test scrollbar-3.63 {ScrollbarWidgetCmd procedure, "set" option} { } set result } {0.4 0.4} -test scrollbar-3.64 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - list [catch {.s set abc def ghi jkl} msg] $msg -} {1 {expected integer but got "abc"}} -test scrollbar-3.65 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - list [catch {.s set 1 def ghi jkl} msg] $msg -} {1 {expected integer but got "def"}} -test scrollbar-3.66 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - list [catch {.s set 1 2 ghi jkl} msg] $msg -} {1 {expected integer but got "ghi"}} -test scrollbar-3.67 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - list [catch {.s set 1 2 3 jkl} msg] $msg -} {1 {expected integer but got "jkl"}} -test scrollbar-3.68 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - .s set -10 50 20 30 - .s get -} {0 50 0 0} -test scrollbar-3.69 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - .s set 100 -10 20 30 - .s get -} {100 0 20 30} -test scrollbar-3.70 {ScrollbarWidgetCmd procedure, "set" option} deprecated { - .s set 100 50 30 20 - .s get -} {100 50 30 30} test scrollbar-3.71 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3} msg] $msg } {1 {wrong # args: should be ".s set firstFraction lastFraction"}} -- cgit v0.12 From 2b3b6f6334373b0e5eec61731bf83e629235d3ed Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 27 Nov 2023 16:16:12 +0000 Subject: Starting work to compile Tk with TCL_UTF_MAX=4 (WIP) --- generic/tkBind.c | 4 +-- generic/tkEntry.c | 10 +++---- generic/tkFont.c | 10 +++---- generic/tkIcu.c | 22 ++++++++++++-- generic/tkInt.h | 8 ------ generic/tkText.c | 4 +-- generic/tkTextDisp.c | 2 +- generic/tkTextIndex.c | 8 +++--- generic/tkUtil.c | 73 ----------------------------------------------- generic/ttk/ttkEntry.c | 8 +++--- macosx/tkMacOSXKeyboard.c | 2 +- unix/Makefile.in | 2 +- unix/tkUnixFont.c | 18 ++++++------ unix/tkUnixKey.c | 2 +- unix/tkUnixMenu.c | 2 +- unix/tkUnixRFont.c | 4 +-- win/Makefile.in | 2 +- win/makefile.vc | 2 +- win/tkWinFont.c | 10 +++---- win/tkWinKey.c | 4 +-- win/tkWinMenu.c | 2 +- 21 files changed, 67 insertions(+), 132 deletions(-) diff --git a/generic/tkBind.c b/generic/tkBind.c index acd982b..d62666f 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -5300,7 +5300,7 @@ TkStringToKeysym( #endif /* REDO_KEYSYM_LOOKUP */ int keysym; - size_t len = TkUtfToUniChar(name, &keysym); + size_t len = Tcl_UtfToUniChar(name, &keysym); if (name[len] == '\0') { if (!Tcl_UniCharIsPrint(keysym)) { /* This form not supported */ @@ -5384,7 +5384,7 @@ TkKeysymToString( && ((unsigned)(keysym - 0x100007F) > 0x20)) { char buf[10]; if (Tcl_UniCharIsPrint(keysym-0x1000000)) { - buf[TkUniCharToUtf(keysym - 0x1000000, buf)] = '\0'; + buf[Tcl_UniCharToUtf(keysym - 0x1000000, buf)] = '\0'; } else if (keysym >= 0x1010000) { snprintf(buf, sizeof(buf), "U%08X", (int)(keysym - 0x1000000)); } else { diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 6601d65..6da9e40 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -2002,8 +2002,8 @@ EntryComputeGeometry( * resulting string. */ - TkUtfToUniChar(entryPtr->showChar, &ch); - size = TkUniCharToUtf(ch, buf); + Tcl_UtfToUniChar(entryPtr->showChar, &ch); + size = Tcl_UniCharToUtf(ch, buf); entryPtr->numDisplayBytes = entryPtr->numChars * size; p = (char *)ckalloc(entryPtr->numDisplayBytes + 1); @@ -3584,7 +3584,7 @@ ExpandPercents( before++; /* skip over % */ if (*before != '\0') { - before += TkUtfToUniChar(before, &ch); + before += Tcl_UtfToUniChar(before, &ch); } else { ch = '%'; } @@ -3604,7 +3604,7 @@ ExpandPercents( string = Tk_PathName(entryPtr->tkwin); break; default: - length = TkUniCharToUtf(ch, numStorage); + length = Tcl_UniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; @@ -3664,7 +3664,7 @@ ExpandPercents( string = Tk_PathName(entryPtr->tkwin); break; default: - length = TkUniCharToUtf(ch, numStorage); + length = Tcl_UniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; diff --git a/generic/tkFont.c b/generic/tkFont.c index 844ed78..e67be4e 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -576,7 +576,7 @@ Tk_FontObjCmd( if (charPtr != NULL) { const char *string = Tcl_GetString(charPtr); - size_t len = TkUtfToUniChar(string, &uniChar); + size_t len = Tcl_UtfToUniChar(string, &uniChar); if (len != (size_t)charPtr->length) { resultPtr = Tcl_NewStringObj( @@ -1744,14 +1744,14 @@ Tk_PostscriptFontName( src++; upper = 1; } - src += TkUtfToUniChar(src, &ch); + src += Tcl_UtfToUniChar(src, &ch); if (upper) { ch = Tcl_UniCharToUpper(ch); upper = 0; } else { ch = Tcl_UniCharToLower(ch); } - dest += TkUniCharToUtf(ch, dest); + dest += Tcl_UniCharToUtf(ch, dest); } *dest = '\0'; Tcl_DStringSetLength(dsPtr, dest - Tcl_DStringValue(dsPtr)); @@ -2789,7 +2789,7 @@ Tk_CharBbox( } if (widthPtr != NULL) { int ch; - Tk_MeasureChars(tkfont, end, TkUtfToUniChar(end, &ch), -1, 0, &w); + Tk_MeasureChars(tkfont, end, Tcl_UtfToUniChar(end, &ch), -1, 0, &w); } goto check; } @@ -3335,7 +3335,7 @@ Tk_TextLayoutToPostscript( * international postscript fonts. */ - p += TkUtfToUniChar(p, &ch); + p += Tcl_UtfToUniChar(p, &ch); if ((ch == '(') || (ch == ')') || (ch == '\\') || (ch < 0x20)) { /* * Tricky point: the "03" is necessary in the snprintf below, diff --git a/generic/tkIcu.c b/generic/tkIcu.c index 5639336..237daf8 100644 --- a/generic/tkIcu.c +++ b/generic/tkIcu.c @@ -92,13 +92,13 @@ startEndOfCmd( str = Tcl_GetStringFromObj(objv[1], &len); Tcl_UtfToChar16DString(str, len, &ds); len = Tcl_DStringLength(&ds)/2; - if (TkGetIntForIndex(objv[2], len-1, 0, &idx) != TCL_OK) { + Tcl_Size ulen = Tcl_GetCharLength(objv[1]); + if (TkGetIntForIndex(objv[2], ulen-1, 0, &idx) != TCL_OK) { Tcl_DStringFree(&ds); Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "ICU", "INDEX", NULL); return TCL_ERROR; } - it = icu_open((UBreakIteratorTypex)(flags&3), locale, NULL, -1, &errorCode); if (it != NULL) { @@ -112,6 +112,14 @@ startEndOfCmd( Tcl_SetErrorCode(interp, "TK", "ICU", "CANNOTOPEN", NULL); return TCL_ERROR; } + if (idx > 0 && len != ulen) { + /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ + Tcl_Size newIdx = 1; + for (Tcl_Size i = 1; i < idx; i++) { + newIdx += 1 + (((ustr[newIdx-1]&0xFFC0) == 0xD800) && ((ustr[newIdx]&0xFFC0) == 0xDC00)); + } + idx = newIdx; + } if (flags & FLAG_FOLLOWING) { if ((idx < 0) && (flags & FLAG_WORD)) { idx = 0; @@ -122,7 +130,7 @@ startEndOfCmd( } } else if (idx > 0) { if (!(flags & FLAG_WORD)) { - idx += 1 + (((ustr[idx]&0xFFC0) == 0xD800) && ((ustr[idx+1]&0xFFC0) == 0xDC00)); + idx += 1 + (((ustr[idx]&0xFFC0) == 0xD800) && ((ustr[idx+1]&0xFFC0) == 0xDC00)); } idx = icu_preceding(it, idx); if (idx == 0 && (flags & FLAG_WORD)) { @@ -146,6 +154,14 @@ startEndOfCmd( icu_close(it); Tcl_DStringFree(&ds); if (idx != TCL_INDEX_NONE) { + if (idx > 0 && len != ulen) { + /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ + Tcl_Size newIdx = 1; + for (Tcl_Size i = 1; i < idx; i++) { + if (((ustr[i-1]&0xFFC0) != 0xD800) || ((ustr[i]&0xFFC0) != 0xDC00)) newIdx++; + } + idx = newIdx; + } Tcl_SetObjResult(interp, TkNewIndexObj(idx)); } return TCL_OK; diff --git a/generic/tkInt.h b/generic/tkInt.h index d503e95..9b76898 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1437,14 +1437,6 @@ MODULE_SCOPE void TkpCopyRegion(TkRegion dst, TkRegion src); # define c_class class #endif -#if TCL_UTF_MAX > 3 -# define TkUtfToUniChar(src, ch) (size_t)(((int (*)(const char *, int *))Tcl_UtfToUniChar)(src, ch)) -# define TkUniCharToUtf(ch, src) (size_t)(((int (*)(int, char *))Tcl_UniCharToUtf)(ch, src)) -#else - MODULE_SCOPE size_t TkUtfToUniChar(const char *, int *); - MODULE_SCOPE size_t TkUniCharToUtf(int, char *); -#endif - #if defined(_WIN32) && !defined(STATIC_BUILD) && TCL_MAJOR_VERSION < 9 # define tcl_CreateFileHandler reserved9 #endif diff --git a/generic/tkText.c b/generic/tkText.c index 83d2d49..51fa2a0 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -4607,7 +4607,7 @@ TkTextGetTabs( * There may be a more efficient way of getting this. */ - TkUtfToUniChar(Tcl_GetString(objv[i+1]), &ch); + Tcl_UtfToUniChar(Tcl_GetString(objv[i+1]), &ch); if (!Tcl_UniCharIsAlpha(ch)) { continue; } @@ -6186,7 +6186,7 @@ SearchCore( } } else { firstOffset = p - startOfLine + - TkUtfToUniChar(startOfLine+matchOffset,&ch); + Tcl_UtfToUniChar(startOfLine+matchOffset,&ch); } } } while (searchSpecPtr->all); diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index b3096f9..5ad4509 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -7703,7 +7703,7 @@ TkTextCharLayoutProc( if (bytesThatFit + 1 <= maxBytes) { if ((bytesThatFit == 0) && noCharsYet) { int ch; - int chLen = TkUtfToUniChar(p, &ch); + int chLen = Tcl_UtfToUniChar(p, &ch); #ifdef TK_LAYOUT_WITH_BASE_CHUNKS bytesThatFit = CharChunkMeasureChars(chunkPtr, line, diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 2449a12..b0a5c94 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -451,7 +451,7 @@ TkTextMakeByteIndex( start = segPtr->body.chars + (byteIndex - index); p = Tcl_UtfPrev(start, segPtr->body.chars); - p += TkUtfToUniChar(p, &ch); + p += Tcl_UtfToUniChar(p, &ch); indexPtr->byteIndex += p - start; } break; @@ -1665,7 +1665,7 @@ TkTextIndexForwChars( if (segPtr->typePtr == &tkTextCharType) { start = segPtr->body.chars + byteOffset; end = segPtr->body.chars + segPtr->size; - for (p = start; p < end; p += TkUtfToUniChar(p, &ch)) { + for (p = start; p < end; p += Tcl_UtfToUniChar(p, &ch)) { if (charCount == 0) { dstPtr->byteIndex += (p - start); goto forwardCharDone; @@ -2397,7 +2397,7 @@ StartEnd( if (segPtr->typePtr == &tkTextCharType) { int ch; - chSize = TkUtfToUniChar(segPtr->body.chars + offset, &ch); + chSize = Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch); if (!Tcl_UniCharIsWordChar(ch)) { break; } @@ -2442,7 +2442,7 @@ StartEnd( if (segPtr->typePtr == &tkTextCharType) { int ch; - TkUtfToUniChar(segPtr->body.chars + offset, &ch); + Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch); if (!Tcl_UniCharIsWordChar(ch)) { break; } diff --git a/generic/tkUtil.c b/generic/tkUtil.c index d3bf058..b4ce9fe 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -1246,79 +1246,6 @@ Tk_SendVirtualEvent( Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL); } -#if TCL_UTF_MAX < 4 -/* - *--------------------------------------------------------------------------- - * - * TkUtfToUniChar -- - * - * Almost the same as Tcl_UtfToUniChar but using int instead of Tcl_UniChar. - * This function is capable of collapsing a upper/lower surrogate pair to a - * single unicode character. So, up to 6 bytes might be consumed. - * - * Results: - * *chPtr is filled with the Tcl_UniChar, and the return value is the - * number of bytes from the UTF-8 string that were consumed. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -size_t -TkUtfToUniChar( - const char *src, /* The UTF-8 string. */ - int *chPtr) /* Filled with the Unicode value represented by - * the UTF-8 string. */ -{ - Tcl_UniChar uniChar = 0; - - size_t len = Tcl_UtfToUniChar(src, &uniChar); - if ((uniChar & 0xFC00) == 0xD800) { - Tcl_UniChar low = uniChar; - /* This can only happen if sizeof(Tcl_UniChar)== 2 and src points - * to a character > U+FFFF */ - size_t len2 = Tcl_UtfToUniChar(src+len, &low); - if ((low & 0xFC00) == 0xDC00) { - *chPtr = (((uniChar & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000; - return len + len2; - } - } - *chPtr = uniChar; - return len; -} - -/* - *--------------------------------------------------------------------------- - * - * TkUniCharToUtf -- - * - * Almost the same as Tcl_UniCharToUtf but producing 2 x 3-byte UTF-8 - * sequences for out-of-bmp characters when TCL_UTF_MAX==3. - * So, up to 6 bytes might be produced. - * - * Results: - * *buf is filled with the UTF-8 string, and the return value is the - * number of bytes produced. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -size_t TkUniCharToUtf(int ch, char *buf) -{ - if ((unsigned)(ch - 0x10000) <= 0xFFFFF) { - /* Spit out a 4-byte UTF-8 character or 2 x 3-byte UTF-8 characters, depending on Tcl - * version and/or TCL_UTF_MAX build value */ - int len = Tcl_UniCharToUtf(0xD800 | ((ch - 0x10000) >> 10), buf); - return len + Tcl_UniCharToUtf(0xDC00 | (ch & 0x7FF), buf + len); - } - return Tcl_UniCharToUtf(ch, buf); -} -#endif /* * Local Variables: * mode: c diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index f0fe2fc..66d6e3d 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -300,8 +300,8 @@ static char *EntryDisplayString(const char *showChar, int numChars) int ch; char buf[6]; - TkUtfToUniChar(showChar, &ch); - size = TkUniCharToUtf(ch, buf); + Tcl_UtfToUniChar(showChar, &ch); + size = Tcl_UniCharToUtf(ch, buf); p = displayString = (char *)ckalloc(numChars * size + 1); while (numChars--) { @@ -458,7 +458,7 @@ ExpandPercents( */ ++templ; /* skip over % */ if (*templ != '\0') { - templ += TkUtfToUniChar(templ, &ch); + templ += Tcl_UtfToUniChar(templ, &ch); } else { ch = '%'; } @@ -508,7 +508,7 @@ ExpandPercents( string = Tk_PathName(entryPtr->core.tkwin); break; default: - length = TkUniCharToUtf(ch, numStorage); + length = Tcl_UniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index ef0d678..c7127ef 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -501,7 +501,7 @@ TkpGetString( macKC.uint = eventPtr->xkey.keycode; if (IS_PRINTABLE(macKC.v.keychar)) { - length = TkUniCharToUtf(macKC.v.keychar, utfChars); + length = Tcl_UniCharToUtf(macKC.v.keychar, utfChars); } utfChars[length] = 0; diff --git a/unix/Makefile.in b/unix/Makefile.in index da17df8..9724995 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -335,7 +335,7 @@ CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \ ${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \ ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \ -${NO_DEPRECATED_FLAGS} -DTCL_UTF_MAX=3 @EXTRA_CC_SWITCHES@ +${NO_DEPRECATED_FLAGS} -DTCL_UTF_MAX=4 @EXTRA_CC_SWITCHES@ CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@ diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 87863a2..d7e2cff 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -393,7 +393,7 @@ ControlUtfProc( result = TCL_CONVERT_NOSPACE; break; } - src += TkUtfToUniChar(src, &ch); + src += Tcl_UtfToUniChar(src, &ch); dst[0] = '\\'; if (((size_t)ch < sizeof(mapChars)) && (mapChars[ch] != 0)) { dst[1] = mapChars[ch]; @@ -843,7 +843,7 @@ Tk_MeasureChars( curX = 0; end = source + numBytes; for (p = source; p < end; ) { - next = p + TkUtfToUniChar(p, &ch); + next = p + Tcl_UtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; @@ -890,7 +890,7 @@ Tk_MeasureChars( * individually. */ - next = source + TkUtfToUniChar(source, &ch); + next = source + Tcl_UtfToUniChar(source, &ch); newX = curX = termX = 0; term = source; @@ -925,7 +925,7 @@ Tk_MeasureChars( break; } - next += TkUtfToUniChar(next, &ch); + next += Tcl_UtfToUniChar(next, &ch); if ((ch < 256) && isspace(ch)) { if (sawNonSpace) { term = p; @@ -950,13 +950,13 @@ Tk_MeasureChars( */ curX = newX; - p += TkUtfToUniChar(p, &ch); + p += Tcl_UtfToUniChar(p, &ch); } if ((flags & TK_AT_LEAST_ONE) && (term == source) && (p < end)) { term = p; termX = curX; if (term == source) { - term += TkUtfToUniChar(term, &ch); + term += Tcl_UtfToUniChar(term, &ch); termX = newX; } } else if ((p >= end) || !(flags & TK_WHOLE_WORDS)) { @@ -1102,7 +1102,7 @@ Tk_DrawChars( needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike; for (p = source; p <= end; ) { if (p < end) { - next = p + TkUtfToUniChar(p, &ch); + next = p + Tcl_UtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); } else { next = p + 1; @@ -2079,7 +2079,7 @@ FontMapLoadPage( for (i = row << FONTMAP_SHIFT; i < end; i++) { int hi, lo; - if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src), + if (Tcl_UtfToExternal(NULL, encoding, src, Tcl_UniCharToUtf(i, src), TCL_ENCODING_PROFILE_STRICT, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; @@ -2275,7 +2275,7 @@ CanUseFallback( } nameListOrig = nameList; - srcLen = TkUniCharToUtf(ch, src); + srcLen = Tcl_UniCharToUtf(ch, src); want.fa = fontPtr->font.fa; want.xa = fontPtr->xa; diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index c595fbb..933a690 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -196,7 +196,7 @@ TkpGetString( Tcl_DStringValue(&buf)[len] = '\0'; if (len == 1) { - len = TkUniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], + len = Tcl_UniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], Tcl_DStringValue(dsPtr)); Tcl_DStringSetLength(dsPtr, len); } else { diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index 7f9ad7d..c091755 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -867,7 +867,7 @@ DrawMenuUnderline( label = Tcl_GetString(mePtr->labelPtr); start = Tcl_UtfAtIndex(label, (mePtr->underline < 0) ? mePtr->underline + len : mePtr->underline); - end = start + TkUtfToUniChar(start, &ch); + end = start + Tcl_UtfToUniChar(start, &ch); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 72692fc..d295a89 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -80,7 +80,7 @@ TCL_DECLARE_MUTEX(xftMutex); static int utf8ToUcs4(const char *source, FcChar32 *c, int numBytes) { if (numBytes >= 6) { - return TkUtfToUniChar(source, (int *)c); + return Tcl_UtfToUniChar(source, (int *)c); } return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes); } @@ -744,7 +744,7 @@ Tk_MeasureChars( while (numBytes > 0) { int unichar; - clen = TkUtfToUniChar(source, &unichar); + clen = Tcl_UtfToUniChar(source, &unichar); c = (FcChar32) unichar; if (clen <= 0) { diff --git a/win/Makefile.in b/win/Makefile.in index 8e2a9dc..a101ac9 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -261,7 +261,7 @@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ -I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" \ -${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=3 -DUSE_TCL_STUBS +${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=4 -DUSE_TCL_STUBS CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ diff --git a/win/makefile.vc b/win/makefile.vc index 910a0ce..a5347b1 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -337,7 +337,7 @@ PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)" CONFIG_DEFS =/DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \ /DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \ - /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=3 \ + /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=4 \ !if $(TTK_SQUARE_WIDGET) /DTTK_SQUARE_WIDGET=1 \ !endif diff --git a/win/tkWinFont.c b/win/tkWinFont.c index dc74aea..85a2249 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -846,7 +846,7 @@ Tk_MeasureChars( start = source; end = start + numBytes; for (p = start; p < end; ) { - next = p + TkUtfToUniChar(p, &ch); + next = p + Tcl_UtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; @@ -907,7 +907,7 @@ Tk_MeasureChars( familyPtr = lastSubFontPtr->familyPtr; Tcl_DStringInit(&runString); for (p = start; p < end; ) { - next = p + TkUtfToUniChar(p, &ch); + next = p + Tcl_UtfToUniChar(p, &ch); Tcl_UtfToExternal(NULL, familyPtr->encoding, p, (int) (next - p), TCL_ENCODING_PROFILE_TCL8, NULL, buf, sizeof(buf), NULL, &dstWrote, NULL); @@ -962,7 +962,7 @@ Tk_MeasureChars( p = source; ch = ' '; while (p < end) { - next = p + TkUtfToUniChar(p, &ch2); + next = p + Tcl_UtfToUniChar(p, &ch2); if ((ch != ' ') && (ch2 == ' ')) { lastWordBreak = p; } @@ -1479,7 +1479,7 @@ MultiFontTextOut( end = source + numBytes; for (p = source; p < end; ) { - next = p + TkUtfToUniChar(p, &ch); + next = p + Tcl_UtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); /* @@ -2262,7 +2262,7 @@ FontMapLoadPage( end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { if (Tcl_UtfToExternal(NULL, encoding, src, - TkUniCharToUtf(i, src), TCL_ENCODING_PROFILE_STRICT, NULL, + Tcl_UniCharToUtf(i, src), TCL_ENCODING_PROFILE_STRICT, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 5be9e0e..f2230c9 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -113,7 +113,7 @@ TkpGetString( * Special case for WM_UNICHAR and win2000 multilingual IME input */ - len = TkUniCharToUtf(keyEv->keycode, buf); + len = Tcl_UniCharToUtf(keyEv->keycode, buf); Tcl_DStringAppend(dsPtr, buf, len); } else { /* @@ -125,7 +125,7 @@ TkpGetString( if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { - len = TkUniCharToUtf(keysym & 255, buf); + len = Tcl_UniCharToUtf(keysym & 255, buf); Tcl_DStringAppend(dsPtr, buf, len); } } diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 96b3e1c..91d80e2 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -2111,7 +2111,7 @@ DrawMenuUnderline( label = Tcl_GetString(mePtr->labelPtr); start = Tcl_UtfAtIndex(label, mePtr->underline); - end = start + TkUtfToUniChar(start, &ch); + end = start + Tcl_UtfToUniChar(start, &ch); Tk_UnderlineChars(menuPtr->display, d, gc, tkfont, label, x + mePtr->indicatorSpace, y + (height + fmPtr->ascent - fmPtr->descent) / 2, -- cgit v0.12 From 8d21ef8bc5ba14e1addb1c5a8c117be714bc3612 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 28 Nov 2023 13:42:44 +0000 Subject: Remove internal TkMacOSXDrawable stub entry: no longer necessary --- generic/tkInt.decls | 8 ++++---- generic/tkIntPlatDecls.h | 12 ++++-------- generic/tkStubInit.c | 4 ---- 3 files changed, 8 insertions(+), 16 deletions(-) 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/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 */ -- cgit v0.12 From bc234bbd0e9b160f3a6a1ae4e0d22198c55f485e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 28 Nov 2023 13:48:07 +0000 Subject: Remove dead code related to _TK_ALLOW_DECREASING_TABS --- generic/tkText.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 83d2d49..18701c1 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++; -- cgit v0.12 From 5df223b1771334dc89bf52818f093a795506dfe2 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 29 Nov 2023 19:16:34 +0000 Subject: Include pb_image.svg in the distribution. --- unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index da17df8..9bbe37c 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 -- cgit v0.12 From 4e8c59e74d4386204c4d53b5e8dfb2cbe9cd770c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 30 Nov 2023 16:17:52 +0000 Subject: Entry widget on MacOS works fine now --- generic/tkIcu.c | 10 +++++----- macosx/tkMacOSXFont.c | 39 +++++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/generic/tkIcu.c b/generic/tkIcu.c index 3ccb7f6..1e24698 100644 --- a/generic/tkIcu.c +++ b/generic/tkIcu.c @@ -114,9 +114,9 @@ startEndOfCmd( } if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ - Tcl_Size newIdx = 1; - for (Tcl_Size i = 1; i < idx; i++) { - newIdx += 1 + (((ustr[newIdx-1]&0xFFC0) == 0xD800) && ((ustr[newIdx]&0xFFC0) == 0xDC00)); + Tcl_Size newIdx = 0; + for (Tcl_Size i = 0; i < index; i++) { + newIdx += 1 + (((newIdx < (Tcl_Size)len-1) && (ustr[newIdx]&0xFC00) == 0xD800) && ((ustr[newIdx+1]&0xFC00) == 0xDC00)); } idx = newIdx; } @@ -130,7 +130,7 @@ startEndOfCmd( } } else if (idx > 0) { if (!(flags & FLAG_WORD)) { - idx += 1 + (((ustr[idx]&0xFFC0) == 0xD800) && ((ustr[idx+1]&0xFFC0) == 0xDC00)); + idx += 1 + (((ustr[idx]&0xFC00) == 0xD800) && ((ustr[idx+1]&0xFC00) == 0xDC00)); } idx = icu_preceding(it, idx); if (idx == 0 && (flags & FLAG_WORD)) { @@ -158,7 +158,7 @@ startEndOfCmd( /* 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++; + if (((ustr[i-1]&0xFC00) != 0xD800) || ((ustr[i]&0xFC00) != 0xDC00)) newIdx++; } idx = newIdx; } diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 8a2e0a8..36bae03 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -27,6 +27,21 @@ */ /* + * TclNumUtfChars() is the same as Tcl_NumUtfChars(), but counting + * in UTF-16 in stead of UTF-32. For Tcl 8.7 it's a little bit + * tricky to get this function, because we are compiling with TCL_UTF_MAX=4. + */ +#if TCL_MAJOR_VERSION < 9 +# undef TclNumUtfChars +# ifdef USE_TCL_STUBS +# define TclNumUtfChars \ + (tclStubsPtr->tcl_NumUtfChars) /* 312 */ +# else +# define TclNumUtfChars Tcl_NumUtfChars +# endif +#endif + +/* * The following structure represents our Macintosh-specific implementation * of a font object. */ @@ -471,9 +486,9 @@ startOfClusterObjCmd( } 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)); + Tcl_Size newIdx = 0; + for (Tcl_Size i = 0; i < index; i++) { + newIdx += 1 + (((newIdx < (Tcl_Size)[S length]-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00)); } index = newIdx; } @@ -488,7 +503,7 @@ startOfClusterObjCmd( /* 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++; + if ((([S characterAtIndex:i-1]&0xFC00) != 0xD800) || (([S characterAtIndex:i]&0xFC00) != 0xDC00)) newIdx++; } index = newIdx; } @@ -527,9 +542,9 @@ endOfClusterObjCmd( } 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)); + Tcl_Size newIdx = 0; + for (Tcl_Size i = 0; i < index; i++) { + newIdx += 1 + (((newIdx < (Tcl_Size)[S length]-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00)); } index = newIdx; } @@ -544,7 +559,7 @@ endOfClusterObjCmd( /* 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++; + if ((([S characterAtIndex:i-1]&0xFC00) != 0xD800) || (([S characterAtIndex:i]&0xFC00) != 0xDC00)) newIdx++; } index = newIdx; } @@ -1064,8 +1079,8 @@ TkpMeasureCharsInContext( attributes:fontPtr->nsAttributes]; typesetter = CTTypesetterCreateWithAttributedString( (CFAttributedStringRef)attributedString); - start = Tcl_NumUtfChars(source, rangeStart); - len = Tcl_NumUtfChars(source + rangeStart, rangeLength); + start = TclNumUtfChars(source, rangeStart); + len = TclNumUtfChars(source + rangeStart, rangeLength); if (start > 0) { range.length = start; line = CTTypesetterCreateLine(typesetter, range); @@ -1365,8 +1380,8 @@ TkpDrawAngledCharsInContext( -textX, -textY); } CGContextConcatCTM(context, t); - start = Tcl_NumUtfChars(source, rangeStart); - length = Tcl_NumUtfChars(source, rangeStart + rangeLength) - start; + start = TclNumUtfChars(source, rangeStart); + length = TclNumUtfChars(source, rangeStart + rangeLength) - start; line = CTTypesetterCreateLine(typesetter, CFRangeMake(start, length)); if (start > 0) { -- cgit v0.12 From 060aa0b60669f389968deaf5b94f4d4c879bcb47 Mon Sep 17 00:00:00 2001 From: csaba Date: Thu, 30 Nov 2023 20:14:47 +0000 Subject: Minimize the number of artifacts caused by intermixed and events triggered by two-finger gestures. --- library/scrlbar.tcl | 28 ++++++++++++++++++++++++++-- library/ttk/combobox.tcl | 5 ++++- library/ttk/notebook.tcl | 34 +++++++++++++++++++++++++++++++++- library/ttk/scrollbar.tcl | 12 +++++++++--- library/ttk/spinbox.tcl | 5 ++++- 5 files changed, 76 insertions(+), 8 deletions(-) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index c18d4a8..35ff251 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -129,10 +129,19 @@ bind Scrollbar <> { } } +bind Scrollbar {+ + set tk::Priv(xEvents) 0; set tk::Priv(yEvents) 0 +} bind Scrollbar { - tk::ScrollByUnits %W hv %D -40.0 + tk::ScrollByUnits %W vh %D -40.0 } bind Scrollbar { + tk::ScrollByUnits %W vh %D -12.0 +} +bind Scrollbar { + tk::ScrollByUnits %W hv %D -40.0 +} +bind Scrollbar { tk::ScrollByUnits %W hv %D -12.0 } @@ -303,7 +312,7 @@ proc ::tk::ScrollEndDrag {w x y} { # Arguments: # w - The scrollbar widget. # orient - Which kinds of scrollbars this applies to: "h" for -# horizontal, "v" for vertical, "hv" for both. +# horizontal, "v" for vertical, "hv" or "vh" for both. # amount - How many units to scroll: typically 1 or -1. proc ::tk::ScrollByUnits {w orient amount {factor 1.0}} { @@ -312,6 +321,21 @@ proc ::tk::ScrollByUnits {w orient amount {factor 1.0}} { [string index [$w cget -orient] 0] $orient] < 0)} { return } + + if {[string length $orient] == 2 && $factor != 1.0} { + # Count both the and + # events, and ignore the non-dominant ones + + variable ::tk::Priv + set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}] + incr Priv(${axis}Events) + if {($Priv(xEvents) + $Priv(yEvents) > 10) && + ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) || + $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} { + return + } + } + set info [$w get] if {[llength $info] == 2} { uplevel #0 $cmd scroll [expr {$amount/$factor}] units diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 653102e..9756376 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -52,7 +52,10 @@ bind TCombobox { ttk::combobox::Press "3" %W %x %y } bind TCombobox { ttk::combobox::Drag %W %x } bind TCombobox { ttk::combobox::Motion %W %x %y } -ttk::bindMouseWheel TCombobox [list ttk::combobox::Scroll %W] +ttk::bindMouseWheel TCombobox { ttk::combobox::Scroll %W } +bind TCombobox { + # Ignore the event +} bind TCombobox <> { ttk::combobox::TraverseIn %W } diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl index 7097c45..d8ed23b 100644 --- a/library/ttk/notebook.tcl +++ b/library/ttk/notebook.tcl @@ -16,7 +16,21 @@ bind TNotebook { ttk::notebook::CycleTab %W -1; break } } bind TNotebook { ttk::notebook::Cleanup %W } -ttk::bindMouseWheel TNotebook [list ttk::notebook::CycleTab %W] +bind TNotebook { + set tk::Priv(xEvents) 0; set tk::Priv(yEvents) 0 +} +bind TNotebook { + ttk::notebook::CondCycleTab %W y %D -120.0 +} +bind TNotebook { + ttk::notebook::CondCycleTab %W y %D -12.0 +} +bind TNotebook { + ttk::notebook::CondCycleTab %W x %D -120.0 +} +bind TNotebook { + ttk::notebook::CondCycleTab %W x %D -12.0 +} # ActivateTab $nb $tab -- # Select the specified tab and set focus. @@ -75,6 +89,24 @@ proc ttk::notebook::CycleTab {w dir {factor 1.0}} { } } +# CondCycleTab -- +# Conditionally invoke the ttk::notebook::CycleTab proc. +# +proc ttk::notebook::CondCycleTab {w axis dir {factor 1.0}} { + # Count both the and + # events, and ignore the non-dominant ones + + variable ::tk::Priv + incr Priv(${axis}Events) + if {($Priv(xEvents) + $Priv(yEvents) > 10) && + ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) || + $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} { + return + } + + CycleTab $w $dir $factor +} + # MnemonicTab $nb $key -- # Scan all tabs in the specified notebook for one with the # specified mnemonic. If found, returns path name of tab; diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl index 6ad6e15..4f73f1f 100644 --- a/library/ttk/scrollbar.tcl +++ b/library/ttk/scrollbar.tcl @@ -17,10 +17,16 @@ bind TScrollbar { ttk::scrollbar::Jump %W %x %y } bind TScrollbar { ttk::scrollbar::Drag %W %x %y } bind TScrollbar { ttk::scrollbar::Release %W %x %y } -# Redirect scrollwheel bindings to the scrollbar widget +# Copy the mouse wheel event bindings from Scrollbar to TScrollbar # -bind TScrollbar [bind Scrollbar ] -bind TScrollbar [bind Scrollbar ] +bind TScrollbar { + set tk::Priv(xEvents) 0; set tk::Priv(yEvents) 0 +} +foreach event { + } { + bind TScrollbar $event [bind Scrollbar $event] +} +unset event proc ttk::scrollbar::Scroll {w n units} { set cmd [$w cget -command] diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl index 9f002cd..5aca894 100644 --- a/library/ttk/spinbox.tcl +++ b/library/ttk/spinbox.tcl @@ -23,7 +23,10 @@ bind TSpinbox { event generate %W <> } bind TSpinbox <> { ttk::spinbox::Spin %W +1 } bind TSpinbox <> { ttk::spinbox::Spin %W -1 } -ttk::bindMouseWheel TSpinbox [list ttk::spinbox::Spin %W] +ttk::bindMouseWheel TSpinbox { ttk::spinbox::Spin %W } +bind TSpinbox { + # Ignore the event +} ## Motion -- # Sets cursor. -- cgit v0.12 From ad26cd45f04d3631ec265d5c248da3c1efd67718 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 30 Nov 2023 21:52:43 +0000 Subject: Oops --- generic/tkIcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkIcu.c b/generic/tkIcu.c index 1e24698..cce440b 100644 --- a/generic/tkIcu.c +++ b/generic/tkIcu.c @@ -115,7 +115,7 @@ startEndOfCmd( if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ Tcl_Size newIdx = 0; - for (Tcl_Size i = 0; i < index; i++) { + for (Tcl_Size i = 0; i < idx; i++) { newIdx += 1 + (((newIdx < (Tcl_Size)len-1) && (ustr[newIdx]&0xFC00) == 0xD800) && ((ustr[newIdx+1]&0xFC00) == 0xDC00)); } idx = newIdx; -- cgit v0.12 From 23fb2cd45ef74ffd6e1d854f29618ea8e7471ffb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 30 Nov 2023 22:52:32 +0000 Subject: Fix now appears to work for MaxOS too --- macosx/tkMacOSXFont.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 36bae03..e48263f 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -29,15 +29,20 @@ /* * TclNumUtfChars() is the same as Tcl_NumUtfChars(), but counting * in UTF-16 in stead of UTF-32. For Tcl 8.7 it's a little bit - * tricky to get this function, because we are compiling with TCL_UTF_MAX=4. + * tricky to get this function, because we are compiling with + * TCL_UTF_MAX=4. Same for TclUtfAtIndex() */ #if TCL_MAJOR_VERSION < 9 # undef TclNumUtfChars +# undef TclUtfAtIndex # ifdef USE_TCL_STUBS # define TclNumUtfChars \ (tclStubsPtr->tcl_NumUtfChars) /* 312 */ +# define TclUtfAtIndex \ + (tclStubsPtr->tcl_UtfAtIndex) /* 325 */ # else # define TclNumUtfChars Tcl_NumUtfChars +# define TclUtfAtIndex Tcl_UtfAtIndex # endif #endif @@ -179,7 +184,7 @@ static int CreateNamedSystemFont(Tcl_Interp *interp, Tcl_DStringSetLength(&_ds, 3 * [_string length]); p = Tcl_DStringValue(&_ds); for (index = 0; index < [_string length]; index++) { - p += Tcl_UniCharToUtf([_string characterAtIndex: index], p); + p += Tcl_UniCharToUtf([_string characterAtIndex: index]|TCL_COMBINE, p); } Tcl_DStringSetLength(&_ds, (Tcl_Size)(p - Tcl_DStringValue(&_ds))); } @@ -1181,7 +1186,7 @@ TkpMeasureCharsInContext( [attributedString release]; [string release]; length = ceil(width - offset); - fit = (Tcl_UtfAtIndex(source, index) - source) - rangeStart; + fit = (TclUtfAtIndex(source, index) - source) - rangeStart; done: #ifdef TK_MAC_DEBUG_FONTS TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d " -- cgit v0.12 From 8de2fd37d9a31b09faef7451a1dadeee69b1bf09 Mon Sep 17 00:00:00 2001 From: csaba Date: Fri, 1 Dec 2023 11:14:26 +0000 Subject: Adapted scrollbar.test to the improvements in scrlbar.tcl; reverted the changes in scrlbar.tcl and ttk/notebook.tcl made in [c0b55af4]. --- library/scrlbar.tcl | 14 ++++++-------- library/ttk/notebook.tcl | 9 +++------ tests/scrollbar.test | 3 +++ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index fa3af8e..35ff251 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -327,14 +327,12 @@ proc ::tk::ScrollByUnits {w orient amount {factor 1.0}} { # events, and ignore the non-dominant ones variable ::tk::Priv - if {[info exists Priv(xEvents)] && [info exists Priv(yEvents)]} { - set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}] - incr Priv(${axis}Events) - if {($Priv(xEvents) + $Priv(yEvents) > 10) && - ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) || - $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} { - return - } + set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}] + incr Priv(${axis}Events) + if {($Priv(xEvents) + $Priv(yEvents) > 10) && + ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) || + $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} { + return } } diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl index 3d277a4..d8ed23b 100644 --- a/library/ttk/notebook.tcl +++ b/library/ttk/notebook.tcl @@ -98,13 +98,10 @@ proc ttk::notebook::CondCycleTab {w axis dir {factor 1.0}} { variable ::tk::Priv incr Priv(${axis}Events) - if {[info exists Priv(xEvents)] && [info exists Priv(yEvents)]} { - - if {($Priv(xEvents) + $Priv(yEvents) > 10) && - ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) || - $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} { + if {($Priv(xEvents) + $Priv(yEvents) > 10) && + ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) || + $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} { return - } } CycleTab $w $dir $factor diff --git a/tests/scrollbar.test b/tests/scrollbar.test index c84ce58..48eb734 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -677,6 +677,7 @@ test scrollbar-10.1 { event on scrollbar} -setup { pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left update focus -force .s + event generate .s event generate .s -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 @@ -692,6 +693,7 @@ test scrollbar-10.2 { event on scrollbar} -setup { pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s + event generate .s event generate .s -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 @@ -706,6 +708,7 @@ test scrollbar-10.3 { event on horizontal scrollbar} -setup { pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s + event generate .s event generate .s -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 -- cgit v0.12 From dadf50ab5e5447b489146bb5317c82f60356661e Mon Sep 17 00:00:00 2001 From: csaba Date: Sat, 2 Dec 2023 09:26:31 +0000 Subject: Fixed the test failure in ttk/scrollbar test. --- tests/ttk/scrollbar.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ttk/scrollbar.test b/tests/ttk/scrollbar.test index c65bb4a..9b6abee 100644 --- a/tests/ttk/scrollbar.test +++ b/tests/ttk/scrollbar.test @@ -79,6 +79,7 @@ test scrollbar-10.1.1 { event on scrollbar} -setup { pack [ttk::scrollbar .s -command {.t yview}] -fill y -expand 1 -side left update focus -force .s + event generate .s event generate .s -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 @@ -94,6 +95,7 @@ test scrollbar-10.2.1 { event on horizontal scrollbar} -setup pack [ttk::scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s + event generate .s event generate .s -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 @@ -108,6 +110,7 @@ test scrollbar-10.2.2 { event on horizontal scrollbar} -setup { pack [ttk::scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s + event generate .s event generate .s -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 -- cgit v0.12 From 46062ffc84ab155c537a9cc9b2c57b64244b0df6 Mon Sep 17 00:00:00 2001 From: marc_culler Date: Sun, 3 Dec 2023 16:43:21 +0000 Subject: Clean up handling of Apple FourCC Creator Codes - many thanks to Christopher Chavez for patches. --- macosx/tkMacOSXFileTypes.c | 54 ++++++++--------- macosx/tkMacOSXFileTypes.h | 144 --------------------------------------------- 2 files changed, 25 insertions(+), 173 deletions(-) delete mode 100644 macosx/tkMacOSXFileTypes.h diff --git a/macosx/tkMacOSXFileTypes.c b/macosx/tkMacOSXFileTypes.c index 9a91c25..5df7ddd 100644 --- a/macosx/tkMacOSXFileTypes.c +++ b/macosx/tkMacOSXFileTypes.c @@ -24,41 +24,33 @@ without generating deprecation warnings. */ #include "tkMacOSXPrivate.h" -#include "tkMacOSXFileTypes.h" #define CHARS_TO_OSTYPE(string) (OSType) string[0] << 24 | \ (OSType) string[1] << 16 | \ (OSType) string[2] << 8 | \ (OSType) string[3] -static BOOL initialized = false; -static Tcl_HashTable ostype2identifier; -static void initOSTypeTable(void) { - int newPtr; - Tcl_HashEntry *hPtr; - const IdentifierForOSType *entry; - Tcl_InitHashTable(&ostype2identifier, TCL_ONE_WORD_KEYS); - for (entry = OSTypeDB; entry->ostype != NULL; entry++) { - const void *key = INT2PTR(CHARS_TO_OSTYPE(entry->ostype)); - hPtr = Tcl_CreateHashEntry(&ostype2identifier, key, &newPtr); - if (newPtr) { - Tcl_SetHashValue(hPtr, entry->identifier); - } - } - initialized = true; -} - MODULE_SCOPE NSString *TkMacOSXOSTypeToUTI(OSType ostype) { - if (!initialized) { - initOSTypeTable(); + char string[5]; + string[4] = '\0'; + string[3] = ostype; + string[2] = ostype >> 8; + string[1] = ostype >> 16; + string[0] = ostype >> 24; + NSString *tag = [NSString stringWithCString:string encoding:NSMacOSRomanStringEncoding]; + if (tag == nil) { + return nil; } - Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&ostype2identifier, INT2PTR(ostype)); - if (hPtr) { - char *UTI = (char *)Tcl_GetHashValue(hPtr); - return [[NSString alloc] initWithCString:UTI - encoding:NSASCIIStringEncoding]; + NSString *result = nil; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000 + if (@available(macOS 11.0, *)) { + return [UTType typeWithTag:tag tagClass:@"com.apple.ostype" conformingToType:nil].identifier; } - return nil; +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000 + result = (NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassOSType, (CFStringRef)tag, NULL); +#endif + return result; } /* @@ -67,9 +59,6 @@ MODULE_SCOPE NSString *TkMacOSXOSTypeToUTI(OSType ostype) { * or a Uniform Type Idenfier. This function can serve as a replacement. */ MODULE_SCOPE NSImage *TkMacOSXIconForFileType(NSString *filetype) { - if (!initialized) { - initOSTypeTable(); - } #if MAC_OS_X_VERSION_MAX_ALLOWED < 110000 // We don't have UTType but iconForFileType is not deprecated, so use it. return [[NSWorkspace sharedWorkspace] iconForFileType:filetype]; @@ -77,6 +66,13 @@ MODULE_SCOPE NSImage *TkMacOSXIconForFileType(NSString *filetype) { // We might have UTType but iconForFileType might be deprecated. if (@available(macOS 11.0, *)) { /* Yes, we do have UTType */ + if (filetype == nil) { + /* + * Bug 9be830f61b: match the behavior of + * [NSWorkspace.sharedWorkspace iconForFileType:nil] + */ + filetype = @"public.data"; + } UTType *uttype = [UTType typeWithIdentifier: filetype]; if (uttype == nil || !uttype.isDeclared) { uttype = [UTType typeWithFilenameExtension: filetype]; diff --git a/macosx/tkMacOSXFileTypes.h b/macosx/tkMacOSXFileTypes.h deleted file mode 100644 index b5de54f..0000000 --- a/macosx/tkMacOSXFileTypes.h +++ /dev/null @@ -1,144 +0,0 @@ -/* -Apple never published a database of OSType codes for File Types. However, -a database of known OSType codes representing Creators and File Types used on -Apple systems prior to 2003 is available at: - - http://www.lacikam.co.il/tcdb/download/TCDBdata.zip - -Among the 12034 distinct OSType codes for File Types that are listed in the TCDB -database, there are 121 for which the UTTypeCreatePreferredIdentifierForTag -function (deprecated in macOS 12.0) was able to generate a Uniform Type -Identifier on macOS 12.5.1. The mapping from those OSTypes to Uniform Type -identifiers is given by the following array, in which OSTypes are represented as -strings of length 4. -*/ - -typedef struct { - const char *ostype; - const char *identifier; -} IdentifierForOSType; - -static const IdentifierForOSType OSTypeDB[] = { - {".SGI", "com.sgi.sgi-image"}, - {".WAV", "com.microsoft.waveform-audio"}, - {"8BPS", "com.adobe.photoshop-image"}, - {"ABPR", "com.apple.addressbook.person"}, - {"AIFC", "public.aifc-audio"}, - {"AIFF", "public.aiff-audio"}, - {"APPC", "com.apple.deprecated-application-file"}, - {"APPD", "com.apple.deprecated-application-file"}, - {"APPL", "com.apple.application-bundle"}, - {"ASF_", "com.microsoft.advanced-systems-format"}, - {"ASX_", "com.microsoft.advanced-stream-redirector"}, - {"BMP ", "com.microsoft.bmp"}, - {"BMPf", "com.microsoft.bmp"}, - {"BNDL", "com.apple.generic-bundle"}, - {"DDim", "com.apple.disk-image-raw"}, - {"DICM", "org.nema.dicom"}, - {"DOTM", "org.openxmlformats.wordprocessingml.template.macro-enabled"}, - {"EM3F", "com.apple.logic-song"}, - {"EPSF", "com.adobe.encapsulated-postscript"}, - {"FFIL", "com.apple.font-suitcase"}, - {"FLI ", "public.flc-animation"}, - {"FNDR", "com.apple.legacy.finder-icon"}, - {"GIFf", "com.compuserve.gif"}, - {"HTML", "public.html"}, - {"JPEG", "public.jpeg"}, - {"LWFN", "com.adobe.postscript-lwfn-font"}, - {"MP3 ", "public.mp3"}, - {"MP3!", "public.mp3"}, - {"MP3U", "com.apple.tv.m3u-playlist"}, - {"MPEG", "public.mpeg"}, - {"MPG ", "public.mpeg"}, - {"MPG2", "com.apple.music.mp2"}, - {"MPG3", "public.mp3"}, - {"Midi", "public.midi-audio"}, - {"MooV", "com.apple.quicktime-movie"}, - {"Mp3 ", "public.mp3"}, - {"PAT ", "org.gimp.pat"}, - {"PDF ", "com.adobe.pdf"}, - {"PICT", "com.apple.pict"}, - {"PNGf", "public.png"}, - {"PNRA", "com.real.realaudio"}, - {"PNRM", "com.real.realmedia"}, - {"PNTG", "com.apple.macpaint-image"}, - {"PPOT", "com.microsoft.powerpoint.pot"}, - {"PPSS", "com.microsoft.powerpoint.pps"}, - {"RTF ", "public.rtf"}, - {"SDP ", "public.sdp"}, - {"SIT5", "com.stuffit.archive.sit"}, - {"SLD8", "com.microsoft.powerpoint.ppt"}, - {"Sd2f", "com.digidesign.sd2-audio"}, - {"TEXT", "com.apple.traditional-mac-plain-text"}, - {"TIFF", "public.tiff"}, - {"TPIC", "com.truevision.tga-image"}, - {"ULAW", "public.ulaw-audio"}, - {"VfW ", "public.avi"}, - {"W8BN", "com.microsoft.word.doc"}, - {"W8TN", "com.microsoft.word.dot"}, - {"WAVE", "com.microsoft.waveform-audio"}, - {"XLA5", "com.microsoft.excel.xla"}, - {"XLS8", "com.microsoft.excel.xls"}, - {"XLW8", "com.microsoft.excel.xlw"}, - {"alis", "com.apple.alias-record"}, - {"appe", "com.apple.deprecated-application-file"}, - {"cdev", "com.apple.deprecated-application-file"}, - {"clpp", "com.apple.finder.pictclipping"}, - {"clps", "com.apple.finder.sound-clipping"}, - {"clpt", "com.apple.finder.textclipping"}, - {"clpu", "com.apple.finder.clipping"}, - {"ctrl", "com.apple.legacy.finder-icon"}, - {"dfil", "com.apple.deprecated-application-file"}, - {"dict", "com.apple.document-type.dictionary"}, - {"disk", "public.volume"}, - {"docs", "com.apple.documents-folder"}, - {"dvc!", "public.dv-movie"}, - {"ffil", "com.apple.font-suitcase"}, - {"flpy", "com.apple.storage-removable"}, - {"fold", "public.folder"}, - {"font", "com.apple.legacy.finder-icon"}, - {"grup", "com.apple.user-group"}, - {"hdrv", "com.apple.disk-image-raw"}, - {"hdsk", "com.apple.storage-internal"}, - {"help", "com.apple.help-document"}, - {"hkdb", "com.apple.itunes.db"}, - {"hvpl", "com.apple.music.visual"}, - {"ilaf", "com.apple.afp-internet-location"}, - {"ilfi", "com.apple.file-internet-location"}, - {"ilft", "com.apple.ftp-internet-location"}, - {"ilge", "com.apple.generic-internet-location"}, - {"ilht", "com.apple.web-internet-location"}, - {"ilma", "com.apple.mail-internet-location"}, - {"ilnw", "com.apple.news-internet-location"}, - {"macD", "com.apple.legacy.finder-icon"}, - {"mp3!", "public.mp3"}, - {"mpg3", "public.mp3"}, - {"note", "com.apple.alert-note"}, - {"osas", "com.apple.applescript.script"}, - {"plug", "com.apple.plugin"}, - {"pref", "com.apple.legacy.finder-icon"}, - {"prfb", "com.apple.icon-overlay.private-folder-badge"}, - {"prof", "com.apple.colorsync-profile"}, - {"qtif", "com.apple.quicktime-image"}, - {"sLS8", "com.microsoft.excel.xlt"}, - {"sM3F", "com.apple.logic-song"}, - {"sbBF", "com.apple.finder.burn-folder"}, - {"scrp", "com.apple.legacy.finder-icon"}, - {"sdoc", "com.apple.generic-stationery"}, - {"sfnt", "com.apple.font-suitcase"}, - {"shlb", "com.apple.legacy.finder-icon"}, - {"srvr", "com.apple.file-server"}, - {"svg ", "public.svg-image"}, - {"svgz", "public.svg-image"}, - {"tDoc", "com.apple.documents-folder"}, - {"tfil", "com.apple.font-suitcase"}, - {"trsh", "com.apple.trash-empty"}, - {"ttcf", "public.truetype-collection-font"}, - {"ttro", "com.apple.traditional-mac-plain-text"}, - {"txtn", "com.apple.txn.text-multimedia-data"}, - {"url ", "public.url"}, - {"user", "com.apple.user"}, - {"utxt", "public.utf16-plain-text"}, - {"vCrd", "public.vcard"}, - {NULL, NULL} -}; -- cgit v0.12 From 9656aa21d8f30b553c2428689b000923012ca2fb Mon Sep 17 00:00:00 2001 From: marc_culler Date: Thu, 7 Dec 2023 03:02:36 +0000 Subject: More adjustments to tests that failed on macOS Sonoma. --- tests/unixWm.test | 13 ++++++------- tests/wm.test | 24 +++++++++++++++--------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/tests/unixWm.test b/tests/unixWm.test index bd1a579..649eb4f 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -21,7 +21,8 @@ testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowi if {[tk windowingsystem] eq "aqua"} { proc restackDelay {} { - after 100; + after 200; + update idletasks } } else { proc restackDelay {} {} @@ -2080,17 +2081,15 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {uni foreach w {.t .t2 .t3} { destroy $w toplevel $w -width 200 -height 200 -bg green - wm geometry $w +0+0 - update + tkwait visibility $w + wm geometry $w +100+100 } raise .t .t2 restackDelay - update - set result [list [winfo containing 100 100]] + set result [list [winfo containing 200 200]] lower .t3 restackDelay - sleep 10 - lappend result [winfo containing 100 100] + lappend result [winfo containing 200 200] } {.t3 .t} test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix { destroy .t diff --git a/tests/wm.test b/tests/wm.test index 9fb3c73..81d423f 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -101,9 +101,9 @@ testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowi # proc raiseDelay {} { - after 200; - update + after 250; update idletasks + update } # How to carry out a small delay while processing events @@ -1502,8 +1502,10 @@ test wm-stackorder-2.2 {stacking order} -body { destroy .t } -result {.t .} test wm-stackorder-2.3 {stacking order} -body { - toplevel .t ; update - toplevel .t2 ; update + toplevel .t + tkwait visibility .t + toplevel .t2 + tkwait visibility .t2 raise . raiseDelay raise .t2 @@ -1600,9 +1602,12 @@ test wm-stackorder-3.5 {unmapped toplevel} -body { destroy .t1 } -result {.t1.t2} test wm-stackorder-3.6 {unmapped toplevel} -body { - toplevel .t1 ; update - toplevel .t1.t2 ; update - toplevel .t1.t2.t3 ; update + toplevel .t1 + tkwait visibility .t1 + toplevel .t1.t2 + tkwait visibility .t1.t2 + toplevel .t1.t2.t3 + tkwait visibility .t1.t2.t3 wm withdraw .t1.t2 raiseDelay wm stackorder .t1 @@ -1640,10 +1645,11 @@ test wm-stackorder-4.2 {wm stackorder isabove|isbelow} -body { destroy .t } -result 1 test wm-stackorder-4.3 {wm stackorder isabove|isbelow} -body { - toplevel .t ; update + toplevel .t + tkwait visibility .t raise . raiseDelay - wm stackorder .t isa . + wm stackorder .t isabove . } -cleanup { destroy .t } -result 0 -- cgit v0.12 From 83ead5ba0ab1047c737c5ec6fb642b1637069e0c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Dec 2023 12:01:00 +0000 Subject: Sync unix/tcl.m4 with Tcl 9.0 --- unix/configure | 112 ++++++++++++++++++++++++++++++++++++----------------- unix/tcl.m4 | 15 +++---- unix/tkConfig.h.in | 18 +++++++-- 3 files changed, 98 insertions(+), 47 deletions(-) diff --git a/unix/configure b/unix/configure index f5b0706..01c6310 100755 --- a/unix/configure +++ b/unix/configure @@ -6248,6 +6248,33 @@ printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi + # Check for vfork, posix_spawnp() and friends unconditionally + ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" +if test "x$ac_cv_func_vfork" = xyes +then : + printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" +if test "x$ac_cv_func_posix_spawnp" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_spawn_file_actions_adddup2" "ac_cv_func_posix_spawn_file_actions_adddup2" +if test "x$ac_cv_func_posix_spawn_file_actions_adddup2" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_spawnattr_setflags" "ac_cv_func_posix_spawnattr_setflags" +if test "x$ac_cv_func_posix_spawnattr_setflags" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h + +fi + + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -6449,6 +6476,56 @@ printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h tcl_flags="$tcl_flags _FILE_OFFSET_BITS" fi + + if test ${tcl_cv_flag__largefile64_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tcl_cv_flag__largefile64_source=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main (void) +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tcl_cv_flag__largefile64_source=yes +else $as_nop + tcl_cv_flag__largefile64_source=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + if test "x${tcl_flags}" = "x" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } @@ -6638,41 +6715,6 @@ printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 -printf %s "checking for struct stat64... " >&6; } -if test ${tcl_cv_struct_stat64+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -struct stat64 p; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - tcl_cv_struct_stat64=yes -else $as_nop - tcl_cv_struct_stat64=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 -printf "%s\n" "$tcl_cv_struct_stat64" >&6; } - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - -printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h - - fi - ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" if test "x$ac_cv_func_open64" = xyes then : diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 9e1040c..4a9fe40 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1874,6 +1874,9 @@ dnl # preprocessing tests use only CPPFLAGS. AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have ?])],) + # Check for vfork, posix_spawnp() and friends unconditionally + AC_CHECK_FUNCS(vfork posix_spawnp posix_spawn_file_actions_adddup2 posix_spawnattr_setflags) + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -2292,6 +2295,7 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [ # Might define the following vars: # _ISOC99_SOURCE # _FILE_OFFSET_BITS +# _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- @@ -2315,6 +2319,8 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[ [char *p = (char *)strtoll; char *q = (char *)strtoull;]) SC_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include ], [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) + SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else @@ -2335,7 +2341,6 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[ # Might define the following vars: # TCL_WIDE_INT_IS_LONG # HAVE_STRUCT_DIRENT64, HAVE_DIR64 -# HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # _TIME_BITS # @@ -2391,14 +2396,6 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in ?]) fi - AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct stat64 p; -]])], - [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])]) - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) - fi - AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in index 2f6eca6..ffc0e06 100644 --- a/unix/tkConfig.h.in +++ b/unix/tkConfig.h.in @@ -34,6 +34,15 @@ /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 +/* Define to 1 if you have the `posix_spawnattr_setflags' function. */ +#undef HAVE_POSIX_SPAWNATTR_SETFLAGS + +/* Define to 1 if you have the `posix_spawnp' function. */ +#undef HAVE_POSIX_SPAWNP + +/* Define to 1 if you have the `posix_spawn_file_actions_adddup2' function. */ +#undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 + /* Does struct password have a pw_gecos field? */ #undef HAVE_PW_GECOS @@ -58,9 +67,6 @@ /* Is 'struct dirent64' in ? */ #undef HAVE_STRUCT_DIRENT64 -/* Is 'struct stat64' in ? */ -#undef HAVE_STRUCT_STAT64 - /* Should we include ? */ #undef HAVE_SYS_SELECT_H @@ -82,6 +88,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + /* Is weak import available? */ #undef HAVE_WEAK_IMPORT @@ -189,6 +198,9 @@ /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE +/* Add the _LARGEFILE64_SOURCE flag when building */ +#undef _LARGEFILE64_SOURCE + /* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ #undef _OE_SOCKETS -- cgit v0.12 From a6d700b7906372e5f58e98dfd59c5c3bb86a2a1d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 11 Dec 2023 09:24:03 +0000 Subject: backout [b5ee5fc8]. It's causing test-failures on X11 --- tests/unixWm.test | 13 +++++++------ tests/wm.test | 24 +++++++++--------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/tests/unixWm.test b/tests/unixWm.test index 649eb4f..bd1a579 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -21,8 +21,7 @@ testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowi if {[tk windowingsystem] eq "aqua"} { proc restackDelay {} { - after 200; - update idletasks + after 100; } } else { proc restackDelay {} {} @@ -2081,15 +2080,17 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {uni foreach w {.t .t2 .t3} { destroy $w toplevel $w -width 200 -height 200 -bg green - tkwait visibility $w - wm geometry $w +100+100 + wm geometry $w +0+0 + update } raise .t .t2 restackDelay - set result [list [winfo containing 200 200]] + update + set result [list [winfo containing 100 100]] lower .t3 restackDelay - lappend result [winfo containing 200 200] + sleep 10 + lappend result [winfo containing 100 100] } {.t3 .t} test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix { destroy .t diff --git a/tests/wm.test b/tests/wm.test index 81d423f..9fb3c73 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -101,9 +101,9 @@ testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowi # proc raiseDelay {} { - after 250; - update idletasks + after 200; update + update idletasks } # How to carry out a small delay while processing events @@ -1502,10 +1502,8 @@ test wm-stackorder-2.2 {stacking order} -body { destroy .t } -result {.t .} test wm-stackorder-2.3 {stacking order} -body { - toplevel .t - tkwait visibility .t - toplevel .t2 - tkwait visibility .t2 + toplevel .t ; update + toplevel .t2 ; update raise . raiseDelay raise .t2 @@ -1602,12 +1600,9 @@ test wm-stackorder-3.5 {unmapped toplevel} -body { destroy .t1 } -result {.t1.t2} test wm-stackorder-3.6 {unmapped toplevel} -body { - toplevel .t1 - tkwait visibility .t1 - toplevel .t1.t2 - tkwait visibility .t1.t2 - toplevel .t1.t2.t3 - tkwait visibility .t1.t2.t3 + toplevel .t1 ; update + toplevel .t1.t2 ; update + toplevel .t1.t2.t3 ; update wm withdraw .t1.t2 raiseDelay wm stackorder .t1 @@ -1645,11 +1640,10 @@ test wm-stackorder-4.2 {wm stackorder isabove|isbelow} -body { destroy .t } -result 1 test wm-stackorder-4.3 {wm stackorder isabove|isbelow} -body { - toplevel .t - tkwait visibility .t + toplevel .t ; update raise . raiseDelay - wm stackorder .t isabove . + wm stackorder .t isa . } -cleanup { destroy .t } -result 0 -- cgit v0.12 From 99750947deda792be01cd39843159406a497ebb8 Mon Sep 17 00:00:00 2001 From: culler Date: Mon, 11 Dec 2023 15:27:21 +0000 Subject: Test unixWm-51.7 on the X11 CI runner --- .github/workflows/linux-with-tcl91-build.yml | 1 + tests/unixWm.test | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/linux-with-tcl91-build.yml b/.github/workflows/linux-with-tcl91-build.yml index 4672b54..0ac4c8a 100644 --- a/.github/workflows/linux-with-tcl91-build.yml +++ b/.github/workflows/linux-with-tcl91-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "x11-unixwm-51-7" tags: - "core-**" permissions: diff --git a/tests/unixWm.test b/tests/unixWm.test index 649eb4f..2ad40e2 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -2083,12 +2083,15 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {uni toplevel $w -width 200 -height 200 -bg green tkwait visibility $w wm geometry $w +100+100 + update } raise .t .t2 restackDelay + update set result [list [winfo containing 200 200]] lower .t3 restackDelay + sleep 10 lappend result [winfo containing 200 200] } {.t3 .t} test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix { -- cgit v0.12 From 6bfa393f6ca222ee906befd9400746d465debb75 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 11 Dec 2023 19:36:52 +0000 Subject: Change (internal) TkCreateFrame function from argc/argv -> objc/objv --- generic/tkFrame.c | 73 ++++++---------------------------------------------- generic/tkInt.decls | 2 +- generic/tkInt.h | 3 --- generic/tkIntDecls.h | 6 ++--- generic/tkWindow.c | 9 ++++++- 5 files changed, 20 insertions(+), 73 deletions(-) diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 82e33c4..6ea82ae 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -43,7 +43,7 @@ typedef struct { * available for this widget. */ char *className; /* Class name for widget (from configuration * option). Malloc-ed. */ - enum FrameType type; /* Type of widget, such as TYPE_FRAME. */ + int type; /* Type of widget, such as TYPE_FRAME. */ char *screenName; /* Screen on which widget is created. Non-null * only for top-levels. Malloc-ed, may be * NULL. */ @@ -329,9 +329,6 @@ static const Tk_OptionSpec *const optionSpecs[] = { static void ComputeFrameGeometry(Frame *framePtr); static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, int objc, Tcl_Obj *const objv[]); -static int CreateFrame(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], - enum FrameType type, const char *appName); static Tcl_FreeProc DestroyFrame; static void DestroyFramePartly(Frame *framePtr); static void DisplayFrame(void *clientData); @@ -405,7 +402,7 @@ Tk_FrameObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL); + return TkCreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL); } int @@ -415,7 +412,7 @@ Tk_ToplevelObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL); + return TkCreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL); } int @@ -425,7 +422,7 @@ Tk_LabelframeObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL); + return TkCreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL); } /* @@ -446,67 +443,13 @@ Tk_LabelframeObjCmd( * *-------------------------------------------------------------- */ - int TkCreateFrame( - void *clientData, /* Either NULL or pointer to option table. */ - Tcl_Interp *interp, /* Current interpreter. */ - int argc, /* Number of arguments. */ - const char *const *argv, /* Argument strings. */ - int toplevel, /* Non-zero means create a toplevel window, - * zero means create a frame. */ - const char *appName) /* Should only be non-NULL if there is no main - * window associated with the interpreter. - * Gives the base name to use for the new - * application. */ -{ - int result, i; - Tcl_Obj **objv = (Tcl_Obj **)ckalloc((argc+1) * sizeof(Tcl_Obj **)); - - for (i=0; i Date: Mon, 11 Dec 2023 22:24:37 +0000 Subject: Tk_InitImageArgs() was related to USE_OLD_IMAGE, which is now removed --- doc/ConfigWidg.3 | 2 +- doc/CrtImgType.3 | 20 +------------------- doc/Tk_Main.3 | 2 +- generic/tk.h | 2 -- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index e4046a1..09e4df0 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -33,7 +33,7 @@ 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 objc in +.AP Tcl_Size objc in Number of arguments in \fIobjv\fR. .AP "Tcl_Obj *const *" objv in Command-line options for configuring widget. diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index b1f03dd..660585f 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -9,7 +9,7 @@ .so man.macros .BS .SH NAME -Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image +Tk_CreateImageType, Tk_GetImageModelData \- define new kind of image .SH SYNOPSIS .nf \fB#include \fR @@ -18,8 +18,6 @@ Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of .sp ClientData \fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR) -.sp -\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR) .SH ARGUMENTS .AS "const Tk_ImageType" *typePtrPtr .AP "const Tk_ImageType" *typePtr in @@ -34,8 +32,6 @@ Name of existing image. .AP Tk_ImageType **typePtrPtr out Points to word in which to store a pointer to type information for the given image, if it exists. -.AP int argc in -Number of arguments .AP char ***argvPtr in/out Pointer to argument list .BE @@ -241,20 +237,6 @@ and the return value is the ClientData value returned by the \fIcreateProc\fR when the image was created (this is typically a pointer to the image model data structure). If no such image exists then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. -.SH "LEGACY INTERFACE SUPPORT" -.PP -In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR -was incompatibly different, with the following prototype: -.CS -typedef int \fBTk_ImageCreateProc\fR( - Tcl_Interp *\fIinterp\fR, - char *\fIname\fR, - int \fIargc\fR, - char **\fIargv\fR, - Tk_ImageType *\fItypePtr\fR, - Tk_ImageModel \fImodel\fR, - ClientData *\fImodelDataPtr\fR); -.CE .SH "SEE ALSO" Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage .SH KEYWORDS diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3 index ea5f771..a1e12ce 100644 --- a/doc/Tk_Main.3 +++ b/doc/Tk_Main.3 @@ -17,7 +17,7 @@ Tk_Main \- main program for Tk-based applications \fBTk_Main\fR(\fIargc, argv, appInitProc\fR) .SH ARGUMENTS .AS Tcl_AppInitProc *appInitProc -.AP int argc in +.AP Tcl_Size argc in Number of elements in \fIargv\fR. .AP char *argv[] in Array of strings containing command-line arguments. On Windows, when diff --git a/generic/tk.h b/generic/tk.h index 58e8846..bc2c91b 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1522,8 +1522,6 @@ EXTERN const char * Tk_PkgInitStubsCheck(Tcl_Interp *interp, #define Tk_InitStubs(interp, version, exact) \ Tk_PkgInitStubsCheck(interp, version, exact) #endif /* USE_TK_STUBS */ - -#define Tk_InitImageArgs(interp, argc, argv) /**/ /* *---------------------------------------------------------------------- -- cgit v0.12 From eb5378812e0953cf7516d8a3b8783d22ccc6c6e6 Mon Sep 17 00:00:00 2001 From: csaba Date: Tue, 12 Dec 2023 15:31:24 +0000 Subject: Made the scrolling by units via smoother. --- library/listbox.tcl | 2 +- library/tk.tcl | 29 +++++++++++++++-------------- library/ttk/combobox.tcl | 2 +- library/ttk/notebook.tcl | 2 +- library/ttk/spinbox.tcl | 2 +- library/ttk/utils.tcl | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/library/listbox.tcl b/library/listbox.tcl index 3beeaa4..d611801 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -188,7 +188,7 @@ bind Listbox { tk::MouseWheel %W x %D -12.0 units } bind Listbox { - if {[expr {%# %% 15}] != 0} { + if {%# %% 5 != 0} { return } lassign [tk::PreciseScrollDeltas %D] deltaX deltaY diff --git a/library/tk.tcl b/library/tk.tcl index e6e1ce2..26ab1cc 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -550,6 +550,7 @@ proc ::tk::MouseWheel {w dir amount {factor -120.0} {units units}} { } ## ::tk::PreciseScrollDeltas $dxdy + proc ::tk::PreciseScrollDeltas {dxdy} { set deltaX [expr {$dxdy >> 16}] set low [expr {$dxdy & 0xffff}] @@ -557,6 +558,20 @@ proc ::tk::PreciseScrollDeltas {dxdy} { return [list $deltaX $deltaY] } +# Helper for smooth scrolling of widgets that support xview moveto, +# yview moveto, height and width. + +proc ::tk::ScrollByPixels {w deltaX deltaY} { + set width [expr {1.0 * [$w cget -width]}] + set height [expr {1.0 * [$w cget -height]}] + set X [lindex [$w xview] 0] + set Y [lindex [$w yview] 0] + set x [expr {$X - $deltaX / $width}] + set y [expr {$Y - $deltaY / $height}] + $w xview moveto $x + $w yview moveto $y +} + # ::tk::TabToWindow -- # This procedure moves the focus to the given widget. # It sends a <> virtual event to the previous focus window, @@ -845,20 +860,6 @@ if {$::ttk::library ne ""} { uplevel \#0 [list source -encoding utf-8 $::ttk::library/ttk.tcl] } -# Helper for smooth scrolling of widgets that support xview moveto, -# yview moveto, height and width. - -proc ::tk::ScrollByPixels {w deltaX deltaY} { - set width [expr {1.0 * [$w cget -width]}] - set height [expr {1.0 * [$w cget -height]}] - set X [lindex [$w xview] 0] - set Y [lindex [$w yview] 0] - set x [expr {$X - $deltaX / $width}] - set y [expr {$Y - $deltaY / $height}] - $w xview moveto $x - $w yview moveto $y -} - # Local Variables: # mode: tcl diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index c253eb0..1b9d4cb 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -59,7 +59,7 @@ bind TCombobox { bind TCombobox { lassign [tk::PreciseScrollDeltas %D] deltaX deltaY # TouchpadScroll events fire about 60 times per second. - if {$deltaY != 0 && [expr {%# %% 15}] == 0} { + if {$deltaY != 0 && %# %% 15 == 0} { ttk::combobox::Scroll %W [expr {$deltaY > 0 ? -1 : 1}] } } diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl index 55aaa03..1d59d1e 100644 --- a/library/ttk/notebook.tcl +++ b/library/ttk/notebook.tcl @@ -33,7 +33,7 @@ bind TNotebook { } bind TNotebook { # TouchpadScroll events fire about 60 times per second. - if {[expr {%# %% 30}] == 0} { + if {%# %% 15 == 0} { ttk::notebook::CondCycleTab2 %W %D } } diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl index 0160d35..96d8acf 100644 --- a/library/ttk/spinbox.tcl +++ b/library/ttk/spinbox.tcl @@ -30,7 +30,7 @@ bind TSpinbox { bind TSpinbox { lassign [tk::PreciseScrollDeltas %D] deltaX deltaY # TouchpadScroll events fire about 60 times per second. - if {$deltaY != 0 && [expr {%# %% 12}] == 0} { + if {$deltaY != 0 && %# %% 12 == 0} { ttk::spinbox::Spin %W [expr {$deltaY > 0 ? -1 : 1}] } } diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index 9b15eb6..3f6446d 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -304,7 +304,7 @@ bind TtkScrollable \ ## Touchpad scrolling # bind TtkScrollable { - if {[expr {%# %% 15}] != 0} { + if {%# %% 5 != 0} { return } lassign [tk::PreciseScrollDeltas %D] deltaX deltaY -- cgit v0.12 From adab678818f2464d3ece02dea83523ef8443bfb1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Dec 2023 15:49:43 +0000 Subject: Fix for [0de707ab06]: Problem in tk9 static build under windows --- unix/tkAppInit.c | 1 + win/winMain.c | 1 + 2 files changed, 2 insertions(+) diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index 77f7330..5252972 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -12,6 +12,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef USE_TCL_STUBS #undef BUILD_tk #undef STATIC_BUILD #include "tk.h" diff --git a/win/winMain.c b/win/winMain.c index 9c23037..b93e11e 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -12,6 +12,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef USE_TCL_STUBS #include "tk.h" #define WIN32_LEAN_AND_MEAN #include -- cgit v0.12 From e2d41cd9d979b5877eba4870b5e20df072050acc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Dec 2023 23:30:54 +0000 Subject: Remove USE_OLD_CANVAS --- generic/tk.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index bc2c91b..eae1b22 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -997,18 +997,6 @@ typedef struct Tk_Item { * lines, circles, etc.) that can form part of a canvas widget. */ -#if defined(USE_OLD_CANVAS) && TCL_MAJOR_VERSION < 9 -typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Size argc, char **argv); -typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Size argc, char **argv, int flags); -typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Size argc, char **argv); -typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int beforeThis, char *string); -typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, char *indexString, int *indexPtr); -#else typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, @@ -1020,7 +1008,6 @@ typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Obj *indexString, Tcl_Size *indexPtr); -#endif /* USE_OLD_CANVAS */ typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr, -- cgit v0.12 From c253a25bf983c9a6f1ac39689d16b886fbbde7bf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Dec 2023 10:09:58 +0000 Subject: Fix Tk_CharBbox/Tk_DrawTextLayout signature (int -> Tcl_Size). Update documentation. --- doc/CrtErrHdlr.3 | 4 ++-- doc/CrtGenHdlr.3 | 4 ++-- doc/CrtImgType.3 | 16 ++++++++-------- doc/CrtSelHdlr.3 | 10 +++++----- doc/EventHndlr.3 | 4 ++-- doc/GetImage.3 | 4 ++-- doc/GetSelect.3 | 4 ++-- doc/ManageGeom.3 | 6 +++--- doc/MeasureChar.3 | 2 +- doc/OwnSelect.3 | 4 ++-- doc/RestrictEv.3 | 6 +++--- doc/SetClassProcs.3 | 6 +++--- doc/SetOptions.3 | 10 +++++----- doc/TextLayout.3 | 6 +++--- generic/tk.decls | 4 ++-- generic/tkDecls.h | 8 ++++---- generic/tkFont.c | 30 ++++++++++++++++-------------- generic/tkInt.decls | 4 ++-- generic/tkIntDecls.h | 5 +++-- generic/tkText.c | 9 +++++---- generic/tkText.h | 6 +++--- generic/tkTextDisp.c | 7 ++++--- generic/tkTextIndex.c | 2 +- 23 files changed, 83 insertions(+), 78 deletions(-) diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3 index e6ebafe..09dcf8b 100644 --- a/doc/CrtErrHdlr.3 +++ b/doc/CrtErrHdlr.3 @@ -35,7 +35,7 @@ field. If \-1, then match any \fIminor_code\fR value. Procedure to invoke whenever an error event is received for \fIdisplay\fR and matches \fIerror\fR, \fIrequest\fR, and \fIminor\fR. NULL means ignore any matching errors. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .AP Tk_ErrorHandler handler in Token for error handler to delete (return value from a previous @@ -73,7 +73,7 @@ made when the handler was active (see below for more information). following type: .CS typedef int \fBTk_ErrorProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, XErrorEvent *\fIerrEventPtr\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3 index 1d6f3d5..aaf3285 100644 --- a/doc/CrtGenHdlr.3 +++ b/doc/CrtGenHdlr.3 @@ -21,7 +21,7 @@ Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback .AS "Tk_GenericProc" clientData .AP Tk_GenericProc *proc in Procedure to invoke whenever any X event occurs on any display. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .BE .SH DESCRIPTION @@ -45,7 +45,7 @@ call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or type \fBTk_GenericProc\fR: .CS typedef int \fBTk_GenericProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, XEvent *\fIeventPtr\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index 660585f..f59a78e 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -16,7 +16,7 @@ Tk_CreateImageType, Tk_GetImageModelData \- define new kind of image .sp \fBTk_CreateImageType\fR(\fItypePtr\fR) .sp -ClientData +void * \fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR) .SH ARGUMENTS .AS "const Tk_ImageType" *typePtrPtr @@ -110,7 +110,7 @@ typedef int \fBTk_ImageCreateProc\fR( Tcl_Obj *const \fIobjv\fR[], const Tk_ImageType *\fItypePtr\fR, Tk_ImageModel \fImodel\fR, - ClientData *\fImodelDataPtr\fR); + void **\fImodelDataPtr\fR); .CE The \fIinterp\fR argument is the interpreter in which the \fBimage\fR command was invoked, and \fIname\fR is the name for the new image, @@ -142,9 +142,9 @@ size of the image and request an initial redisplay. calls \fBTk_GetImage\fR to use a particular image. This procedure must match the following prototype: .CS -typedef ClientData \fBTk_ImageGetProc\fR( +typedef void *\fBTk_ImageGetProc\fR( Tk_Window \fItkwin\fR, - ClientData \fImodelData\fR); + void *\fImodelData\fR); .CE The \fItkwin\fR argument identifies the window in which the image will be used and \fImodelData\fR is the value @@ -163,7 +163,7 @@ to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR). \fIdisplayProc\fR must match the following prototype: .CS typedef void \fBTk_ImageDisplayProc\fR( - ClientData \fIinstanceData\fR, + void *\fIinstanceData\fR, Display *\fIdisplay\fR, Drawable \fIdrawable\fR, int \fIimageX\fR, @@ -199,7 +199,7 @@ canvas item is changed. \fIfreeProc\fR must match the following prototype: .CS typedef void \fBTk_ImageFreeProc\fR( - ClientData \fIinstanceData\fR, + void *\fIinstanceData\fR, Display *\fIdisplay\fR); .CE The \fIinstanceData\fR will be the same as the value returned by @@ -217,7 +217,7 @@ each of the image's instances. \fIdeleteProc\fR must match the following prototype: .CS typedef void \fBTk_ImageDeleteProc\fR( - ClientData \fImodelData\fR); + void *\fImodelData\fR); .CE The \fImodelData\fR argument will be the same as the value stored in \fI*modelDataPtr\fR by \fIcreateProc\fR when the @@ -233,7 +233,7 @@ If there exists an image named \fIname\fR in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is filled in with type information for the image (the \fItypePtr\fR value passed to \fBTk_CreateImageType\fR when the image type was registered) -and the return value is the ClientData value returned by the +and the return value is the clientData value returned by the \fIcreateProc\fR when the image was created (this is typically a pointer to the image model data structure). If no such image exists then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3 index 2292ccc..d6d27bb 100644 --- a/doc/CrtSelHdlr.3 +++ b/doc/CrtSelHdlr.3 @@ -32,7 +32,7 @@ commands. Procedure to invoke whenever the selection is owned by \fItkwin\fR and the selection contents are requested in the format given by \fItarget\fR. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .AP Atom format in If the selection requestor is not in this process, \fIformat\fR determines @@ -54,11 +54,11 @@ the selection. The most common form is STRING. \fIProc\fR should have arguments and result that match the type \fBTk_SelectionProc\fR: .CS -typedef int \fBTk_SelectionProc\fR( - ClientData \fIclientData\fR, - int \fIoffset\fR, +typedef Tcl_Size \fBTk_SelectionProc\fR( + void *\fIclientData\fR, + Tcl_Size \fIoffset\fR, char *\fIbuffer\fR, - int \fImaxBytes\fR); + Tcl_Size \fImaxBytes\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR argument given to \fBTk_CreateSelHandler\fR. diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3 index cbc5b79..128f8ee 100644 --- a/doc/EventHndlr.3 +++ b/doc/EventHndlr.3 @@ -37,7 +37,7 @@ for which \fIproc\fR should be called. .AP Tk_EventProc *proc in Procedure to invoke whenever an event in \fImask\fR occurs in the window given by \fItkwin\fR. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .BE .SH DESCRIPTION @@ -55,7 +55,7 @@ call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or type \fBTk_EventProc\fR: .CS typedef void \fBTk_EventProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, XEvent *\fIeventPtr\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR diff --git a/doc/GetImage.3 b/doc/GetImage.3 index 744f9ac..c437db7 100644 --- a/doc/GetImage.3 +++ b/doc/GetImage.3 @@ -32,7 +32,7 @@ Window in which image will be used. Name of image. .AP Tk_ImageChangedProc *changeProc in Procedure for Tk to invoke whenever image content or size changes. -.AP ClientData clientData in +.AP void *clientData in One-word value for Tk to pass to \fIchangeProc\fR. .AP Tk_Image image in Token for image instance; must have been returned by a previous @@ -106,7 +106,7 @@ The \fIchangeProc\fR and \fIclientData\fR arguments to in the image; it must match the following prototype: .CS typedef void \fBTk_ImageChangedProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, int \fIx\fR, int \fIy\fR, int \fIwidth\fR, diff --git a/doc/GetSelect.3 b/doc/GetSelect.3 index 11e837e..455b142 100644 --- a/doc/GetSelect.3 +++ b/doc/GetSelect.3 @@ -30,7 +30,7 @@ Form in which to retrieve selection. .AP Tk_GetSelProc *proc in Procedure to invoke to process pieces of the selection as they are retrieved. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .BE .SH DESCRIPTION @@ -44,7 +44,7 @@ should have arguments and result that match the type .PP .CS typedef int \fBTk_GetSelProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tcl_Interp *\fIinterp\fR, char *\fIportion\fR); .CE diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3 index 0c72d69..dd69273 100644 --- a/doc/ManageGeom.3 +++ b/doc/ManageGeom.3 @@ -25,7 +25,7 @@ geometry manager, or NULL to indicate that \fItkwin\fR's geometry should not be managed anymore. The data structure pointed to by \fImgrPtr\fR must be static: Tk keeps a reference to it as long as the window is managed. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to geometry manager callbacks. .BE .SH DESCRIPTION @@ -58,7 +58,7 @@ content window to change its desired geometry. type \fBTk_GeomRequestProc\fR: .CS typedef void \fBTk_GeomRequestProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tk_Window \fItkwin\fR); .CE The parameters to \fIrequestProc\fR will be identical to the @@ -81,7 +81,7 @@ is the same as the window's current geometry manager. arguments and results that match the following prototype: .CS typedef void \fBTk_GeomLostContentProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tk_Window \fItkwin\fR); .CE The parameters to \fIlostContentProc\fR will be identical to the diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3 index 3959978..0922fd5 100644 --- a/doc/MeasureChar.3 +++ b/doc/MeasureChar.3 @@ -33,7 +33,7 @@ Text to be measured or displayed. Need not be null terminated. Any non-printing meta-characters in the string (such as tabs, newlines, and other control characters) will be measured or displayed in a platform-dependent manner. -.AP int numBytes in +.AP Tcl_Size numBytes in The maximum number of bytes to consider when measuring or drawing \fIstring\fR. Must be greater than or equal to 0. .AP int maxPixels in diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3 index 0e16eac..67bac55 100644 --- a/doc/OwnSelect.3 +++ b/doc/OwnSelect.3 @@ -23,7 +23,7 @@ Window that is to become new selection owner. The name of the selection to be owned, such as XA_PRIMARY. .AP Tk_LostSelProc *proc in Procedure to invoke when \fItkwin\fR loses selection ownership later. -.AP ClientData clientData in +.AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .BE .SH DESCRIPTION @@ -39,7 +39,7 @@ unhighlighting the selection). \fIProc\fR should have arguments and result that match the type \fBTk_LostSelProc\fR: .CS typedef void \fBTk_LostSelProc\fR( - ClientData \fIclientData\fR); + void *\fIclientData\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3 index 8b3af07..f61e764 100644 --- a/doc/RestrictEv.3 +++ b/doc/RestrictEv.3 @@ -21,9 +21,9 @@ Tk_RestrictProc * .AP Tk_RestrictProc *proc in Predicate procedure to call to filter incoming X events. NULL means do not restrict events at all. -.AP ClientData arg in +.AP void *arg in Arbitrary argument to pass to \fIproc\fR. -.AP ClientData *prevArgPtr out +.AP void **prevArgPtr out Pointer to place to save argument to previous restrict procedure. .BE .SH DESCRIPTION @@ -40,7 +40,7 @@ is a procedure with arguments and result that match the type \fBTk_RestrictProc\fR: .CS typedef Tk_RestrictAction \fBTk_RestrictProc\fR( - ClientData \fIarg\fR, + void *\fIarg\fR, XEvent *\fIeventPtr\fR); .CE The \fIarg\fR argument is a copy of the \fIarg\fR passed diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3 index 53f7cce..d8f89a4 100644 --- a/doc/SetClassProcs.3 +++ b/doc/SetClassProcs.3 @@ -22,7 +22,7 @@ Token for window to modify. Pointer to data structure containing widget specific procedures. The data structure pointed to by \fIprocs\fR must be static: Tk keeps a reference to it as long as the window exists. -.AP ClientData instanceData in +.AP void *instanceData in Arbitrary one-word value to pass to widget callbacks. .BE .SH DESCRIPTION @@ -50,7 +50,7 @@ accordingly. \fIworldChangedProc\fR should have arguments and results that match the type \fBTk_ClassWorldChangedProc\fR: .CS typedef void \fBTk_ClassWorldChangedProc\fR( - ClientData \fIinstanceData\fR); + void *\fIinstanceData\fR); .CE The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR will be identical to the \fIinstanceData\fR parameter passed to @@ -63,7 +63,7 @@ arguments and results that match the type \fBTk_ClassCreateProc\fR: typedef Window \fBTk_ClassCreateProc\fR( Tk_Window \fItkwin\fR, Window \fIparent\fR, - ClientData \fIinstanceData\fR); + void *\fIinstanceData\fR); .CE The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to the \fItkwin\fR and \fIinstanceData\fR parameters passed to diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index c568dd6..bdf502f 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -550,11 +550,11 @@ typedef struct Tk_ObjCustomOption { Tk_CustomOptionGetProc *\fIgetProc\fR; Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; Tk_CustomOptionFreeProc *\fIfreeProc\fR; - ClientData \fIclientData\fR; + void *\fIclientData\fR; } \fBTk_ObjCustomOption\fR; typedef int \fBTk_CustomOptionSetProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, Tcl_Obj **\fIvaluePtr\fR, @@ -564,19 +564,19 @@ typedef int \fBTk_CustomOptionSetProc\fR( int \fIflags\fR); typedef Tcl_Obj *\fBTk_CustomOptionGetProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tk_Window \fItkwin\fR, char *\fIrecordPtr\fR, int \fIinternalOffset\fR); typedef void \fBTk_CustomOptionRestoreProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tk_Window \fItkwin\fR, char *\fIinternalPtr\fR, char *\fIsaveInternalPtr\fR); typedef void \fBTk_CustomOptionFreeProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tk_Window \fItkwin\fR, char *\fIinternalPtr\fR); .CE diff --git a/doc/TextLayout.3 b/doc/TextLayout.3 index 7df0685..335ab39 100644 --- a/doc/TextLayout.3 +++ b/doc/TextLayout.3 @@ -100,10 +100,10 @@ Point, in pixels, at which to place the upper-left hand corner of the text layout when it is being drawn, or the coordinates of a point (with respect to the upper-left hand corner of the text layout) to check against the text layout. -.AP int firstChar in +.AP Tcl_Size firstChar in The index of the first character to draw from the given text layout. The number 0 means to draw from the beginning. -.AP int lastChar in +.AP Tcl_Size lastChar in The index of the last character up to which to draw. The character specified by \fIlastChar\fR itself will not be drawn. A number less than 0 means to draw all characters in the text layout. @@ -111,7 +111,7 @@ than 0 means to draw all characters in the text layout. Index of the single character to underline in the text layout, or a negative number counting backwards from the end of the string. Any out-of-range number (e.g. INT_MIN) means no underline. -.AP int index in +.AP Tcl_Size index in The index of the character whose bounding box is desired. The bounding box is computed with respect to the upper-left hand corner of the text layout. .AP int "*xPtr, *yPtr" out diff --git a/generic/tk.decls b/generic/tk.decls index ae693d3..d1b5ffb 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -120,7 +120,7 @@ declare 22 { XSetWindowAttributes *attsPtr) } declare 23 { - int Tk_CharBbox(Tk_TextLayout layout, int index, int *xPtr, + int Tk_CharBbox(Tk_TextLayout layout, Tcl_Size index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr) } declare 24 { @@ -272,7 +272,7 @@ declare 60 { declare 61 { void Tk_DrawTextLayout(Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, - int x, int y, int firstChar, int lastChar) + int x, int y, Tcl_Size firstChar, Tcl_Size lastChar) } declare 62 { void Tk_Fill3DPolygon(Tk_Window tkwin, diff --git a/generic/tkDecls.h b/generic/tkDecls.h index cb39e7b..5a6b81a 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -118,7 +118,7 @@ EXTERN void Tk_ChangeWindowAttributes(Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 23 */ -EXTERN int Tk_CharBbox(Tk_TextLayout layout, int index, +EXTERN int Tk_CharBbox(Tk_TextLayout layout, Tcl_Size index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 24 */ @@ -248,7 +248,7 @@ EXTERN void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, EXTERN void Tk_DrawTextLayout(Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, - int firstChar, int lastChar); + Tcl_Size firstChar, Tcl_Size lastChar); /* 62 */ EXTERN void Tk_Fill3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, @@ -922,7 +922,7 @@ typedef struct TkStubs { Tk_Window (*tk_CanvasTkwin) (Tk_Canvas canvas); /* 20 */ void (*tk_CanvasWindowCoords) (Tk_Canvas canvas, double x, double y, short *screenXPtr, short *screenYPtr); /* 21 */ void (*tk_ChangeWindowAttributes) (Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 22 */ - int (*tk_CharBbox) (Tk_TextLayout layout, int index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 23 */ + int (*tk_CharBbox) (Tk_TextLayout layout, Tcl_Size index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 23 */ 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 */ @@ -960,7 +960,7 @@ typedef struct TkStubs { void (*tk_Draw3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 58 */ void (*tk_DrawChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, Tcl_Size numBytes, int x, int y); /* 59 */ void (*tk_DrawFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable); /* 60 */ - void (*tk_DrawTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar); /* 61 */ + void (*tk_DrawTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, Tcl_Size firstChar, Tcl_Size lastChar); /* 61 */ void (*tk_Fill3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, Tcl_Size numPoints, int borderWidth, int leftRelief); /* 62 */ void (*tk_Fill3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 63 */ Tk_PhotoHandle (*tk_FindPhoto) (Tcl_Interp *interp, const char *imageName); /* 64 */ diff --git a/generic/tkFont.c b/generic/tkFont.c index e67be4e..384119c 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -73,9 +73,9 @@ typedef struct LayoutChunk { const char *start; /* Pointer to simple string to be displayed. * This is a pointer into the TkTextLayout's * string. */ - int numBytes; /* The number of bytes in this chunk. */ - int numChars; /* The number of characters in this chunk. */ - int numDisplayChars; /* The number of characters to display when + Tcl_Size numBytes; /* The number of bytes in this chunk. */ + Tcl_Size numChars; /* The number of characters in this chunk. */ + Tcl_Size numDisplayChars; /* The number of characters to display when * this chunk is displayed. Can be less than * numChars if extra space characters were * absorbed by the end of the chunk. This will @@ -98,7 +98,7 @@ typedef struct TextLayout { const char *string; /* The string that was layed out. */ int width; /* The maximum width of all lines in the text * layout. */ - int numChunks; /* Number of chunks actually used in following + Tcl_Size numChunks; /* Number of chunks actually used in following * array. */ LayoutChunk chunks[TKFLEXARRAY];/* Array of chunks. The actual size will be * maxChunks. THIS FIELD MUST BE THE LAST IN @@ -337,7 +337,7 @@ static void FreeFontObjProc(Tcl_Obj *objPtr); static int GetAttributeInfoObj(Tcl_Interp *interp, const TkFontAttributes *faPtr, Tcl_Obj *objPtr); static LayoutChunk * NewChunk(TextLayout **layoutPtrPtr, int *maxPtr, - const char *start, int numChars, int curX, + const char *start, Tcl_Size numChars, int curX, int newX, int y); static int ParseFontNameObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, TkFontAttributes *faPtr); @@ -1987,7 +1987,8 @@ Tk_ComputeTextLayout( { TkFont *fontPtr = (TkFont *) tkfont; const char *start, *endp, *special; - int n, y, bytesThisChunk, maxChunks, curLine, layoutHeight; + Tcl_Size n; + int y, bytesThisChunk, maxChunks, curLine, layoutHeight; int baseline, height, curX, newX, maxWidth, *lineLengths; TextLayout *layoutPtr; LayoutChunk *chunkPtr; @@ -2310,10 +2311,10 @@ Tk_DrawTextLayout( * Tk_ComputeTextLayout(). */ int x, int y, /* Upper-left hand corner of rectangle in * which to draw (pixels). */ - int firstChar, /* The index of the first character to draw + Tcl_Size firstChar, /* The index of the first character to draw * from the given text item. 0 specifies the * beginning. */ - int lastChar) /* The index just after the last character to + Tcl_Size lastChar) /* The index just after the last character to * draw from the given text item. A number < 0 * means to draw all characters. */ { @@ -2322,7 +2323,8 @@ Tk_DrawTextLayout( TkDrawAngledTextLayout(display, drawable, gc, layout, x, y, 0.0, firstChar, lastChar); #else TextLayout *layoutPtr = (TextLayout *) layout; - int i, numDisplayChars, drawX; + int i, drawX; + Tcl_Size numDisplayChars; const char *firstByte, *lastByte; LayoutChunk *chunkPtr; @@ -2381,10 +2383,10 @@ TkDrawAngledTextLayout( int x, int y, /* Upper-left hand corner of rectangle in * which to draw (pixels). */ double angle, - int firstChar, /* The index of the first character to draw + Tcl_Size firstChar, /* The index of the first character to draw * from the given text item. 0 specifies the * beginning. */ - int lastChar) /* The index just after the last character to + Tcl_Size lastChar) /* The index just after the last character to * draw from the given text item. A number < 0 * means to draw all characters. */ { @@ -2743,7 +2745,7 @@ int Tk_CharBbox( Tk_TextLayout layout, /* Layout information, from a previous call to * Tk_ComputeTextLayout(). */ - int index, /* The index of the character whose bbox is + Tcl_Size index, /* The index of the character whose bbox is * desired. Negative means count backwards. */ int *xPtr, int *yPtr, /* Filled with the upper-left hand corner, in * pixels, of the bounding box for the @@ -3836,7 +3838,7 @@ NewChunk( TextLayout **layoutPtrPtr, int *maxPtr, const char *start, - int numBytes, + Tcl_Size numBytes, int curX, int newX, int y) @@ -4358,7 +4360,7 @@ TkFontGetFirstTextLayout( { TextLayout *layoutPtr = (TextLayout *) layout; LayoutChunk *chunkPtr; - int numBytesInChunk; + Tcl_Size numBytesInChunk; if ((layoutPtr == NULL) || (layoutPtr->numChunks == 0) || (layoutPtr->chunks->numDisplayChars <= 0)) { diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 1f465ca..e6db14e 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -581,8 +581,8 @@ declare 180 { # Angled text API, exposed for Emiliano Gavilán's RBC work. declare 181 { void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc, - Tk_TextLayout layout, int x, int y, double angle, int firstChar, - int lastChar) + Tk_TextLayout layout, int x, int y, double angle, Tcl_Size firstChar, + Tcl_Size lastChar) } declare 182 { void TkUnderlineAngledTextLayout(Display *display, Drawable drawable, diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index a1cd4ae..42c679f 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -520,7 +520,8 @@ EXTERN const char * TkSmoothPrintProc(void *clientData, Tk_Window tkwin, EXTERN void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, - double angle, int firstChar, int lastChar); + double angle, Tcl_Size firstChar, + Tcl_Size lastChar); /* 182 */ EXTERN void TkUnderlineAngledTextLayout(Display *display, Drawable drawable, GC gc, @@ -729,7 +730,7 @@ typedef struct TkIntStubs { const char * (*tkOrientPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 178 */ int (*tkSmoothParseProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 179 */ const char * (*tkSmoothPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 180 */ - void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */ + void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, Tcl_Size firstChar, Tcl_Size lastChar); /* 181 */ void (*tkUnderlineAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int underline); /* 182 */ int (*tkIntersectAngledTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height, double angle); /* 183 */ void (*tkDrawAngledChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, Tcl_Size numBytes, double x, double y, double angle); /* 184 */ diff --git a/generic/tkText.c b/generic/tkText.c index ff58398..9421f35 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1417,7 +1417,8 @@ TextWidgetObjCmd( goto done; } if (textPtr->state == TK_TEXT_STATE_NORMAL) { - int lineNum, byteIndex; + int lineNum; + Tcl_Size byteIndex; TkTextIndex index; /* @@ -3229,7 +3230,7 @@ DeleteIndexRange( } for (tPtr = sharedTextPtr->peers; tPtr != NULL ; tPtr = tPtr->next) { int line = 0; - int byteIndex = 0; + Tcl_Size byteIndex = 0; int resetView = 0; if (TkTextIndexCmp(&index2, &tPtr->topIndex) >= 0) { @@ -3314,10 +3315,10 @@ DeleteIndexRange( resetViewCount = 0; for (tPtr = sharedTextPtr->peers; tPtr != NULL ; tPtr = tPtr->next) { - int line = lineAndByteIndex[resetViewCount]; + Tcl_Size line = lineAndByteIndex[resetViewCount]; if (line != -1) { - int byteIndex = lineAndByteIndex[resetViewCount+1]; + Tcl_Size byteIndex = lineAndByteIndex[resetViewCount+1]; TkTextIndex indexTmp; if (tPtr == textPtr) { diff --git a/generic/tkText.h b/generic/tkText.h index 22e45b5..81b925b 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -190,7 +190,7 @@ typedef struct TkTextIndex { TkTextBTree tree; /* Tree containing desired position. */ TkTextLine *linePtr; /* Pointer to line containing position of * interest. */ - int byteIndex; /* Index within line of desired character (0 + Tcl_Size byteIndex; /* Index within line of desired character (0 * means first one). */ struct TkText *textPtr; /* May be NULL, but otherwise the text widget * with which this index is associated. If not @@ -255,7 +255,7 @@ struct TkTextDispChunk { * x-location. */ Tk_ChunkBboxProc *bboxProc; /* Procedure to find bounding box of character * in chunk. */ - int numBytes; /* Number of bytes that will be displayed in + Tcl_Size numBytes; /* Number of bytes that will be displayed in * the chunk. */ int minAscent; /* Minimum space above the baseline needed by * this chunk. */ @@ -267,7 +267,7 @@ struct TkTextDispChunk { * set by chunk-specific code, but may be * increased to include tab or extra space at * end of line. */ - int breakIndex; /* Index within chunk of last acceptable + Tcl_Size breakIndex; /* Index within chunk of last acceptable * position for a line (break just before this * byte index). <= 0 means don't break during * or immediately after this chunk. */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 5ad4509..11ceb59 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -440,7 +440,7 @@ typedef struct TextDInfo { #ifndef TK_LAYOUT_WITH_BASE_CHUNKS typedef struct CharInfo { - int numBytes; /* Number of bytes to display. */ + Tcl_Size numBytes; /* Number of bytes to display. */ char chars[TKFLEXARRAY]; /* UTF characters to display. * Allocated as large as necessary. THIS MUST BE THE LAST * FIELD IN THE STRUCTURE. */ @@ -452,7 +452,7 @@ typedef struct CharInfo { TkTextDispChunk *baseChunkPtr; int baseOffset; /* Starting offset in base chunk * baseChars. */ - int numBytes; /* Number of bytes that belong to this + Tcl_Size numBytes; /* Number of bytes that belong to this * chunk. */ const char *chars; /* UTF characters to display. Actually points * into the baseChars of the base chunk. Only @@ -7989,7 +7989,8 @@ CharDisplayProc( const char *string; TextStyle *stylePtr; StyleValues *sValuePtr; - int numBytes, offsetBytes, offsetX; + Tcl_Size numBytes, offsetBytes; + int offsetX; #ifdef TK_DRAW_IN_CONTEXT BaseCharInfo *bciPtr; #endif /* TK_DRAW_IN_CONTEXT */ diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index b0a5c94..14e9106 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -1109,7 +1109,7 @@ TkTextPrintIndex( { TkTextSegment *segPtr; TkTextLine *linePtr; - int numBytes, charIndex; + Tcl_Size numBytes, charIndex; numBytes = indexPtr->byteIndex; charIndex = 0; -- cgit v0.12 From b4d15bb091d5a10a8a1d747f54a8065884f45285 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 14 Dec 2023 16:20:26 +0000 Subject: Fix for Cygwin build --- unix/Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index cf274c3..cce7c65 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -649,9 +649,9 @@ ${LIB_FILE}: ${STUB_LIB_FILE} @LIB_RSRC_FILE@ ${OBJS} ${TK_ZIP_FILE} fi ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} - @if test "x${LIB_FILE}" = "xlibtk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ - (cd ${TOP_DIR}/win; ${MAKE} tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \ - cp "${TOP_DIR}/win/tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \ + @if test "x${LIB_FILE}" = "xlibtcl9tk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ + (cd ${TOP_DIR}/win; ${MAKE} tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \ + cp "${TOP_DIR}/win/tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \ fi rm -f $@ @MAKE_STUB_LIB@ -- cgit v0.12 From e1d9effa09ef0e191dc1c74e423293d182663064 Mon Sep 17 00:00:00 2001 From: oehhar Date: Wed, 20 Dec 2023 11:06:10 +0000 Subject: Ticket [0de707ab06]: Add explanation of the solution provided on the core list by Jan --- unix/tkAppInit.c | 18 ++++++++++++++++++ win/winMain.c | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index 5252972..5b6e14e 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -12,6 +12,24 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +/* + * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list: + * What's going on is related to TIP #596: + * Stubs support for Embedding Tcl in other applications + * + * If an application using Tcl_Main() is compiled with USE_TCL_STUBS, + * Tcl_Main() will be replaced by a stub function, which loads + * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If + * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens. + * + * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS + * (unless you want to use the TIP #596 functionality) + * + * The proper solution is to make sure that Makefile.in doesn't use + * TCL_USE_STUBS when compiling tkAppInit.c. But that's a + * quite big re-organization just before a b1 release. Simpler + * is just to #undef'ine USE_TCL_STUBS, it has the same effect. + */ #undef USE_TCL_STUBS #undef BUILD_tk #undef STATIC_BUILD diff --git a/win/winMain.c b/win/winMain.c index b93e11e..7f4ab28 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -12,6 +12,24 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +/* + * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list: + * What's going on is related to TIP #596: + * Stubs support for Embedding Tcl in other applications + * + * If an application using Tcl_Main() is compiled with USE_TCL_STUBS, + * Tcl_Main() will be replaced by a stub function, which loads + * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If + * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens. + * + * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS + * (unless you want to use the TIP #596 functionality) + * + * The proper solution is to make sure that Makefile.in doesn't use + * TCL_USE_STUBS when compiling tkAppInit.c. But that's a + * quite big re-organization just before a b1 release. Simpler + * is just to #undef'ine USE_TCL_STUBS, it has the same effect. + */ #undef USE_TCL_STUBS #include "tk.h" #define WIN32_LEAN_AND_MEAN -- cgit v0.12 From 6289fa3b000e0d3855c8171217fd7052a2961ba2 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 21 Dec 2023 01:59:50 +0000 Subject: Update documentation for print command --- doc/print.n | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/print.n b/doc/print.n index 3f51866..91f02a7 100644 --- a/doc/print.n +++ b/doc/print.n @@ -34,8 +34,7 @@ dialog that provides parallel functionality on X11. . The Mac implementation uses native print dialogs and relies on the underlying Common Unix Printing System (CUPS) to render text output from the text widget -and PostScript output from the canvas widget to the printer, to a PDF file, or -a PostScript file. +and PDF conversion of the canvas data to the printer or to a PDF file. .TP \fBWindows\fR . -- cgit v0.12 From ac0e511f72ffa121c90ad832a6fcadec631de40e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 22 Dec 2023 10:06:44 +0000 Subject: Fix TK_RELEASE_SERIAL for "b1" release --- generic/tk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tk.h b/generic/tk.h index eae1b22..4f72009 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -71,7 +71,7 @@ extern "C" { #if TK_MAJOR_VERSION == 9 # define TK_MINOR_VERSION 0 # define TK_RELEASE_LEVEL TCL_BETA_RELEASE -# define TK_RELEASE_SERIAL 0 +# define TK_RELEASE_SERIAL 1 # define TK_VERSION "9.0" # define TK_PATCH_LEVEL "9.0b1" -- cgit v0.12 From 2b5f153185ed0a402daa10f6e1e86b7aaab41a5b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 22 Dec 2023 10:26:32 +0000 Subject: Make sure that the zip-file is attached to tcl9tk90.dll for non-static builds too --- win/makefile.vc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index a5347b1..e56f2a8 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -108,7 +108,7 @@ USING_PRE87_TCL = 1 # Extra makefile options processing for non-standard OPTS values ... !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] TTK_SQUARE_WIDGET = 0 -TK_EMBED_SCRIPTS = $(STATIC_BUILD) +TK_EMBED_SCRIPTS = 1 !else !if [nmakehlp -f "$(OPTS)" "square"] !message *** Include ttk square demo widget @@ -121,7 +121,7 @@ TTK_SQUARE_WIDGET = 0 TK_EMBED_SCRIPTS = 0 !else !message *** Tk script library will be appended to the binary. -TK_EMBED_SCRIPTS = $(STATIC_BUILD) +TK_EMBED_SCRIPTS = 1 !endif !endif @@ -375,9 +375,6 @@ libtkzip: setup $(TKSCRIPTZIP) embed: setup $(WISH) $(WISHSCRIPTZIP) @copy /y /b "$(WISH)"+"$(WISHSCRIPTZIP)" "$(WISH)" !else -# Note this is currently dead code as TK_EMBED_SCRIPTS is always 0 -# for non-static builds as the C code does not currently setup up -# a VFS for a non-static wish. embed: setup $(TKLIB) $(TKSCRIPTZIP) @copy /y /b "$(TKLIB)"+"$(TKSCRIPTZIP)" "$(TKLIB)" !endif -- cgit v0.12 From e243555515373bf613ac0829ef986b0ba5da1e59 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 23 Dec 2023 20:22:02 +0000 Subject: Rename linux-with-tcl87-build.yml -> linux-with-tcl8-build.yml --- .github/workflows/linux-with-tcl8-build.yml | 178 +++++++++++++++++++++++++++ .github/workflows/linux-with-tcl87-build.yml | 178 --------------------------- 2 files changed, 178 insertions(+), 178 deletions(-) create mode 100644 .github/workflows/linux-with-tcl8-build.yml delete mode 100644 .github/workflows/linux-with-tcl87-build.yml diff --git a/.github/workflows/linux-with-tcl8-build.yml b/.github/workflows/linux-with-tcl8-build.yml new file mode 100644 index 0000000..557b0e9 --- /dev/null +++ b/.github/workflows/linux-with-tcl8-build.yml @@ -0,0 +1,178 @@ +name: Linux (with Tcl 8.7) +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-shared" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + 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 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + timeout-minutes: 15 diff --git a/.github/workflows/linux-with-tcl87-build.yml b/.github/workflows/linux-with-tcl87-build.yml deleted file mode 100644 index 557b0e9..0000000 --- a/.github/workflows/linux-with-tcl87-build.yml +++ /dev/null @@ -1,178 +0,0 @@ -name: Linux (with Tcl 8.7) -on: - push: - branches: - - "main" - - "core-8-branch" - - "core-8-6-branch" - tags: - - "core-**" -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: core-8-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - test: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--disable-xft" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: core-8-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - 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 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - timeout-minutes: 15 -- cgit v0.12 From 1c2e80197e9d307739aa5760770364927b90533a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 26 Dec 2023 14:38:45 +0000 Subject: [da23032e6a]: Update documentation --- doc/ttk_combobox.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n index fdc51af..20688f1 100644 --- a/doc/ttk_combobox.n +++ b/doc/ttk_combobox.n @@ -69,7 +69,7 @@ the last element of the list, moreover the same simple interpretation as for the command \fBstring index\fR is supported, with simple integer index arithmetic and indexing relative to \fBend\fR). Otherwise, returns the index of the current value in the list of -\fB\-values\fR or \fB\-1\fR if the current value does not appear in the list. +\fB\-values\fR or \fB\{}\fR if the current value does not appear in the list. .TP \fIpathName \fBget\fR Returns the current value of the combobox. -- cgit v0.12 From ff9382175f54cad6bc383522854f745ab2950167 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Dec 2023 17:06:56 +0000 Subject: Ticket [0de707ab06]: Add explanation of the solution provided on the core list by Jan --- unix/tkAppInit.c | 18 ++++++++++++++++++ win/winMain.c | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index 5252972..5b6e14e 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -12,6 +12,24 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +/* + * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list: + * What's going on is related to TIP #596: + * Stubs support for Embedding Tcl in other applications + * + * If an application using Tcl_Main() is compiled with USE_TCL_STUBS, + * Tcl_Main() will be replaced by a stub function, which loads + * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If + * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens. + * + * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS + * (unless you want to use the TIP #596 functionality) + * + * The proper solution is to make sure that Makefile.in doesn't use + * TCL_USE_STUBS when compiling tkAppInit.c. But that's a + * quite big re-organization just before a b1 release. Simpler + * is just to #undef'ine USE_TCL_STUBS, it has the same effect. + */ #undef USE_TCL_STUBS #undef BUILD_tk #undef STATIC_BUILD diff --git a/win/winMain.c b/win/winMain.c index b93e11e..7f4ab28 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -12,6 +12,24 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +/* + * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list: + * What's going on is related to TIP #596: + * Stubs support for Embedding Tcl in other applications + * + * If an application using Tcl_Main() is compiled with USE_TCL_STUBS, + * Tcl_Main() will be replaced by a stub function, which loads + * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If + * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens. + * + * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS + * (unless you want to use the TIP #596 functionality) + * + * The proper solution is to make sure that Makefile.in doesn't use + * TCL_USE_STUBS when compiling tkAppInit.c. But that's a + * quite big re-organization just before a b1 release. Simpler + * is just to #undef'ine USE_TCL_STUBS, it has the same effect. + */ #undef USE_TCL_STUBS #include "tk.h" #define WIN32_LEAN_AND_MEAN -- cgit v0.12 From 71387c1400119ce45793a26cad3b8608313466d0 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Dec 2023 17:10:05 +0000 Subject: Fix TK_RELEASE_SERIAL for "b1" release --- generic/tk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tk.h b/generic/tk.h index eae1b22..4f72009 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -71,7 +71,7 @@ extern "C" { #if TK_MAJOR_VERSION == 9 # define TK_MINOR_VERSION 0 # define TK_RELEASE_LEVEL TCL_BETA_RELEASE -# define TK_RELEASE_SERIAL 0 +# define TK_RELEASE_SERIAL 1 # define TK_VERSION "9.0" # define TK_PATCH_LEVEL "9.0b1" -- cgit v0.12 From da7712e01dd3015c76d14476108c721c2eecce71 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Dec 2023 17:11:36 +0000 Subject: Make sure that the zip-file is attached to tcl9tk90.dll for non-static builds too --- win/makefile.vc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index a5347b1..e56f2a8 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -108,7 +108,7 @@ USING_PRE87_TCL = 1 # Extra makefile options processing for non-standard OPTS values ... !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] TTK_SQUARE_WIDGET = 0 -TK_EMBED_SCRIPTS = $(STATIC_BUILD) +TK_EMBED_SCRIPTS = 1 !else !if [nmakehlp -f "$(OPTS)" "square"] !message *** Include ttk square demo widget @@ -121,7 +121,7 @@ TTK_SQUARE_WIDGET = 0 TK_EMBED_SCRIPTS = 0 !else !message *** Tk script library will be appended to the binary. -TK_EMBED_SCRIPTS = $(STATIC_BUILD) +TK_EMBED_SCRIPTS = 1 !endif !endif @@ -375,9 +375,6 @@ libtkzip: setup $(TKSCRIPTZIP) embed: setup $(WISH) $(WISHSCRIPTZIP) @copy /y /b "$(WISH)"+"$(WISHSCRIPTZIP)" "$(WISH)" !else -# Note this is currently dead code as TK_EMBED_SCRIPTS is always 0 -# for non-static builds as the C code does not currently setup up -# a VFS for a non-static wish. embed: setup $(TKLIB) $(TKSCRIPTZIP) @copy /y /b "$(TKLIB)"+"$(TKSCRIPTZIP)" "$(TKLIB)" !endif -- cgit v0.12 From a1254f9ff3e5391b3e23db3abc00dca7275a9134 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 2 Jan 2024 14:46:17 +0000 Subject: unneeded "if" statement --- library/tearoff.tcl | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 63d4f43..7b2ed66 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -79,11 +79,11 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} { } if {[tk windowingsystem] eq "win32"} { - # [Bug 3181181]: Find the toplevel window for the menu - set parent [winfo toplevel $parent] - while {[winfo class $parent] eq "Menu"} { - set parent [winfo toplevel [winfo parent $parent]] - } + # [Bug 3181181]: Find the toplevel window for the menu + set parent [winfo toplevel $parent] + while {[winfo class $parent] eq "Menu"} { + set parent [winfo toplevel [winfo parent $parent]] + } wm transient $menu [winfo toplevel $parent] wm attributes $menu -toolwindow 1 } @@ -138,14 +138,12 @@ proc ::tk::MenuDup {src dst type} { # Copy the meny entries, if any set last [$src index last] - if {$last >= 0} { - for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { - set cmd [list $dst add [$src type $i] [$src id $i]] - foreach option [$src entryconfigure $i] { - lappend cmd [lindex $option 0] [lindex $option 4] - } - eval $cmd + for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { + set cmd [list $dst add [$src type $i] [$src id $i]] + foreach option [$src entryconfigure $i] { + lappend cmd [lindex $option 0] [lindex $option 4] } + eval $cmd } # Duplicate the binding tags from the source menu, replacing src with dst -- cgit v0.12 From edd040192036bb59eca585f279d6261ef9b0065a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Jan 2024 08:57:39 +0000 Subject: Starting with Tcl 9.0, lower-case package-names are recommended --- library/demos/anilabel.tcl | 2 +- library/demos/aniwave.tcl | 2 +- library/demos/arrow.tcl | 2 +- library/demos/bind.tcl | 2 +- library/demos/bitmap.tcl | 2 +- library/demos/browse | 2 +- library/demos/button.tcl | 2 +- library/demos/check.tcl | 2 +- library/demos/clrpick.tcl | 2 +- library/demos/colors.tcl | 2 +- library/demos/combo.tcl | 2 +- library/demos/cscroll.tcl | 2 +- library/demos/ctext.tcl | 2 +- library/demos/entry1.tcl | 2 +- library/demos/entry2.tcl | 2 +- library/demos/entry3.tcl | 2 +- library/demos/filebox.tcl | 2 +- library/demos/floor.tcl | 2 +- library/demos/fontchoose.tcl | 2 +- library/demos/form.tcl | 2 +- library/demos/goldberg.tcl | 2 +- library/demos/hello | 2 +- library/demos/hscale.tcl | 2 +- library/demos/icon.tcl | 2 +- library/demos/image1.tcl | 2 +- library/demos/image2.tcl | 2 +- library/demos/items.tcl | 2 +- library/demos/ixset | 2 +- library/demos/knightstour.tcl | 2 +- library/demos/label.tcl | 2 +- library/demos/labelframe.tcl | 2 +- library/demos/mac_styles.tcl | 4 +--- library/demos/mac_tabs.tcl | 3 +-- library/demos/mac_wm.tcl | 3 +-- library/demos/mclist.tcl | 2 +- library/demos/menu.tcl | 2 +- library/demos/menubu.tcl | 2 +- library/demos/msgbox.tcl | 2 +- library/demos/paned1.tcl | 2 +- library/demos/paned2.tcl | 2 +- library/demos/pendulum.tcl | 2 +- library/demos/plot.tcl | 2 +- library/demos/puzzle.tcl | 2 +- library/demos/radio.tcl | 2 +- library/demos/rmt | 2 +- library/demos/rolodex | 2 +- library/demos/ruler.tcl | 2 +- library/demos/sayings.tcl | 2 +- library/demos/search.tcl | 2 +- library/demos/spin.tcl | 2 +- library/demos/states.tcl | 2 +- library/demos/style.tcl | 2 +- library/demos/tcolor | 2 +- library/demos/text.tcl | 2 +- library/demos/textpeer.tcl | 2 +- library/demos/timer | 2 +- library/demos/toolbar.tcl | 2 +- library/demos/tree.tcl | 2 +- library/demos/ttkbut.tcl | 2 +- library/demos/ttkmenu.tcl | 2 +- library/demos/ttknote.tcl | 2 +- library/demos/ttkpane.tcl | 2 +- library/demos/ttkprogress.tcl | 2 +- library/demos/ttkscale.tcl | 2 +- library/demos/twind.tcl | 2 +- library/demos/unicodeout.tcl | 2 +- library/demos/vscale.tcl | 2 +- library/demos/widget | 2 +- 68 files changed, 68 insertions(+), 72 deletions(-) diff --git a/library/demos/anilabel.tcl b/library/demos/anilabel.tcl index be1b402..6662f9a 100644 --- a/library/demos/anilabel.tcl +++ b/library/demos/anilabel.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .anilabel catch {destroy $w} diff --git a/library/demos/aniwave.tcl b/library/demos/aniwave.tcl index 1f7e8f3..50de429 100644 --- a/library/demos/aniwave.tcl +++ b/library/demos/aniwave.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .aniwave catch {destroy $w} diff --git a/library/demos/arrow.tcl b/library/demos/arrow.tcl index 5674be9..e30406b 100644 --- a/library/demos/arrow.tcl +++ b/library/demos/arrow.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # scl -- # Scales an integer according to the display's current scaling percentage. diff --git a/library/demos/bind.tcl b/library/demos/bind.tcl index 8b56639..179310a 100644 --- a/library/demos/bind.tcl +++ b/library/demos/bind.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .bind catch {destroy $w} diff --git a/library/demos/bitmap.tcl b/library/demos/bitmap.tcl index 453987d..2787efa 100644 --- a/library/demos/bitmap.tcl +++ b/library/demos/bitmap.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # bitmapRow -- # Create a row of bitmap items in a window. diff --git a/library/demos/browse b/library/demos/browse index d107f28..e401034 100644 --- a/library/demos/browse +++ b/library/demos/browse @@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"} # directory and allows you to open files or subdirectories by # double-clicking. -package require Tk +package require tk # Create a scrollbar on the right side of the main window and a listbox # on the left side. diff --git a/library/demos/button.tcl b/library/demos/button.tcl index 0169c2a..d7cd4ce 100644 --- a/library/demos/button.tcl +++ b/library/demos/button.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .button catch {destroy $w} diff --git a/library/demos/check.tcl b/library/demos/check.tcl index 96ff251..2623618 100644 --- a/library/demos/check.tcl +++ b/library/demos/check.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .check catch {destroy $w} diff --git a/library/demos/clrpick.tcl b/library/demos/clrpick.tcl index ba50b75..7322bcf 100644 --- a/library/demos/clrpick.tcl +++ b/library/demos/clrpick.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .clrpick catch {destroy $w} diff --git a/library/demos/colors.tcl b/library/demos/colors.tcl index f1f931d..3a79cb1 100644 --- a/library/demos/colors.tcl +++ b/library/demos/colors.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .colors catch {destroy $w} diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl index 53e5a27..7f33fa9 100644 --- a/library/demos/combo.tcl +++ b/library/demos/combo.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .combo catch {destroy $w} diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl index ed21310..e209a63 100644 --- a/library/demos/cscroll.tcl +++ b/library/demos/cscroll.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .cscroll catch {destroy $w} diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl index 6874226..0fbb450 100644 --- a/library/demos/ctext.tcl +++ b/library/demos/ctext.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ctext catch {destroy $w} diff --git a/library/demos/entry1.tcl b/library/demos/entry1.tcl index f41c2ab..f6b087e 100644 --- a/library/demos/entry1.tcl +++ b/library/demos/entry1.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .entry1 catch {destroy $w} diff --git a/library/demos/entry2.tcl b/library/demos/entry2.tcl index ac82c6a..7f15ee1 100644 --- a/library/demos/entry2.tcl +++ b/library/demos/entry2.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .entry2 catch {destroy $w} diff --git a/library/demos/entry3.tcl b/library/demos/entry3.tcl index f229de6..f6c2e8c 100644 --- a/library/demos/entry3.tcl +++ b/library/demos/entry3.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .entry3 catch {destroy $w} diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl index a8f5c32..06dacc8 100644 --- a/library/demos/filebox.tcl +++ b/library/demos/filebox.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .filebox catch {destroy $w} diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl index 81920ed..9632a44 100644 --- a/library/demos/floor.tcl +++ b/library/demos/floor.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # floorDisplay -- # Recreate the floorplan display in the canvas given by "w". The diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl index 4353a4d..de9e854 100644 --- a/library/demos/fontchoose.tcl +++ b/library/demos/fontchoose.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .fontchoose catch {destroy $w} diff --git a/library/demos/form.tcl b/library/demos/form.tcl index 4d80437..f0f3109 100644 --- a/library/demos/form.tcl +++ b/library/demos/form.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .form catch {destroy $w} diff --git a/library/demos/goldberg.tcl b/library/demos/goldberg.tcl index 860d03c..5a5b462 100644 --- a/library/demos/goldberg.tcl +++ b/library/demos/goldberg.tcl @@ -40,7 +40,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .goldberg catch {destroy $w} diff --git a/library/demos/hello b/library/demos/hello index d10b8d5..d5e733d 100644 --- a/library/demos/hello +++ b/library/demos/hello @@ -6,7 +6,7 @@ exec wish "$0" ${1+"$@"} # Simple Tk script to create a button that prints "Hello, world". # Click on the button to terminate the program. -package require Tk +package require tk # The first line below creates the button, and the second line # asks the packer to shrink-wrap the application's main window diff --git a/library/demos/hscale.tcl b/library/demos/hscale.tcl index 26745bc..777b195 100644 --- a/library/demos/hscale.tcl +++ b/library/demos/hscale.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .hscale catch {destroy $w} diff --git a/library/demos/icon.tcl b/library/demos/icon.tcl index c8c1e18..14e1c0b 100644 --- a/library/demos/icon.tcl +++ b/library/demos/icon.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .icon catch {destroy $w} diff --git a/library/demos/image1.tcl b/library/demos/image1.tcl index c174a92..1e67e24 100644 --- a/library/demos/image1.tcl +++ b/library/demos/image1.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .image1 catch {destroy $w} diff --git a/library/demos/image2.tcl b/library/demos/image2.tcl index 9691b87..f3aab60 100644 --- a/library/demos/image2.tcl +++ b/library/demos/image2.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # loadDir -- # This procedure reloads the directory listbox from the directory diff --git a/library/demos/items.tcl b/library/demos/items.tcl index 335971b..70afcee 100644 --- a/library/demos/items.tcl +++ b/library/demos/items.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .items catch {destroy $w} diff --git a/library/demos/ixset b/library/demos/ixset index 3457ed7..11ec531 100644 --- a/library/demos/ixset +++ b/library/demos/ixset @@ -9,7 +9,7 @@ exec wish8.7 "$0" ${1+"$@"} # 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design # 92/08/01 : pda@masi.ibp.fr : cleaning -package require Tk +package require tk # # Button actions diff --git a/library/demos/knightstour.tcl b/library/demos/knightstour.tcl index 8367477..76b6a4f 100644 --- a/library/demos/knightstour.tcl +++ b/library/demos/knightstour.tcl @@ -21,7 +21,7 @@ # If you let it repeat then it will choose random start positions # for each new tour. -package require Tk +package require tk # Return a list of accessible squares from a given square proc ValidMoves {square} { diff --git a/library/demos/label.tcl b/library/demos/label.tcl index d2823e1..0644de8 100644 --- a/library/demos/label.tcl +++ b/library/demos/label.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .label catch {destroy $w} diff --git a/library/demos/labelframe.tcl b/library/demos/labelframe.tcl index b40bd54..08e8a23 100644 --- a/library/demos/labelframe.tcl +++ b/library/demos/labelframe.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .labelframe catch {destroy $w} diff --git a/library/demos/mac_styles.tcl b/library/demos/mac_styles.tcl index 33fa888..3fff03c 100644 --- a/library/demos/mac_styles.tcl +++ b/library/demos/mac_styles.tcl @@ -8,12 +8,10 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk - set w .mac_styles catch {destroy $w} toplevel $w -package require Tk +package require tk wm title $w "Tk Aqua Widgets" wm iconname $w "mac_styles" positionWindow $w diff --git a/library/demos/mac_tabs.tcl b/library/demos/mac_tabs.tcl index 16771a8..fea9b03 100644 --- a/library/demos/mac_tabs.tcl +++ b/library/demos/mac_tabs.tcl @@ -8,12 +8,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk catch {font create giant -family {Times New Roman} -size 64} set w .mac_tabs catch {destroy $w} toplevel $w -package require Tk wm title $w "Tabbed Windows in Aqua" wm iconname $w "mac_tabs" positionWindow $w diff --git a/library/demos/mac_wm.tcl b/library/demos/mac_wm.tcl index 3272623..105c12c 100644 --- a/library/demos/mac_wm.tcl +++ b/library/demos/mac_wm.tcl @@ -8,12 +8,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .mac_wm catch {destroy $w} toplevel $w -package require Tk wm title $w "Tk Aqua Window Styles" wm iconname $w "mac_wm" positionWindow $w diff --git a/library/demos/mclist.tcl b/library/demos/mclist.tcl index 086fbf5..a60a00f 100644 --- a/library/demos/mclist.tcl +++ b/library/demos/mclist.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .mclist catch {destroy $w} diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl index d43a374..2a8ad1c 100644 --- a/library/demos/menu.tcl +++ b/library/demos/menu.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .menu catch {destroy $w} diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl index cb52f43..a45fe84 100644 --- a/library/demos/menubu.tcl +++ b/library/demos/menubu.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .menubu catch {destroy $w} diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl index 6f34e16..1c9a319 100644 --- a/library/demos/msgbox.tcl +++ b/library/demos/msgbox.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .msgbox catch {destroy $w} diff --git a/library/demos/paned1.tcl b/library/demos/paned1.tcl index 829988a..8e2568b 100644 --- a/library/demos/paned1.tcl +++ b/library/demos/paned1.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .paned1 catch {destroy $w} diff --git a/library/demos/paned2.tcl b/library/demos/paned2.tcl index 73af21d..feb0254 100644 --- a/library/demos/paned2.tcl +++ b/library/demos/paned2.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .paned2 catch {destroy $w} diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl index d76a1ec..060c070 100644 --- a/library/demos/pendulum.tcl +++ b/library/demos/pendulum.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .pendulum catch {destroy $w} diff --git a/library/demos/plot.tcl b/library/demos/plot.tcl index 5df318b..32bc2d5 100644 --- a/library/demos/plot.tcl +++ b/library/demos/plot.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .plot catch {destroy $w} diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl index 30c0562..aab5744 100644 --- a/library/demos/puzzle.tcl +++ b/library/demos/puzzle.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # puzzleSwitch -- # This procedure is invoked when the user clicks on a particular button; diff --git a/library/demos/radio.tcl b/library/demos/radio.tcl index 41f8db2..c6f5135 100644 --- a/library/demos/radio.tcl +++ b/library/demos/radio.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .radio catch {destroy $w} diff --git a/library/demos/rmt b/library/demos/rmt index 00bdc9d..21c6ca0 100644 --- a/library/demos/rmt +++ b/library/demos/rmt @@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"} # Tk applications. It allows you to select an application and # then type commands to that application. -package require Tk +package require tk wm title . "Tk Remote Controller" wm iconname . "Tk Remote" diff --git a/library/demos/rolodex b/library/demos/rolodex index abbf028..d528cb5 100644 --- a/library/demos/rolodex +++ b/library/demos/rolodex @@ -8,7 +8,7 @@ exec wish8.7 "$0" ${1+"$@"} # feel of a rolodex program, although it's lifeless and doesn't # actually do the rolodex application. -package require Tk +package require tk foreach i [winfo child .] { catch {destroy $i} diff --git a/library/demos/ruler.tcl b/library/demos/ruler.tcl index 0b78370..761892e 100644 --- a/library/demos/ruler.tcl +++ b/library/demos/ruler.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # rulerMkTab -- # This procedure creates a new triangular polygon in a canvas to diff --git a/library/demos/sayings.tcl b/library/demos/sayings.tcl index 3458016..b7be791 100644 --- a/library/demos/sayings.tcl +++ b/library/demos/sayings.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .sayings catch {destroy $w} diff --git a/library/demos/search.tcl b/library/demos/search.tcl index b4beb28..f4913f8 100644 --- a/library/demos/search.tcl +++ b/library/demos/search.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # textLoadFile -- # This procedure below loads a file into a text widget, discarding diff --git a/library/demos/spin.tcl b/library/demos/spin.tcl index b08ed16..203850d 100644 --- a/library/demos/spin.tcl +++ b/library/demos/spin.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .spin catch {destroy $w} diff --git a/library/demos/states.tcl b/library/demos/states.tcl index e2acd80..4e14fd5 100644 --- a/library/demos/states.tcl +++ b/library/demos/states.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .states catch {destroy $w} diff --git a/library/demos/style.tcl b/library/demos/style.tcl index a529a03..a32f3a6 100644 --- a/library/demos/style.tcl +++ b/library/demos/style.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .style catch {destroy $w} diff --git a/library/demos/tcolor b/library/demos/tcolor index 0aa133b..b349c5b 100644 --- a/library/demos/tcolor +++ b/library/demos/tcolor @@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"} # create colors using either the RGB, HSB, or CYM color spaces # and apply the color to existing applications. -package require Tk +package require tk wm title . "Color Editor" # Global variables that control the program: diff --git a/library/demos/text.tcl b/library/demos/text.tcl index 2736b88..130a4a5 100644 --- a/library/demos/text.tcl +++ b/library/demos/text.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .text catch {destroy $w} diff --git a/library/demos/textpeer.tcl b/library/demos/textpeer.tcl index 83e8e14..7dd55a7 100644 --- a/library/demos/textpeer.tcl +++ b/library/demos/textpeer.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .textpeer catch {destroy $w} diff --git a/library/demos/timer b/library/demos/timer index 6b61ca4..2d96ec4 100644 --- a/library/demos/timer +++ b/library/demos/timer @@ -5,7 +5,7 @@ exec wish "$0" ${1+"$@"} # timer -- # This script generates a counter with start and stop buttons. -package require Tk +package require tk label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m button .start -text Start -command { diff --git a/library/demos/toolbar.tcl b/library/demos/toolbar.tcl index c8248e3..50d4e49 100644 --- a/library/demos/toolbar.tcl +++ b/library/demos/toolbar.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .toolbar destroy $w diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl index 1cc70f8..fe06ce1 100644 --- a/library/demos/tree.tcl +++ b/library/demos/tree.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .tree catch {destroy $w} diff --git a/library/demos/ttkbut.tcl b/library/demos/ttkbut.tcl index 86e4382..f567790 100644 --- a/library/demos/ttkbut.tcl +++ b/library/demos/ttkbut.tcl @@ -8,7 +8,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ttkbut catch {destroy $w} diff --git a/library/demos/ttkmenu.tcl b/library/demos/ttkmenu.tcl index aad5aa0..35cf935 100644 --- a/library/demos/ttkmenu.tcl +++ b/library/demos/ttkmenu.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ttkmenu catch {destroy $w} diff --git a/library/demos/ttknote.tcl b/library/demos/ttknote.tcl index 5e5551d..d1d15f9 100644 --- a/library/demos/ttknote.tcl +++ b/library/demos/ttknote.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ttknote catch {destroy $w} diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl index bae8716..749f940 100644 --- a/library/demos/ttkpane.tcl +++ b/library/demos/ttkpane.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ttkpane catch {destroy $w} diff --git a/library/demos/ttkprogress.tcl b/library/demos/ttkprogress.tcl index e5d0e22..6e5068e 100644 --- a/library/demos/ttkprogress.tcl +++ b/library/demos/ttkprogress.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ttkprogress catch {destroy $w} diff --git a/library/demos/ttkscale.tcl b/library/demos/ttkscale.tcl index e08d9b2..6aeb11c 100644 --- a/library/demos/ttkscale.tcl +++ b/library/demos/ttkscale.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .ttkscale catch {destroy $w} diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl index 5268fdf..b974456 100644 --- a/library/demos/twind.tcl +++ b/library/demos/twind.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk # Make an Aqua button's fill color match its parent's background proc blend {bt} { diff --git a/library/demos/unicodeout.tcl b/library/demos/unicodeout.tcl index 1ecc064..0f3dc2d 100644 --- a/library/demos/unicodeout.tcl +++ b/library/demos/unicodeout.tcl @@ -7,7 +7,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .unicodeout catch {destroy $w} diff --git a/library/demos/vscale.tcl b/library/demos/vscale.tcl index 3a041a6..f1529c0 100644 --- a/library/demos/vscale.tcl +++ b/library/demos/vscale.tcl @@ -6,7 +6,7 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require Tk +package require tk set w .vscale catch {destroy $w} diff --git a/library/demos/widget b/library/demos/widget index d931b89..b6811d8 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"} # separate ".tcl" files is this directory, which are sourced by this script as # needed. -package require Tk 8.6- +package require tk package require msgcat eval destroy [winfo child .] -- cgit v0.12 From 75035addb25fecd579fe5170ef0355717d505d71 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Jan 2024 15:34:26 +0000 Subject: Remove test constraints which are not necessary any more in Tk 9.0 --- tests/bind.test | 4 ++-- tests/button.test | 6 +++--- tests/config.test | 10 +++++----- tests/constraints.tcl | 18 ++++-------------- tests/panedwindow.test | 2 +- 5 files changed, 15 insertions(+), 25 deletions(-) diff --git a/tests/bind.test b/tests/bind.test index 61c0f50..3af1880 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -2225,7 +2225,7 @@ test bind-16.46 {ExpandPercents procedure} -setup { bind all $savedBind(All) unset savedBind } -result {0 1 2} -test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87} -setup { +test bind-16.47 {ExpandPercents procedure} -constraints aquaOrWin32 -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f focus -force .t.f @@ -6059,7 +6059,7 @@ test bind-28.14 {keysym names, Emoji} -body { } -cleanup { destroy .t.f } -result "" -test bind-28.15 {keysym names, Emoji} -constraints needsTcl87 -body { +test bind-28.15 {keysym names, Emoji} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <👍> foo bind .t.f diff --git a/tests/button.test b/tests/button.test index 5913945..9e0055e 100644 --- a/tests/button.test +++ b/tests/button.test @@ -1744,7 +1744,7 @@ test button-1.177 {configuration option: "overrelief" for button} -setup { } -cleanup { destroy .b } -result {} -test button-1.178 {configuration option: "overrelief" for button} -constraints needsTcl87 -setup { +test button-1.178 {configuration option: "overrelief" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b update @@ -1763,7 +1763,7 @@ test button-1.179 {configuration option: "overrelief" for checkbutton} -setup { } -cleanup { destroy .c } -result {} -test button-1.180 {configuration option: "overrelief" for checkbutton} -constraints needsTcl87 -setup { +test button-1.180 {configuration option: "overrelief" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c update @@ -1782,7 +1782,7 @@ test button-1.181 {configuration option: "overrelief" for radiobutton} -setup { } -cleanup { destroy .r } -result {} -test button-1.182 {configuration option: "overrelief" for radiobutton} -constraints needsTcl87 -setup { +test button-1.182 {configuration option: "overrelief" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r update diff --git a/tests/config.test b/tests/config.test index a128aa2..352d43f 100644 --- a/tests/config.test +++ b/tests/config.test @@ -458,14 +458,14 @@ test config-4.28 {DoObjConfig - string table} -constraints testobjconfig -body { killTables } -returnCodes ok test config-4.29 {DoObjConfig - invalid string table} -constraints { - testobjconfig needsTcl87 + testobjconfig } -body { testobjconfig alltypes .foo -stringtable foo } -cleanup { killTables } -returnCodes error -result {bad stringtable "foo": must be one, two, three, four, or ""} test config-4.29a {DoObjConfig - invalid string table} -constraints { - testobjconfig needsTcl87 + testobjconfig } -body { testobjconfig alltypes .foo -stringtable2 foo } -cleanup { @@ -780,7 +780,7 @@ test config-4.70 {DoObjConfig - relief} -constraints testobjconfig -body { killTables } -returnCodes ok -result flat test config-4.71 {DoObjConfig - invalid relief} -constraints { - testobjconfig needsTcl87 + testobjconfig } -body { testobjconfig alltypes .foo -relief foo } -cleanup { @@ -874,7 +874,7 @@ test config-4.84 {DoObjConfig - justify} -constraints testobjconfig -body { } -cleanup { killTables } -returnCodes ok -result center -test config-4.85 {DoObjConfig - invalid justify} -constraints {testobjconfig needsTcl87} -body { +test config-4.85 {DoObjConfig - invalid justify} -constraints testobjconfig -body { testobjconfig alltypes .foo -justify foo } -cleanup { killTables @@ -916,7 +916,7 @@ test config-4.90 {DoObjConfig - anchor} -constraints testobjconfig -body { } -returnCodes ok -result center test config-4.91 {DoObjConfig - invalid anchor} -constraints testobjconfig -body { testobjconfig alltypes .foo -anchor foo -} -constraints needsTcl87 -cleanup { +} -cleanup { killTables } -returnCodes error -result {bad anchor "foo": must be n, ne, e, se, s, sw, w, nw, center, or ""} test config-4.92 {DoObjConfig - new anchor} -constraints testobjconfig -body { diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 3f8c897..8cc1a18 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -189,13 +189,8 @@ namespace eval tk { # It takes care of the following timing details of pointer warping: # # a. Allow pointer warping to happen if it was scheduled for execution at - # idle time. - # - In Tk releases 8.6 and older, pointer warping is scheduled for - # execution at idle time - # - In release 8.7 and newer this happens synchronously if $w refers to the - # whole screen or if the -when option to [event generate] is "now". - # The namespace variable idle_pointer_warping records which of these is - # the case. + # idle time. This happens synchronously if $w refers to the + # whole screen or if the -when option to [event generate] is "now". # # b. Work around a race condition associated with OS notification of # mouse motion on Windows. @@ -238,12 +233,8 @@ namespace eval tk { # to [event generate $w] is not "now", and $w refers to a Tk window, i.e. not # the whole screen. # - variable idle_pointer_warping [expr {![package vsatisfies [package provide tk] 8.7-]}] proc controlPointerWarpTiming {{duration 50}} { - variable idle_pointer_warping - if {$idle_pointer_warping} { - update idletasks ;# see a. above - } + update idletasks ;# see a. above if {[tk windowingsystem] eq "win32"} { after $duration ;# see b. above } @@ -273,8 +264,7 @@ testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)] testConstraint noExceed [expr { ![testConstraint unix] || [catch {font actual "\{xyz"}] }] -testConstraint deprecated [expr {![package vsatisfies [package provide Tcl] 8.7-] || ![::tk::build-info no-deprecate]}] -testConstraint needsTcl87 [package vsatisfies [package provide Tcl] 8.7-] +testConstraint deprecated [expr {![::tk::build-info no-deprecate]}] # constraint for running a test on all windowing system except aqua # where the test fails due to a known bug diff --git a/tests/panedwindow.test b/tests/panedwindow.test index e302b5d..ebae5f5 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -122,7 +122,7 @@ test panedwindow-1.23 {configuration options: -proxyrelief (good)} -body { } -cleanup { .p configure -proxyrelief [lindex [.p configure -proxyrelief] 3] } -result {groove groove} -test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -constraints needsTcl87 -body { +test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -body { .p configure -proxyrelief 1.5 } -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test panedwindow-1.25 {configuration options: -relief (good)} -body { -- cgit v0.12 From 83b61ebd6b046f2806aa6c1dfa37d392259e65fb Mon Sep 17 00:00:00 2001 From: csaba Date: Tue, 9 Jan 2024 19:36:42 +0000 Subject: Scrolling-related improvements in the documentation. --- doc/canvas.n | 3 ++- doc/listbox.n | 3 ++- doc/scrollbar.n | 4 ++-- doc/ttk_widget.n | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/canvas.n b/doc/canvas.n index 95f073c..cda7706 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -1189,7 +1189,8 @@ area is off-screen to the top. . This command adjusts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. -\fINumber\fR must be an integer. +\fINumber\fR must be an integer or a float, but if it is a float then +it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR. If \fIwhat\fR is \fBpages\fR then the view adjusts in units of nine-tenths the window's height. diff --git a/doc/listbox.n b/doc/listbox.n index fa24ec7..a047be6 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -435,7 +435,8 @@ way through the listbox, and so on. . This command adjusts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. -\fINumber\fR must be an integer. +\fINumber\fR must be an integer or a float, but if it is a float then +it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 838dac1..fee959d 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -203,7 +203,7 @@ generated from the scrollbar's \fB\-command\fR option. The command may take any of the following forms. In each case, \fIprefix\fR is the contents of the \fB\-command\fR option, which usually has a form like -.QW \fB.t yview\fR . +.QW "\fB.t yview\fR" . .TP \fIprefix \fBmoveto \fIfraction\fR . @@ -223,7 +223,7 @@ it is slightly less than what fits in the window, so that there is a slight overlap between the old and new views. \fINumber\fR is either 1, which means the next page should become visible, or \-1, which means that the previous page should -become visible. Fractional number are rounded away from 0, so +become visible. Fractional numbers are rounded away from 0, so scrolling 0.001 pages has the same effect as scrolling 1 page. .TP \fIprefix \fBscroll \fInumber \fBunits\fR diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index 635c782..7605260 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -298,7 +298,8 @@ way through the content appears at the top edge of the window. \fIpathName \fByview scroll \fInumber what\fR This command shifts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. -\fINumber\fR must be an integer. +\fINumber\fR must be an integer or a float, but if it is a float then +it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR. '\" or an abbreviation of one of these, but we don't document that. If \fIwhat\fR is -- cgit v0.12 From c067d2e7e9449f983168980972ff1d67323281a0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 13 Jan 2024 09:00:55 +0000 Subject: Correct one missing -1 --> TCL_INDEX_NONE change in previous commit. --- generic/tkTextImage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 9bbb1fd..e759584 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -396,7 +396,7 @@ EmbImageConfigure( char buf[4 + TCL_INTEGER_SPACE]; snprintf(buf, sizeof(buf), "#%d", ++textPtr->sharedTextPtr->imageCount); Tcl_DStringSetLength(&newName, 0); - Tcl_DStringAppend(&newName, name, -1); + Tcl_DStringAppend(&newName, name, TCL_INDEX_NONE); Tcl_DStringAppend(&newName, buf, TCL_INDEX_NONE); name = Tcl_DStringValue(&newName); } -- cgit v0.12 From 938e168d69246657ad480f57d0f0a69852e23d8a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 14 Jan 2024 21:56:36 +0000 Subject: Remove tricky code, no longer necessary in 9.0 --- generic/tkTextIndex.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index d6710b8..e586282 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -48,14 +48,6 @@ static int IndexCountBytesOrdered(const TkText *textPtr, const TkTextIndex *indexPtr1, const TkTextIndex *indexPtr2); -#if defined(USE_TCL_STUBS) && (TCL_MAJOR_VERSION < 9) -# undef Tcl_UtfPrev -# define Tcl_UtfPrev (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ - ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[656])) \ - : ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[331]))) -#endif - - /* * The "textindex" Tcl_Obj definition: */ -- cgit v0.12 From 1869d717b143a3e9eeab3da4aa5157c724257679 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 14 Jan 2024 22:23:21 +0000 Subject: Those #define's are no longer necessary --- generic/tkInt.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/generic/tkInt.h b/generic/tkInt.h index 540b121..83e754e 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -939,18 +939,6 @@ typedef struct { #define TK_MAKE_MENU_POPUP 1 #define TK_MAKE_MENU_DROPDOWN 2 -/* See TIP #494 */ -#ifndef TCL_IO_FAILURE -# define TCL_IO_FAILURE (-1) -#endif -/* See TIP #537 */ -#ifndef TCL_INDEX_NONE -# define TCL_INDEX_NONE (-1) -#endif -#ifndef TCL_INDEX_END -# define TCL_INDEX_END ((Tcl_Size)-2) -#endif - /* * The following structure is used with TkMakeEnsemble to create ensemble * commands and optionally to create sub-ensembles. -- cgit v0.12 From 4a9a68b38deb944ff99314e2fe6f8aeb2d51293e Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 20 Jan 2024 09:45:57 +0000 Subject: Fix comments following [48598763]. --- generic/tkTextDisp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 03a5041..fde7715 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3428,13 +3428,13 @@ TkTextUpdateLineMetrics( void TkTextInvalidateLineMetrics( - TkSharedText *sharedTextPtr,/* Shared widget section for all peers, or - * NULL. */ - TkText *textPtr, /* Widget record for text widget. */ - TkTextLine *linePtr, /* Invalidation starts from this line. */ - int lineCount, /* And includes this many following lines. */ - TkTextInvalidateAction action) /* Indicates what type of invalidation - * occurred, TK_TEXT_INVALIDATE_(ONLY|INSERT|DELETE). */ + TkSharedText *sharedTextPtr, /* Shared widget section for all peers, or + * NULL. */ + TkText *textPtr, /* Widget record for text widget. */ + TkTextLine *linePtr, /* Invalidation starts from this line. */ + int lineCount, /* And includes this many following lines. */ + TkTextInvalidateAction action) /* Indicates what type of invalidation + * occurred, TK_TEXT_INVALIDATE_(ONLY|INSERT|DELETE). */ { if (sharedTextPtr == NULL) { TextInvalidateLineMetrics(textPtr, linePtr, lineCount, action); @@ -3449,11 +3449,11 @@ TkTextInvalidateLineMetrics( static void TextInvalidateLineMetrics( - TkText *textPtr, /* Widget record for text widget. */ - TkTextLine *linePtr, /* Invalidation starts from this line. */ - int lineCount, /* And includes this many following lines. */ - TkTextInvalidateAction action) /* Indicates what type of invalidation - * occurred (insert, delete, or simple). */ + TkText *textPtr, /* Widget record for text widget. */ + TkTextLine *linePtr, /* Invalidation starts from this line. */ + int lineCount, /* And includes this many following lines. */ + TkTextInvalidateAction action) /* Indicates what type of invalidation + * occurred, TK_TEXT_INVALIDATE_(ONLY|INSERT|DELETE). */ { int fromLine; TextDInfo *dInfoPtr = textPtr->dInfoPtr; -- cgit v0.12 From 210ff65d13820051a750cdaaa212c9bbd5a17f40 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 20 Jan 2024 09:57:29 +0000 Subject: Fix comments following [cd59cd0e]. --- generic/tkText.h | 4 ++-- generic/tkTextDisp.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/tkText.h b/generic/tkText.h index b16ada9..085db81 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -403,7 +403,7 @@ typedef struct TkTextTag { struct TkTextTabArray *tabArrayPtr; /* Info about tabs for tag (malloc-ed) or * NULL. Corresponds to tabString. */ - TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR * or TK_TEXT_TABSTYLE_NULL (if not specified). */ Tcl_Obj *underlinePtr; /* -underline option. NULL * means option not specified. */ @@ -686,7 +686,7 @@ typedef struct TkText { /* Information about tab stops (malloc'ed). * NULL means perform default tabbing * behavior. */ - TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ /* * Additional information used for displaying: diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index fde7715..4a4df6d 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -150,7 +150,7 @@ typedef struct StyleValues { int spacing3; /* Spacing below last dline in text line. */ TkTextTabArray *tabArrayPtr;/* Locations and types of tab stops (may be * NULL). */ - TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int underline; /* Non-zero means draw underline underneath * text. */ XColor *underlineColor; /* Foreground color for underline underneath @@ -1171,7 +1171,7 @@ LayoutDLine( * chunk. */ TkTextTabArray *tabArrayPtr;/* Tab stops for line; taken from style for * the first character on line. */ - TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int tabSize; /* Number of pixels consumed by current tab * stop. */ TkTextDispChunk *lastCharChunkPtr; @@ -8489,7 +8489,7 @@ static int SizeOfTab( TkText *textPtr, /* Information about the text widget as a * whole. */ - TkTextTabStyle tabStyle, /* One of TK_TEXT_TABSTYLE_TABULAR + TkTextTabStyle tabStyle, /* One of TK_TEXT_TABSTYLE_TABULAR * or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ TkTextTabArray *tabArrayPtr,/* Information about the tab stops that apply * to this line. NULL means use default -- cgit v0.12 From 6dd017f62501e845b16fa754d6bea15b227c6460 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 20 Jan 2024 10:02:30 +0000 Subject: Fix comments following [724fbd24]. --- generic/tkText.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tkText.h b/generic/tkText.h index 085db81..46d837d 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -116,7 +116,7 @@ typedef struct TkTextEmbWindow { * window. */ char *create; /* Script to create window on-demand. NULL * means no such script. Malloc-ed. */ - TkAlignMode align; /* How to align window in vertical space. See + TkAlignMode align; /* How to align window in vertical space. See * definitions in tkTextWind.c. */ int padX, padY; /* Padding to leave around each side of * window, in pixels. */ @@ -148,7 +148,7 @@ typedef struct TkTextEmbImage { * the image. */ Tk_Image image; /* Image for this segment. NULL means that the * image hasn't been created yet. */ - TkAlignMode align; /* How to align image in vertical space. See + TkAlignMode align; /* How to align image in vertical space. See * definitions in tkTextImage.c. */ int padX, padY; /* Padding to leave around each side of image, * in pixels. */ -- cgit v0.12 From 668c3b43a9c64988d3d62ba2b75798dae2d0ed46 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 20 Jan 2024 16:08:23 +0000 Subject: Resolve duplicate tests names (menu-40.1 and menu-40.2) by renumbering the tests added in [e2b00bfd]. --- tests/menu.test | 94 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/tests/menu.test b/tests/menu.test index 054ac68..df993d4 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -4128,7 +4128,40 @@ test menu-39.2 {use-after-free fix - bug 1797555fff} -setup { destroy .t } -result {} -test menu-40.1 {identifiers - auto generated} -setup { +test menu-40.1 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup { +} -constraints {pressbutton} -body { + set done false + event generate {} -x 100 -y 100 + toplevel .t + menu .t.m + .t.m add command -command {puts Marco} -label Marco + .t.m add command -command {puts Polo} -label Polo + after 1000 {.t.m post 500 500} + after 2000 {destroy .t} + after 2500 {pressbutton 530 510} + after 3000 {set done true} + tkwait variable done +} + +test menu-40.2 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup { +} -constraints {movemouse} -body { + set done false + event generate {} -x 100 -y 100 + toplevel .t + menu .t.m + .t.m add command -command {puts Marco} -label Marco + .t.m add command -command {puts Polo} -label Polo + after 1000 {.t.m post 500 500} + after 2000 {movemouse 530 510} + after 3000 {destroy .t} + after 3500 {movemouse 530 530} + after 4000 pressbutton 530 530 + after 4500 {set done true} + tkwait variable done + pressbutton 530 510 +} + +test menu-41.1 {identifiers - auto generated} -setup { destroy .m } -body { menu .m @@ -4136,7 +4169,7 @@ test menu-40.1 {identifiers - auto generated} -setup { } -cleanup { destroy .m } -result {e001 e002 e003} -test menu-40.2 {identifiers - out of sequence} -setup { +test menu-41.2 {identifiers - out of sequence} -setup { destroy .m } -body { menu .m -tearoff 0 @@ -4147,7 +4180,7 @@ test menu-40.2 {identifiers - out of sequence} -setup { } -cleanup { destroy .m } -result {1 0 2} -test menu-40.3 {identifiers - out of sequence with tearoff} -setup { +test menu-41.3 {identifiers - out of sequence with tearoff} -setup { destroy .m } -body { menu .m -tearoff 1 @@ -4158,7 +4191,7 @@ test menu-40.3 {identifiers - out of sequence with tearoff} -setup { } -cleanup { destroy .m } -result {2 1 3} -test menu-40.4 {identifiers - entry id} -setup { +test menu-41.4 {identifiers - entry id} -setup { destroy .m } -body { menu .m -tearoff 1 @@ -4169,7 +4202,7 @@ test menu-40.4 {identifiers - entry id} -setup { } -cleanup { destroy .m } -result {{} e002 e001 e003} -test menu-40.5 {identifiers - assigned} -setup { +test menu-41.5 {identifiers - assigned} -setup { destroy .m } -body { menu .m @@ -4177,7 +4210,7 @@ test menu-40.5 {identifiers - assigned} -setup { } -cleanup { destroy .m } -result {cmd1 cmd2 cmd3} -test menu-40.6 {identifiers - mixed} -setup { +test menu-41.6 {identifiers - mixed} -setup { destroy .m } -body { menu .m @@ -4185,7 +4218,7 @@ test menu-40.6 {identifiers - mixed} -setup { } -cleanup { destroy .m } -result {e001 cmd2 e002} -test menu-40.7 {identifiers - conflict} -setup { +test menu-41.7 {identifiers - conflict} -setup { destroy .m } -body { menu .m @@ -4193,7 +4226,7 @@ test menu-40.7 {identifiers - conflict} -setup { } -cleanup { destroy .m } -result {e002 e001 e003} -test menu-40.8 {identifiers - clone of complete menu} -setup { +test menu-41.8 {identifiers - clone of complete menu} -setup { destroy .m1 .m2 } -body { menu .m1 -tearoff 0 @@ -4205,7 +4238,7 @@ test menu-40.8 {identifiers - clone of complete menu} -setup { } -cleanup { destroy .m1 .m2 } -result {1 0 2} -test menu-40.9 {identifiers - modify after cloning} -setup { +test menu-41.9 {identifiers - modify after cloning} -setup { destroy .m1 .m2 } -body { menu .m1 -tearoff 0 @@ -4217,7 +4250,7 @@ test menu-40.9 {identifiers - modify after cloning} -setup { } -cleanup { destroy .m1 .m2 } -result {1 0 2} -test menu-40.10 {identifiers - modify clone} -setup { +test menu-41.10 {identifiers - modify clone} -setup { destroy .m1 .m2 } -body { menu .m1 -tearoff 0 @@ -4229,7 +4262,7 @@ test menu-40.10 {identifiers - modify clone} -setup { } -cleanup { destroy .m1 .m2 } -result {1 0 2} -test menu-40.11 {identifiers - entrycget by id} -setup { +test menu-41.11 {identifiers - entrycget by id} -setup { destroy .m } -body { menu .m @@ -4240,7 +4273,7 @@ test menu-40.11 {identifiers - entrycget by id} -setup { } -cleanup { destroy .m } -result {1 2 3} -test menu-40.12 {identifiers - delete by id} -setup { +test menu-41.12 {identifiers - delete by id} -setup { destroy .m } -body { menu .m @@ -4258,7 +4291,7 @@ test menu-40.12 {identifiers - delete by id} -setup { } -cleanup { destroy .m } -result {e001 e002 cmd9} -test menu-40.13 {identifiers - duplicate} -setup { +test menu-41.13 {identifiers - duplicate} -setup { destroy .m } -body { menu .m @@ -4268,7 +4301,7 @@ test menu-40.13 {identifiers - duplicate} -setup { } -cleanup { destroy .m } -returnCodes error -result {entry "foo" already exists} -test menu-40.14 {identifiers - reserved word} -setup { +test menu-41.14 {identifiers - reserved word} -setup { destroy .m } -body { menu .m -tearoff 0 @@ -4280,39 +4313,6 @@ test menu-40.14 {identifiers - reserved word} -setup { destroy .m } -result {2} -test menu-40.1 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup { -} -constraints {pressbutton} -body { - set done false - event generate {} -x 100 -y 100 - toplevel .t - menu .t.m - .t.m add command -command {puts Marco} -label Marco - .t.m add command -command {puts Polo} -label Polo - after 1000 {.t.m post 500 500} - after 2000 {destroy .t} - after 2500 {pressbutton 530 510} - after 3000 {set done true} - tkwait variable done -} - -test menu-40.2 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup { -} -constraints {movemouse} -body { - set done false - event generate {} -x 100 -y 100 - toplevel .t - menu .t.m - .t.m add command -command {puts Marco} -label Marco - .t.m add command -command {puts Polo} -label Polo - after 1000 {.t.m post 500 500} - after 2000 {movemouse 530 510} - after 3000 {destroy .t} - after 3500 {movemouse 530 530} - after 4000 pressbutton 530 530 - after 4500 {set done true} - tkwait variable done - pressbutton 530 510 -} - # cleanup imageFinish deleteWindows -- cgit v0.12 From 81ac88e72f468bd35eb1eb30d6947b6feb0af48d Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 21 Jan 2024 00:00:49 +0000 Subject: Many small tweaks to docs The main one is I've added a comment in to make primary subcommands ("methods") more obvious when editing. --- doc/bind.n | 4 +- doc/bitmap.n | 6 +- doc/busy.n | 15 +++-- doc/button.n | 12 +++- doc/canvas.n | 57 +++++++++++++++---- doc/checkbutton.n | 16 +++++- doc/chooseColor.n | 6 +- doc/chooseDirectory.n | 12 ++-- doc/clipboard.n | 9 ++- doc/console.n | 16 +++++- doc/entry.n | 37 ++++++++++-- doc/event.n | 55 +++++++++++++++++- doc/focus.n | 9 ++- doc/font.n | 11 +++- doc/fontchooser.n | 3 + doc/frame.n | 6 +- doc/getOpenFile.n | 22 +++---- doc/grab.n | 8 +++ doc/grid.n | 29 +++++++--- doc/image.n | 21 ++++++- doc/label.n | 8 ++- doc/labelframe.n | 8 ++- doc/listbox.n | 28 +++++++-- doc/loadTk.n | 6 +- doc/menu.n | 22 ++++++- doc/menubutton.n | 4 +- doc/message.n | 4 +- doc/messageBox.n | 16 +++--- doc/nsimage.n | 7 ++- doc/option.n | 8 ++- doc/options.n | 2 +- doc/pack.n | 21 +++++-- doc/panedwindow.n | 20 +++++-- doc/photo.n | 155 +++++++++++++++++++++++++++++++------------------- doc/place.n | 18 ++++-- doc/radiobutton.n | 10 +++- doc/scale.n | 10 +++- doc/scrollbar.n | 10 +++- doc/selection.n | 47 +++++++++++---- doc/send.n | 2 +- doc/spinbox.n | 59 ++++++++++++++++--- doc/sysnotify.n | 6 +- doc/systray.n | 28 ++++++--- doc/text.n | 71 ++++++++++++++++------- doc/tk.n | 14 ++++- doc/tk_mac.n | 3 - doc/tkwait.n | 3 + doc/toplevel.n | 4 +- doc/ttk_button.n | 4 +- doc/ttk_checkbutton.n | 4 +- doc/ttk_combobox.n | 10 +++- doc/ttk_entry.n | 23 +++++++- doc/ttk_frame.n | 2 +- doc/ttk_image.n | 8 +-- doc/ttk_label.n | 2 +- doc/ttk_labelframe.n | 2 +- doc/ttk_menubutton.n | 2 +- doc/ttk_notebook.n | 28 +++++++-- doc/ttk_panedwindow.n | 20 ++++++- doc/ttk_progressbar.n | 14 +++-- doc/ttk_radiobutton.n | 4 +- doc/ttk_scale.n | 6 ++ doc/ttk_scrollbar.n | 29 +++++++--- doc/ttk_separator.n | 2 +- doc/ttk_sizegrip.n | 2 +- doc/ttk_spinbox.n | 6 +- doc/ttk_style.n | 46 ++++++++++----- doc/ttk_treeview.n | 110 ++++++++++++++++++++++++++++++----- doc/ttk_vsapi.n | 4 +- doc/ttk_widget.n | 28 ++++++++- doc/winfo.n | 56 +++++++++++++++++- doc/wm.n | 37 +++++++++++- 72 files changed, 1088 insertions(+), 309 deletions(-) diff --git a/doc/bind.n b/doc/bind.n index 9fb5c07..3fe72f1 100644 --- a/doc/bind.n +++ b/doc/bind.n @@ -649,9 +649,9 @@ then that script terminates and no other scripts will be invoked for the event. .PP Within a script called from the binding script, \fBreturn\fR -\fB-code ok\fR may be used to continue processing (including +\fB\-code ok\fR may be used to continue processing (including .QW + -appended scripts), or \fBreturn\fR \fB-code break\fR may be used to +appended scripts), or \fBreturn\fR \fB\-code break\fR may be used to stop processing all other binding scripts. .PP If more than one binding matches a particular event and they diff --git a/doc/bitmap.n b/doc/bitmap.n index 19716e1..8afcdfd 100644 --- a/doc/bitmap.n +++ b/doc/bitmap.n @@ -15,7 +15,7 @@ bitmap \- Images that display two colors .nf \fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? -\fIimageName \fBcget\fR \fIoption\fR +\fIimageName \fBcget\fI option\fR \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? .fi .BE @@ -95,13 +95,15 @@ It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for bitmap images: +.\" METHOD: cget .TP -\fIimageName \fBcget\fR \fIoption\fR +\fIimageName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBimage create\fR \fBbitmap\fR command. +.\" METHOD: configure .TP \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . diff --git a/doc/busy.n b/doc/busy.n index 3274524..649187a 100644 --- a/doc/busy.n +++ b/doc/busy.n @@ -30,15 +30,15 @@ .SH NAME busy \- Make Tk widgets busy, temporarily blocking user interactions .SH SYNOPSIS -\fBtk busy\fR \fIwindow \fR?\fIoptions\fR? +\fBtk busy\fI window \fR?\fIoptions\fR? .sp \fBtk busy busywindow \fIwindow\fR .sp -\fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR? +\fBtk busy hold\fI window \fR?\fIoptions\fR? .sp \fBtk busy configure \fIwindow\fR ?\fIoption value\fR?... .sp -\fBtk busy forget\fR \fIwindow \fR?\fIwindow \fR?... +\fBtk busy forget\fI window \fR?\fIwindow \fR?... .sp \fBtk busy current\fR ?\fIpattern\fR? .sp @@ -129,20 +129,23 @@ The following operations are available for the \fBtk busy\fR command: \fBtk busy \fIwindow\fR ?\fIoption value\fR?... . Shortcut for \fBtk busy hold\fR command. +.\" METHOD: busywindow .TP \fBtk busy busywindow \fIwindow\fR . Returns the pathname of the busy window (i.e. the transparent window shielding the window appearing busy) created by the \fBtk busy hold\fR command for \fIwindow\fR, or the empty string if \fIwindow\fR is not busy. +.\" METHOD: cget .TP -\fBtk busy cget \fIwindow\fR \fIoption\fR +\fBtk busy cget \fIwindow option\fR . Queries the \fBtk busy\fR command configuration options for \fIwindow\fR. \fIWindow\fR must be the path name of a widget previously made busy by the \fBhold\fR operation. The command returns the present value of the specified \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBhold\fR operation. +.\" METHOD: configure .TP \fBtk busy configure \fIwindow\fR ?\fIoption value\fR?... . @@ -169,12 +172,14 @@ option add *frame.busyCursor gumby option add *Frame.BusyCursor gumby .CE .RE +.\" METHOD: current .TP \fBtk busy current \fR?\fIpattern\fR? . Returns the pathnames of all widgets that are currently busy. If a \fIpattern\fR is given, only the path names of busy widgets matching \fIpattern\fR are returned. +.\" METHOD: forget .TP \fBtk busy forget \fIwindow\fR ?\fIwindow\fR?... . @@ -183,6 +188,7 @@ including the transparent window. User events will again be received by \fIwindow\fR. Resources are also released when \fIwindow\fR is destroyed. \fIWindow\fR must be the name of a widget specified in the \fBhold\fR operation, otherwise an error is reported. +.\" METHOD: hold .TP \fBtk busy hold \fIwindow\fR ?\fIoption value\fR?... . @@ -204,6 +210,7 @@ Specifies the cursor to be displayed when the widget is made busy. \fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms. .RE +.\" METHOD: status .TP \fBtk busy status \fIwindow\fR . diff --git a/doc/button.n b/doc/button.n index 70e0e65..79cf14e 100644 --- a/doc/button.n +++ b/doc/button.n @@ -12,7 +12,7 @@ .SH NAME button \- Create and manipulate 'button' action widgets .SH SYNOPSIS -\fBbutton\fR \fIpathName \fR?\fIoptions\fR? +\fBbutton\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-font \-relief \-activeforeground \-foreground \-repeatdelay @@ -114,14 +114,18 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for button widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBbutton\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -134,15 +138,19 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBbutton\fR command. +.\" METHOD: flash .TP \fIpathName \fBflash\fR +. Flash the button. This is accomplished by redisplaying the button several times, alternating between the configured activebackground and background colors. At the end of the flash the button is left in the same normal/active state as when the command was invoked. This command is ignored if the button's state is \fBdisabled\fR. +.\" METHOD: invoke .TP \fIpathName \fBinvoke\fR +. Invoke the Tcl command associated with the button, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the button. diff --git a/doc/canvas.n b/doc/canvas.n index cda7706..52f27d6 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -13,7 +13,7 @@ .SH NAME canvas \- Create and manipulate 'canvas' hypergraphics drawing surface widgets .SH SYNOPSIS -\fBcanvas\fR \fIpathName \fR?\fIoptions\fR? +\fBcanvas\fI pathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-highlightbackground \-highlightcolor \-highlightthickness @@ -353,6 +353,7 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following widget commands are possible for canvas widgets: +.\" METHOD: addtag .TP \fIpathName \fBaddtag \fItag searchSpec \fR?\fIarg ...\fR? . @@ -406,14 +407,14 @@ select the topmost closest item that is below \fIstart\fR in the display list; if no such item exists, then the selection behaves as if the \fIstart\fR argument had not been specified. .TP -\fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR +\fBenclosed\fI x1 y1 x2 y2\fR . Selects all the items completely enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. .TP -\fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR +\fBoverlapping\fI x1 y1 x2 y2\fR . Selects all the items that overlap or are enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, @@ -425,6 +426,7 @@ no greater than \fIy2\fR. . Selects all the items given by \fItagOrId\fR. .RE +.\" METHOD: bbox .TP \fIpathName \fBbbox \fItagOrId\fR ?\fItagOrId tagOrId ...\fR? . @@ -442,6 +444,7 @@ If no items match any of the \fItagOrId\fR arguments or if the matching items have empty bounding boxes (i.e. they have nothing to display) then an empty string is returned. +.\" METHOD: bind .TP \fIpathName \fBbind \fItagOrId\fR ?\fIsequence\fR? ?\fIcommand\fR? . @@ -503,6 +506,7 @@ the canvas's items using the \fBbind\fR widget command. The bindings for items will be invoked before any of the bindings for the window as a whole. .RE +.\" METHOD: canvasx .TP \fIpathName \fBcanvasx \fIscreenx\fR ?\fIgridspacing\fR? . @@ -510,6 +514,7 @@ Given a window x-coordinate in the canvas \fIscreenx\fR, this command returns the canvas x-coordinate that is displayed at that location. If \fIgridspacing\fR is specified, then the canvas coordinate is rounded to the nearest multiple of \fIgridspacing\fR units. +.\" METHOD: canvasy .TP \fIpathName \fBcanvasy \fIscreeny\fR ?\fIgridspacing\fR? . @@ -517,13 +522,15 @@ Given a window y-coordinate in the canvas \fIscreeny\fR this command returns the canvas y-coordinate that is displayed at that location. If \fIgridspacing\fR is specified, then the canvas coordinate is rounded to the nearest multiple of \fIgridspacing\fR units. +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBcanvas\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . @@ -539,10 +546,11 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBcanvas\fR command. +.\" METHOD: coords .TP -\fIpathName\fR \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR? +\fIpathName \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR? .TP -\fIpathName\fR \fBcoords \fItagOrId \fR?\fIcoordList\fR? +\fIpathName \fBcoords \fItagOrId \fR?\fIcoordList\fR? . Query or modify the coordinates that define an item. If no coordinates are specified, this command returns a list @@ -561,6 +569,7 @@ returned in screen units with no units (that is, in pixels). So if the original coordinates were specified for instance in centimeters or inches, the returned values will nevertheless be in pixels. .RE +.\" METHOD: create .TP \fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR? .TP @@ -574,6 +583,7 @@ more item options. See the subsections on individual item types below for more on the syntax of this command. This command returns the id for the new item. +.\" METHOD: dchars .TP \fIpathName \fBdchars \fItagOrId first \fR?\fIlast\fR? . @@ -586,11 +596,13 @@ line and polygon items interpret them as indices to a coordinate (an x,y pair). Indices are described in \fBINDICES\fR above. If \fIlast\fR is omitted, it defaults to \fIfirst\fR. This command returns an empty string. +.\" METHOD: delete .TP \fIpathName \fBdelete \fR?\fItagOrId tagOrId ...\fR? . Delete each of the items given by each \fItagOrId\fR, and return an empty string. +.\" METHOD: dtag .TP \fIpathName \fBdtag \fItagOrId \fR?\fItagToDelete\fR? . @@ -601,6 +613,7 @@ If an item does not have the tag \fItagToDelete\fR then the item is unaffected by the command. If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR. This command returns an empty string. +.\" METHOD: find .TP \fIpathName \fBfind \fIsearchCommand \fR?\fIarg ...\fR? . @@ -610,6 +623,7 @@ meet the constraints specified by \fIsearchCommand\fR and \fISearchCommand\fR and \fIargs\fR have any of the forms accepted by the \fBaddtag\fR command. The items are returned in stacking order, with the lowest item first. +.\" METHOD: focus .TP \fIpathName \fBfocus \fR?\fItagOrId\fR? . @@ -639,8 +653,9 @@ In most cases it is advisable to follow the \fBfocus\fR widget command with the \fBfocus\fR command to set the focus window to the canvas (if it was not there already). .RE +.\" METHOD: gettags .TP -\fIpathName \fBgettags\fR \fItagOrId\fR +\fIpathName \fBgettags\fI tagOrId\fR . Return a list whose elements are the tags associated with the item given by \fItagOrId\fR. @@ -648,6 +663,7 @@ If \fItagOrId\fR refers to more than one item, then the tags are returned from the first such item in the display list. If \fItagOrId\fR does not refer to any items, or if the item contains no tags, then an empty string is returned. +.\" METHOD: icursor .TP \fIpathName \fBicursor \fItagOrId index\fR . @@ -662,10 +678,11 @@ that item currently has the keyboard focus (see the \fBfocus\fR widget command, above), but the cursor position may be set even when the item does not have the focus. This command returns an empty string. +.\" METHOD: image .TP \fIpathName \fBimage \fIimagename\fR ?\fIsubsample\fR? ?\fIzoom\fR? . -Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB-scrollregion\fR +Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB\-scrollregion\fR has been defined then this will be the boundaries of the canvas region drawn and the final size of the photo image. Otherwise the widget width and height with an origin of 0,0 will be the size of the canvas region drawn and the final size of the photo @@ -676,6 +693,7 @@ will be filled with the canvas background colour. The canvas widget does not nee be mapped for this widget command to work, but at least one of it's ancestors must be mapped. This command returns an empty string. +.\" METHOD: imove .TP \fIpathName \fBimove \fItagOrId index x y\fR . @@ -684,6 +702,7 @@ indicated by \fItagOrId\fR to be relocated to the location (\fIx\fR,\fIy\fR). Each item interprets \fIindex\fR independently according to the rules described in \fBINDICES\fR above. Out of the standard set of items, only line and polygon items may have their coordinates relocated this way. +.\" METHOD: index .TP \fIpathName \fBindex \fItagOrId index\fR . @@ -698,6 +717,7 @@ of characters, or coordinates, within the item, inclusive. If \fItagOrId\fR refers to multiple items, then the index is processed in the first of these items that supports indexing operations (in display list order). +.\" METHOD: insert .TP \fIpathName \fBinsert \fItagOrId beforeThis string\fR . @@ -711,8 +731,9 @@ sequence. See \fBINDICES\fR above for information about the forms allowed for \fIbeforeThis\fR. This command returns an empty string. +.\" METHOD: itemcget .TP -\fIpathName \fBitemcget\fR \fItagOrId\fR \fIoption\fR +\fIpathName \fBitemcget\fI tagOrId option\fR . Returns the current value of the configuration option for the item given by \fItagOrId\fR whose name is \fIoption\fR. @@ -722,6 +743,7 @@ it applies to a particular item rather than the widget as a whole. widget command when the item was created. If \fItagOrId\fR is a tag that refers to more than one item, the first (lowest) such item is used. +.\" METHOD: itemconfigure .TP \fIpathName \fBitemconfigure \fItagOrId\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . @@ -744,6 +766,7 @@ The \fIoption\fRs and \fIvalue\fRs are the same as those permissible in the \fBcreate\fR widget command when the item(s) were created; see the sections describing individual item types below for details on the legal options. +.\" METHOD: lower .TP \fIpathName \fBlower \fItagOrId \fR?\fIbelowThis\fR? . @@ -759,6 +782,7 @@ obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. This command returns an empty string. +.\" METHOD: move .TP \fIpathName \fBmove \fItagOrId xAmount yAmount\fR . @@ -767,6 +791,7 @@ space by adding \fIxAmount\fR to the x-coordinate of each point associated with the item and \fIyAmount\fR to the y-coordinate of each point associated with the item. This command returns an empty string. +.\" METHOD: moveto .TP \fIpathName \fBmoveto \fItagOrId xPos yPos\fR . @@ -779,6 +804,7 @@ the empty string, in which case the corresponding coordinate will be unchanged. All items matching \fItagOrId\fR remain in the same positions relative to each other. This command returns an empty string. +.\" METHOD: postscript .TP \fIpathName \fBpostscript \fR?\fIoption value option value ...\fR? . @@ -944,6 +970,7 @@ canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the top edge of the window. .RE +.\" METHOD: raise .TP \fIpathName \fBraise \fItagOrId \fR?\fIaboveThis\fR? . @@ -962,6 +989,7 @@ obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. .RE +.\" METHOD: rchars .TP \fIpathName \fBrchars \fItagOrId first last string\fR . @@ -973,6 +1001,7 @@ set of items, text items support this operation by altering their text as directed, and line and polygon items support this operation by altering their coordinate list (in which case \fIstring\fR should be a list of coordinates to use as a replacement). The other items ignore this operation. +.\" METHOD: rotate .TP \fIpathName \fBrotate \fItagOrId xOrigin yOrigin angle\fR .VS "8.7, TIP164" @@ -994,6 +1023,7 @@ Some items (currently \fBarc\fR and\fB text\fR) have angles in their options; this command \fIdoes not\fR affect those options. .RE .VE "8.7, TIP164" +.\" METHOD: scale .TP \fIpathName \fBscale \fItagOrId xOrigin yOrigin xScale yScale\fR . @@ -1015,8 +1045,9 @@ Note that some items have only a single pair of coordinates (e.g., text, images and windows) and so scaling of them by this command can only move them around. .RE +.\" METHOD: scan .TP -\fIpathName \fBscan\fR \fIoption args\fR +\fIpathName \fBscan\fI option args\fR . This command is used to implement scanning on canvases. It has two forms, depending on \fIoption\fR: @@ -1042,6 +1073,7 @@ with mouse motion events in the widget, to produce the effect of dragging the canvas at high speed through its window. The return value is an empty string. .RE +.\" METHOD: select .TP \fIpathName \fBselect \fIoption\fR ?\fItagOrId arg\fR? . @@ -1108,6 +1140,7 @@ If the selection anchor point for the widget is not currently in by \fIindex\fR. Returns an empty string. .RE +.\" METHOD: type .TP \fIpathName \fBtype\fI tagOrId\fR . @@ -1117,6 +1150,7 @@ If \fItagOrId\fR refers to more than one item, then the type of the first item in the display list is returned. If \fItagOrId\fR does not refer to any items at all then an empty string is returned. +.\" METHOD: xview .TP \fIpathName \fBxview \fR?\fIargs\fR? . @@ -1160,6 +1194,7 @@ If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units of the \fBxScrollIncrement\fR option, if it is greater than zero, or in units of one-tenth the window's width otherwise. .RE +.\" METHOD: yview .TP \fIpathName \fByview ?\fIargs\fR? . @@ -1420,7 +1455,7 @@ from the 3-o'clock position; it may be either positive or negative. Provides a shortcut for creating a circular arc segment by defining the distance of the mid-point of the arc from its chord. When this option is used the coordinates are interpreted as the start and end coordinates -of the chord, and the options \fB\-start\fR and \fB-extent\fR are ignored. +of the chord, and the options \fB\-start\fR and \fB\-extent\fR are ignored. The value of \fIdistance\fR has the following meaning: .RS .PP diff --git a/doc/checkbutton.n b/doc/checkbutton.n index 411045f..0f27d49 100644 --- a/doc/checkbutton.n +++ b/doc/checkbutton.n @@ -197,14 +197,18 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for checkbutton widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBcheckbutton\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -217,33 +221,43 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBcheckbutton\fR command. +.\" METHOD: deselect .TP \fIpathName \fBdeselect\fR +. Deselects the checkbutton and sets the associated variable to its .QW off value. +.\" METHOD: flash .TP \fIpathName \fBflash\fR +. Flashes the checkbutton. This is accomplished by redisplaying the checkbutton several times, alternating between active and normal colors. At the end of the flash the checkbutton is left in the same normal/active state as when the command was invoked. This command is ignored if the checkbutton's state is \fBdisabled\fR. +.\" METHOD: invoke .TP \fIpathName \fBinvoke\fR +. Does just what would have happened if the user invoked the checkbutton with the mouse: toggle the selection state of the button and invoke the Tcl command associated with the checkbutton, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the checkbutton. This command is ignored if the checkbutton's state is \fBdisabled\fR. +.\" METHOD: select .TP \fIpathName \fBselect\fR +. Selects the checkbutton and sets the associated variable to its .QW on value. +.\" METHOD: toggle .TP \fIpathName \fBtoggle\fR +. Toggles the selection state of the button, redisplaying it and modifying its associated variable to reflect the new state. .SH BINDINGS diff --git a/doc/chooseColor.n b/doc/chooseColor.n index 3fa6de3..be24c8e 100644 --- a/doc/chooseColor.n +++ b/doc/chooseColor.n @@ -19,16 +19,16 @@ The procedure \fBtk_chooseColor\fR pops up a dialog box for the user to select a color. The following \fIoption\-value\fR pairs are possible as command line arguments: .TP -\fB\-initialcolor\fR \fIcolor\fR +\fB\-initialcolor\fI color\fR Specifies the color to display in the color dialog when it pops up. \fIcolor\fR must be in a form acceptable to the \fBTk_GetColor\fR function. .TP -\fB\-parent\fR \fIwindow\fR +\fB\-parent\fI window\fR Makes \fIwindow\fR the logical parent of the color dialog. The color dialog is displayed on top of its parent window. .TP -\fB\-title\fR \fItitleString\fR +\fB\-title\fI titleString\fR Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .LP diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n index a5b30f5..7de09b5 100644 --- a/doc/chooseDirectory.n +++ b/doc/chooseDirectory.n @@ -17,14 +17,14 @@ The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the user to select a directory. The following \fIoption\-value\fR pairs are possible as command line arguments: .TP -\fB\-command\fR \fIstring\fR +\fB\-command\fI string\fR Specifies the prefix of a Tcl command to invoke when the user closes the dialog after having selected an item. This callback is not called if the user cancelled the dialog. The actual command consists of \fIstring\fR followed by a space and the value selected by the user in the dialog. This is only available on Mac OS X. .TP -\fB\-initialdir\fR \fIdirname\fR +\fB\-initialdir\fI dirname\fR Specifies that the directories in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory @@ -34,21 +34,21 @@ user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. .TP -\fB\-message\fR \fIstring\fR +\fB\-message\fI string\fR Specifies a message to include in the client area of the dialog. This is only available on Mac OS X. .TP -\fB\-mustexist\fR \fIboolean\fR +\fB\-mustexist\fI boolean\fR Specifies whether the user may specify non-existent directories. If this parameter is true, then the user may only select directories that already exist. The default value is \fIfalse\fR. .TP -\fB\-parent\fR \fIwindow\fR +\fB\-parent\fI window\fR Makes \fIwindow\fR the logical parent of the dialog. The dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window. .TP -\fB\-title\fR \fItitleString\fR +\fB\-title\fI titleString\fR Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .SH EXAMPLE diff --git a/doc/clipboard.n b/doc/clipboard.n index ee964df..0be7936 100644 --- a/doc/clipboard.n +++ b/doc/clipboard.n @@ -27,8 +27,9 @@ appends should be completed before returning to the event loop. The first argument to \fBclipboard\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: +.\" METHOD: append .TP -\fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR +\fBclipboard append\fR ?\fB\-displayof\fI window\fR? ?\fB\-format\fI format\fR? ?\fB\-type\fI type\fR? ?\fB\-\|\-\fR? \fIdata\fR . Appends \fIdata\fR to the clipboard on \fIwindow\fR's display in the form given by \fItype\fR with the representation given @@ -71,15 +72,17 @@ next argument will always be used as \fIdata\fR. This feature may be convenient if, for example, \fIdata\fR starts with a \fB\-\fR. .RE +.\" METHOD: clear .TP -\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR? +\fBclipboard clear\fR ?\fB\-displayof\fI window\fR? . Claims ownership of the clipboard on \fIwindow\fR's display and removes any previous contents. \fIWindow\fR defaults to .QW . . Returns an empty string. +.\" METHOD: get .TP -\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR? +\fBclipboard get\fR ?\fB\-displayof\fI window\fR? ?\fB\-type\fI type\fR? . Retrieve data from the clipboard on \fIwindow\fR's display. \fIWindow\fR defaults to diff --git a/doc/console.n b/doc/console.n index 0a9a794..d3b5f9d 100644 --- a/doc/console.n +++ b/doc/console.n @@ -11,7 +11,7 @@ .SH NAME console \- Control the console on systems without a real console .SH SYNOPSIS -\fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR? +\fBconsole\fI subcommand\fR ?\fIarg ...\fR? .BE .SH DESCRIPTION .PP @@ -23,7 +23,7 @@ the \fBconsole\fR command. The behaviour of the console window is defined mainly through the contents of the \fIconsole.tcl\fR file in the Tk library. Except for TkAqua, this command is not available when Tk is loaded into a tclsh interpreter with -.QW "\fBpackage require tk\fR" , +.QW "\fBpackage require Tk\fR" , as a conventional terminal is expected to be present in that case. In TkAqua, this command is disabled when there is a startup script and stdin is \fB/dev/null\fR (as is the case e.g. when a bundled application @@ -32,21 +32,29 @@ in that case, define the environment variable \fBTK_CONSOLE\fR. This can be done by modifying the Info.plist file by adding the LSEnvironment key to the main dict and setting its value to be a dict with the key \fBTK_CONSOLE\fR. .PP +.\" METHOD: eval .TP \fBconsole eval \fIscript\fR +. Evaluate the \fIscript\fR argument as a Tcl script in the console interpreter. The normal interpreter is accessed through the \fBconsoleinterp\fR command in the console interpreter. +.\" METHOD: hide .TP \fBconsole hide\fR +. Hide the console window from view. Precisely equivalent to withdrawing the \fB.\fR window in the console interpreter. +.\" METHOD: show .TP \fBconsole show\fR +. Display the console window. Precisely equivalent to deiconifying the \fB.\fR window in the console interpreter. +.\" METHOD: title .TP \fBconsole title \fR?\fIstring\fR? +. Query or modify the title of the console window. If \fIstring\fR is not specified, queries the title of the console window, and sets the title of the console window to \fIstring\fR otherwise. Precisely @@ -58,12 +66,16 @@ The \fBconsoleinterp\fR command in the console interpreter allows scripts to be evaluated in the main interpreter. It supports two subcommands: \fBeval\fR and \fBrecord\fR. .PP +.\" METHOD: eval .TP \fBconsoleinterp eval \fIscript\fR +. Evaluates \fIscript\fR as a Tcl script at the global level in the main interpreter. +.\" METHOD: record .TP \fBconsoleinterp record \fIscript\fR +. Records and evaluates \fIscript\fR as a Tcl script at the global level in the main interpreter as if \fIscript\fR had been typed in at the console. diff --git a/doc/entry.n b/doc/entry.n index 80e8428..f60bc20 100644 --- a/doc/entry.n +++ b/doc/entry.n @@ -13,7 +13,7 @@ .SH NAME entry \- Create and manipulate 'entry' one-line text entry widgets .SH SYNOPSIS -\fBentry\fR \fIpathName \fR?\fIoptions\fR? +\fBentry\fI pathName \fR?\fIoptions\fR? .SO \-background \-highlightthickness \-selectbackground \-borderwidth \-insertbackground \-selectborderwidth @@ -245,8 +245,10 @@ arithmetic and indexing relative to \fBend\fR. .SS SUBCOMMANDS .PP The following commands are possible for entry widgets: +.\" METHOD: bbox .TP \fIpathName \fBbbox \fIindex\fR +. Returns a list of four numbers describing the bounding box of the character given by \fIindex\fR. The first two elements of the list give the x and y coordinates of @@ -255,14 +257,18 @@ the upper-left corner of the screen area covered by the character the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBentry\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -275,8 +281,10 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBentry\fR command. +.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? +. Delete one or more elements of the entry. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last @@ -284,22 +292,32 @@ one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns an empty string. +.\" METHOD: get .TP \fIpathName \fBget\fR +. Returns the entry's string. +.\" METHOD: icursor .TP \fIpathName \fBicursor \fIindex\fR +. Arrange for the insertion cursor to be displayed just before the character given by \fIindex\fR. Returns an empty string. +.\" METHOD: index .TP \fIpathName \fBindex\fI index\fR +. Returns the numerical index corresponding to \fIindex\fR. +.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex string\fR +. Insert the characters of \fIstring\fR just before the character indicated by \fIindex\fR. Returns an empty string. +.\" METHOD: scan .TP -\fIpathName \fBscan\fR \fIoption args\fR +\fIpathName \fBscan\fI option args\fR +. This command is used to implement scanning on entries. It has two forms, depending on \fIoption\fR: .RS @@ -319,6 +337,7 @@ with mouse motion events in the widget, to produce the effect of dragging the entry at high speed through the window. The return value is an empty string. .RE +.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR This command is used to adjust the selection within an entry. It @@ -350,7 +369,7 @@ Returns an empty string. Returns 1 if there is are characters selected in the entry, 0 if nothing is selected. .TP -\fIpathName \fBselection range \fIstart\fR \fIend\fR +\fIpathName \fBselection range \fIstart end\fR Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. @@ -371,20 +390,25 @@ If the selection is not in this widget then a new selection is created using the most recent anchor point specified for the widget. Returns an empty string. .RE +.\" METHOD: validate .TP \fIpathName \fBvalidate\fR +. This command is used to force an evaluation of the \fB\-validatecommand\fR independent of the conditions specified by the \fB\-validate\fR option. This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. +.\" METHOD: xview .TP \fIpathName \fBxview \fIargs\fR +. This command is used to query and change the horizontal position of the text in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fBxview\fR +. Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the horizontal span that is visible in the window. @@ -394,16 +418,19 @@ in the window, and 40% of the text is off-screen to the right. These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP -\fIpathName \fBxview\fR \fIindex\fR +\fIpathName \fBxview\fI index\fR +. Adjusts the view in the window so that the character given by \fIindex\fR is displayed at the left edge of the window. .TP \fIpathName \fBxview moveto\fI fraction\fR +. Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR +. This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then diff --git a/doc/event.n b/doc/event.n index 9f5a4c6..a77861c 100644 --- a/doc/event.n +++ b/doc/event.n @@ -20,8 +20,10 @@ The \fBevent\fR command provides several facilities for dealing with window system events, such as defining virtual events and synthesizing events. The command has several different forms, determined by the first argument. The following forms are currently supported: +.\" METHOD: add .TP \fBevent add <<\fIvirtual\fB>>\fI sequence \fR?\fIsequence ...\fR? +. Associates the virtual event \fIvirtual\fR with the physical event sequence(s) given by the \fIsequence\fR arguments, so that the virtual event will trigger whenever any one of the \fIsequence\fRs @@ -31,8 +33,10 @@ any of the values allowed for the \fIsequence\fR argument to the \fBbind\fR command. If \fIvirtual\fR is already defined, the new physical event sequences add to the existing sequences for the event. +.\" METHOD: delete .TP -\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence\fR \fIsequence ...\fR? +\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence sequence ...\fR? +. Deletes each of the \fIsequence\fRs from those associated with the virtual event given by \fIvirtual\fR. \fIVirtual\fR may be any string value and \fIsequence\fR may have @@ -43,8 +47,10 @@ are ignored. If no \fIsequence\fR argument is provided, all physical event sequences are removed for \fIvirtual\fR, so that the virtual event will not trigger anymore. +.\" METHOD: generate .TP \fBevent generate \fIwindow event \fR?\fIoption value option value ...\fR? +. Generates a window event and arranges for it to be processed just as if it had come from the window system. \fIWindow\fR gives the path name of the window for which the event @@ -65,8 +71,10 @@ will complete before the \fBevent generate\fR command returns. If the \fB\-when\fR option is specified then it determines when the event is processed. Certain events, such as key events, require that the window has focus to receive the event properly. +.\" METHOD: info .TP \fBevent info \fR?\fB<<\fIvirtual\fB>>\fR? +. Returns information about virtual events. If the \fB<<\fIvirtual\fB>>\fR argument is omitted, the return value is a list of all the virtual events that are currently defined. @@ -87,34 +95,40 @@ command. These correspond to the expansions allowed in binding scripts for the \fBbind\fR command. .TP \fB\-above\fI window\fR +. \fIWindow\fR specifies the \fIabove\fR field for the event, either as a window path name or as an integer window id. Valid for \fBConfigure\fR events. Corresponds to the \fB%a\fR substitution for binding scripts. .TP \fB\-borderwidth\fI size\fR +. \fISize\fR must be a screen distance; it specifies the \fIborder_width\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%B\fR substitution for binding scripts. .TP \fB\-button\fI number\fR +. \fINumber\fR must be an integer; it specifies the \fIdetail\fR field for a \fBButton\fR or \fBButtonRelease\fR event, overriding any button number provided in the base \fIevent\fR argument. Corresponds to the \fB%b\fR substitution for binding scripts. .TP \fB\-count\fI number\fR +. \fINumber\fR must be an integer; it specifies the \fIcount\fR field for the event. Valid for \fBExpose\fR events. Corresponds to the \fB%c\fR substitution for binding scripts. .TP \fB\-data\fI string\fR +. \fIString\fR may be any value; it specifies the \fIuser_data\fR field for the event. Only valid for virtual events. Corresponds to the \fB%d\fR substitution for virtual events in binding scripts. .TP \fB\-delta\fI number\fR +. \fINumber\fR must be an integer; it specifies the \fIdelta\fR field for the \fBMouseWheel\fR event. The \fIdelta\fR refers to the direction and magnitude the mouse wheel was rotated. Note the value @@ -126,6 +140,7 @@ behaviors for mouse wheel motion. This field corresponds to the \fB%D\fR substitution for binding scripts. .TP \fB\-detail\fI detail\fR +. \fIDetail\fR specifies the \fIdetail\fR field for the event and must be one of the following: .RS @@ -142,23 +157,27 @@ Corresponds to the \fB%d\fR substitution for binding scripts. .RE .TP \fB\-focus\fI boolean\fR +. \fIBoolean\fR must be a boolean value; it specifies the \fIfocus\fR field for the event. Valid for \fBEnter\fR and \fBLeave\fR events. Corresponds to the \fB%f\fR substitution for binding scripts. .TP \fB\-height\fI size\fR +. \fISize\fR must be a screen distance; it specifies the \fIheight\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%h\fR substitution for binding scripts. .TP \fB\-keycode\fI number\fR +. \fINumber\fR must be an integer; it specifies the \fIkeycode\fR field for the event. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%k\fR substitution for binding scripts. .TP \fB\-keysym\fI name\fR +. \fIName\fR must be the name of a valid keysym, such as \fBg\fR, \fBspace\fR, or \fBReturn\fR; its corresponding keycode value is used as the \fIkeycode\fR field for event, overriding @@ -167,6 +186,7 @@ Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%K\fR substitution for binding scripts. .TP \fB\-mode\fI notify\fR +. \fINotify\fR specifies the \fImode\fR field for the event and must be one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or \fBNotifyWhileGrabbed\fR. @@ -175,18 +195,21 @@ Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and Corresponds to the \fB%m\fR substitution for binding scripts. .TP \fB\-override\fI boolean\fR +. \fIBoolean\fR must be a boolean value; it specifies the \fIoverride_redirect\fR field for the event. Valid for \fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events. Corresponds to the \fB%o\fR substitution for binding scripts. .TP \fB\-place\fI where\fR +. \fIWhere\fR specifies the \fIplace\fR field for the event; it must be either \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR. Valid for \fBCirculate\fR events. Corresponds to the \fB%p\fR substitution for binding scripts. .TP \fB\-root\fI window\fR +. \fIWindow\fR must be either a window path name or an integer window identifier; it specifies the \fIroot\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -195,6 +218,7 @@ events. Corresponds to the \fB%R\fR substitution for binding scripts. .TP \fB\-rootx\fI coord\fR +. \fICoord\fR must be a screen distance; it specifies the \fIx_root\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -202,6 +226,7 @@ Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, events. Corresponds to the \fB%X\fR substitution for binding scripts. .TP \fB\-rooty\fI coord\fR +. \fICoord\fR must be a screen distance; it specifies the \fIy_root\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -210,16 +235,19 @@ events. Corresponds to the \fB%Y\fR substitution for binding scripts. .TP \fB\-sendevent\fI boolean\fR +. \fIBoolean\fR must be a boolean value; it specifies the \fIsend_event\fR field for the event. Valid for all events. Corresponds to the \fB%E\fR substitution for binding scripts. .TP \fB\-serial\fI number\fR +. \fINumber\fR must be an integer; it specifies the \fIserial\fR field for the event. Valid for all events. Corresponds to the \fB%#\fR substitution for binding scripts. .TP \fB\-state\fI state\fR +. \fIState\fR specifies the \fIstate\fR field for the event. For \fBKey\fR, \fBKeyRelease\fR, \fBButtons\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events @@ -231,6 +259,7 @@ specified in the base \fIevent\fR. Corresponds to the \fB%s\fR substitution for binding scripts. .TP \fB\-subwindow\fI window\fR +. \fIWindow\fR specifies the \fIsubwindow\fR field for the event, either as a path name for a Tk widget or as an integer window identifier. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -238,6 +267,7 @@ Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, Similar to \fB%S\fR substitution for binding scripts. .TP \fB\-time\fI integer\fR +. \fIInteger\fR must be an integer value; it specifies the \fItime\fR field for the event. Additonally the special value \fBcurrent\fR is allowed, this value will be substituted by the current event time. @@ -247,6 +277,7 @@ and \fBProperty\fR events. Corresponds to the \fB%t\fR substitution for binding scripts. .TP \fB\-warp\fI boolean\fR +. \fIboolean\fR must be a boolean value; it specifies whether the screen pointer should be warped as well. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -254,12 +285,14 @@ Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, only warp to a window if it is mapped. .TP \fB\-width\fI size\fR +. \fISize\fR must be a screen distance; it specifies the \fIwidth\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%w\fR substitution for binding scripts. .TP \fB\-when\fI when\fR +. \fIWhen\fR determines when the event will be processed; it must have one of the following values: .RS @@ -280,6 +313,7 @@ be processed in order but at the front of the queue. .RE .TP \fB\-x\fI coord\fR +. \fICoord\fR must be a screen distance; it specifies the \fIx\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -292,6 +326,7 @@ screen, and this option corresponds to the \fB%X\fR substitution for binding scripts. .TP \fB\-y\fI coord\fR +. \fICoord\fR must be a screen distance; it specifies the \fIy\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, @@ -312,6 +347,7 @@ Tk defines the following virtual events for the purposes of notification: .TP \fB<>\fR +. This is sent to widget to notify it that the letter it has underlined (as an accelerator indicator) with the \fB\-underline\fR option has been pressed in combination with the Alt key. The usual response to @@ -319,26 +355,32 @@ this is to either focus into the widget (or some related widget) or to invoke the widget. .TP \fB<>\fR +. This can be sent to some widgets (e.g. button, listbox, menu) as an alternative to . .TP \fB<>\fR +. This is sent to a listbox when the set of selected item(s) in the listbox is updated. .TP \fB<>\fR +. This is sent to a menu when the currently selected item in the menu changes. It is intended for use with context-sensitive help systems. .TP \fB<>\fR +. This is sent to a text widget when the contents of the widget are changed. .TP \fB<>\fR +. This is sent to a text widget when the selection in the widget is changed. .TP \fB<>\fR +. This is sent to all widgets when the ttk theme changed. The ttk widgets listen to this event and redisplay themselves when it fires. The legacy widgets ignore this event. @@ -353,22 +395,26 @@ cause of the change. NOTE: all tk and ttk widgets already handle this event internally. .TP \fB<>\fR +. This is sent to a widget when the focus enters the widget because of a user-driven .QW "tab to widget" action. .TP \fB<>\fR +. This is sent to a widget when the focus leaves the widget because of a user-driven .QW "tab to widget" action. .TP \fB<>\fR +. This is sent to a text widget when its undo stack or redo stack becomes empty or unempty. .TP \fB<>\fR +. This is sent to a text widget when its internal data become obsolete, and again when these internal data are back in sync with the widget view. The detail field (%d substitution) is either true (when the @@ -379,12 +425,15 @@ bindings across multiple platforms. Users expect them to behave in the following way: .TP \fB<>\fR +. Delete the currently selected widget contents. .TP \fB<>\fR +. Copy the currently selected widget contents to the clipboard. .TP \fB<>\fR +. Move the currently selected widget contents to the clipboard. .TP \fB<>\fR @@ -418,10 +467,12 @@ Move to the next group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<>\fR +. Replace the currently selected widget contents with the contents of the clipboard. .TP \fB<>\fR +. Insert the contents of the selection at the mouse location. (This event has meaningful \fB%x\fR and \fB%y\fR substitutions). .TP @@ -441,6 +492,7 @@ Move to the previous paragraph in the current widget while deselecting any selected contents. .TP \fB<>\fR +. Traverse to the previous window. .TP \fB<>\fR @@ -449,6 +501,7 @@ Move to the previous group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<>\fR +. Redo one undone action. .TP \fB<>\fR diff --git a/doc/focus.n b/doc/focus.n index a6b0575..2aebd53 100644 --- a/doc/focus.n +++ b/doc/focus.n @@ -55,6 +55,7 @@ things. The \fBfocus\fR command can take any of the following forms: .TP \fBfocus\fR +. Returns the path name of the focus window on the display containing the application's main window, or an empty string if no window in this application has the focus on that display. Note: it is @@ -63,6 +64,7 @@ better to specify the display explicitly using \fB\-displayof\fR displays. .TP \fBfocus \fIwindow\fR +. If the application currently has the input focus on \fIwindow\fR's display, this command resets the input focus for \fIwindow\fR's display to \fIwindow\fR and returns an empty string. @@ -72,12 +74,14 @@ for its top-level; the next time the focus arrives at the top-level, Tk will redirect it to \fIwindow\fR. If \fIwindow\fR is an empty string then the command does nothing. .TP -\fBfocus \-displayof\fR \fIwindow\fR +\fBfocus \-displayof \fIwindow\fR +. Returns the name of the focus window on the display containing \fIwindow\fR. If the focus window for \fIwindow\fR's display is not in this application, the return value is an empty string. .TP \fBfocus \-force \fIwindow\fR +. Sets the focus of \fIwindow\fR's display to \fIwindow\fR, even if the application does not currently have the input focus for the display. This command should be used sparingly, if at all. @@ -86,7 +90,8 @@ itself; instead, it should wait for the window manager to give it the focus. If \fIwindow\fR is an empty string then the command does nothing. .TP -\fBfocus \-lastfor\fR \fIwindow\fR +\fBfocus \-lastfor \fIwindow\fR +. Returns the name of the most recent window to have the input focus among all the windows in the same top-level as \fIwindow\fR. If no window in that top-level has ever had the input focus, or diff --git a/doc/font.n b/doc/font.n index 4d2f5f4..ac503a1 100644 --- a/doc/font.n +++ b/doc/font.n @@ -20,6 +20,7 @@ The \fBfont\fR command provides several facilities for dealing with fonts, such as defining named fonts and inspecting the actual attributes of a font. The command has several different forms, determined by the first argument. The following forms are currently supported: +.\" METHOD: actual .TP \fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? ?\fB\-\|\-\fR? ?\fIchar\fR? . @@ -38,6 +39,7 @@ that character, which will be different from the base font if the base font does not contain the given character. If \fIchar\fR may be a hyphen, it should be preceded by \fB\-\|\-\fR to distinguish it from a misspelled \fIoption\fR. +.\" METHOD: configure .TP \fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -58,6 +60,7 @@ are implemented by the system theme. To achieve the effect of modification, use \fBfont actual\fR to get their configuration and \fBfont create\fR to synthesize a copy of the font which can be modified. .RE +.\" METHOD: create .TP \fBfont create\fR ?\fIfontname\fR? ?\fIoption value ...\fR? . @@ -67,8 +70,9 @@ form \fBfont\fIx\fR, where \fIx\fR is an integer. There may be any number of \fIoption\fR\-\fIvalue\fR pairs, which provide the desired attributes for the new named font. See \fBFONT OPTIONS\fR below for a list of the possible attributes. +.\" METHOD: delete .TP -\fBfont delete\fR \fIfontname\fR ?\fIfontname ...\fR? +\fBfont delete\fI fontname\fR ?\fIfontname ...\fR? . Delete the specified named fonts. If there are widgets using the named font, the named font will not actually be deleted until all the instances are @@ -76,12 +80,14 @@ released. Those widgets will continue to display using the last known values for the named font. If a deleted named font is subsequently recreated with another call to \fBfont create\fR, the widgets will use the new named font and redisplay themselves using the new attributes of that font. +.\" METHOD: families .TP \fBfont families\fR ?\fB\-displayof \fIwindow\fR? . The return value is a list of the case-insensitive names of all font families that exist on \fIwindow\fR's display. If the \fIwindow\fR argument is omitted, it defaults to the main window. +.\" METHOD: measure .TP \fBfont measure \fIfont\fR ?\fB\-displayof \fIwindow\fR? \fItext\fR . @@ -96,6 +102,7 @@ characters such as cursive If the string contains newlines or tabs, those characters are not expanded or treated specially when measuring the string. +.\" METHOD: metrics .TP \fBfont metrics \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? . @@ -107,8 +114,10 @@ omitted, it defaults to the main window. If \fIoption\fR is specified, returns the value of that metric; if it is omitted, the return value is a list of all the metrics and their values. See \fBFONT METRICS\fR below for a list of the possible metrics. +.\" METHOD: names .TP \fBfont names\fR +. The return value is a list of all the named fonts that are currently defined. .SH "FONT DESCRIPTIONS" .PP diff --git a/doc/fontchooser.n b/doc/fontchooser.n index 465af2e..02c2d61 100644 --- a/doc/fontchooser.n +++ b/doc/fontchooser.n @@ -30,16 +30,19 @@ difference, all user interaction with the dialog will be communicated to the caller via callbacks or virtual events. .PP The \fBtk fontchooser\fR command can have one of the following forms: +.\" METHOD: configure .TP \fBtk fontchooser\fR \fBconfigure \fR?\fI\-option value ...\fR? . Set or query one or more of the configurations options below (analogous to Tk widget configuration). +.\" METHOD: show .TP \fBtk fontchooser\fR \fBshow\fR . Show the font selection dialog. Depending on the platform, may return immediately or only once the dialog has been withdrawn. +.\" METHOD: hide .TP \fBtk fontchooser\fR \fBhide\fR . diff --git a/doc/frame.n b/doc/frame.n index 5520f32..078bac6 100644 --- a/doc/frame.n +++ b/doc/frame.n @@ -12,7 +12,7 @@ .SH NAME frame \- Create and manipulate 'frame' simple container widgets .SH SYNOPSIS -\fBframe\fR \fIpathName\fR ?\fIoptions\fR? +\fBframe\fI pathName\fR ?\fIoptions\fR? .SO \-borderwidth \-highlightcolor \-pady \-cursor \-highlightthickness \-relief @@ -127,13 +127,15 @@ operations on the widget. It has the following general form: the frame widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for frame widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBframe\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n index d2323de..747145d 100644 --- a/doc/getOpenFile.n +++ b/doc/getOpenFile.n @@ -35,20 +35,20 @@ whether the existing file should be overwritten or not. The following \fIoption\-value\fR pairs are possible as command line arguments to these two commands: .TP -\fB\-command\fR \fIstring\fR +\fB\-command\fI string\fR Specifies the prefix of a Tcl command to invoke when the user closes the dialog after having selected an item. This callback is not called if the user cancelled the dialog. The actual command consists of \fIstring\fR followed by a space and the value selected by the user in the dialog. This is only available on Mac OS X. .TP -\fB\-confirmoverwrite\fR \fIboolean\fR +\fB\-confirmoverwrite\fI boolean\fR Configures how the Save dialog reacts when the selected file already exists, and saving would overwrite it. A true value requests a confirmation dialog be presented to the user. A false value requests that the overwrite take place without confirmation. Default value is true. .TP -\fB\-defaultextension\fR \fIextension\fR +\fB\-defaultextension\fI extension\fR . Specifies a string that will be appended to the filename if the user enters a filename without an extension. The default value is the empty @@ -58,7 +58,7 @@ does not require extensions to filenames, and the UNIX implementation guesses reasonable values for this from the \fB\-filetypes\fR option when this is not supplied. .TP -\fB\-filetypes\fR \fIfilePatternList\fR +\fB\-filetypes\fI filePatternList\fR . If a \fBFile types\fR listbox exists in the file dialog on the particular platform, this option gives the \fIfiletype\fRs in this listbox. When @@ -69,7 +69,7 @@ particular platform then all files are listed regardless of their types. See the section \fBSPECIFYING FILE PATTERNS\fR below for a discussion on the contents of \fIfilePatternList\fR. .TP -\fB\-initialdir\fR \fIdirectory\fR +\fB\-initialdir\fI directory\fR . Specifies that the files in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, @@ -80,31 +80,31 @@ user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. .TP -\fB\-initialfile\fR \fIfilename\fR +\fB\-initialfile\fI filename\fR . Specifies a filename to be displayed in the dialog when it pops up. .TP -\fB\-message\fR \fIstring\fR +\fB\-message\fI string\fR . Specifies a message to include in the client area of the dialog. This is only available on Mac OS X. .TP -\fB\-multiple\fR \fIboolean\fR +\fB\-multiple\fI boolean\fR . Allows the user to choose multiple files from the Open dialog. .TP -\fB\-parent\fR \fIwindow\fR +\fB\-parent\fI window\fR . Makes \fIwindow\fR the logical parent of the file dialog. The file dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window. .TP -\fB\-title\fR \fItitleString\fR +\fB\-title\fI titleString\fR . Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title is displayed. .TP -\fB\-typevariable\fR \fIvariableName\fR +\fB\-typevariable\fI variableName\fR . The global variable \fIvariableName\fR is used to preselect which filter is used from \fIfilterList\fR when the dialog box is opened and is diff --git a/doc/grab.n b/doc/grab.n index 259d68e..72bc8ee 100644 --- a/doc/grab.n +++ b/doc/grab.n @@ -84,20 +84,26 @@ The \fBgrab\fR command can take any of the following forms: .TP \fBgrab \fR?\fB\-global\fR? \fIwindow\fR Same as \fBgrab set\fR, described below. +.\" METHOD: current .TP \fBgrab current \fR?\fIwindow\fR? +. If \fIwindow\fR is specified, returns the name of the current grab window in this application for \fIwindow\fR's display, or an empty string if there is no such window. If \fIwindow\fR is omitted, the command returns a list whose elements are all of the windows grabbed by this application for all displays, or an empty string if the application has no grabs. +.\" METHOD: release .TP \fBgrab release \fIwindow\fR +. Releases the grab on \fIwindow\fR if there is one, otherwise does nothing. Returns an empty string. +.\" METHOD: set .TP \fBgrab set \fR?\fB\-global\fR? \fIwindow\fR +. Sets a grab on \fIwindow\fR. If \fB\-global\fR is specified then the grab is global, otherwise it is local. If a grab was already in effect for this application on @@ -105,8 +111,10 @@ If a grab was already in effect for this application on If there is already a grab on \fIwindow\fR and it has the same global/local form as the requested grab, then the command does nothing. Returns an empty string. +.\" METHOD: status .TP \fBgrab status \fIwindow\fR +. Returns \fBnone\fR if no grab is currently set on \fIwindow\fR, \fBlocal\fR if a local grab is set on \fIwindow\fR, and \fBglobal\fR if a global grab is set. diff --git a/doc/grid.n b/doc/grid.n index 90f80cd..3bcfd3f 100644 --- a/doc/grid.n +++ b/doc/grid.n @@ -28,12 +28,14 @@ argument to \fBgrid configure\fR, either a window name (any value starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR (see the \fBRELATIVE PLACEMENT\fR section below), then the command is processed in the same way as \fBgrid configure\fR. +.\" METHOD: anchor .TP \fBgrid anchor \fIwindow\fR ?\fIanchor\fR? . The anchor value controls how to place the grid within the container window when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below for further details. The default \fIanchor\fR is \fInw\fR. +.\" METHOD: bbox .TP \fBgrid bbox \fIwindow\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? . @@ -47,6 +49,7 @@ the command line, then the bounding box for that cell is returned, where the top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR arguments are specified, then the bounding box spanning the rows and columns indicated is returned. +.\" METHOD: columnconfigure .TP \fBgrid columnconfigure \fIwindow index \fR?\fI\-option value...\fR? . @@ -84,6 +87,7 @@ If only the container window and index is specified, all the current settings are returned in a list of .QW "\-option value" pairs. +.\" METHOD: configure .TP \fBgrid configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? . @@ -193,6 +197,16 @@ If any of the content is already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE +.\" METHOD: content +.TP +\fBgrid content \fIwindow\fR ?\fI\-option value\fR? +. +If no options are supplied, a list of all of the content in \fIwindow\fR +is returned, most recently managed first. +\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which +causes only the content in the row (or column) specified by \fIvalue\fR +to be returned. +.\" METHOD: forget .TP \fBgrid forget \fIwindow \fR?\fIwindow ...\fR? . @@ -210,6 +224,7 @@ the virtual event \fB<>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE +.\" METHOD: info .TP \fBgrid info \fIwindow\fR . @@ -219,6 +234,7 @@ might be specified to \fBgrid configure\fR. The first two elements of the list are .QW "\fB\-in \fIcontainer\fR" where \fIcontainer\fR is the windows's container window. +.\" METHOD: location .TP \fBgrid location \fIwindow x y\fR . @@ -226,6 +242,7 @@ Given \fIx\fR and \fIy\fR values in screen units relative to the container wind the column and row number at that \fIx\fR and \fIy\fR location is returned. For locations that are above or to the left of the grid, \fB\-1\fR is returned. +.\" METHOD: propagate .TP \fBgrid propagate \fIwindow\fR ?\fIboolean\fR? . @@ -239,6 +256,7 @@ If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIwindow\fR. Propagation is enabled by default. +.\" METHOD: rowconfigure .TP \fBgrid rowconfigure \fIwindow index \fR?\fI\-option value...\fR? . @@ -276,6 +294,7 @@ If only the container window and index is specified, all the current settings are returned in a list of .QW "-option value" pairs. +.\" METHOD: remove .TP \fBgrid remove \fIwindow \fR?\fIwindow ...\fR? . @@ -293,6 +312,7 @@ the virtual event \fB<>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE +.\" METHOD: size .TP \fBgrid size \fIcontainer\fR . @@ -300,14 +320,7 @@ Returns the size of the grid (in columns then rows) for \fIcontainer\fR. The size is determined either by the \fIcontent\fR occupying the largest row or column, or the largest column or row with a \fB\-minsize\fR, \fB\-weight\fR, or \fB\-pad\fR that is non-zero. -.TP -\fBgrid content \fIwindow\fR ?\fI\-option value\fR? -. -If no options are supplied, a list of all of the content in \fIwindow\fR -is returned, most recently managed first. -\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which -causes only the content in the row (or column) specified by \fIvalue\fR -to be returned. +.\" METHOD: slaves .TP \fBgrid slaves \fIwindow\fR ?\fI\-option value\fR? . diff --git a/doc/image.n b/doc/image.n index 24b768a..9946544 100644 --- a/doc/image.n +++ b/doc/image.n @@ -12,15 +12,17 @@ .SH NAME image \- Create and manipulate images .SH SYNOPSIS -\fBimage\fR \fIoption \fR?\fIarg ...\fR? +\fBimage\fI option \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBimage\fR command is used to create, delete, and query images. It can take several different forms, depending on the \fIoption\fR argument. The legal forms are: +.\" METHOD: create .TP \fBimage create \fItype \fR?\fIname\fR? ?\fIoption value ...\fR? +. Creates a new image and a command with the same name and returns its name. \fItype\fR specifies the type of the image, which must be one of the types currently defined (e.g., \fBbitmap\fR). @@ -38,8 +40,10 @@ It is important to note that the image command will silently overwrite any procedure that may currently be defined by the given name, so choose the name wisely. It is recommended to use a separate namespace for image names (e.g., \fB::img::logo\fR, \fB::img::large\fR). +.\" METHOD: delete .TP \fBimage delete \fR?\fIname name\fR ...? +. Deletes each of the named images and returns an empty string. If there are instances of the images displayed in widgets, the images will not actually be deleted until all of the instances @@ -50,28 +54,40 @@ Existing instances will retain their sizes but redisplay as empty areas. If a deleted image is recreated with another call to \fBimage create\fR, the existing instances will use the new image. +.\" METHOD: height .TP \fBimage height \fIname\fR +. Returns a decimal string giving the height of image \fIname\fR in pixels. +.\" METHOD: inuse .TP \fBimage inuse \fIname\fR +. Returns a boolean value indicating whether or not the image given by \fIname\fR is in use by any widgets. +.\" METHOD: names .TP \fBimage names\fR +. Returns a list containing the names of all existing images. +.\" METHOD: type .TP \fBimage type \fIname\fR +. Returns the type of image \fIname\fR (the value of the \fItype\fR argument to \fBimage create\fR when the image was created). +.\" METHOD: types .TP \fBimage types\fR +. Returns a list whose elements are all of the valid image types (i.e., all of the values that may be supplied for the \fItype\fR argument to \fBimage create\fR). +.\" METHOD: width .TP \fBimage width \fIname\fR +. Returns a decimal string giving the width of image \fIname\fR in pixels. .PP @@ -85,16 +101,19 @@ in any Tk application. Individual applications or extensions may define additional types. .TP \fBbitmap\fR +. Each pixel in the image displays a foreground color, a background color, or nothing. See the \fBbitmap\fR manual entry for more information. .TP \fBphoto\fR +. Displays a variety of full-color images, using dithering to approximate colors on displays with limited color capabilities. See the \fBphoto\fR manual entry for more information. .TP \fBnsimage\fR +. This type is only available in the Aqua platform. It is a full-color image which may be created from a named system image. It has options designed to facilitate the use of these images in buttons. An diff --git a/doc/label.n b/doc/label.n index 290ac8a..5d28e31 100644 --- a/doc/label.n +++ b/doc/label.n @@ -12,7 +12,7 @@ .SH NAME label \- Create and manipulate 'label' non-interactive text or image widgets .SH SYNOPSIS -\fBlabel\fR \fIpathName \fR?\fIoptions\fR? +\fBlabel\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady @@ -80,14 +80,18 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for label widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlabel\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for diff --git a/doc/labelframe.n b/doc/labelframe.n index 89f56c4..da8eab9 100644 --- a/doc/labelframe.n +++ b/doc/labelframe.n @@ -12,7 +12,7 @@ .SH NAME labelframe \- Create and manipulate 'labelframe' labelled container widgets .SH SYNOPSIS -\fBlabelframe\fR \fIpathName\fR ?\fIoptions\fR? +\fBlabelframe\fI pathName\fR ?\fIoptions\fR? .SO \-borderwidth \-highlightbackground \-pady \-cursor \-highlightcolor \-relief @@ -101,14 +101,18 @@ operations on the widget. It has the following general form: the labelframe widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for frame widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlabelframe\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for diff --git a/doc/listbox.n b/doc/listbox.n index a047be6..68f6e80 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -12,7 +12,7 @@ .SH NAME listbox \- Create and manipulate 'listbox' item list widgets .SH SYNOPSIS -\fBlistbox\fR \fIpathName \fR?\fIoptions\fR? +\fBlistbox\fI pathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-disabledforeground \-exportselection \-font @@ -144,8 +144,9 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for listbox widgets: +.\" METHOD: activate .TP -\fIpathName \fBactivate\fR \fIindex\fR +\fIpathName \fBactivate\fI index\fR . Sets the active element to the one indicated by \fIindex\fR. If \fIindex\fR is outside the range of elements in the listbox @@ -153,8 +154,9 @@ then the closest element is activated. The active element is drawn as specified by \fB\-activestyle\fR when the widget has the input focus, and its index may be retrieved with the index \fBactive\fR. +.\" METHOD: bbox .TP -\fIpathName \fBbbox\fR \fIindex\fR +\fIpathName \fBbbox\fI index\fR . Returns a list of four numbers describing the bounding box of the text in the element given by \fIindex\fR. @@ -168,13 +170,15 @@ or if \fIindex\fR refers to a non-existent element, then the result is an empty string; if the element is partially visible, the result gives the full area of the element, including any parts that are not visible. +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlistbox\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -190,6 +194,7 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBlistbox\fR command. +.\" METHOD: curselection .TP \fIpathName \fBcurselection\fR . @@ -197,6 +202,7 @@ Returns a list containing the numerical indices of all of the elements in the listbox that are currently selected. If there are no elements selected in the listbox then an empty string is returned. +.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? . @@ -204,6 +210,7 @@ Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR are indices specifying the first and last elements in the range to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR, i.e. a single element is deleted. +.\" METHOD: get .TP \fIpathName \fBget \fIfirst\fR ?\fIlast\fR? . @@ -215,12 +222,14 @@ are all of the listbox elements between \fIfirst\fR and \fIlast\fR, inclusive. Both \fIfirst\fR and \fIlast\fR may have any of the standard forms for indices. +.\" METHOD: index .TP \fIpathName \fBindex \fIindex\fR . Returns the integer index value that corresponds to \fIindex\fR. If \fIindex\fR is \fBend\fR the return value is a count of the number of elements in the listbox (not the index of the last element). +.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR? . @@ -228,12 +237,14 @@ Inserts zero or more new elements in the list just before the element given by \fIindex\fR. If \fIindex\fR is specified as \fBend\fR then the new elements are added to the end of the list. Returns an empty string. +.\" METHOD: itemcget .TP \fIpathName \fBitemcget \fIindex option\fR . Returns the current value of the item configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBitemconfigure\fR command. +.\" METHOD: itemconfigure .TP \fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . @@ -272,13 +283,15 @@ item while it is selected. It may have any of the forms accepted by item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. .RE +.\" METHOD: nearest .TP \fIpathName \fBnearest \fIy\fR . Given a y-coordinate within the listbox window, this command returns the index of the (visible) listbox element nearest to that y-coordinate. +.\" METHOD: scan .TP -\fIpathName \fBscan\fR \fIoption args\fR +\fIpathName \fBscan\fI option args\fR . This command is used to implement scanning on listboxes. It has two forms, depending on \fIoption\fR: @@ -302,6 +315,7 @@ with mouse motion events in the widget, to produce the effect of dragging the list at high speed through the window. The return value is an empty string. .RE +.\" METHOD: see .TP \fIpathName \fBsee \fIindex\fR . @@ -311,6 +325,7 @@ If the element is already visible then the command has no effect; if the element is near one edge of the window then the listbox scrolls to bring the element into view at the edge; otherwise the listbox scrolls to center the element. +.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR . @@ -346,11 +361,13 @@ Selects all of the elements in the range between \fIfirst\fR and \fIlast\fR, inclusive, without affecting the selection state of elements outside that range. .RE +.\" METHOD: size .TP \fIpathName \fBsize\fR . Returns a decimal string indicating the total number of elements in the listbox. +.\" METHOD: xview .TP \fIpathName \fBxview \fR?\fIargs\fR . @@ -399,6 +416,7 @@ If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by \fInumber\fR character units (the width of the \fB0\fR character) on the display. .RE +.\" METHOD: yview .TP \fIpathName \fByview \fR?\fIargs\fR? . diff --git a/doc/loadTk.n b/doc/loadTk.n index e1c93c8..122b2be 100644 --- a/doc/loadTk.n +++ b/doc/loadTk.n @@ -11,7 +11,7 @@ .SH NAME safe::loadTk \- Load Tk into a safe interpreter. .SH SYNOPSIS -\fBsafe::loadTk \fIchild\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? +\fBsafe::loadTk \fIchild\fR ?\fB\-use\fI windowId\fR? ?\fB\-display\fI displayName\fR? .BE .SH DESCRIPTION .PP @@ -32,7 +32,7 @@ a window belonging to another application. As a convenience, if the window you plan to use is a Tk Window of the application you can use the window name (e.g., .QW \fB.x.y\fR ) -instead of its window Id (e.g., from \fBwinfo id\fR \fB.x.y\fR). +instead of its window Id (e.g., from \fBwinfo id\fB .x.y\fR). When \fB\-use\fR is not specified, a new toplevel window is created for the .QW . window of the safe interpreter. On X11 if you want the embedded window to use @@ -51,7 +51,7 @@ Tk initialization is now safe with respect to not trusting the child's state for startup. \fBsafe::loadTk\fR registers the child's name so when the Tk initialization (\fBTk_SafeInit\fR) is called and in turn calls the parent's \fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent -(\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.) +(\fB\-use\fI windowId\fR, correct \fB\-display\fR, etc.) .PP When \fB\-use\fR is not used, the new toplevel created is specially decorated so the user is always aware that the user interface presented comes from a diff --git a/doc/menu.n b/doc/menu.n index 0f1decd..40ebf8c 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -13,8 +13,8 @@ menu, tk_menuSetFocus \- Create and manipulate 'menu' widgets and menubars .SH SYNOPSIS .nf -\fBmenu\fR \fIpathName \fR?\fIoptions\fR? -\fBtk_menuSetFocus\fR \fIpathName\fR +\fBmenu\fI pathName \fR?\fIoptions\fR? +\fBtk_menuSetFocus\fI pathName\fR .SO \-activebackground \-borderwidth \-foreground \-activeborderwidth \-cursor \-relief @@ -371,6 +371,7 @@ for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. .PP The following widget commands are possible for menu widgets: +.\" METHOD: activate .TP \fIpathName \fBactivate \fIindex\fR . @@ -380,6 +381,7 @@ Any previously-active entry is deactivated. If \fIindex\fR is specified as \fB{}\fR, or if the specified entry is disabled, then the menu ends up with no active entry. Returns an empty string. +.\" METHOD: add .TP \fIpathName \fBadd \fItype \fR?\fIid\fR? ?\fIoption value option value ...\fR? . @@ -393,6 +395,7 @@ identifier is generated. If additional arguments are present, they specify the options listed in the \fBMENU ENTRY OPTIONS\fR section below. The \fBadd\fR widget command returns the id of the new entry. +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . @@ -400,6 +403,7 @@ Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmenu\fR command. +.\" METHOD: clone .TP \fIpathName \fBclone \fInewPathname\fR ?\fIcloneType\fR? . @@ -409,6 +413,7 @@ propagated to the original menu and vice versa. \fIcloneType\fR can be \fBnormal\fR, \fBmenubar\fR, or \fBtearoff\fR. Should not normally be called outside of the Tk library. See the \fBCLONES\fR section for more information. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -424,6 +429,7 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBmenu\fR command. +.\" METHOD: delete .TP \fIpathName \fBdelete \fIindex1\fR ?\fIindex2\fR? . @@ -432,6 +438,7 @@ Delete all of the menu entries between \fIindex1\fR and If \fIindex2\fR is omitted then it defaults to \fIindex1\fR. Attempts to delete a tear-off menu entry are ignored (instead, you should change the \fB\-tearoff\fR option to remove the tear-off entry). +.\" METHOD: entrycget .TP \fIpathName \fBentrycget \fIindex option\fR . @@ -439,6 +446,7 @@ Returns the current value of a configuration option for the entry given by \fIindex\fR. \fIOption\fR may have any of the names described in the \fBMENU ENTRY OPTIONS\fR section below. +.\" METHOD: entryconfigure .TP \fIpathName \fBentryconfigure \fIindex \fR?\fIoptions...\fR? . @@ -452,6 +460,7 @@ modified as indicated in the command and the command returns an empty string. If no \fIoptions\fR are specified, returns a list describing the current options for entry \fIindex\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). +.\" METHOD: id .TP \fIpathName \fBid \fIindex\fR . @@ -460,11 +469,13 @@ This is the identifier that was assigned to the entry when it was created using the \fBadd\fR or \fBinsert\fR widget command. Returns an empty string for the tear-off entry, or if \fIindex\fR is equivalent to \fB{}\fR. +.\" METHOD: index .TP \fIpathName \fBindex \fIindex\fR . Returns the numerical index corresponding to \fIindex\fR, or \fB{}\fR if \fIindex\fR was specified as \fB{}\fR. +.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex type \fR?\fIid\fR? ?\fIoption value option value ...\fR? . @@ -475,6 +486,7 @@ to the end of the menu. The \fItype\fR, \fIid\fR, \fIoption\fR, and widget command. It is not possible to insert new menu entries before the tear-off entry, if the menu has one. The \fBinsert\fR widget command returns the id of the new entry. +.\" METHOD: invoke .TP \fIpathName \fBinvoke \fIindex\fR . @@ -487,6 +499,7 @@ command. Otherwise the result is an empty string. Note: invoking a menu entry does not automatically unpost the menu; the default bindings normally take care of this before invoking the \fBinvoke\fR widget command. +.\" METHOD: post .TP \fIpathName \fBpost \fIx y\fR ?\fIindex\fR? . @@ -501,6 +514,7 @@ posting the menu and the result of that script is returned as the result of the \fBpost\fR widget command. If an error returns while executing the command, then the error is returned without posting the menu. +.\" METHOD: postcascade .TP \fIpathName \fBpostcascade \fIindex\fR . @@ -510,6 +524,7 @@ If \fIindex\fR does not correspond to a cascade entry, or if \fIpathName\fR is not posted, the command has no effect except to unpost any currently posted submenu. +.\" METHOD: type .TP \fIpathName \fBtype \fIindex\fR . @@ -517,6 +532,7 @@ Returns the type of the menu entry given by \fIindex\fR. This is the \fItype\fR argument passed to the \fBadd\fR or \fBinsert\fR widget command when the entry was created, such as \fBcommand\fR or \fBseparator\fR, or \fBtearoff\fR for a tear-off entry. +.\" METHOD: unpost .TP \fIpathName \fBunpost\fR . @@ -524,11 +540,13 @@ Unmap the window so that it is no longer displayed. If a lower-level cascaded menu is posted, unpost that menu. Returns an empty string. This subcommand does not work on Windows and the Macintosh, as those platforms have their own way of unposting menus. +.\" METHOD: xposition .TP \fIpathName \fBxposition \fIindex\fR . Returns a decimal string giving the x-coordinate within the menu window of the leftmost pixel in the entry specified by \fIindex\fR. +.\" METHOD: yposition .TP \fIpathName \fByposition \fIindex\fR . diff --git a/doc/menubutton.n b/doc/menubutton.n index d07a8fe..375b69a 100644 --- a/doc/menubutton.n +++ b/doc/menubutton.n @@ -12,7 +12,7 @@ .SH NAME menubutton \- Create and manipulate 'menubutton' pop-up menu indicator widgets .SH SYNOPSIS -\fBmenubutton\fR \fIpathName \fR?\fIoptions\fR? +\fBmenubutton\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady @@ -122,6 +122,7 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for menubutton widgets: +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . @@ -129,6 +130,7 @@ Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmenubutton\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . diff --git a/doc/message.n b/doc/message.n index eb83d2f..95547c4 100644 --- a/doc/message.n +++ b/doc/message.n @@ -12,7 +12,7 @@ .SH NAME message \- Create and manipulate 'message' non-interactive text widgets .SH SYNOPSIS -\fBmessage\fR \fIpathName \fR?\fIoptions\fR? +\fBmessage\fI pathName \fR?\fIoptions\fR? .SO \-anchor \-background \-borderwidth \-cursor \-font \-foreground @@ -111,6 +111,7 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for message widgets: +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . @@ -118,6 +119,7 @@ Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmessage\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . diff --git a/doc/messageBox.n b/doc/messageBox.n index 4350b22..b7be4e8 100644 --- a/doc/messageBox.n +++ b/doc/messageBox.n @@ -24,13 +24,13 @@ buttons. Then it returns the symbolic name of the selected button. .PP The following option-value pairs are supported: .TP -\fB\-command\fR \fIstring\fR +\fB\-command\fI string\fR Specifies the prefix of a Tcl command to invoke when the user closes the dialog. The actual command consists of \fIstring\fR followed by a space and the name of the button clicked by the user to close the dialog. This is only available on Mac OS X. .TP -\fB\-default\fR \fIname\fR +\fB\-default\fI name\fR . \fIName\fR gives the symbolic name of the default button for this message window ( @@ -40,36 +40,36 @@ and so on). See \fB\-type\fR for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default. .TP -\fB\-detail\fR \fIstring\fR +\fB\-detail\fI string\fR . Specifies an auxiliary message to the main message given by the \fB\-message\fR option. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message. .TP -\fB\-icon\fR \fIiconImage\fR +\fB\-icon\fI iconImage\fR . Specifies an icon to display. \fIIconImage\fR must be one of the following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or \fBwarning\fR. If this option is not specified, then the info icon will be displayed. .TP -\fB\-message\fR \fIstring\fR +\fB\-message\fI string\fR . Specifies the message to display in this message box. The default value is an empty string. .TP -\fB\-parent\fR \fIwindow\fR +\fB\-parent\fI window\fR . Makes \fIwindow\fR the logical parent of the message box. The message box is displayed on top of its parent window. .TP -\fB\-title\fR \fItitleString\fR +\fB\-title\fI titleString\fR . Specifies a string to display as the title of the message box. The default value is an empty string. .TP -\fB\-type\fR \fIpredefinedType\fR +\fB\-type\fI predefinedType\fR . Arranges for a predefined set of buttons to be displayed. The following values are possible for \fIpredefinedType\fR: diff --git a/doc/nsimage.n b/doc/nsimage.n index 8b401d7..cf2fe82 100644 --- a/doc/nsimage.n +++ b/doc/nsimage.n @@ -37,14 +37,15 @@ This option is required. .TP \fB\-as\fR .PP -There are four possible values for the \fB-as\fR option which specify +There are four possible values for the \fB\-as\fR option which specify how the source string should be interpreted. The allowed values and their meanings are: .IP \fBname\fR .IP The source should be interpreted as the name of a named NSImage -provided by the system. This is the default if the -as option is not specified. +provided by the system. +This is the default if the \fB\-as\fR option is not specified. .IP \fBfile\fR .IP @@ -101,7 +102,7 @@ change slightly. The value of the \fIalpha\fR option should be a floating point number between 0.0 and 1.0. This alpha value will be applied to each pixel of the nsimage, producing a partially transparent image. The default value -is 1,0, which makes the image opaque. +is 1.0, which makes the image opaque. .TP \fB\-pressed\fR .PP diff --git a/doc/option.n b/doc/option.n index 6042010..9ec408f 100644 --- a/doc/option.n +++ b/doc/option.n @@ -22,8 +22,9 @@ option \- Add/retrieve window options to/from the option database .SH DESCRIPTION .PP The \fBoption\fR command allows you to add entries to the Tk option -database or to retrieve options from the database. The \fBadd\fR -form of the command adds a new option to the database. +database or to retrieve options from the database. +.\" METHOD: add +The \fBadd\fR form of the command adds a new option to the database. \fIPattern\fR contains the option being specified, and consists of names and/or classes separated by asterisks or dots, in the usual X format (see @@ -35,6 +36,7 @@ is specified, it indicates the priority level for this option (see below for legal values); it defaults to \fBinteractive\fR. This command always returns an empty string. .PP +.\" METHOD: clear The \fBoption clear\fR command clears the option database. Default options (from the \fBRESOURCE_MANAGER\fR property or the \fB.Xdefaults\fR @@ -42,6 +44,7 @@ file) will be reloaded automatically the next time an option is added to the database or removed from it. This command always returns an empty string. .PP +.\" METHOD: get The \fBoption get\fR command returns the value of the option specified for \fIwindow\fR under \fIname\fR and \fIclass\fR. If several entries in the option @@ -52,6 +55,7 @@ entries at the same priority level, then it returns whichever entry was most recently entered into the option database. If there are no matching entries, then the empty string is returned. .PP +.\" METHOD: readfile The \fBreadfile\fR form of the command reads \fIfileName\fR, which should have the standard format for an X resource database such as \fB.Xdefaults\fR, and adds all the diff --git a/doc/options.n b/doc/options.n index de03ec8..913c912 100644 --- a/doc/options.n +++ b/doc/options.n @@ -60,7 +60,7 @@ Specifies foreground color to use when drawing active elements. See above for definition of active elements. .OP \-activerelief activeRelief Relief Specifies the 3-D effect desired for the active item of the widget. -See the \fB-relief\fR option for details. +See the \fB\-relief\fR option for details. .OP \-anchor anchor Anchor Specifies how the information in a widget (e.g. text or a bitmap) is to be displayed in the widget. diff --git a/doc/pack.n b/doc/pack.n index cdcfeb8..ae12ead 100644 --- a/doc/pack.n +++ b/doc/pack.n @@ -27,8 +27,10 @@ If the first argument to \fBpack\fR is a window name (any value starting with .QW . ), then the command is processed in the same way as \fBpack configure\fR. +.\" METHOD: configure .TP \fBpack configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? +. The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how to manage the content. @@ -124,6 +126,15 @@ If any of the content are already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE +.\" METHOD: content +.TP +\fBpack content \fIwindow\fR +. +Returns a list of all of the content windows in the packing order for \fIwindow\fR. +The order of the content windows in the list is the same as their order in +the packing order. +If \fIwindow\fR has no content then an empty string is returned. +.\" METHOD: forget .TP \fBpack forget \fIwindow \fR?\fIwindow ...\fR? Removes each of the \fIwindow\fRs from the packing order for its @@ -137,6 +148,7 @@ the virtual event \fB<>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE +.\" METHOD: info .TP \fBpack info \fIwindow\fR Returns a list whose elements are the current configuration state of @@ -145,8 +157,10 @@ might be specified to \fBpack configure\fR. The first two elements of the list are .QW "\fB\-in \fIcontainer\fR" where \fIcontainer\fR is the window's container. +.\" METHOD: propagate .TP \fBpack propagate \fIcontainer\fR ?\fIboolean\fR? +. If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR then propagation is enabled for \fIcontainer\fR, which must be a window name (see \fBGEOMETRY PROPAGATION\fR below). @@ -157,12 +171,7 @@ If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIcontainer\fR. Propagation is enabled by default. -.TP -\fBpack content \fIwindow\fR -Returns a list of all of the content windows in the packing order for \fIwindow\fR. -The order of the content windows in the list is the same as their order in -the packing order. -If \fIwindow\fR has no content then an empty string is returned. +.\" METHOD: slaves .TP \fBpack slaves \fIwindow\fR . diff --git a/doc/panedwindow.n b/doc/panedwindow.n index cad256a..54abb8f 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -12,7 +12,7 @@ .SH NAME panedwindow \- Create and manipulate 'panedwindow' split container widgets .SH SYNOPSIS -\fBpanedwindow\fR \fIpathName \fR?\fIoptions\fR? +\fBpanedwindow\fI pathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-orient \-relief @@ -38,17 +38,17 @@ version of the sash is displayed during the resizing to show where the panes will be resized to when releasing the mouse button. This .QW ghost version of the sash is the proxy. It's rendering can be configured -using the \fB-proxybackground\fR, \fB-proxyborderwidth\fR and -\fB-proxyrelief\fR options. +using the \fB\-proxybackground\fR, \fB\-proxyborderwidth\fR and +\fB\-proxyrelief\fR options. .OP \-proxybackground proxyBackground ProxyBackground Background color to use when drawing the proxy. If an empty string, the -value of the \fB-background\fR option will be used. +value of the \fB\-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth Specifies the borderwidth of the proxy. May be any value accepted by \fBTk_GetPixels\fR. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk -relief values. If an empty string, the value of the \fB-sashrelief\fR +relief values. If an empty string, the value of the \fB\-sashrelief\fR option will be used. .OP \-sashcursor sashCursor SashCursor Mouse cursor to use when over a sash. If null, @@ -98,6 +98,7 @@ following general form: the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for panedwindow widgets: +.\" METHOD: add .TP \fIpathName \fBadd \fIwindow \fR?\fIwindow ...\fR? ?\fIoption value ...\fR? . @@ -106,12 +107,14 @@ The arguments consist of the names of one or more windows followed by pairs of arguments that specify how to manage the windows. \fIOption\fR may have any of the values accepted by the \fBconfigure\fR subcommand. +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBpanedwindow\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure \fR?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -126,11 +129,13 @@ one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBpanedwindow\fR command. +.\" METHOD: forget .TP \fIpathName \fBforget \fIwindow \fR?\fIwindow ...\fR? . Remove the pane containing \fIwindow\fR from the panedwindow. All geometry management options for \fIwindow\fR will be forgotten. +.\" METHOD: identify .TP \fIpathName \fBidentify \fIx y\fR . @@ -140,11 +145,13 @@ sash or a sash handle, the result is a two element list containing the index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as {0 sash} or {2 handle}. If the point is over any other part of the panedwindow, the result is an empty list. +.\" METHOD: panecget .TP \fIpathName \fBpanecget \fIwindow option\fR . Query a management option for \fIwindow\fR. \fIOption\fR may be any value allowed by the \fBpaneconfigure\fR subcommand. +.\" METHOD: paneconfigure .TP \fIpathName \fBpaneconfigure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -264,10 +271,12 @@ width requested internally by the window will be used initially; the width may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .RE +.\" METHOD: panes .TP \fIpathName \fBpanes\fR . Returns an ordered list of the widgets managed by \fIpathName\fR. +.\" METHOD: proxy .TP \fIpathName \fBproxy \fR?\fIargs\fR? . @@ -289,6 +298,7 @@ Remove the proxy from the display. . Place the proxy at the given \fIx\fR and \fIy\fR coordinates. .RE +.\" METHOD: sash .TP \fIpathName \fBsash \fR?\fIargs\fR? This command is used to query and change the position of sashes in the diff --git a/doc/photo.n b/doc/photo.n index bc97319..d8a48df 100644 --- a/doc/photo.n +++ b/doc/photo.n @@ -43,7 +43,11 @@ procedural interface. At present, only .VS 8.6 PNG, .VE 8.6 -GIF and PPM/PGM formats are supported, but an interface exists to +GIF, PPM/PGM, +.VS 8.7 +and (read-only) SVG +.VE 8.7 +formats are supported, but an interface exists to allow additional image file formats to be added easily. A photo image is (semi)transparent if the image data it was obtained from had transparency informaton. In regions where no image data has been @@ -151,19 +155,22 @@ case the width and/or height, respectively, of the image will not be changed. .PP The following commands are possible for photo images: +.\" METHOD: blank .TP \fIimageName \fBblank\fR . Blank the image; that is, set the entire image to have no data, so it will be displayed as transparent, and the background of whatever window it is displayed in will show through. The metadata dict of the image is not changed. +.\" METHOD: cget .TP -\fIimageName \fBcget\fR \fIoption\fR +\fIimageName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBimage create\fR \fBphoto\fR command. +.\" METHOD: configure .TP \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -183,8 +190,9 @@ this case the command returns an empty string. Note: setting the \fB\-metadata\fR option without any other option will not invoke the image format driver to recreate the bitmap. .VE 8.7 +.\" METHOD: copy .TP -\fIimageName \fBcopy\fR \fIsourceImage\fR ?\fIoption value(s) ...\fR? +\fIimageName \fBcopy\fI sourceImage\fR ?\fIoption value(s) ...\fR? . Copies a region from the image called \fIsourceImage\fR (which must be a photo image) to the image called \fIimageName\fR, possibly with @@ -250,6 +258,7 @@ is set, the old contents of the destination image are discarded and the source image is used as-is. The default compositing rule is \fIoverlay\fR. .RE +.\" METHOD: data .TP \fIimageName \fBdata\fR ?\fIoption value(s) ...\fR? . @@ -257,7 +266,7 @@ Returns image data in the form of a string. .VS 8.7 The format of the string depends on the format handler. By default, a human readable format as a list of lists of pixel data is used, other -formats can be chosen with the \fB-format\fR option. +formats can be chosen with the \fB\-format\fR option. See \fBIMAGE FORMATS\fR below for details. .VE 8.7 The following options may be specified: @@ -303,7 +312,7 @@ If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 .TP -\fB\-metadata\fR \fImetadata\fR +\fB\-metadata\fI metadata\fR . Image format handler may use metadata to be included in the returned data string. @@ -313,17 +322,19 @@ If no \fB\-metadata\fR option is given, the current metadata of the image is used. .VE 8.7 .RE -\fIimageName \fBget\fR \fIx y\fR ?\fB-withalpha\fR? +.\" METHOD: get +.TP +\fIimageName \fBget\fI x y\fR ?\fB\-withalpha\fR? . Returns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in the image as a list of three integers between 0 and 255, representing the -red, green and blue components respectively. If the \fB-withalpha\fR +red, green and blue components respectively. If the \fB\-withalpha\fR option is specified, the returned list will have a fourth element representing the alpha value of the pixel as an integer between 0 and 255. -.VE 8.7 +.\" METHOD: put .TP -\fIimageName \fBput\fR \fIdata\fR ?\fIoption value(s) ...\fR? +\fIimageName \fBput\fI data\fR ?\fIoption value(s) ...\fR? . Sets pixels in \fI imageName\fR to the data specified in \fIdata\fR. .VS 8.7 @@ -347,7 +358,7 @@ This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .VS 8.7 .TP -\fB\-metadata\fR \fImetadata\fR +\fB\-metadata\fI metadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. @@ -368,8 +379,9 @@ discarded. Note that if \fIdata\fR specifies a single color value, then a region extending to the bottom-right corner represented by (\fIx2\fR,\fIy2\fR) will be filled with that color. .RE +.\" METHOD: read .TP -\fIimageName \fBread\fR \fIfilename\fR ?\fIoption value(s) ...\fR? +\fIimageName \fBread\fI filename\fR ?\fIoption value(s) ...\fR? . Reads image data from the file named \fIfilename\fR into the image. This command first searches the list of @@ -401,7 +413,7 @@ The default, if this option is not specified, is the whole of the image in the image file. .VS 8.7 .TP -\fB\-metadata\fR \fImetadata\fR +\fB\-metadata\fI metadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. @@ -424,6 +436,7 @@ Specifies the coordinates of the top-left corner of the region of \fIimageName\fR into which data from \fIfilename\fR are to be read. The default is (0,0). .RE +.\" METHOD: redither .TP \fIimageName \fBredither\fR . @@ -434,33 +447,32 @@ dithered image may not be exactly correct. Normally the difference is not noticeable, but if it is a problem, this command can be used to recalculate the dithered image in each window where the image is displayed. +.\" METHOD: transparency .TP \fIimageName \fBtransparency \fIsubcommand \fR?\fIarg ...\fR? . Allows examination and manipulation of the transparency information in the photo image. Several subcommands are available: .RS -.VS 8.7 .TP -\fIimageName \fBtransparency get \fIx y\fR ?\fB-alpha\fR? -. +\fIimageName \fBtransparency get \fIx y\fR ?\fB\-alpha\fR? +.VS 8.7 Returns true if the pixel at (\fIx\fR,\fIy\fR) is fully transparent, -false otherwise. If the option \fB-alpha\fR is passed, returns the +false otherwise. If the option \fB\-alpha\fR is passed, returns the alpha value of the pixel instead, as an integer in the range 0 to 255. .VE 8.7 - -.VS 8.7 .TP -\fIimageName \fBtransparency set \fIx y\fR \fInewVal\fR ?\fB-alpha\fR? -. +\fIimageName \fBtransparency set \fIx y newVal\fR ?\fB\-alpha\fR? +.VS 8.7 Change the transparency of the pixel at (\fIx\fR,\fIy\fR) to \fInewVal.\fR If no additional option is passed, \fInewVal\fR is interpreted as a boolean and the pixel is made fully transparent if -that value is true, fully opaque otherwise. If the \fB-alpha\fR +that value is true, fully opaque otherwise. If the \fB\-alpha\fR option is passed, \fInewVal\fR is interpreted as an integral alpha value for the pixel, which must be in the range 0 to 255. .VE 8.7 .RE +.\" METHOD: write .TP \fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR? . @@ -503,7 +515,7 @@ If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 .TP -\fB\-metadata\fR \fBmetadata\fR +\fB\-metadata\fI metadata\fR . Image format handler may use metadata to be included in the written file. The specified \fImetadata\fR is passed to the driver for inclusion in the @@ -518,8 +530,8 @@ The photo image code is structured to allow handlers for additional image file formats to be added easily. The photo image code maintains a list of these handlers. Handlers are added to the list by registering them with a call to \fBTk_CreatePhotoImageFormat\fR. The -standard Tk distribution comes with handlers for PPM/PGM, PNG and GIF -formats, +standard Tk distribution comes with handlers for PPM/PGM, PNG, GIF and +(read-only) SVG formats, .VS 8.7 as well as the \fBdefault\fR handler to encode/decode image data in a human readable form. @@ -555,7 +567,7 @@ from/to a file. Its sole purpose is to encode and decode image data in string form in a clear text, human readable, form. The \fIimageName\fR \fBdata\fR subcommand uses this handler when no other format is specified. When reading image data from a string with \fIimageName\fR -\fBput\fR or the \fB-data\fR option, the default handler is treated +\fBput\fR or the \fB\-data\fR option, the default handler is treated as the other handlers. .PP Image data in the \fBdefault\fR string format is a (top-to-bottom) @@ -579,7 +591,7 @@ The built-in handlers support these suboptions: \fBdefault \-colorformat\fI formatType\fR . The option is allowed when writing image data to a string with -\fIimageName\fR \fBdata\fR. Specifies the format to use for the color +\fIimageName \fBdata\fR. Specifies the format to use for the color string of each pixel. \fIformatType\fR may be one of: \fBrgb\fR to encode pixel data in the form \fB#\fIRRGGBB\fR, \fBrgba\fR to encode pixel data in the form \fB#\fIRRGGBBAA\fR or \fBlist\fR to encode @@ -603,11 +615,13 @@ background on which the image is displayed to show through. This usually also has the effect of desaturating the image. The \fIalphaValue\fR must be between 0.0 and 1.0. .TP -\fBsvg \-dpi\fI dpiValue\fB \-scale\fI scaleValue\fB \-scaletowidth \fI width\fB \-scaletoheight\fI height\fR +\fBsvg \-dpi\fI dpiValue \fB\-scale\fI scaleValue \fB\-scaletowidth\fI width \fB\-scaletoheight\fI height\fR . \fIdpiValue\fR is used in conversion between given coordinates and screen resolution. The value must be greater than 0 and the default value is 96. +.RS +.PP \fIscaleValue\fR is used to scale the resulting image. The value must be greater than 0 and the default value is 1. \fIwidth\fR and \fIheight\fR are the width or height that the image @@ -618,32 +632,51 @@ The svg format supports a wide range of SVG features, but the full SVG standard is not available, for instance the 'text' feature is missing and silently ignored when reading the SVG data. The supported SVG features are: +.TP +\fBelements:\fR . -.RS -\fB elements:\fR g, path, rect, circle, ellipse, line, polyline, polygon, +g, path, rect, circle, ellipse, line, polyline, polygon, linearGradient, radialGradient, stop, defs, svg, style -.PP -\fB attributes:\fR width, height, viewBox, +.TP +\fBattributes:\fR +. +width, height, viewBox, preserveAspectRatio with none, xMin, xMid, xMax, yMin, yMid, yMax, slice -.PP -\fB gradient attributes:\fR gradientUnits with objectBoundingBox, +.TP +\fBgradient attributes:\fR +. +gradientUnits with objectBoundingBox, gradientTransform, cx, cy, r fx, fy x1, y1, x2, y2 spreadMethod with pad, reflect or repeat, xlink:href -.PP -\fB poly attributes: \fR points -.PP -\fB line attributes: \fR x1, y1, x2, y2 -.PP -\fB ellipse attributes: \fR cx, cy, rx, ry -.PP -\fB circle attributes: \fR cx, cy, r -.PP -\fB rectangle attributes: \fR x, y, width, height, rx, ry -.PP -\fB path attributes: \fR d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z -.PP -\fB style attributes: \fR display with none, visibility, hidden, visible, +.TP +\fBpoly attributes:\fR +. +points +.TP +\fBline attributes:\fR +. +x1, y1, x2, y2 +.TP +\fBellipse attributes:\fR +. +cx, cy, rx, ry +.TP +\fBcircle attributes:\fR +. +cx, cy, r +.TP +\fBrectangle attributes:\fR +. +x, y, width, height, rx, ry +.TP +\fBpath attributes:\fR +. +d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z +.TP +\fBstyle attributes:\fR +. +display with none, visibility, hidden, visible, fill with nonzero and evenodd, opacity, fill-opacity, stroke, stroke-width, stroke-dasharray, stroke-dashoffset, stroke-opacity, stroke-linecap with butt, round and square, @@ -652,10 +685,11 @@ fill-rule, font-size, transform with matrix, translate, scale, rotate, skewX and skewY, stop-color, stop-opacity, offset, id, class .RE -. +.PP Currently only SVG images reading and conversion into (pixel-based format) photos is supported: Tk does not (yet) support bundling photo images in SVG vector graphics. +.RE .VE 8.6 .VS 8.7 .SH "COLOR FORMATS" @@ -747,45 +781,46 @@ parsed, or may use metadata to be included in image files or formats. Each image format driver supports an individual set of metadata dictionary keys. Predefined keys are: .TP -DPI +\fBDPI\fR . Horizontal image resolution in DPI as a double value. Supported by format \fBpng\fR. .TP -aspect +\fBaspect\fR . Aspect ratio horizontal divided by vertical as double value. Supported by formats \fBgif\fR and \fBpng\fR. .TP -comment +\fBcomment\fR . Image text comment. Supported by formats \fBgif\fR and \fBpng\fR. .PP It is valid to set any key in the metadata dict. -A format driver will ignore keys it does not handle. +A format driver will ignore keys that it does not handle. .SS "METADATA KEYS FOR ANIMATED GIF INFORMATION" .PP The following metadata keys are reported when reading a \fBgif\fR format file. -They are typically used in conjunction with the \fI-index\fR option of an +They are typically used in conjunction with the \fB\-index\fR option of an animated \fBgif\fR file to properly display the subimage sequence. -The options are linked to each subimage selected by \fI-index\fR. +The options are linked to each subimage selected by \fB\-index\fR. .TP -\fBdelay time\fR \fItime\fR +\fBdelay time\fI time\fR . -Update delay time in 10ms unit. This key is only present, if delay time is not 0. +Update delay time in 10ms units. This key is only present if the delay time is not 0. .TP -\fBdisposal method\fR \fImethod\fR +\fBdisposal method\fI method\fR . Disposal method of the preceeding image, if given for the current image. -Possible values are: \fIdo not dispose\fR, \fIrestore to background color\fR, \fIrestore to previous\fR. +Possible values are: \fBdo not dispose\fR, \fBrestore to background color\fR, +\fBrestore to previous\fR. .TP -\fBuser interaction\fR \fIbool\fR +\fBuser interaction\fI bool\fR . The key is present with a value of 1, if user interaction is specified. Otherwise, the key is not present. .TP -\fBupdate region\fR \fIX0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR +\fBupdate region\fI X0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR . Update region of the current subimage, if subimage has not the same size as the full image. The pixel outside of this box are all fully transparent. diff --git a/doc/place.n b/doc/place.n index b56ad58..b1189cd 100644 --- a/doc/place.n +++ b/doc/place.n @@ -30,13 +30,16 @@ centered inside the container. .PP .TP \fBplace \fIwindow option value \fR?\fIoption value ...\fR? +. Arrange for the placer to manage the geometry of a content whose pathName is \fIwindow\fR. The remaining arguments consist of one or more \fIoption\-value\fR pairs that specify the way in which \fIwindow\fR's geometry is managed. \fIOption\fR may have any of the values accepted by the \fBplace configure\fR command. +.\" METHOD: configure .TP \fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the geometry options of the content given by \fIwindow\fR. If no \fIoption\fR is specified, this command returns a list describing the available options (see \fBTk_ConfigureInfo\fR for @@ -177,23 +180,30 @@ If the same value is specified separately with two different options, such as \fB\-x\fR and \fB\-relx\fR, then the most recent option is used and the older one is ignored. .RE +.\" METHOD: content +.TP +\fBplace content \fIwindow\fR +. +Returns a list of all the content windows for which \fIwindow\fR is the container. +If there is no content for \fIwindow\fR then an empty string is returned. +.\" METHOD: forget .TP \fBplace forget \fIwindow\fR +. Causes the placer to stop managing the geometry of \fIwindow\fR. As a side effect of this command \fIwindow\fR will be unmapped so that it does not appear on the screen. If \fIwindow\fR is not currently managed by the placer then the command has no effect. This command returns an empty string. +.\" METHOD: info .TP \fBplace info \fIwindow\fR +. Returns a list giving the current configuration of \fIwindow\fR. The list consists of \fIoption\-value\fR pairs in exactly the same form as might be specified to the \fBplace configure\fR command. -.TP -\fBplace content \fIwindow\fR -Returns a list of all the content windows for which \fIwindow\fR is the container. -If there is no content for \fIwindow\fR then an empty string is returned. +.\" METHOD: slaves .TP \fBplace slaves \fIwindow\fR . diff --git a/doc/radiobutton.n b/doc/radiobutton.n index 2169515..6033954 100644 --- a/doc/radiobutton.n +++ b/doc/radiobutton.n @@ -12,7 +12,7 @@ .SH NAME radiobutton \- Create and manipulate 'radiobutton' pick-one widgets .SH SYNOPSIS -\fBradiobutton\fR \fIpathName \fR?\fIoptions\fR? +\fBradiobutton\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady @@ -181,13 +181,15 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for radiobutton widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBradiobutton\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -203,6 +205,7 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBradiobutton\fR command. +.\" METHOD: deselect .TP \fIpathName \fBdeselect\fR . @@ -210,6 +213,7 @@ Deselects the radiobutton and sets the associated variable to an empty string. If this radiobutton was not currently selected, the command has no effect. +.\" METHOD: flash .TP \fIpathName \fBflash\fR . @@ -218,6 +222,7 @@ several times, alternating between active and normal colors. At the end of the flash the radiobutton is left in the same normal/active state as when the command was invoked. This command is ignored if the radiobutton's state is \fBdisabled\fR. +.\" METHOD: invoke .TP \fIpathName \fBinvoke\fR . @@ -227,6 +232,7 @@ its associated Tcl command, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the radiobutton. This command is ignored if the radiobutton's state is \fBdisabled\fR. +.\" METHOD: select .TP \fIpathName \fBselect\fR . diff --git a/doc/scale.n b/doc/scale.n index 0499d0a..97e0de3 100644 --- a/doc/scale.n +++ b/doc/scale.n @@ -12,7 +12,7 @@ .SH NAME scale \- Create and manipulate 'scale' value-controlled slider widgets .SH SYNOPSIS -\fBscale\fR \fIpathName \fR?\fIoptions\fR? +\fBscale\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-foreground \-relief \-background \-highlightbackground \-repeatdelay @@ -143,13 +143,15 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for scale widgets: +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBscale\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -165,6 +167,7 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBscale\fR command. +.\" METHOD: coords .TP \fIpathName \fBcoords \fR?\fIvalue\fR? . @@ -172,6 +175,7 @@ Returns a list whose elements are the x and y coordinates of the point along the centerline of the trough that corresponds to \fIvalue\fR. If \fIvalue\fR is omitted then the scale's current value is used. +.\" METHOD: get .TP \fIpathName \fBget\fR ?\fIx y\fR? . @@ -181,6 +185,7 @@ pixel coordinates within the widget; the command returns the scale value corresponding to the given pixel. Only one of \fIx\fR or \fIy\fR is used: for horizontal scales \fIy\fR is ignored, and for vertical scales \fIx\fR is ignored. +.\" METHOD: identify .TP \fIpathName \fBidentify \fIx y\fR . @@ -193,6 +198,7 @@ and \fBtrough2\fR means that the point is over the portion of the slider below or to the right of the slider. If the point is not over one of these elements, an empty string is returned. +.\" METHOD: set .TP \fIpathName \fBset \fIvalue\fR . diff --git a/doc/scrollbar.n b/doc/scrollbar.n index fee959d..86b6214 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -12,7 +12,7 @@ .SH NAME scrollbar \- Create and manipulate 'scrollbar' scrolling control and indicator widgets .SH SYNOPSIS -\fBscrollbar\fR \fIpathName \fR?\fIoptions\fR? +\fBscrollbar\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-highlightcolor \-repeatdelay \-background \-highlightthickness \-repeatinterval @@ -108,6 +108,7 @@ operations on the widget. It has the following general form: \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for scrollbar widgets: +.\" METHOD: activate .TP \fIpathName \fBactivate \fR?\fIelement\fR? . @@ -121,6 +122,7 @@ will be active. If \fIelement\fR is not specified, the command returns the name of the element that is currently active, or an empty string if no element is active. +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . @@ -128,6 +130,7 @@ Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -143,6 +146,7 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR command. +.\" METHOD: delta .TP \fIpathName \fBdelta \fIdeltaX deltaY\fR . @@ -155,6 +159,7 @@ ignored in this case). If the scrollbar is vertical, the result indicates how much the scrollbar setting must change to move the slider \fIdeltaY\fR pixels down. The arguments and the result may be zero or negative. +.\" METHOD: fraction .TP \fIpathName \fBfraction \fIx y\fR . @@ -167,11 +172,13 @@ the middle, and so on. widget. If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest point in the trough is used. +.\" METHOD: get .TP \fIpathName \fBget\fR . Returns the scrollbar settings in the form of a list whose elements are the arguments to the most recent \fBset\fR widget command. +.\" METHOD: identify .TP \fIpathName \fBidentify \fIx y\fR . @@ -180,6 +187,7 @@ Returns the name of the element under the point given by \fIx\fR and not lie in any element of the scrollbar. \fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar widget. +.\" METHOD: set .TP \fIpathName \fBset \fIfirst last\fR . diff --git a/doc/selection.n b/doc/selection.n index a26c5d9..19117ee 100644 --- a/doc/selection.n +++ b/doc/selection.n @@ -26,8 +26,9 @@ Note that for management of the \fBCLIPBOARD\fR selection (see below), the The first argument to \fBselection\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: +.\" METHOD: clear .TP -\fBselection clear\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? +\fBselection clear\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? . If \fIselection\fR exists anywhere on \fIwindow\fR's display, clear it so that no window owns the selection anymore. \fISelection\fR @@ -37,8 +38,9 @@ Communication Conventions Manual for complete details. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . Returns an empty string. +.\" METHOD: get .TP -\fBselection get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR? +\fBselection get\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? ?\fB\-type\fI type\fR? . Retrieves the value of \fIselection\fR from \fIwindow\fR's display and returns it as a result. \fISelection\fR defaults to \fBPRIMARY\fR and @@ -61,8 +63,9 @@ collection of fields separated by spaces: atoms are converted to their textual names, and anything else is converted to hexadecimal integers. Note that \fBselection get\fR does not retrieve the selection in the \fBUTF8_STRING\fR format unless told to. +.\" METHOD: handle .TP -\fBselection handle\fR ?\fB\-selection\fR \fIs\fR? ?\fB\-type\fR \fIt\fR? ?\fB\-format\fR \fIf\fR? \fIwindow command\fR +\fBselection handle\fR ?\fB\-selection\fI s\fR? ?\fB\-type\fI t\fR? ?\fB\-format\fI f\fR? \fIwindow command\fR . Creates a handler for selection requests, such that \fIcommand\fR will be executed whenever selection \fIs\fR is owned by \fIwindow\fR and @@ -119,10 +122,11 @@ used to retrieve the selection then the value is converted back to a string at the requesting end, so \fIformat\fR is irrelevant. .RE +.\" METHOD: own .TP -\fBselection own\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? +\fBselection own\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? .TP -\fBselection own\fR ?\fB\-command\fR \fIcommand\fR? ?\fB\-selection\fR \fIselection\fR? \fIwindow\fR +\fBselection own\fR ?\fB\-command\fI command\fR? ?\fB\-selection\fI selection\fR? \fIwindow\fR . The first form of \fBselection own\fR returns the path name of the window in this application that owns \fIselection\fR on the display @@ -142,23 +146,42 @@ some other window claims ownership of the selection away from .RE .SH WIDGET FACILITIES .PP -The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a widget has this option set to boolean \fBtrue\fR, then (in an unsafe interpreter) a selection made in the widget is automatically written to the \fBPRIMARY\fR selection. +The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR +and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a +widget has this option set to boolean \fBtrue\fR, then (in an unsafe +interpreter) a selection made in the widget is automatically written to the +\fBPRIMARY\fR selection. .PP -A GUI event, for example \fB<>\fR, can copy the \fBPRIMARY\fR selection to certain widgets. This copy is implemented by a widget binding to the event. The binding script makes appropriate calls to the \fBselection\fR command. +A GUI event, for example \fB<>\fR, can copy the \fBPRIMARY\fR +selection to certain widgets. This copy is implemented by a widget binding to +the event. The binding script makes appropriate calls to the \fBselection\fR +command. .PP .SH PORTABILITY ISSUES .PP -On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, allowing communication between different processes that are X11 clients. +On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, +allowing communication between different processes that are X11 clients. .PP -On Windows, the \fBPRIMARY\fR selection is not provided by the system, but only by Tk, and so it is shared only between windows of a parent interpreter and its child interpreters. It is not shared between interpreters in different processes or different threads. Each parent interpreter has a separate \fBPRIMARY\fR selection that is shared only with its child interpreters which are not safe interpreters. +On Windows, the \fBPRIMARY\fR selection is not provided by the system, but +only by Tk, and so it is shared only between windows of a parent interpreter +and its child interpreters. It is not shared between interpreters in +different processes or different threads. Each parent interpreter has a +separate \fBPRIMARY\fR selection that is shared only with its child +interpreters which are not safe interpreters. .PP .SH SECURITY .PP -A safe interpreter cannot read from the \fBPRIMARY\fR selection because its \fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR selection cannot be written to the Tk widgets of a safe interpreter. +A safe interpreter cannot read from the \fBPRIMARY\fR selection because its +\fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR +selection cannot be written to the Tk widgets of a safe interpreter. .PP -A Tk widget can have its option \fB\-exportselection\fR set to boolean \fBtrue\fR, but in a safe interpreter this option has no effect: writing from the widget to the \fBPRIMARY\fR selection is disabled. +A Tk widget can have its option \fB\-exportselection\fR set to boolean +\fBtrue\fR, but in a safe interpreter this option has no effect: writing +from the widget to the \fBPRIMARY\fR selection is disabled. .PP -These are security features. A safe interpreter may run untrusted code, and it is a security risk if this untrusted code can read or write the \fBPRIMARY\fR selection used by other interpreters. +These are security features. A safe interpreter may run untrusted code, and +it is a security risk if this untrusted code can read or write the +\fBPRIMARY\fR selection used by other interpreters. .PP .SH EXAMPLES .PP diff --git a/doc/send.n b/doc/send.n index f200128..b8a92c5 100644 --- a/doc/send.n +++ b/doc/send.n @@ -39,7 +39,7 @@ and errors in the sent command will be ignored. If the target application is in the same process as the sending application then the \fB\-async\fR option is ignored. .TP -\fB\-displayof\fR \fIpathName\fR +\fB\-displayof\fI pathName\fR Specifies that the target application's main window is on the display of the window given by \fIpathName\fR, instead of the display containing the application's main window. diff --git a/doc/spinbox.n b/doc/spinbox.n index 104ef13..d358e62 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -12,7 +12,7 @@ .SH NAME spinbox \- Create and manipulate 'spinbox' value spinner widgets .SH SYNOPSIS -\fBspinbox\fR \fIpathName \fR?\fIoptions\fR? +\fBspinbox\fI pathName \fR?\fIoptions\fR? .SO \-activebackground \-highlightthickness \-repeatinterval \-background \-insertbackground \-selectbackground @@ -220,19 +220,19 @@ were editing the spinbox widget from). It is also recommended to not set an associated \fB\-textvariable\fR during validation, as that can cause the spinbox widget to become out of sync with the \fB\-textvariable\fR. .PP -Also, the \fB-validate\fR option will set itself to \fBnone\fR when the -spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR -and the \fB-validatecommand\fR returns false. For instance +Also, the \fB\-validate\fR option will set itself to \fBnone\fR when the +spinbox value gets changed because of adjustment of \fB\-from\fR or \fB\-to\fR +and the \fB\-validatecommand\fR returns false. For instance .CS \fIspinbox pathName \-from 1 \-to 10 \-validate all \-validatecommand {return 0}\fR .CE -will in fact set the \fB-validate\fR option to \fBnone\fR because the default -value for the spinbox gets changed (due to the \fB-from\fR and \fB-to\fR +will in fact set the \fB\-validate\fR option to \fBnone\fR because the default +value for the spinbox gets changed (due to the \fB\-from\fR and \fB\-to\fR options) to a value not accepted by the validation script. .PP Moreover, forced validation is performed when invoking any spinbutton of the spinbox. If the validation script returns false in this situation, -then the \fB-validate\fR option will be automatically set to \fBnone\fR. +then the \fB\-validate\fR option will be automatically set to \fBnone\fR. .SH "WIDGET COMMAND" .PP The \fBspinbox\fR command creates a new Tcl command whose @@ -294,8 +294,10 @@ arithmetic and indexing relative to \fBend\fR. .SS SUBCOMMANDS .PP The following commands are possible for spinbox widgets: +.\" METHOD: bbox .TP \fIpathName \fBbbox \fIindex\fR +. Returns a list of four numbers describing the bounding box of the character given by \fIindex\fR. The first two elements of the list give the x and y coordinates of @@ -304,14 +306,18 @@ the upper-left corner of the screen area covered by the character the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBspinbox\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -324,8 +330,10 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBspinbox\fR command. +.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? +. Delete one or more elements of the spinbox. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last @@ -333,31 +341,45 @@ one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns an empty string. +.\" METHOD: get .TP \fIpathName \fBget\fR +. Returns the spinbox's string. +.\" METHOD: icursor .TP \fIpathName \fBicursor \fIindex\fR +. Arrange for the insertion cursor to be displayed just before the character given by \fIindex\fR. Returns an empty string. +.\" METHOD: identify .TP \fIpathName \fBidentify\fI x y\fR +. Returns the name of the window element corresponding to coordinates \fIx\fR and \fIy\fR in the spinbox. Return value is one of: \fBnone\fR, \fBbuttondown\fR, \fBbuttonup\fR, \fBentry\fR. +.\" METHOD: index .TP \fIpathName \fBindex\fI index\fR +. Returns the numerical index corresponding to \fIindex\fR. +.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex string\fR +. Insert the characters of \fIstring\fR just before the character indicated by \fIindex\fR. Returns an empty string. +.\" METHOD: invoke .TP \fIpathName \fBinvoke\fI element\fR +. Causes the specified element, either \fBbuttondown\fR or \fBbuttonup\fR, to be invoked, triggering the action associated with it. +.\" METHOD: scan .TP -\fIpathName \fBscan\fR \fIoption args\fR +\fIpathName \fBscan\fI option args\fR +. This command is used to implement scanning on spinboxes. It has two forms, depending on \fIoption\fR: .RS @@ -377,13 +399,16 @@ with mouse motion events in the widget, to produce the effect of dragging the spinbox at high speed through the window. The return value is an empty string. .RE +.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR +. This command is used to adjust the selection within a spinbox. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection adjust \fIindex\fR +. Locate the end of the selection nearest to the character given by \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR (i.e. including but not going beyond \fIindex\fR). The other @@ -395,24 +420,29 @@ selection anchor point, inclusive. Returns an empty string. .TP \fIpathName \fBselection clear\fR +. Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns an empty string. .TP \fIpathName \fBselection element\fR ?\fIelement\fR? +. Sets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed. .TP \fIpathName \fBselection from \fIindex\fR +. Set the selection anchor point to just before the character given by \fIindex\fR. Does not change the selection. Returns an empty string. .TP \fIpathName \fBselection present\fR +. Returns 1 if there is are characters selected in the spinbox, 0 if nothing is selected. .TP \fIpathName \fBselection range \fIstart end\fR +. Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. @@ -420,6 +450,7 @@ If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the spinbox's selection is cleared. .TP \fIpathName \fBselection to \fIindex\fR +. If \fIindex\fR is before the anchor point, set the selection to the characters from \fIindex\fR up to but not including the anchor point. @@ -433,25 +464,32 @@ If the selection is not in this widget then a new selection is created using the most recent anchor point specified for the widget. Returns an empty string. .RE +.\" METHOD: set .TP \fIpathName \fBset\fR ?\fIstring\fR? +. If \fIstring\fR is specified, the spinbox will try and set it to this value, otherwise it just returns the spinbox's string. If validation is on, it will occur when setting the string. +.\" METHOD: validate .TP \fIpathName \fBvalidate\fR +. This command is used to force an evaluation of the \fB\-validatecommand\fR independent of the conditions specified by the \fB\-validate\fR option. This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. +.\" METHOD: xview .TP \fIpathName \fBxview \fIargs\fR +. This command is used to query and change the horizontal position of the text in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fBxview\fR +. Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the horizontal span that is visible in the window. @@ -462,15 +500,18 @@ These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP \fIpathName \fBxview \fIindex\fR +. Adjusts the view in the window so that the character given by \fIindex\fR is displayed at the left edge of the window. .TP \fIpathName \fBxview moveto\fI fraction\fR +. Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR +. This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then diff --git a/doc/sysnotify.n b/doc/sysnotify.n index ea1ab89..ea126b4 100644 --- a/doc/sysnotify.n +++ b/doc/sysnotify.n @@ -10,11 +10,13 @@ .SH NAME sysnotify \- Creates a notification window with a title and message. .SH SYNOPSIS -\fBtk sysnotify\fR \fItitle\fR \fImessage\fR +\fBtk sysnotify\fI title message\fR .BE .SH DESCRIPTION .PP -The \fBtk sysnotify\fR command creates a platform-specific system notification alert. Its intent is to provide a brief, unobtrusive notification to the user by popping up a window that briefly appears in a corner of the screen. +The \fBtk sysnotify\fR command creates a platform-specific system notification +alert. Its intent is to provide a brief, unobtrusive notification to the user +by popping up a window that briefly appears in a corner of the screen. .SH EXAMPLE .PP Here is an example of the \fBtk sysnotify\fR code: diff --git a/doc/systray.n b/doc/systray.n index ed89e1a..8b875d1 100644 --- a/doc/systray.n +++ b/doc/systray.n @@ -10,7 +10,7 @@ .SH NAME systray \- Creates an icon display in the platform-specific system tray. .SH SYNOPSIS -\fBtk systray create \fI-image image\fR \fI?-text text\fR? \fI?-button1 callback?\fR \fI?-button3 callback?\fR +\fBtk systray create \fB\-image \fIimage\fR ?\fB\-text \fItext\fR? ?\fB\-button1 \fIcallback\fR? ?\fB\-button3 \fIcallback\fR? .sp \fBtk systray configure \fI?option? ?value option value ...?\fR .sp @@ -21,21 +21,25 @@ systray \- Creates an icon display in the platform-specific system tray. .BE .SH DESCRIPTION .PP +.\" METHOD: create The \fBtk systray create\fR command creates an icon in the platform-specific tray. The widget is configured with a Tk image for the icon display, an optional string for display in a tooltip, and optional callbacks that are bound to and . .PP +.\" METHOD: configure The \fBtk systray configure\fR command sets one or more options of the systray icon. Configurable options are the same as for the \fBcreate\fR subcommand. When a single option name is given, the command returns the current value of this option. When no option is given this command returns the list of all options and their current value. .PP +.\" METHOD: exists The \fBtk systray exists\fR command checks whether a systray icon was created. It returns a boolean. .PP - The \fBtk systray destroy\fR command removes the icon from display and +.\" METHOD: destroy +The \fBtk systray destroy\fR command removes the icon from display and deallocates it. .PP From a user-interface standpoint, only one icon per interpreter is @@ -46,16 +50,26 @@ running instance of Wish will allow additional icons to be displayed. .SH EXAMPLE .PP Here is an example of the \fBtk systray\fR code: +.RS .CS - image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== - tk systray create -image book -text "tk systray sample" -button1 {puts "Here is the tk systray output"} -button3 {puts "here is alternate output"} +image create photo book -data \e + R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== +tk systray create -image book -text "tk systray sample" \e + -button1 {puts "Here is the tk systray output"} \e + -button3 {puts "here is alternate output"} .CE +.RE .PP Here is an example of modifying the \fBtk systray\fR icon: +.RS .CS - image create photo book_page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7 - tk systray configure -image book_page -text "Updated sample" -button1 {puts "Different output from the tk systray"} -button3 {puts "and more different output from the tk systray"} +image create photo book_page -data \e + R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7 +tk systray configure -image book_page -text "Updated sample" \e + -button1 {puts "Different output from the tk systray"} \e + -button3 {puts "and more different output from the tk systray"} .CE +.RE .SH PLATFORM NOTES .PP The X11 implementation is supported on a "best efforts" basis because it is @@ -63,7 +77,7 @@ dependent on the window manager. The "text" flag, which is implemented as a tooltip, does not always display if the WM does not support such features; the systray icon itself may not even display with some window managers. .PP -On Windows, the Tk image provided in the \fI-image\fR option must be a +On Windows, the Tk image provided in the \fB\-image\fR option must be a photo image. On other platforms either a bitmap image or a photo image may be provided. .SH KEYWORDS diff --git a/doc/text.n b/doc/text.n index 7498cb5..bd1f029 100644 --- a/doc/text.n +++ b/doc/text.n @@ -13,10 +13,10 @@ text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate 'text' hypertext editing widgets .SH SYNOPSIS .nf -\fBtext\fR \fIpathName \fR?\fIoptions\fR? -\fBtk_textCopy\fR \fIpathName\fR -\fBtk_textCut\fR \fIpathName\fR -\fBtk_textPaste\fR \fIpathName\fR +\fBtext\fI pathName \fR?\fIoptions\fR? +\fBtk_textCopy\fI pathName\fR +\fBtk_textCut\fI pathName\fR +\fBtk_textPaste\fI pathName\fR .SO \-background \-highlightthickness \-relief \-borderwidth \-insertbackground \-selectbackground @@ -493,8 +493,8 @@ contain characters because they are indented by \fB\-lmargin1\fR or \fB\-lmargin2\fR. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color used is specified by the -\fB-background\fR tag option (or, if this is also unspecified, by the -\fB-background\fR widget option). +\fB\-background\fR tag option (or, if this is also unspecified, by the +\fB\-background\fR widget option). .TP \fB\-offset \fIpixels\fR . @@ -540,8 +540,8 @@ character of that display line. contain characters because they are indented by \fB\-rmargin\fR. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color -used is specified by the \fB-background\fR tag option (or, if this is also -unspecified, by the \fB-background\fR widget option). +used is specified by the \fB\-background\fR tag option (or, if this is also +unspecified, by the \fB\-background\fR widget option). .TP \fB\-selectbackground \fIcolor\fR \fIColor\fR specifies the background color to use when displaying selected @@ -695,9 +695,9 @@ then the window is destroyed. Similarly if the text widget as a whole is deleted, then the window is destroyed. .PP Eliding an embedded window immediately after scheduling it for creation via -\fIpathName \fBwindow create \fIindex \fB-create\fR will prevent it from being +\fIpathName \fBwindow create \fIindex \fB\-create\fR will prevent it from being effectively created. Uneliding an elided embedded window scheduled for creation -via \fIpathName \fBwindow create \fIindex \fB-create\fR will automatically +via \fIpathName \fBwindow create \fIindex \fB\-create\fR will automatically trigger the associated creation script. After destroying an elided embedded window, the latter won't get automatically recreated. .PP @@ -774,9 +774,9 @@ containing the embedded image is deleted then that copy of the image is removed from the screen. .PP Eliding an embedded image immediately after scheduling it for creation via -\fIpathName \fBimage create \fIindex \fB-create\fR will prevent it from being +\fIpathName \fBimage create \fIindex \fB\-create\fR will prevent it from being effectively created. Uneliding an elided embedded image scheduled for creation -via \fIpathName \fBimage create \fIindex \fB-create\fR will automatically +via \fIpathName \fBimage create \fIindex \fB\-create\fR will automatically trigger the associated creation script. After destroying an elided embedded image, the latter won't get automatically recreated. .PP @@ -978,7 +978,7 @@ In order to maintain a responsive user-experience, the text widget calculates lines metrics (line heights in pixels) asynchronously. Because of this, some commands of the text widget may return wrong results if the asynchronous calculations are not finished at the time of calling. This applies to -\fIpathName \fBcount -ypixels\fR and \fIpathName \fByview\fR. +\fIpathName \fBcount \-ypixels\fR and \fIpathName \fByview\fR. .PP Again for performance reasons, it would not be appropriate to let these commands always wait for the end of the update calculation each time they are @@ -1060,6 +1060,7 @@ operations on the widget. It has the following general form: \fIPathName\fR is the name of the command, which is the same as the text widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for text widgets: +.\" METHOD: bbox .TP \fIpathName \fBbbox \fIindex\fR . @@ -1070,13 +1071,15 @@ and the last two elements give the width and height of the area. If the character is only partially visible on the screen, then the return value reflects just the visible part. If the character is not visible on the screen then the return value is an empty list. +.\" METHOD: cget .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget\fI option\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBtext\fR command. +.\" METHOD: compare .TP -\fIpathName \fBcompare\fR \fIindex1 op index2\fR +\fIpathName \fBcompare\fI index1 op index2\fR . Compares the indices given by \fIindex1\fR and \fIindex2\fR according to the relational operator given by \fIop\fR, and returns 1 if the relationship is @@ -1084,6 +1087,7 @@ satisfied and 0 if it is not. \fIOp\fR must be one of the operators <, <=, ==, >=, >, or !=. If \fIop\fR is == then 1 is returned if the two indices refer to the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR refers to an earlier character in the text than \fIindex2\fR, and so on. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -1097,6 +1101,7 @@ specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBtext\fR command. +.\" METHOD: count .TP \fIpathName \fBcount\fR ?\fIoptions\fR? \fIindex1 index2\fR . @@ -1160,6 +1165,7 @@ supplied. For example .QW ".text count \-xpixels \-ypixels 1.3 4.5" is perfectly valid and will return a list of two elements. .RE +.\" METHOD: debug .TP \fIpathName \fBdebug \fR?\fIboolean\fR? . @@ -1180,6 +1186,7 @@ global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR to the lists of indices that are redrawn. The values of these variables are tested by Tk's test suite. .RE +.\" METHOD: delete .TP \fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR? . @@ -1207,6 +1214,7 @@ side-effects. If multiple ranges with the same start index are given, then the longest range is used. If overlapping ranges are given, then they will be merged into spans that do not cause deletion of text outside the given ranges due to text shifted during deletion. +.\" METHOD: dlineinfo .TP \fIpathName \fBdlineinfo \fIindex\fR . @@ -1223,6 +1231,7 @@ width of the window then the area returned reflects just the portion of the line that is occupied by characters and embedded windows. If the display line containing \fIindex\fR is not visible on the screen then the return value is an empty list. +.\" METHOD: dump .TP \fIpathName \fBdump \fR?\fIswitches\fR? \fIindex1 \fR?\fIindex2\fR? . @@ -1283,6 +1292,7 @@ window is its Tk pathname, unless the window has not been created yet. (It must have a create script.) In this case an empty string is returned, and you must query the window by its index position to get more information. .RE +.\" METHOD: edit .TP \fIpathName \fBedit \fIoption \fR?\fIarg ...\fR? . @@ -1333,6 +1343,7 @@ edit action is defined as all the insert and delete commands that are recorded on the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the \fB\-undo\fR option is false. .RE +.\" METHOD: get .TP \fIpathName \fBget\fR ?\fB\-displaychars\fR? ?\fB\-\-\fR? \fIindex1\fR ?\fIindex2 ...\fR? . @@ -1351,6 +1362,7 @@ order passed to \fIpathName \fBget\fR. If the \fB\-displaychars\fR option is given, then, within each range, only those characters which are not elided will be returned. This may have the effect that some of the returned ranges are empty strings. +.\" METHOD: image .TP \fIpathName \fBimage \fIoption \fR?\fIarg ...\fR? . @@ -1393,12 +1405,14 @@ identifier returned. Returns a list whose elements are the names of all image instances currently embedded in \fIwindow\fR. .RE +.\" METHOD: index .TP \fIpathName \fBindex \fIindex\fR . Returns the position corresponding to \fIindex\fR in the form \fIline.char\fR where \fIline\fR is the line number and \fIchar\fR is the character number. \fIIndex\fR may have any of the forms described under \fBINDICES\fR above. +.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex chars \fR?\fItagList chars tagList ...\fR? . @@ -1416,6 +1430,7 @@ of the tags present around the insertion point. If multiple effect as if a separate \fIpathName \fBinsert\fR widget command had been issued for each pair, in order. The last \fItagList\fR argument may be omitted. +.\" METHOD: mark .TP \fIpathName \fBmark \fIoption \fR?\fIarg ...\fR? . @@ -1446,7 +1461,7 @@ position if there are multiple marks at the same index. These semantics mean that the \fBmark next\fR operation can be used to step through all the marks in a text widget in the same order as the mark information returned by the \fIpathName \fBdump\fR operation. If a mark has been set to the special -\fBend\fR index, then it appears to be \fIafter\fR \fBend\fR with respect to +\fBend\fR index, then it appears to be \fIafter \fBend\fR with respect to the \fIpathName \fBmark next\fR operation. An empty string is returned if there are no marks after \fIindex\fR. .TP @@ -1478,6 +1493,7 @@ calls to .QW "\fIpathName \fBmark names\fR" . This command returns an empty string. .RE +.\" METHOD: peer .TP \fIpathName \fBpeer \fIoption args\fR . @@ -1497,11 +1513,15 @@ be overridden with the standard configuration options. Returns a list of peers of this widget (this does not include the widget itself). The order within this list is undefined. .RE +.\" METHOD: pendingsync .TP \fIpathName \fBpendingsync\fR +. Returns 1 if the line heights calculations are not up-to-date, 0 otherwise. +.\" METHOD: replace .TP -\fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR? +\fIpathName \fBreplace\fI index1 index2 chars\fR ?\fItagList chars tagList ...\fR? +. Replaces the range of characters between \fIindex1\fR and \fIindex2\fR with the given characters and tags. See the section on \fIpathName \fBinsert\fR for an explanation of the handling of the \fItagList...\fR @@ -1516,6 +1536,7 @@ the window or movement of insertion cursor occurs. In addition the undo/redo stack are correctly modified, if undo operations are active in the text widget. The command returns an empty string. .RE +.\" METHOD: scan .TP \fIpathName \fBscan \fIoption args\fR . @@ -1539,6 +1560,7 @@ coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the text at high speed through the window. The return value is an empty string. .RE +.\" METHOD: search .TP \fIpathName \fBsearch \fR?\fIswitches\fR? \fIpattern index \fR?\fIstopIndex\fR? . @@ -1670,6 +1692,7 @@ no wrap-around will occur. This means that, for example, if the search is \fIstartIndex\fR, nothing will ever be found. See \fBKNOWN BUGS\fR below for a number of minor limitations of the \fIpathName \fBsearch\fR command. .RE +.\" METHOD: see .TP \fIpathName \fBsee \fIindex\fR . @@ -1679,23 +1702,28 @@ nothing. If \fIindex\fR is a short distance out of view, the command adjusts the view just enough to make \fIindex\fR visible at the edge of the window. If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the window. +.\" METHOD: sync .TP -\fIpathName \fBsync\fR ?\fB-command \fIcommand\fR? +\fIpathName \fBsync\fR ?\fB\-command \fIcommand\fR? +. Controls the synchronization of the view of the text widget. .RS .TP \fIpathName \fBsync\fR +. Immediately brings the line metrics up-to-date by forcing computation of any outdated line heights. The command returns immediately if there is no such outdated line heights, otherwise it returns only at the end of the computation. The command returns an empty string. .TP -\fIpathName \fBsync -command \fIcommand\fR +\fIpathName \fBsync \-command \fIcommand\fR +. Schedules \fIcommand\fR to be executed (by the event loop) exactly once as soon as all line heights are up-to-date. If there are no pending line metrics calculations, the scheduling is immediate. The command returns the empty string. \fBbgerror\fR is called on \fIcommand\fR failure. .RE +.\" METHOD: tag .TP \fIpathName \fBtag \fIoption \fR?\fIarg ...\fR? . @@ -1837,7 +1865,7 @@ of the range and the index of the character just after the last one in the range. If no matching range is found then the return value is an empty string. If \fIindex2\fR is not given then it defaults to the beginning of the text. .TP -\fIpathName\fB tag raise \fItagName \fR?\fIaboveThis\fR? +\fIpathName \fBtag raise \fItagName \fR?\fIaboveThis\fR? . Changes the priority of tag \fItagName\fR so that it is just higher in priority than the tag whose name is \fIaboveThis\fR. If \fIaboveThis\fR is @@ -1865,6 +1893,7 @@ characters in the specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR is less than or equal to \fIindex1\fR) then the command has no effect. This command returns an empty string. .RE +.\" METHOD: window .TP \fIpathName \fBwindow \fIoption \fR?\fIarg ...\fR? . @@ -1905,6 +1934,7 @@ information on the options that are supported. Returns an empty string. Returns a list whose elements are the names of all windows currently embedded in \fIwindow\fR. .RE +.\" METHOD: xview .TP \fIpathName \fBxview \fIoption args\fR . @@ -1950,6 +1980,7 @@ right by \fInumber\fR average-width characters on the display. If \fInumber\fR i negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. .RE +.\" METHOD: yview .TP \fIpathName \fByview \fR?\fIargs\fR? . diff --git a/doc/tk.n b/doc/tk.n index 27a2d58..e2a81c4 100644 --- a/doc/tk.n +++ b/doc/tk.n @@ -12,7 +12,7 @@ .SH NAME tk \- Manipulate Tk internal state .SH SYNOPSIS -\fBtk\fR \fIoption \fR?\fIarg ...\fR? +\fBtk\fI option \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP @@ -23,6 +23,7 @@ application as a whole, or to a screen or display, rather than to a particular window. The command can take any of a number of different forms depending on the \fIoption\fR argument. The legal forms are: +.\" METHOD: appname .TP \fBtk appname \fR?\fInewName\fR? . @@ -44,6 +45,7 @@ be able to find some options for the application. If sends have been disabled by deleting the \fBsend\fR command, this command will reenable them and recreate the \fBsend\fR command. +.\" METHOD: busy .TP \fBtk busy \fIsubcommand\fR ... . @@ -51,6 +53,7 @@ This command controls the marking of window hierarchies as .QW busy , rendering them non-interactive while some other operation is proceeding. For more details see the \fBbusy\fR manual page. +.\" METHOD: caret .TP \fBtk caret \fIwindow \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR? . @@ -63,6 +66,7 @@ the last values used for setting the caret are return in option-value pair format. \fB\-x\fR and \fB\-y\fR represent window-relative coordinates, and \fB\-height\fR is the height of the current cursor location, or the height of the specified \fIwindow\fR if none is given. +.\" METHOD: inactive .TP \fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR? . @@ -81,10 +85,13 @@ the timer is reset and an empty string is returned. Resetting the inactivity time is forbidden in safe interpreters and will throw an error if tried. .RE +.\" METHOD: fontchooser .TP \fBtk fontchooser \fIsubcommand\fR ... +. Controls the Tk font selection dialog. For more details see the \fBfontchooser\fR manual page. +.\" METHOD: print .TP \fBtk print \fIwindow\fR . @@ -92,6 +99,7 @@ The \fBtk print\fR command posts a dialog that allows users to print output from the \fBcanvas\fR and \fBtext\fR widgets. The printing will be done using platform-native APIs and dialogs where available. For more details see the \fBprint\fR manual page. +.\" METHOD: scaling .TP \fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR? . @@ -117,6 +125,7 @@ after the scaling factor is changed will use the new scaling factor, but it is undefined whether existing widgets will resize themselves dynamically to accommodate the new scaling factor. .RE +.\" METHOD: sysnotify .TP \fBtk sysnotify \fP \fItitle\fP? \fImessage\fP? . @@ -124,11 +133,13 @@ The \fBtk sysnotify\fP command creates a platform-specific system notification alert. Its intent is to provide a brief, unobtrusive notification to the user by popping up a window that briefly appears in a corner of the screen. For more details see the \fBsysnotify\fR manual page. +.\" METHOD: systray .TP \fBtk systray create\fP \fIsubcommand...\fP . The \fBtk systray\fP command creates an icon in the platform-specific tray. For more details see the \fBsystray\fR manual page. +.\" METHOD: useinputmethods .TP \fBtk useinputmethods \fR?\fB\-displayof \fIwindow\fR? ?\fIboolean\fR? . @@ -139,6 +150,7 @@ feature is only significant on X. If XIM support is not available, this will always return 0. If the \fIwindow\fR argument is omitted, it defaults to the main window. If the \fIboolean\fR argument is omitted, the current state is returned. This is turned on by default for the main display. +.\" METHOD: windowingsystem .TP \fBtk windowingsystem\fR . diff --git a/doc/tk_mac.n b/doc/tk_mac.n index 2ce1374..9ea8f85 100644 --- a/doc/tk_mac.n +++ b/doc/tk_mac.n @@ -35,7 +35,6 @@ tk::mac \- Access Mac-Specific Functionality on OS X from Tk \fB::tk::mac::antialiasedtext \fInumber\fR \fB::tk::mac::useThemedToplevel \fIboolean\fR - \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR .fi .BE @@ -209,8 +208,6 @@ scheme the developer wants to support. . Returns the current applications's file path. .TP - - .SH "ADDITIONAL DIALOGS" .PP The Aqua/Mac OS X defines additional dialogs that applications should diff --git a/doc/tkwait.n b/doc/tkwait.n index 82d51ba..42d5ea6 100644 --- a/doc/tkwait.n +++ b/doc/tkwait.n @@ -23,15 +23,18 @@ tkwait \- Wait for variable to change or window to be destroyed The \fBtkwait\fR command waits for one of several things to happen, then it returns without taking any other actions. The return value is always an empty string. +.\" METHOD: variable If the first argument is \fBvariable\fR (or any abbreviation of it) then the second argument is the name of a global variable and the command waits for that variable to be modified. +.\" METHOD: visibility If the first argument is \fBvisibility\fR (or any abbreviation of it) then the second argument is the name of a window and the \fBtkwait\fR command waits for a change in its visibility state (as indicated by the arrival of a VisibilityNotify event). This form is typically used to wait for a newly-created window to appear on the screen before taking some action. +.\" METHOD: window If the first argument is \fBwindow\fR (or any abbreviation of it) then the second argument is the name of a window and the \fBtkwait\fR command waits for that window to be destroyed. diff --git a/doc/toplevel.n b/doc/toplevel.n index e946248..d37faa2 100644 --- a/doc/toplevel.n +++ b/doc/toplevel.n @@ -12,7 +12,7 @@ .SH NAME toplevel \- Create and manipulate 'toplevel' main and popup window widgets .SH SYNOPSIS -\fBtoplevel\fR \fIpathName \fR?\fIoptions\fR? +\fBtoplevel\fI pathName \fR?\fIoptions\fR? .SO \-borderwidth \-highlightcolor \-pady \-cursor \-highlightthickness \-relief @@ -148,6 +148,7 @@ operations on the widget. It has the following general form: the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for toplevel widgets: +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . @@ -155,6 +156,7 @@ Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBtoplevel\fR command. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . diff --git a/doc/ttk_button.n b/doc/ttk_button.n index 896432f..cd54add 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -10,7 +10,7 @@ .SH NAME ttk::button \- Widget that issues a command when pressed .SH SYNOPSIS -\fBttk::button\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::button\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION A \fBttk::button\fR widget displays a textual label and/or image, @@ -52,8 +52,10 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), button widgets support the following additional commands: +.\" METHOD: invoke .TP \fIpathName \fBinvoke\fR +. Invokes the command associated with the button. .SH "STANDARD STYLES" .PP diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n index d78b7fc..e49b414 100644 --- a/doc/ttk_checkbutton.n +++ b/doc/ttk_checkbutton.n @@ -10,7 +10,7 @@ .SH NAME ttk::checkbutton \- On/off widget .SH SYNOPSIS -\fBttk::checkbutton\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::checkbutton\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION A \fBttk::checkbutton\fR widget is used to show or change a setting. @@ -41,8 +41,10 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), checkbutton widgets support the following additional commands: +.\" METHOD: invoke .TP \fIpathname\fB invoke\fR +. Toggles between the selected and deselected states and evaluates the associated \fB\-command\fR. If the widget is currently selected, sets the \fB\-variable\fR diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n index bd41bf1..3c88f84 100644 --- a/doc/ttk_combobox.n +++ b/doc/ttk_combobox.n @@ -10,7 +10,7 @@ .SH NAME ttk::combobox \- text field with popdown selection list .SH SYNOPSIS -\fBttk::combobox\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::combobox\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -60,8 +60,10 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), combobox widgets support the following additional commands: +.\" METHOD: current .TP \fIpathName \fBcurrent\fR ?\fInewIndex\fR? +. If \fInewIndex\fR is supplied, sets the combobox value to the element at position \fInewIndex\fR in the list of \fB\-values\fR (in addition to integers, the \fBend\fR index is supported and indicates @@ -70,11 +72,15 @@ for the command \fBstring index\fR is supported, with simple integer index arithmetic and indexing relative to \fBend\fR). Otherwise, returns the index of the current value in the list of \fB\-values\fR or \fB{}\fR if the current value does not appear in the list. +.\" METHOD: get .TP \fIpathName \fBget\fR +. Returns the current value of the combobox. +.\" METHOD: set .TP -\fIpathName \fBset\fR \fIvalue\fR +\fIpathName \fBset\fI value\fR +. Sets the value of the combobox to \fIvalue\fR. .PP The combobox widget also supports the following \fBttk::entry\fR diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n index e71bd01..7f7b202 100644 --- a/doc/ttk_entry.n +++ b/doc/ttk_entry.n @@ -12,7 +12,7 @@ .SH NAME ttk::entry \- Editable text field widget .SH SYNOPSIS -\fBttk::entry\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::entry\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -147,8 +147,10 @@ In addition to the standard \fBstate\fR, \fBstyle\fR and \fBxview\fR commands (see \fBttk::widget\fR), entry widgets support the following additional commands: +.\" METHOD: bbox .TP \fIpathName \fBbbox \fIindex\fR +. Returns a list of four numbers describing the bounding box of the character given by \fIindex\fR. The first two elements of the list give the x and y coordinates of @@ -157,8 +159,10 @@ the upper-left corner of the screen area covered by the character the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. +.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? +. Delete one or more elements of the entry. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last @@ -166,44 +170,59 @@ one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns the empty string. +.\" METHOD: get .TP \fIpathName \fBget\fR +. Returns the entry's string. +.\" METHOD: icursor .TP \fIpathName \fBicursor \fIindex\fR +. Arrange for the insert cursor to be displayed just before the character given by \fIindex\fR. Returns the empty string. +.\" METHOD: index .TP \fIpathName \fBindex\fI index\fR +. Returns the numerical index corresponding to \fIindex\fR. +.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex string\fR +. Insert \fIstring\fR just before the character indicated by \fIindex\fR. Returns the empty string. +.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR +. This command is used to adjust the selection within an entry. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection clear\fR +. Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns the empty string. .TP \fIpathName \fBselection present\fR +. Returns 1 if there is are characters selected in the entry, 0 if nothing is selected. .TP -\fIpathName \fBselection range \fIstart\fR \fIend\fR +\fIpathName \fBselection range \fIstart end\fR +. Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the entry's selection is cleared. .RE +.\" METHOD: validate .TP \fIpathName \fBvalidate\fR +. Force revalidation, independent of the conditions specified by the \fB\-validate\fR option. Returns 0 if validation fails, 1 if it succeeds. diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n index 413bb09..20f642b 100644 --- a/doc/ttk_frame.n +++ b/doc/ttk_frame.n @@ -10,7 +10,7 @@ .SH NAME ttk::frame \- Simple container widget .SH SYNOPSIS -\fBttk::frame\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::frame\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_image.n b/doc/ttk_image.n index 34dbabb..8bc1b9e 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -10,7 +10,7 @@ .SH NAME ttk_image \- Define an element based on an image .SH SYNOPSIS -\fBttk::style element create \fIname\fR \fBimage\fR \fIimageSpec\fR ?\fIoptions\fR? +\fBttk::style element create \fIname \fBimage\fI imageSpec\fR ?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -26,7 +26,7 @@ in a particular state or combination of states. .PP Valid \fIoptions\fR are: .TP -\fB\-border\fR \fIpadding\fR +\fB\-border\fI padding\fR \fIpadding\fR is a list of up to four integers, specifying the left, top, right, and bottom borders, respectively. If fewer than four elements are specified, @@ -42,7 +42,7 @@ See \fBIMAGE STRETCHING\fR, below. Specifies a minimum height for the element. If less than zero, the base image's height is used as a default. .TP -\fB\-padding\fR \fIpadding\fR +\fB\-padding\fI padding\fR Specifies the element's interior padding. The padding is a list of up to four length specifications \fIleft top right bottom\fR. @@ -55,7 +55,7 @@ a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget. Defaults to \fB\-border\fR if not specified. .TP -\fB\-sticky\fR \fIspec\fR +\fB\-sticky\fI spec\fR Specifies how the image is placed within the final parcel. \fIspec\fR contains zero or more characters .QW n , diff --git a/doc/ttk_label.n b/doc/ttk_label.n index 54c0f47..0d7d766 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -10,7 +10,7 @@ .SH NAME ttk::label \- Display a text string and/or image .SH SYNOPSIS -\fBttk::label\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::label\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n index 593d96c..8649dae 100644 --- a/doc/ttk_labelframe.n +++ b/doc/ttk_labelframe.n @@ -10,7 +10,7 @@ .SH NAME ttk::labelframe \- Container widget with optional label .SH SYNOPSIS -\fBttk::labelframe\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::labelframe\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n index b9b716f..5578835 100644 --- a/doc/ttk_menubutton.n +++ b/doc/ttk_menubutton.n @@ -10,7 +10,7 @@ .SH NAME ttk::menubutton \- Widget that pops down a menu when pressed .SH SYNOPSIS -\fBttk::menubutton\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::menubutton\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index 84b6495..f93f234 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -11,10 +11,10 @@ ttk::notebook \- Multi-paned container widget .SH SYNOPSIS .nf -\fBttk::notebook\fR \fIpathname \fR?\fIoptions...\fR? +\fBttk::notebook\fI pathname \fR?\fIoptions...\fR? .br -\fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR? -\fIpathname \fBinsert\fR \fIindex\fR \fIwindow\fR ?\fIoptions...\fR? +\fIpathname \fBadd\fI window\fR ?\fIoptions...\fR? +\fIpathname \fBinsert\fI index window\fR ?\fIoptions...\fR? .fi .BE .SH DESCRIPTION @@ -112,57 +112,73 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), notebook widgets support the following additional commands: +.\" METHOD: add .TP \fIpathname \fBadd \fIwindow\fR ?\fIoptions...\fR? +. Adds a new tab to the notebook. See \fBTAB OPTIONS\fR for the list of available \fIoptions\fR. If \fIwindow\fR is currently managed by the notebook but hidden, it is restored to its previous position. +.\" METHOD: forget .TP \fIpathname \fBforget \fItabid\fR +. Removes the tab specified by \fItabid\fR, unmaps and unmanages the associated window. +.\" METHOD: hide .TP \fIpathname \fBhide \fItabid\fR +. Hides the tab specified by \fItabid\fR. The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the \fBadd\fR command. +.\" METHOD: identify .TP \fIpathname \fBidentify\fI component x y\fR +. Returns the name of the element under the point given by \fIx\fR and \fIy\fR, or the empty string if no component is present at that location. The following subcommands are supported: .RS .TP -\fIpathname \fBidentify element\fR \fIx y\fR +\fIpathname \fBidentify element\fI x y\fR Returns the name of the element at the specified location. .TP -\fIpathname \fBidentify tab\fR \fIx y\fR +\fIpathname \fBidentify tab\fI x y\fR Returns the index of the tab at the specified location. .RE +.\" METHOD: index .TP \fIpathname \fBindex \fItabid\fR +. Returns the numeric index of the tab specified by \fItabid\fR, or the total number of tabs if \fItabid\fR is the string .QW \fBend\fR . +.\" METHOD: insert .TP \fIpathname \fBinsert \fIpos subwindow options...\fR +. Inserts a pane at the specified position. \fIpos\fR is either the string \fBend\fR, an integer index, or the name of a managed subwindow. If \fIsubwindow\fR is already managed by the notebook, moves it to the specified position. See \fBTAB OPTIONS\fR for the list of available options. +.\" METHOD: select .TP \fIpathname \fBselect\fR ?\fItabid\fR? +. Selects the specified tab. The associated content window will be displayed, and the previously-selected window (if different) is unmapped. If \fItabid\fR is omitted, returns the widget name of the currently selected pane. +.\" METHOD: tab .TP \fIpathname \fBtab \fItabid\fR ?\fI\-option \fR?\fIvalue ...\fR +. Query or modify the options of the specific tab. If no \fI\-option\fR is specified, returns a dictionary of the tab option values. @@ -170,8 +186,10 @@ If one \fI\-option\fR is specified, returns the value of that \fIoption\fR. Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs. See \fBTAB OPTIONS\fR for the available options. +.\" METHOD: tabs .TP \fIpathname \fBtabs\fR +. Returns the list of windows managed by the notebook, in the index order of their associated tabs. .SH "KEYBOARD TRAVERSAL" diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n index a6a809b..adf92bb 100644 --- a/doc/ttk_panedwindow.n +++ b/doc/ttk_panedwindow.n @@ -11,10 +11,10 @@ ttk::panedwindow \- Multi-pane container window .SH SYNOPSIS .nf -\fBttk::panedwindow\fR \fIpathname \fR?\fIoptions\fR? +\fBttk::panedwindow\fI pathname \fR?\fIoptions\fR? .br -\fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR? -\fIpathname \fBinsert\fR \fIindex\fR \fIwindow\fR ?\fIoptions...\fR? +\fIpathname \fBadd\fI window\fR ?\fIoptions...\fR? +\fIpathname \fBinsert\fI index window\fR ?\fIoptions...\fR? .fi .BE .SH DESCRIPTION @@ -54,16 +54,22 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), panedwindow widgets support the following additional commands: +.\" METHOD: add .TP \fIpathname \fBadd \fIsubwindow options...\fR +. Adds a new pane to the window. See \fBPANE OPTIONS\fR for the list of available options. +.\" METHOD: forget .TP \fIpathname \fBforget \fIpane\fR +. Removes the specified subpane from the widget. \fIpane\fR is either an integer index or the name of a managed subwindow. +.\" METHOD: identify .TP \fIpathname \fBidentify \fIcomponent x y\fR +. Returns the name of the element under the point given by \fIx\fR and \fIy\fR, or the empty string if no component is present at that location. If \fIcomponent\fR is omitted, it defaults to \fBsash\fR. @@ -76,28 +82,36 @@ Returns the name of the element at the specified location. \fIpathname \fBidentify sash \fIx y\fR Returns the index of the sash at the specified location. .RE +.\" METHOD: insert .TP \fIpathname \fBinsert \fIpos subwindow options...\fR +. Inserts a pane at the specified position. \fIpos\fR is either the string \fBend\fR, an integer index, or the name of a managed subwindow. If \fIsubwindow\fR is already managed by the paned window, moves it to the specified position. See \fBPANE OPTIONS\fR for the list of available options. +.\" METHOD: pane .TP \fIpathname \fBpane \fIpane \-option \fR?\fIvalue \fR?\fI\-option value...\fR +. Query or modify the options of the specified \fIpane\fR, where \fIpane\fR is either an integer index or the name of a managed subwindow. If no \fI\-option\fR is specified, returns a dictionary of the pane option values. If one \fI\-option\fR is specified, returns the value of that \fIoption\fR. Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs. +.\" METHOD: panes .TP \fIpathname \fBpanes\fR +. Returns the list of all windows managed by the widget, in the index order of their associated panes. +.\" METHOD: sashpos .TP \fIpathname \fBsashpos \fIindex\fR ?\fInewpos\fR? +. If \fInewpos\fR is specified, sets the position of sash number \fIindex\fR. May adjust the positions of adjacent sashes diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n index 0673ca6..aae3f46 100644 --- a/doc/ttk_progressbar.n +++ b/doc/ttk_progressbar.n @@ -10,7 +10,7 @@ .SH NAME ttk::progressbar \- Provide progress feedback .SH SYNOPSIS -\fBttk::progressbar\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::progressbar\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -20,10 +20,10 @@ amount completed relative to the total amount of work to be done, and \fIindeterminate\fR mode provides an animated display to let the user know that something is happening. .PP -If the value of \fB-orient\fR is \fBhorizontal\fR a text string can be +If the value of \fB\-orient\fR is \fBhorizontal\fR a text string can be displayed inside the progressbar. This string can be configured using -the \fB-anchor\fR, \fB-font\fR, \fB-foreground\fR, \fB-justify\fR, -\fB-text\fR and \fB-wraplength\fR options. If the value of \fB-orient\fR +the \fB\-anchor\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-justify\fR, +\fB\-text\fR and \fB\-wraplength\fR options. If the value of \fB\-orient\fR is \fBvertical\fR then these options are ignored. .SO ttk_widget \-anchor \-class \-cursor @@ -71,18 +71,24 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), progressbar widgets support the following additional commands: +.\" METHOD: start .TP \fIpathName \fBstart\fR ?\fIinterval\fR? +. Begin autoincrement mode: schedules a recurring timer event that calls \fBstep\fR every \fIinterval\fR milliseconds. If omitted, \fIinterval\fR defaults to 50 milliseconds (20 steps/second). +.\" METHOD: step .TP \fIpathName \fBstep\fR ?\fIamount\fR? +. Increments the \fB\-value\fR by \fIamount\fR. \fIamount\fR defaults to 1.0 if omitted. +.\" METHOD: stop .TP \fIpathName \fBstop\fR +. Stop autoincrement mode: cancels any recurring timer event initiated by \fIpathName \fBstart\fR. .SH "STYLING OPTIONS" diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n index 45be7df..74777dc 100644 --- a/doc/ttk_radiobutton.n +++ b/doc/ttk_radiobutton.n @@ -10,7 +10,7 @@ .SH NAME ttk::radiobutton \- Mutually exclusive option widget .SH SYNOPSIS -\fBttk::radiobutton\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::radiobutton\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -41,8 +41,10 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), radiobutton widgets support the following additional commands: +.\" METHOD: invoke .TP \fIpathname\fB invoke\fR +. Sets the \fB\-variable\fR to the \fB\-value\fR, selects the widget, and evaluates the associated \fB\-command\fR. Returns the result of the \fB\-command\fR, or the empty diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n index c0c351b..c9f0298 100644 --- a/doc/ttk_scale.n +++ b/doc/ttk_scale.n @@ -56,21 +56,27 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), scale widgets support the following additional commands: +.\" METHOD: get .TP \fIpathName \fBget \fR?\fIx y\fR? +. Get the current value of the \fB\-value\fR option, or the value corresponding to the coordinates \fIx,y\fR if they are specified. \fIX\fR and \fIy\fR are pixel coordinates relative to the scale widget origin. +.\" METHOD: see .TP \fIpathName \fBset \fIvalue\fR +. Set the value of the widget (i.e. the \fB\-value\fR option) to \fIvalue\fR. The value will be clipped to the range given by the \fB\-from\fR and \fB\-to\fR options. Note that setting the linked variable (i.e. the variable named in the \fB\-variable\fR option) does not cause such clipping. .SH "INTERNAL COMMANDS" .PP +.\" METHOD: coords .TP \fIpathName \fBcoords \fR?\fIvalue\fR? +. Get the coordinates corresponding to \fIvalue\fR, or the coordinates corresponding to the current value of the \fB\-value\fR option if \fIvalue\fR is omitted. diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n index bd38a5c..321d101 100644 --- a/doc/ttk_scrollbar.n +++ b/doc/ttk_scrollbar.n @@ -11,7 +11,7 @@ .SH NAME ttk::scrollbar \- Control the viewport of a scrollable widget .SH SYNOPSIS -\fBttk::scrollbar\fR \fIpathName \fR?\fIoptions...\fR? +\fBttk::scrollbar\fI pathName \fR?\fIoptions...\fR? .BE .SH DESCRIPTION .PP @@ -52,12 +52,16 @@ In addition to the standard \fBstate\fR and \fBstyle\fR commands (see \fBttk::widget\fR), scrollbar widgets support the following additional commands: +.\" METHOD: get .TP \fIpathName \fBget\fR +. Returns the scrollbar settings in the form of a list whose elements are the arguments to the most recent \fBset\fR widget command. +.\" METHOD: set .TP \fIpathName \fBset \fIfirst last\fR +. This command is normally invoked by the scrollbar's associated widget from an \fB\-xscrollcommand\fR or \fB\-yscrollcommand\fR callback. Specifies the visible range to be displayed. @@ -66,8 +70,10 @@ Specifies the visible range to be displayed. .PP The following widget commands are used internally by the \fBTScrollbar\fP widget class bindings. +.\" METHOD: delta .TP \fIpathName \fBdelta \fIdeltaX deltaY\fR +. Returns a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in thumb position. For example, if the scrollbar is horizontal, @@ -77,8 +83,10 @@ ignored in this case). If the scrollbar is vertical, the result indicates how much the scrollbar setting must change to move the thumb \fIdeltaY\fR pixels down. The arguments and the result may be zero or negative. +.\" METHOD: fraction .TP \fIpathName \fBfraction \fIx y\fR +. Returns a real number between 0 and 1 indicating where the point given by \fIx\fR and \fIy\fR lies in the trough area of the scrollbar, where 0.0 corresponds to the top or left of the trough @@ -99,6 +107,7 @@ In each case, \fIprefix\fR is the contents of the \fB\-command\fR option, which usually has a form like \fB.t yview\fR .TP \fIprefix \fBmoveto \fIfraction\fR +. \fIFraction\fR is a real number between 0 and 1. The widget should adjust its view so that the point given by \fIfraction\fR appears at the beginning of the widget. @@ -108,6 +117,7 @@ refers to a point one-third of the way through the document, and so on. .TP \fIprefix \fBscroll \fInumber \fBpages\fR +. The widget should adjust its view by \fInumber\fR pages. It is up to the widget to define the meaning of a page; typically it is slightly less than what fits in the window, so that there @@ -117,6 +127,7 @@ become visible, or \-1, which means that the previous page should become visible. .TP \fIprefix \fBscroll \fInumber \fBunits\fR +. The widget should adjust its view by \fInumber\fR units. The units are defined in whatever way makes sense for the widget, such as characters or lines in a text widget. @@ -134,14 +145,14 @@ of individual elements, based on the position and state of the mouse pointer. .PP .CS set f [frame .f] -ttk::scrollbar $f.hsb \-orient horizontal \-command [list $f.t xview] -ttk::scrollbar $f.vsb \-orient vertical \-command [list $f.t yview] -text $f.t \-xscrollcommand [list $f.hsb set] \-yscrollcommand [list $f.vsb set] -grid $f.t \-row 0 \-column 0 \-sticky nsew -grid $f.vsb \-row 0 \-column 1 \-sticky nsew -grid $f.hsb \-row 1 \-column 0 \-sticky nsew -grid columnconfigure $f 0 \-weight 1 -grid rowconfigure $f 0 \-weight 1 +\fBttk::scrollbar\fR $f.hsb -orient horizontal -command [list $f.t xview] +\fBttk::scrollbar\fR $f.vsb -orient vertical -command [list $f.t yview] +text $f.t -xscrollcommand [list $f.hsb set] -yscrollcommand [list $f.vsb set] +grid $f.t -row 0 -column 0 -sticky nsew +grid $f.vsb -row 0 -column 1 -sticky nsew +grid $f.hsb -row 1 -column 0 -sticky nsew +grid columnconfigure $f 0 -weight 1 +grid rowconfigure $f 0 -weight 1 pack $f .CE .SH "STYLING OPTIONS" diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n index 5331f3e..dacd10e 100644 --- a/doc/ttk_separator.n +++ b/doc/ttk_separator.n @@ -10,7 +10,7 @@ .SH NAME ttk::separator \- Separator bar .SH SYNOPSIS -\fBttk::separator\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::separator\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n index fda8d07..1f63821 100644 --- a/doc/ttk_sizegrip.n +++ b/doc/ttk_sizegrip.n @@ -10,7 +10,7 @@ .SH NAME ttk::sizegrip \- Bottom-right corner resize widget .SH SYNOPSIS -\fBttk::sizegrip\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::sizegrip\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n index 49dc8ff..3b038f0 100644 --- a/doc/ttk_spinbox.n +++ b/doc/ttk_spinbox.n @@ -10,7 +10,7 @@ .SH NAME ttk::spinbox \- Selecting text field widget .SH SYNOPSIS -\fBttk::spinbox\fR \fIpathName \fR?\fIoptions\fR? +\fBttk::spinbox\fI pathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -66,11 +66,15 @@ See the \fBttk::entry\fR manual for information about using the .PP The following subcommands are possible for spinbox widgets in addition to the commands described for the \fBttk::entry\fR widget: +.\" METHOD: get .TP \fIpathName \fBget\fR +. Returns the spinbox's current value. +.\" METHOD: set .TP \fIpathName \fBset \fIvalue\fR +. Set the spinbox string to \fIvalue\fR. If a \fB\-format\fR option has been configured then this format will be applied. If formatting fails or is not set or the \fB\-values\fR option has been used then the value diff --git a/doc/ttk_style.n b/doc/ttk_style.n index 7763336..dcd5567 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -10,7 +10,7 @@ .SH NAME ttk::style \- Manipulate style database .SH SYNOPSIS -\fBttk::style\fR \fIoption\fR ?\fIargs\fR? +\fBttk::style\fI option\fR ?\fIargs\fR? .BE .SH NOTES .PP @@ -33,19 +33,23 @@ style is the theme root style on which derived styles are based. .SH DESCRIPTION .PP The \fBttk::style\fR command takes the following arguments: +.\" METHOD: configure .TP \fBttk::style configure \fIstyle\fR ?\fI\-option\fR ?\fIvalue option value...\fR? ? +. Sets the default value of the specified option(s) in \fIstyle\fR. If \fIstyle\fR does not exist, it is created. -If only \fIstyle\fR and \fI-option\fR are specified, get the default value -for option \fI-option\fR of style \fIstyle\fR. +If only \fIstyle\fR and \fI\-option\fR are specified, get the default value +for option \fI\-option\fR of style \fIstyle\fR. If only \fIstyle\fR is specified, get the default value for all options of style \fIstyle\fR. +.\" METHOD: element .TP -\fBttk::style element\fR \fIargs\fR +\fBttk::style element\fI args\fR .RS .TP -\fBttk::style element create\fR \fIelementName\fR \fItype\fR ?\fIargs...\fR? +\fBttk::style element create\fI elementName type\fR ?\fIargs...\fR? +. Creates a new element in the current theme of type \fItype\fR. The only cross-platform built-in element type is \fIimage\fR (see \fBttk_image\fR(n)) but themes may define other element types @@ -54,19 +58,25 @@ an element factory is registered to create Windows theme elements (see \fBttk_vsapi\fR(n)). .TP \fBttk::style element names\fR +. Returns the list of elements defined in the current theme. .TP \fBttk::style element options \fIelement\fR +. Returns the list of \fIelement\fR's options. .RE +.\" METHOD: layout .TP \fBttk::style layout \fIstyle\fR ?\fIlayoutSpec\fR? +. Define the widget layout for style \fIstyle\fR. See \fBLAYOUTS\fR below for the format of \fIlayoutSpec\fR. If \fIlayoutSpec\fR is omitted, return the layout specification for style \fIstyle\fR. +.\" METHOD: lookup .TP -\fBttk::style lookup \fIstyle\fR \fI\-option \fR?\fIstate \fR?\fIdefault\fR?? +\fBttk::style lookup \fIstyle \-option \fR?\fIstate \fR?\fIdefault\fR?? +. Returns the value specified for \fI\-option\fR in style \fIstyle\fR in state \fIstate\fR, using the standard lookup rules for element options. \fIstate\fR is a list of state names; if omitted, @@ -77,22 +87,26 @@ If the \fIdefault\fR argument is present, it is used as a fallback value in case no specification for \fI\-option\fR is found. .\" Otherwise -- signal error? return empty string? Leave unspecified for now. If \fIstyle\fR does not exist, it is created. +.\" METHOD: map .TP \fBttk::style map \fIstyle\fR ?\fI\-option\fB { \fIstatespec value...\fB }\fR? +. Sets dynamic (state dependent) values of the specified option(s) in \fIstyle\fR. Each \fIstatespec / value\fR pair is examined in order; the value corresponding to the first matching \fIstatespec\fR is used. If \fIstyle\fR does not exist, it is created. -If only \fIstyle\fR and \fI-option\fR are specified, get the dynamic values -for option \fI-option\fR of style \fIstyle\fR. +If only \fIstyle\fR and \fI\-option\fR are specified, get the dynamic values +for option \fI\-option\fR of style \fIstyle\fR. If only \fIstyle\fR is specified, get the dynamic values for all options of style \fIstyle\fR. +.\" METHOD: theme .TP -\fBttk::style theme\fR \fIargs\fR +\fBttk::style theme\fI args\fR .RS .TP -\fBttk::style theme create\fR \fIthemeName\fR ?\fB\-parent \fIbasedon\fR? ?\fB\-settings \fIscript...\fR ? +\fBttk::style theme create\fI themeName\fR ?\fB\-parent \fIbasedon\fR? ?\fB\-settings \fIscript...\fR ? +. Creates a new theme. It is an error if \fIthemeName\fR already exists. If \fB\-parent\fR is specified, the new theme will inherit styles, elements, and layouts from the parent theme \fIbasedon\fR. @@ -100,19 +114,23 @@ If \fB\-settings\fR is present, \fIscript\fR is evaluated in the context of the new theme as per \fBttk::style theme settings\fR. .TP \fBttk::style theme names\fR +. Returns a list of all known themes. .TP -\fBttk::style theme settings \fIthemeName\fR \fIscript\fR +\fBttk::style theme settings \fIthemeName script\fR +. Temporarily sets the current theme to \fIthemeName\fR, evaluate \fIscript\fR, then restore the previous theme. Typically \fIscript\fR simply defines styles and elements, though arbitrary Tcl code may appear. .TP \fBttk::style theme styles\fR ?\fIthemeName\fR? +. Returns a list of all styles in \fIthemeName\fR. If \fIthemeName\fR is omitted, the current theme is used. .TP \fBttk::style theme use\fR ?\fIthemeName\fR? +. Without an argument the result is the name of the current theme. Otherwise this command sets the current theme to \fIthemeName\fR, and refreshes all widgets. @@ -129,13 +147,13 @@ the allocated parcel. Valid options are: .\" -border should remain undocumented for now (dubious usefulness) .\" .TP -.\" \fB\-border\fR \fIboolean\fR +.\" \fB\-border\fI boolean\fR .\" Specifies whether the element is drawn after its children. Defaults to 0. .TP \fB\-children { \fIsublayout...\fB }\fR Specifies a list of elements to place inside the element. .TP -\fB\-expand\fR \fIboolean\fR +\fB\-expand\fI boolean\fR Specifies whether the allocated parcel is the entire cavity. If so, simultaneous specification of \fB\-side\fR is ignored. Defaults to 0. @@ -155,7 +173,7 @@ If specified as an empty string then the actual parcel is centered in the allocated parcel. Default is \fBnswe\fR. .\" -unit should remain undocumented for now (dubious usefulness) .\" .TP -.\" \fB\-unit\fR \fIboolean\fR +.\" \fB\-unit\fI boolean\fR .\" Specifies whether the element propagates its state to its children. .\" Defaults to 0. .PP diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index c819093..d2ef877 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -111,8 +111,10 @@ In addition to the standard \fBstate\fR, \fBstyle\fR, \fBxview\fR and \fByview\fR commands (see \fBttk::widget\fR), treeview widgets support the following additional commands: +.\" METHOD: bbox .TP \fIpathname \fBbbox \fIitem\fR ?\fIcolumn\fR? +. Returns the bounding box (relative to the treeview widget's window) of the specified \fIitem\fR in the form \fIx y width height\fR. @@ -122,8 +124,10 @@ returns the empty list. If \fIcolumn\fR is specified and is not hidden (by the \fB\-displaycolumns\fR option), returns the bounding box of that cell within \fIitem\fR (even if the cell is horizontally scrolled offscreen). +.\" METHOD: cellselection .TP \fIpathname \fBcellselection\fR ?\fIselop arg ...\fR? +. Manages cell selection. Cell selection is independent from item selection handled by the \fBselection\fR command. A cell is given by a list of two elements, item and column. @@ -135,31 +139,41 @@ Otherwise, \fIselop\fR is one of the following: .RS .TP \fIpathname \fBcellselection set \fIcellList\fR +. \fIcellList\fR becomes the new cell selection. .TP -\fIpathname \fBcellselection set \fIfirstCell\fR \fIlastCell\fR +\fIpathname \fBcellselection set \fIfirstCell lastCell\fR +. The rectangle defined becomes the new cell selection. .TP \fIpathname \fBcellselection add \fIcellList\fR -Add \fIcellList\fR to the cell selection +. +Add \fIcellList\fR to the cell selection. .TP -\fIpathname \fBcellselection add \fIfirstCell\fR \fIlastCell\fR +\fIpathname \fBcellselection add \fIfirstCell lastCell\fR +. The rectangle defined is added to the cell selection. .TP \fIpathname \fBcellselection remove \fIcellList\fR -Remove \fIcellList\fR from the cell selection +. +Remove \fIcellList\fR from the cell selection. .TP -\fIpathname \fBcellselection remove \fIfirstCell\fR \fIlastCell\fR +\fIpathname \fBcellselection remove \fIfirstCell lastCell\fR +. The rectangle defined is removed from the cell selection. .TP \fIpathname \fBcellselection toggle \fIcellList\fR +. Toggle the cell selection state of each cell in \fIcellList\fR. .TP -\fIpathname \fBcellselection toggle \fIfirstCell\fR \fIlastCell\fR +\fIpathname \fBcellselection toggle \fIfirstCell lastCell\fR +. Toggle the cell selection state of each cell in the rectangle defined. .RE +.\" METHOD: children .TP \fIpathname \fBchildren \fIitem\fR ?\fInewchildren\fR? +. If \fInewchildren\fR is not specified, returns the list of children belonging to \fIitem\fR. .RS @@ -171,8 +185,10 @@ are detached from the tree. None of the items in \fInewchildren\fR may be an ancestor of \fIitem\fR. .RE +.\" METHOD: column .TP \fIpathname \fBcolumn \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR? +. Query or modify the options for the specified \fIcolumn\fR. If no \fI\-option\fR is specified, returns a dictionary of option/value pairs. @@ -183,48 +199,58 @@ The following options may be set on each column: .RS .TP \fB\-id \fIname\fR +. The column name. This is a read-only option. For example, [\fI$pathname \fBcolumn #\fIn \fB\-id\fR] -returns the data column associated with display column #\fIn\fR. -The tree column has -id \fB#0\fR. +returns the data column associated with display column \fIn\fR. +The tree column has \fB\-id #0\fR. .TP \fB\-anchor \fIanchor\fR +. Specifies how the text in this column should be aligned with respect to the cell. \fIAnchor\fR is one of \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. .TP \fB\-minwidth \fIminwidth\fR +. The minimum width of the column in pixels. The treeview widget will not make the column any smaller than \fB\-minwidth\fR when the widget is resized or the user drags a heading column separator. Default is 20 pixels. .TP \fB\-separator \fIboolean\fR +. Specifies whether or not a column separator should be drawn to the right of the column. Default is false. .TP \fB\-stretch \fIboolean\fR +. Specifies whether or not the column width should be adjusted when the widget is resized or the user drags a heading column separator. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. By default columns are stretchable. .TP \fB\-width \fIwidth\fR +. The width of the column in pixels. Default is 200 pixels. The specified column width may be changed by Tk in order to honor \fB\-stretch\fR and/or \fB\-minwidth\fR, or when the widget is resized or the user drags a heading column separator. .PP -Use \fIpathname column #0\fR to configure the tree column. +Use \fIpathname fBcolumn #0\fR to configure the tree column. .RE +.\" METHOD: delete .TP \fIpathname \fBdelete \fIitemList\fR +. Deletes each of the items in \fIitemList\fR and all of their descendants. The root item may not be deleted. See also: \fBdetach\fR. +.\" METHOD: detach .TP \fIpathname \fBdetach \fIitemList\fR +. Unlinks all of the specified items in \fIitemList\fR from the tree. The items and all of their descendants are still present and may be reinserted at another point in the tree @@ -232,6 +258,7 @@ with the \fBmove\fR operation, but will not be displayed until that is done. The root item may not be detached. See also: \fBdelete\fR. +.\" METHOD: detached .TP \fIpathname \fBdetached \fR?\fIitem\fR? . @@ -239,38 +266,51 @@ If \fIitem\fR is provided, returns a boolean value indicating whether it is the name of a detached item (see \fBdetach\fR). Otherwise, returns a list of all the detached items (in an arbitrary order). The root item is never detached. +.\" METHOD: exists .TP \fIpathname \fBexists \fIitem\fR +. Returns 1 if the specified \fIitem\fR is present in the tree, 0 otherwise. +.\" METHOD: focus .TP \fIpathname \fBfocus \fR?\fIitem\fR? +. If \fIitem\fR is specified, sets the focus item to \fIitem\fR. Otherwise, returns the current focus item, or \fB{}\fR if there is none. .\" Need: way to clear the focus item. {} works for this... +.\" +.\" METHOD: heading .TP \fIpathname \fBheading \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR? +. Query or modify the heading options for the specified \fIcolumn\fR. Valid options are: .RS .TP \fB\-text \fItext\fR +. The text to display in the column heading. .TP \fB\-image \fIimageName\fR +. Specifies an image to display to the right of the column heading. .TP \fB\-anchor \fIanchor\fR +. Specifies how the heading text should be aligned. One of the standard Tk anchor values. .TP \fB\-command \fIscript\fR +. A script to evaluate when the heading label is pressed. .PP Use \fIpathname heading #0\fR to configure the tree column heading. .RE +.\" METHOD: identify .TP \fIpathname \fBidentify \fIcomponent x y\fR +. Returns a description of the specified \fIcomponent\fR under the point given by \fIx\fR and \fIy\fR, or the empty string if no such \fIcomponent\fR is present at that position. @@ -296,30 +336,39 @@ A data cell. .RE .TP \fIpathname \fBidentify item \fIx y\fR +. Returns the item ID of the item at position \fIy\fR. .TP \fIpathname \fBidentify column \fIx y\fR +. Returns the display column identifier of the cell at position \fIx\fR. The tree column has ID \fB#0\fR. .TP \fIpathname \fBidentify cell \fIx y\fR +. Returns the cell identifier of the cell at position \fIx y\fR. A cell identifier is a list of item ID and column ID. .TP \fIpathname \fBidentify element \fIx y\fR +. The element at position \fIx,y\fR. .TP \fIpathname \fBidentify row \fIx y\fR +. Obsolescent synonym for \fIpathname \fBidentify item\fR. .PP See \fBCOLUMN IDENTIFIERS\fR for a discussion of display columns and data columns. .RE +.\" METHOD: index .TP \fIpathname \fBindex \fIitem\fR +. Returns the integer index of \fIitem\fR within its parent's list of children. +.\" METHOD: insert .TP \fIpathname \fBinsert \fIparent index\fR ?\fB\-id \fIid\fR? \fIoptions...\fR +. Creates a new item. \fIparent\fR is the item ID of the parent item, or the empty string \fB{}\fR @@ -339,8 +388,10 @@ Otherwise, a new unique identifier is generated. newly created item. See \fBITEM OPTIONS\fR for the list of available options. .RE +.\" METHOD: item .TP \fIpathname \fBitem \fIitem\fR ?\fI\-option \fR?\fIvalue \-option value...\fR? +. Query or modify the options for the specified \fIitem\fR. If no \fI\-option\fR is specified, returns a dictionary of option/value pairs. @@ -348,8 +399,10 @@ If a single \fI\-option\fR is specified, returns the value of that option. Otherwise, the item's options are updated with the specified values. See \fBITEM OPTIONS\fR for the list of available options. +.\" METHOD: move .TP \fIpathname \fBmove \fIitem parent index\fR +. Moves \fIitem\fR to position \fIindex\fR in \fIparent\fR's list of children. It is illegal to move an item under one of its descendants. .RS @@ -358,26 +411,36 @@ If \fIindex\fR is less than or equal to zero, \fIitem\fR is moved to the beginning; if greater than or equal to the number of children, it is moved to the end. .RE +.\" METHOD: next .TP \fIpathname \fBnext \fIitem\fR +. Returns the identifier of \fIitem\fR's next sibling, or \fB{}\fR if \fIitem\fR is the last child of its parent. +.\" METHOD: parent .TP \fIpathname \fBparent \fIitem\fR +. Returns the ID of the parent of \fIitem\fR, or \fB{}\fR if \fIitem\fR is at the top level of the hierarchy. +.\" METHOD: prev .TP \fIpathname \fBprev \fIitem\fR +. Returns the identifier of \fIitem\fR's previous sibling, or \fB{}\fR if \fIitem\fR is the first child of its parent. +.\" METHOD: see .TP \fIpathname \fBsee \fIitem\fR +. Ensure that \fIitem\fR is visible: sets all of \fIitem\fR's ancestors to \fB\-open true\fR, and scrolls the widget if necessary so that \fIitem\fR is within the visible portion of the tree. +.\" METHOD: selection .TP \fIpathname \fBselection\fR ?\fIselop itemList\fR? +. Manages item selection. Item selection is independent from cell selection handled by the \fBcellselection\fR command. If \fIselop\fR is not specified, returns the list of selected items. @@ -385,27 +448,35 @@ Otherwise, \fIselop\fR is one of the following: .RS .TP \fIpathname \fBselection set \fIitemList\fR +. \fIitemList\fR becomes the new selection. .TP \fIpathname \fBselection add \fIitemList\fR -Add \fIitemList\fR to the selection +. +Add \fIitemList\fR to the selection. .TP \fIpathname \fBselection remove \fIitemList\fR -Remove \fIitemList\fR from the selection +. +Remove \fIitemList\fR from the selection. .TP \fIpathname \fBselection toggle \fIitemList\fR +. Toggle the selection state of each item in \fIitemList\fR. .RE +.\" METHOD: set .TP \fIpathname \fBset \fIitem\fR ?\fIcolumn\fR? ?\fIvalue\fR? +. With one argument, returns a dictionary of column/value pairs for the specified \fIitem\fR. With two arguments, returns the current value of the specified \fIcolumn\fR. With three arguments, sets the value of column \fIcolumn\fR in item \fIitem\fR to the specified \fIvalue\fR. See also \fBCOLUMN IDENTIFIERS\fR. +.\" METHOD: tag .TP \fIpathName \fBtag \fIargs...\fR +. Manages tags. Tags can be set on items as well as on cells. The set of tags is shared between items and cells. However item tagging is independent from cell tagging (for instance adding a tag on an item does @@ -415,11 +486,13 @@ The following subcommands are supported: .RS .TP \fIpathName \fBtag add \fItag items\fR +. Adds the specified \fItag\fR to each of the listed \fIitems\fR. If \fItag\fR is already present for a particular item, then the \fB\-tags\fR for that item are unchanged. .TP \fIpathName \fBtag bind \fItagName \fR?\fIsequence\fR? ?\fIscript\fR? +. Add a Tk binding script for the event sequence \fIsequence\fR to the tag \fItagName\fR. When an X event is delivered to an item, binding scripts for each of the item's \fB\-tags\fR are evaluated @@ -435,31 +508,36 @@ are sent to the item under the mouse pointer. No other event types are supported. .PP The binding \fIscript\fR undergoes \fB%\fR-substitutions before -evaluation; see \fBbind(n)\fR for details. +evaluation; see \fBbind\fR(n) for details. .RE .TP \fIpathName \fBtag cell \fIsubcmd...\fR +. Manages tags on individual cells. A \fIcellList\fR argument may be a single cell or a list of cells. .RS .TP \fIpathName \fBtag cell add \fItag cellList\fR +. Adds the specified \fItag\fR to each of the listed \fIcellList\fR. If \fItag\fR is already present for a particular cell, then the tag list for that cell is unchanged. .TP \fIpathName \fBtag cell has \fItagName\fR ?\fIcell\fR? +. If \fIcell\fR is specified, returns 1 or 0 depending on whether the specified cell has the named tag. Otherwise, returns a list of all cells which have the specified tag. .TP \fIpathName \fBtag cell remove \fItag\fR ?\fIcellList\fR? +. Removes the specified \fItag\fR from each of the listed \fIcellList\fR. If \fIcellList\fR is omitted, removes \fItag\fR from each cell in the tree. .RE .TP \fIpathName \fBtag configure \fItagName\fR ?\fIoption\fR? ?\fIvalue option value...\fR? +. Query or modify the options for the specified \fItagName\fR. If one or more \fIoption/value\fR pairs are specified, sets the value of those options for the specified tag. @@ -471,21 +549,25 @@ returns a dictionary of the option settings for \fItagName\fR. See \fBTAG OPTIONS\fR for the list of available options. .TP \fIpathName \fBtag delete \fItagName\fR +. Deletes all tag information for the \fItagName\fR argument. The command removes the tag from all items and cells in the widget and also deletes any other information associated with the tag, such as bindings and display information. The command returns an empty string. .TP \fIpathName \fBtag has \fItagName\fR ?\fIitem\fR? +. If \fIitem\fR is specified, returns 1 or 0 depending on whether the specified item has the named tag. Otherwise, returns a list of all items which have the specified tag. .TP \fIpathName \fBtag names\fR +. Returns a list of all tags used by the widget. .TP \fIpathName \fBtag remove \fItag\fR ?\fIitems\fR? +. Removes the specified \fItag\fR from each of the listed \fIitems\fR. If \fIitems\fR is omitted, removes \fItag\fR from each item in the tree. If \fItag\fR is not present for a particular item, @@ -500,9 +582,9 @@ The textual label to display for the item in the tree column. .IP \fB\-height\fR The height for the item, in integer multiples of \fB\-rowheight\fP. Default is 1. .IP \fB\-image\fR -A Tk image, displayed next to the label in the tree column, placed according to \fB-imageanchor\fR. +A Tk image, displayed next to the label in the tree column, placed according to \fB\-imageanchor\fR. .IP \fB\-imageanchor\fR -Specifies how the \fB-image\fR is displayed relative to the text. Default is \fBw\fR. +Specifies how the \fB\-image\fR is displayed relative to the text. Default is \fBw\fR. One of the standard Tk anchor values. .IP \fB\-values\fR The list of values associated with the item. diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index af63c39..52b18c9 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -10,7 +10,7 @@ .SH NAME ttk_vsapi \- Define a Microsoft Visual Styles element .SH SYNOPSIS -\fBttk::style element create \fIname\fR \fBvsapi\fR \fIclassName\fR \fIpartId\fR ?\fIstateMap\fR? ?\fIoptions\fR? +\fBttk::style element create \fIname \fBvsapi\fI className partId\fR ?\fIstateMap\fR? ?\fIoptions\fR? .BE .SH DESCRIPTION .PP @@ -21,7 +21,7 @@ on Windows XP and Vista. This factory permits any of the Visual Styles parts to be declared as Ttk elements that can then be included in a style layout to modify the appearance of Ttk widgets. .PP -\fIclassName\fR and \fIpartId\fR are required parameters and specify +The \fIclassName\fR and \fIpartId\fR are required parameters and specify the Visual Styles class and part as given in the Microsoft documentation. The \fIstateMap\fR may be provided to map Ttk states to Visual Styles API states (see \fBSTATE MAP\fR). diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index 7605260..e286eb0 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -173,12 +173,16 @@ setting it changes the widget state, but the \fBstate\fR widget command does not affect the \fB\-state\fR option. .SH COMMANDS +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) @@ -192,16 +196,20 @@ and current value. .\" Note: Ttk widgets don't use TK_OPTION_SYNONYM. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR. +.\" METHOD: identify .TP \fIpathName \fBidentify element \fIx y\fR +. Returns the name of the element under the point given by \fIx\fR and \fIy\fR, or an empty string if the point does not lie within any element. \fIx\fR and \fIy\fR are pixel coordinates relative to the widget. Some widgets accept other \fBidentify\fR subcommands described in these widgets documentation. +.\" METHOD: instate .TP \fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? +. Test the widget's state. If \fIscript\fR is not specified, returns 1 if the widget state matches \fIstatespec\fR and 0 otherwise. @@ -209,8 +217,10 @@ If \fIscript\fR is specified, equivalent to .CS if {[\fIpathName\fR instate \fIstateSpec\fR]} \fIscript\fR .CE +.\" METHOD: state .TP \fIpathName \fBstate\fR ?\fIstateSpec\fR? +. Modify or inquire widget state. If \fIstateSpec\fR is present, sets the widget state: for each flag in \fIstateSpec\fR, sets the corresponding flag @@ -225,17 +235,22 @@ will restore \fIpathName\fR to the original state. If \fIstateSpec\fR is not specified, returns a list of the currently-enabled state flags. .RE +.\" METHOD: style .TP \fIpathName \fBstyle\fR +. Return the style used by the widget. +.\" METHOD: xview .TP \fIpathName \fBxview \fIargs\fR +. This command is used to query and change the horizontal position of the content in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fBxview\fR +. Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the horizontal span that is visible in the window. @@ -245,16 +260,19 @@ in the window, and 40% of the content is off-screen to the right. These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP -\fIpathName \fBxview\fR \fIindex\fR +\fIpathName \fBxview\fI index\fR +. Adjusts the view in the window so that the content given by \fIindex\fR is displayed at the left edge of the window. .TP \fIpathName \fBxview moveto\fI fraction\fR +. Adjusts the view in the window so that the character \fIfraction\fR of the way through the content appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR +. This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then @@ -269,14 +287,17 @@ become visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by \fInumber\fR average-width characters on the display. .RE +.\" METHOD: yview .TP \fIpathName \fByview \fIargs\fR +. This command is used to query and change the vertical position of the content in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fByview\fR +. Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the vertical span that is visible in the window. @@ -286,16 +307,19 @@ in the window, and 40% of the content is off-screen to the bottom. These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR option. .TP -\fIpathName \fByview\fR \fIindex\fR +\fIpathName \fByview\fI index\fR +. Adjusts the view in the window so that the content given by \fIindex\fR is displayed at the top edge of the window. .TP \fIpathName \fByview moveto\fI fraction\fR +. Adjusts the view in the window so that the item \fIfraction\fR of the way through the content appears at the top edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fByview scroll \fInumber what\fR +. This command shifts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then diff --git a/doc/winfo.n b/doc/winfo.n index 5651f2c..136eaf7 100644 --- a/doc/winfo.n +++ b/doc/winfo.n @@ -12,13 +12,14 @@ .SH NAME winfo \- Return window-related information .SH SYNOPSIS -\fBwinfo\fR \fIoption \fR?\fIarg ...\fR? +\fBwinfo\fI option \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBwinfo\fR command is used to retrieve information about windows managed by Tk. It can take any of a number of different forms, depending on the \fIoption\fR argument. The legal forms are: +.\" METHOD: atom .TP \fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR Returns a decimal string giving the integer identifier for the @@ -27,6 +28,7 @@ atom whose name is \fIname\fR. If no atom exists with the name If the \fB\-displayof\fR option is given then the atom is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. +.\" METHOD: atomname .TP \fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR Returns the textual name for the atom whose integer identifier is @@ -36,10 +38,12 @@ up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. This command is the inverse of the \fBwinfo atom\fR command. It generates an error if no such atom exists. +.\" METHOD: cells .TP \fBwinfo cells \fIwindow\fR Returns a decimal string giving the number of cells in the color map for \fIwindow\fR. +.\" METHOD: children .TP \fBwinfo children \fIwindow\fR Returns a list containing the path names of all the children @@ -48,9 +52,11 @@ of their logical parents. The list is in stacking order, with the lowest window first, except for Top-level windows which are not returned in stacking order. Use the \fBwm stackorder\fR command to query the stacking order of Top-level windows. +.\" METHOD: class .TP \fBwinfo class \fIwindow\fR Returns the class name for \fIwindow\fR. +.\" METHOD: colormapfull .TP \fBwinfo colormapfull \fIwindow\fR Returns 1 if the colormap for \fIwindow\fR is known to be full, 0 @@ -60,6 +66,7 @@ to be full if the last attempt to allocate a new color on that window failed and this application has not freed any colors in the colormap since the failed allocation. +.\" METHOD: containing .TP \fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR Returns the path name for the window containing the point given @@ -79,16 +86,19 @@ or border of its highest containing toplevel in this application. In selecting the containing window, children are given higher priority than parents and among siblings the highest one in the stacking order is chosen. +.\" METHOD: depth .TP \fBwinfo depth \fIwindow\fR Returns a decimal string giving the depth of \fIwindow\fR (number of bits per pixel). +.\" METHOD: exists .TP \fBwinfo exists \fIwindow\fR Returns 1 if there exists a window named \fIwindow\fR, 0 if no such window exists. +.\" METHOD: fpixels .TP -\fBwinfo fpixels \fIwindow\fR \fInumber\fR +\fBwinfo fpixels \fIwindow number\fR Returns a floating-point value giving the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable @@ -98,11 +108,13 @@ or .QW 1i . The return value may be fractional; for an integer value, use \fBwinfo pixels\fR. +.\" METHOD: geometry .TP \fBwinfo geometry \fIwindow\fR Returns the geometry for \fIwindow\fR, in the form \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are in pixels. +.\" METHOD: height .TP \fBwinfo height \fIwindow\fR Returns a decimal string giving \fIwindow\fR's height in pixels. @@ -113,12 +125,14 @@ If you need the true height immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fBwinfo reqheight\fR to get the window's requested height instead of its actual height. +.\" METHOD: id .TP \fBwinfo id \fIwindow\fR Returns a hexadecimal string giving a low-level platform-specific identifier for \fIwindow\fR. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows HWND. On the Macintosh the value has no meaning outside Tk. +.\" METHOD: interps .TP \fBwinfo interps \fR?\fB\-displayof \fIwindow\fR? Returns a list whose members are the names of all Tcl interpreters @@ -126,11 +140,14 @@ Returns a list whose members are the names of all Tcl interpreters If the \fB\-displayof\fR option is given then the return value refers to the display of \fIwindow\fR; otherwise it refers to the display of the application's main window. +.\" METHOD: ismapped .TP \fBwinfo ismapped \fIwindow\fR Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise. +.\" METHOD: manager .TP \fBwinfo manager \fIwindow\fR +. Returns the name of the geometry manager currently responsible for \fIwindow\fR, or an empty string if \fIwindow\fR is not managed by any geometry manager. @@ -138,15 +155,18 @@ The name is usually the name of the Tcl command for the geometry manager, such as \fBpack\fR or \fBplace\fR. If the geometry manager is a widget, such as canvases or text, the name is the widget's class command, such as \fBcanvas\fR. +.\" METHOD: name .TP \fBwinfo name \fIwindow\fR Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed to its full path name). The command \fBwinfo name .\fR will return the name of the application. +.\" METHOD: parent .TP \fBwinfo parent \fIwindow\fR Returns the path name of \fIwindow\fR's parent, or an empty string if \fIwindow\fR is the main window of the application. +.\" METHOD: pathname .TP \fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR Returns the path name of the window whose X identifier is \fIid\fR. @@ -155,8 +175,9 @@ correspond to a window in the invoking application. If the \fB\-displayof\fR option is given then the identifier is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. +.\" METHOD: pixels .TP -\fBwinfo pixels \fIwindow\fR \fInumber\fR +\fBwinfo pixels \fIwindow number\fR Returns the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable @@ -166,6 +187,7 @@ or .QW 1i . The result is rounded to the nearest integer value; for a fractional result, use \fBwinfo fpixels\fR. +.\" METHOD: pointerx .TP \fBwinfo pointerx \fIwindow\fR If the mouse pointer is on the same screen as \fIwindow\fR, returns the @@ -174,6 +196,7 @@ If a virtual root window is in use on the screen, the position is measured in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then -1 is returned. +.\" METHOD: pointerxy .TP \fBwinfo pointerxy \fIwindow\fR If the mouse pointer is on the same screen as \fIwindow\fR, returns a list @@ -183,6 +206,7 @@ If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then both of the returned coordinates are \-1. +.\" METHOD: pointery .TP \fBwinfo pointery \fIwindow\fR If the mouse pointer is on the same screen as \fIwindow\fR, returns the @@ -191,16 +215,19 @@ If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then -1 is returned. +.\" METHOD: reqheight .TP \fBwinfo reqheight \fIwindow\fR Returns a decimal string giving \fIwindow\fR's requested height, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. +.\" METHOD: reqwidth .TP \fBwinfo reqwidth \fIwindow\fR Returns a decimal string giving \fIwindow\fR's requested width, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. +.\" METHOD: rgb .TP \fBwinfo rgb \fIwindow color\fR Returns a list containing three decimal values in the range 0 to @@ -209,52 +236,63 @@ red, green, and blue intensities that correspond to \fIcolor\fR in the window given by \fIwindow\fR. \fIColor\fR may be specified in any of the forms acceptable for a color option. +.\" METHOD: rootx .TP \fBwinfo rootx \fIwindow\fR Returns a decimal string giving the x-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). +.\" METHOD: rooty .TP \fBwinfo rooty \fIwindow\fR Returns a decimal string giving the y-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). +.\" METHOD: screen .TP \fBwinfo screen \fIwindow\fR Returns the name of the screen associated with \fIwindow\fR, in the form \fIdisplayName\fR.\fIscreenIndex\fR. +.\" METHOD: screencells .TP \fBwinfo screencells \fIwindow\fR Returns a decimal string giving the number of cells in the default color map for \fIwindow\fR's screen. +.\" METHOD: screendepth .TP \fBwinfo screendepth \fIwindow\fR Returns a decimal string giving the depth of the root window of \fIwindow\fR's screen (number of bits per pixel). +.\" METHOD: screenheight .TP \fBwinfo screenheight \fIwindow\fR Returns a decimal string giving the height of \fIwindow\fR's screen, in pixels. +.\" METHOD: screenmmheight .TP \fBwinfo screenmmheight \fIwindow\fR Returns a decimal string giving the height of \fIwindow\fR's screen, in millimeters. +.\" METHOD: screenmmwidth .TP \fBwinfo screenmmwidth \fIwindow\fR Returns a decimal string giving the width of \fIwindow\fR's screen, in millimeters. +.\" METHOD: screenvisual .TP \fBwinfo screenvisual \fIwindow\fR Returns one of the following strings to indicate the default visual class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \fBtruecolor\fR. +.\" METHOD: screenwidth .TP \fBwinfo screenwidth \fIwindow\fR Returns a decimal string giving the width of \fIwindow\fR's screen, in pixels. +.\" METHOD: server .TP \fBwinfo server \fIwindow\fR Returns a string containing information about the server for @@ -266,25 +304,30 @@ where \fImajor\fR and \fIminor\fR are the version and revision numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR is the name of the vendor for the server, and \fIvendorRelease\fR is an integer release number provided by the server. +.\" METHOD: toplevel .TP \fBwinfo toplevel \fIwindow\fR Returns the path name of the top-of-hierarchy window containing \fIwindow\fR. In standard Tk this will always be a \fBtoplevel\fR widget, but extensions may create other kinds of top-of-hierarchy widgets. +.\" METHOD: viewable .TP \fBwinfo viewable \fIwindow\fR Returns 1 if \fIwindow\fR and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped. +.\" METHOD: visual .TP \fBwinfo visual \fIwindow\fR Returns one of the following strings to indicate the visual class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \fBtruecolor\fR. +.\" METHOD: visualid .TP \fBwinfo visualid \fIwindow\fR Returns the X identifier for the visual for \fIwindow\fR. +.\" METHOD: visualsavailable .TP \fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR? Returns a list whose elements describe the visuals available for @@ -294,26 +337,31 @@ The class has the same form as returned by \fBwinfo visual\fR. The depth gives the number of bits per pixel in the visual. In addition, if the \fBincludeids\fR argument is provided, then the depth is followed by the X identifier for the visual. +.\" METHOD: vrootheight .TP \fBwinfo vrootheight \fIwindow\fR Returns the height of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the height of \fIwindow\fR's screen. +.\" METHOD: vrootwidth .TP \fBwinfo vrootwidth \fIwindow\fR Returns the width of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the width of \fIwindow\fR's screen. +.\" METHOD: vrootx .TP \fBwinfo vrootx \fIwindow\fR Returns the x-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fIwindow\fR. +.\" METHOD: vrooty .TP \fBwinfo vrooty \fIwindow\fR Returns the y-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fIwindow\fR. +.\" METHOD: width .TP \fBwinfo width \fIwindow\fR Returns a decimal string giving \fIwindow\fR's width in pixels. @@ -324,12 +372,14 @@ If you need the true width immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fBwinfo reqwidth\fR to get the window's requested width instead of its actual width. +.\" METHOD: x .TP \fBwinfo x \fIwindow\fR Returns a decimal string giving the x-coordinate, in \fIwindow\fR's parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). +.\" METHOD: y .TP \fBwinfo y \fIwindow\fR Returns a decimal string giving the y-coordinate, in \fIwindow\fR's diff --git a/doc/wm.n b/doc/wm.n index e53529c..ce5a4c5 100644 --- a/doc/wm.n +++ b/doc/wm.n @@ -12,7 +12,7 @@ .SH NAME wm \- Communicate with window manager .SH SYNOPSIS -\fBwm\fR \fIoption window \fR?\fIargs\fR? +\fBwm\fI option window \fR?\fIargs\fR? .BE .SH DESCRIPTION .PP @@ -25,6 +25,7 @@ additional argument, \fIwindow\fR, which must be the path name of a top-level window. .PP The legal forms for the \fBwm\fR command are: +.\" METHOD: aspect .TP \fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR? . @@ -42,6 +43,7 @@ a Tcl list containing four elements, which are the current values of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR (if no aspect restrictions are in effect, then an empty string is returned). +.\" METHOD: attributes .TP \fBwm attributes \fIwindow\fR .TP @@ -276,6 +278,7 @@ the value of an attribute returns the current state, which will not be the same as the value most recently set if the window manager has not yet processed the request or if it does not support the attribute. .RE +.\" METHOD: client .TP \fBwm client \fIwindow\fR ?\fIname\fR? . @@ -289,6 +292,7 @@ If \fIname\fR is not specified, the command returns the last name set in a \fBwm client\fR command for \fIwindow\fR. If \fIname\fR is specified as an empty string, the command deletes the \fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR. +.\" METHOD: colormapwindows .TP \fBwm colormapwindows \fIwindow\fR ?\fIwindowList\fR? . @@ -320,6 +324,7 @@ itself; the order of the internal windows is undefined. See the ICCCM documentation for more information on the \fBWM_COLORMAP_WINDOWS\fR property. .RE +.\" METHOD: command .TP \fBwm command \fIwindow\fR ?\fIvalue\fR? . @@ -332,6 +337,7 @@ If \fIvalue\fR is not specified then the command returns the last value set in a \fBwm command\fR command for \fIwindow\fR. If \fIvalue\fR is specified as an empty string, the command deletes the \fBWM_COMMAND\fR property from \fIwindow\fR. +.\" METHOD: deiconify .TP \fBwm deiconify \fIwindow\fR . @@ -342,6 +348,7 @@ that when the window is first mapped it will be displayed in de-iconified form. On Windows, a deiconified window will also be raised and be given the focus (made the active window). Returns an empty string. +.\" METHOD: focusmodel .TP \fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR? . @@ -362,6 +369,7 @@ the application may re-assign the focus among \fIwindow\fR's descendants. The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR command assumes a passive model of focusing. .RE +.\" METHOD: forget .TP \fBwm forget \fIwindow\fR . @@ -370,6 +378,7 @@ be managed by \fBwm\fR. Windows created with the \fBtoplevel\fR command will be treated like \fBframe\fR windows once they are no longer managed by \fBwm\fR, however, the \fB\-menu\fR configuration will be remembered and the menus will return once the widget is managed again. +.\" METHOD: frame .TP \fBwm frame \fIwindow\fR . @@ -379,6 +388,7 @@ identifier for the outermost frame that contains \fIwindow\fR (the window whose parent is the root or virtual root). If \fIwindow\fR has not been reparented by the window manager then the command returns the platform specific window identifier for \fIwindow\fR. +.\" METHOD: geometry .TP \fBwm geometry \fIwindow\fR ?\fInewGeometry\fR? . @@ -423,6 +433,7 @@ reflect the addition of decorative elements to \fIwindow\fR such as title bars, and window managers are not required to precisely follow the requests made through this command. .RE +.\" METHOD: grid .TP \fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR? . @@ -459,6 +470,7 @@ Note: this command should not be needed very often, since the \fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option provide easier access to the same functionality. .RE +.\" METHOD: group .TP \fBwm group \fIwindow\fR ?\fIpathName\fR? . @@ -470,8 +482,9 @@ remove \fIwindow\fR from any group association. If \fIpathName\fR is specified then the command returns an empty string; otherwise it returns the path name of \fIwindow\fR's current group leader, or an empty string if \fIwindow\fR is not part of any group. +.\" METHOD: iconbadge .TP -\fBwm iconbadge \fIwindow\fR \fIbadge\fR +\fBwm iconbadge \fIwindow badge\fR . Sets a badge for the icon of the \fIwindow\fR. The badge can be a positive integer number, for instance the number of new or unread messages, or @@ -501,6 +514,7 @@ Badge display on macOS is configured in the system preferences. App panel display behavior on X11 will depend on the window manager and/or desktop environment. .RE +.\" METHOD: iconbitmap .TP \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR? . @@ -530,12 +544,14 @@ first test if the file contains an icon, then if it has an assigned icon, and finally, if that fails, test for a bitmap. .RE +.\" METHOD: iconify .TP \fBwm iconify \fIwindow\fR . Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR has not yet been mapped for the first time, this command will arrange for it to appear in the iconified state when it is eventually mapped. +.\" METHOD: iconmask .TP \fBwm iconmask \fIwindow\fR ?\fIbitmap\fR? . @@ -551,6 +567,7 @@ a bitmap of all ones). If \fIbitmap\fR is specified then the command returns an empty string. Otherwise it returns the name of the current icon mask associated with \fIwindow\fR, or an empty string if no mask is in effect. +.\" METHOD: iconname .TP \fBwm iconname \fIwindow\fR ?\fInewName\fR? . @@ -562,6 +579,7 @@ then the command returns the current icon name for \fIwindow\fR, or an empty string if no icon name has been specified (in this case the window manager will normally display the window's title, as specified with the \fBwm title\fR command). +.\" METHOD: iconphoto .TP \fBwm iconphoto \fIwindow\fR ?\fB\-default\fR? \fIimage1\fR ?\fIimage2 ...\fR? . @@ -592,6 +610,7 @@ parameters as support for multiple sizes/resolutions on macOS is outside Tk's scope. Developers should use the largest icon they can support (preferably 512 pixels) to ensure smooth rendering on the Mac. .RE +.\" METHOD: iconposition .TP \fBwm iconposition \fIwindow\fR ?\fIx y\fR? . @@ -602,6 +621,7 @@ specified as empty strings then any existing icon position hint is cancelled. If neither \fIx\fR nor \fIy\fR is specified, then the command returns a Tcl list containing two values, which are the current icon position hints (if no hints are in effect then an empty string is returned). +.\" METHOD: iconwindow .TP \fBwm iconwindow \fIwindow\fR ?\fIpathName\fR? . @@ -620,6 +640,7 @@ an icon window; this is needed in order to allow window managers to .QW own those events. Note: not all window managers support the notion of an icon window. +.\" METHOD: manage .TP \fBwm manage \fIwidget\fR . @@ -629,6 +650,7 @@ window will be decorated with the window managers title bar, etc. Only with this command. Attempting to pass any other widget type will raise an error. Attempting to manage a \fItoplevel\fR widget is benign and achieves nothing. See also \fBGEOMETRY MANAGEMENT\fR. +.\" METHOD: maxsize .TP \fBwm maxsize \fIwindow\fR ?\fIwidth height\fR? . @@ -644,6 +666,7 @@ it returns a Tcl list with two elements, which are the maximum width and height currently in effect. The maximum size defaults to the size of the screen. See the sections on geometry management below for more information. +.\" METHOD: minsize .TP \fBwm minsize \fIwindow\fR ?\fIwidth height\fR? . @@ -659,6 +682,7 @@ it returns a Tcl list with two elements, which are the minimum width and height currently in effect. The minimum size defaults to one pixel in each dimension. See the sections on geometry management below for more information. +.\" METHOD: overrideredirect .TP \fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR? . @@ -679,6 +703,7 @@ when the window is first mapped or when mapped after the state is changed from withdrawn to normal. Some, but not all, platforms will take notice at additional times. .RE +.\" METHOD: positionfrom .TP \fBwm positionfrom \fIwindow\fR ?\fIwho\fR? . @@ -700,6 +725,7 @@ as equivalent to \fBprogram\fR. Tk will automatically set the position source to \fBuser\fR when a \fBwm geometry\fR command is invoked, unless the source has been set explicitly to \fBprogram\fR. +.\" METHOD: protocol .TP \fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR? . @@ -747,6 +773,7 @@ Lastly, if neither \fIname\fR nor \fIcommand\fR is specified, the \fBwm protocol\fR command returns a list of all of the protocols for which handlers are currently defined for \fIwindow\fR. .RE +.\" METHOD: resizable .TP \fBwm resizable \fIwindow\fR ?\fIwidth height\fR? . @@ -763,6 +790,7 @@ If resizing is disabled, then the window's size will be the size from the most recent interactive resize or \fBwm geometry\fR command. If there has been no such operation then the window's natural size will be used. +.\" METHOD: sizefrom .TP \fBwm sizefrom \fIwindow\fR ?\fIwho\fR? . @@ -781,6 +809,7 @@ source of the window's current size, or an empty string if no source has been specified yet. Most window managers interpret .QW "no source" as equivalent to \fBprogram\fR. +.\" METHOD: stackorder .TP \fBwm stackorder \fIwindow\fR ?\fBisabove\fR|\fBisbelow \fIwindow\fR? . @@ -795,6 +824,7 @@ When two window arguments separated by either \fBisabove\fR or \fBisbelow\fR are passed, a boolean result indicates whether or not the first window is currently above or below the second window in the stacking order. +.\" METHOD: state .TP \fBwm state \fIwindow\fR ?newstate? . @@ -807,6 +837,7 @@ The difference between \fBiconic\fR and \fBicon\fR is that \fBwm iconify\fR command) while \fBicon\fR refers to a window whose only purpose is to serve as the icon for some other window (via the \fBwm iconwindow\fR command). The \fBicon\fR state cannot be set. +.\" METHOD: title .TP \fBwm title \fIwindow\fR ?\fIstring\fR? . @@ -816,6 +847,7 @@ should display this string in \fIwindow\fR's title bar). In this case the command returns an empty string. If \fIstring\fR is not specified then the command returns the current title for the \fIwindow\fR. The title for a window defaults to its name. +.\" METHOD: transient .TP \fBwm transient \fIwindow\fR ?\fIcontainer\fR? . @@ -834,6 +866,7 @@ transient of itself. The window manager may also decorate a transient window differently, removing some features normally present (e.g., minimize and maximize buttons) though this is entirely at the discretion of the window manager. +.\" METHOD: widthdraw .TP \fBwm withdraw \fIwindow\fR . -- cgit v0.12 From 9b372a4bc9793dcb2f9e612afb5d23ba7f1a386c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 22 Jan 2024 12:14:43 +0000 Subject: Get rid of tagPtr->(reliefObj|justifyObj|overstrikePtr|underlinePtr|elideObj). Due to TIP #613, they are not needed any more. --- generic/tkSquare.c | 14 ++++-------- generic/tkText.c | 2 -- generic/tkText.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++------- generic/tkTextTag.c | 15 ++++-------- tests/textTag.test | 8 +++---- 5 files changed, 72 insertions(+), 33 deletions(-) diff --git a/generic/tkSquare.c b/generic/tkSquare.c index b459148..71b0267 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -53,7 +53,7 @@ typedef struct { Tcl_Obj *reliefPtr; GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ - Tcl_Obj *doubleBufferPtr; /* Non-zero means double-buffer redisplay with + int doubleBuffer; /* Non-zero means double-buffer redisplay with * pixmap; zero means draw straight onto the * display. */ int updatePending; /* Non-zero means a call to SquareDisplay has @@ -75,7 +75,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", "2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", - "1", offsetof(Square, doubleBufferPtr), TCL_INDEX_NONE, 0 , NULL, 0}, + "1", TCL_INDEX_NONE, offsetof(Square, doubleBuffer), 0 , NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", @@ -322,7 +322,6 @@ SquareConfigure( { int borderWidth; Tk_3DBorder bgBorder; - int doubleBuffer; /* * Set the background for the window and create a graphics context for use @@ -333,8 +332,7 @@ SquareConfigure( squarePtr->bgBorderPtr); Tk_SetWindowBackground(squarePtr->tkwin, Tk_3DBorderColor(bgBorder)->pixel); - Tcl_GetBooleanFromObj(NULL, squarePtr->doubleBufferPtr, &doubleBuffer); - if ((squarePtr->gc == NULL) && doubleBuffer) { + if ((squarePtr->gc == NULL) && squarePtr->doubleBuffer) { XGCValues gcValues; gcValues.function = GXcopy; gcValues.graphics_exposures = False; @@ -478,7 +476,6 @@ SquareDisplay( Drawable d; int borderWidth, size, relief; Tk_3DBorder bgBorder, fgBorder; - int doubleBuffer; squarePtr->updatePending = 0; if (!Tk_IsMapped(tkwin)) { @@ -489,8 +486,7 @@ SquareDisplay( * Create a pixmap for double-buffering, if necessary. */ - Tcl_GetBooleanFromObj(NULL, squarePtr->doubleBufferPtr, &doubleBuffer); - if (doubleBuffer) { + if (squarePtr->doubleBuffer) { pm = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), DefaultDepthOfScreen(Tk_Screen(tkwin))); @@ -525,7 +521,7 @@ SquareDisplay( * If double-buffered, copy to the screen and release the pixmap. */ - if (doubleBuffer) { + if (squarePtr->doubleBuffer) { XCopyArea(Tk_Display(tkwin), pm, Tk_WindowId(tkwin), squarePtr->gc, 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin), 0, 0); diff --git a/generic/tkText.c b/generic/tkText.c index 78fe385..ce39e0d 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -618,8 +618,6 @@ CreateWidget( textPtr->selTagPtr = TkTextCreateTag(textPtr, "sel", NULL); Tk_GetRelief(interp, DEF_TEXT_SELECT_RELIEF, &textPtr->selTagPtr->relief); - textPtr->selTagPtr->reliefObj = Tcl_NewStringObj(DEF_TEXT_SELECT_RELIEF, -1); - Tcl_IncrRefCount(textPtr->selTagPtr->reliefObj); textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &startIndex); textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex); diff --git a/generic/tkText.h b/generic/tkText.h index 46d837d..5578341 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -342,7 +342,10 @@ typedef struct TkTextTag { * value specified here. */ int borderWidth; /* Width of 3-D border for background. */ Tcl_Obj *borderWidthPtr; /* Width of 3-D border for background. */ - Tcl_Obj *reliefObj; +#if TK_MAJOR_VERSION < 9 + char *reliefString; /* -relief option string (malloc-ed). NULL + * means option not specified. */ +#endif int relief; /* 3-D relief for background. */ Pixmap bgStipple; /* Stipple bitmap for background. None means * no value specified here. */ @@ -353,32 +356,57 @@ typedef struct TkTextTag { Pixmap fgStipple; /* Stipple bitmap for text and other * foreground stuff. None means no value * specified here.*/ - Tcl_Obj *justifyObj; - Tk_Justify justify; /* How to justify text: TK_JUSTIFY_LEFT, - * TK_JUSTIFY_RIGHT, TK_JUSTIFY_CENTER, or TK_JUSTIFY_NULL. */ +#if TK_MAJOR_VERSION < 9 + char *justifyString; /* -justify option string (malloc-ed). NULL + * means option not specified. */ +#endif + Tk_Justify justify; /* How to justify text: TK_JUSTIFY_CENTER, + * TK_JUSTIFY_LEFT, or TK_JUSTIFY_RIGHT. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *lMargin1Obj; /* -lmargin1 option object. NULL * means option not specified. */ +#else + char *lMargin1String; /* -lmargin1 option string (malloc-ed). NULL + * means option not specified. */ +#endif int lMargin1; /* Left margin for first display line of each * text line, in pixels. INT_MIN means option not specified. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *lMargin2Obj; /* -lmargin2 option object. NULL * means option not specified. */ +#else + char *lMargin2String; /* -lmargin2 option string (malloc-ed). NULL + * means option not specified. */ +#endif int lMargin2; /* Left margin for second and later display lines - * of each text line, in pixels. */ + * of each text line, in pixels. INT_MIN means option not specified. */ Tk_3DBorder lMarginColor; /* Used for drawing background in left margins. * This is used for both lmargin1 and lmargin2. * NULL means no value specified here. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *offsetObj; /* -offset option. NULL means option not specified. */ +#else + char *offsetString; /* -offset option string (malloc-ed). NULL + * means option not specified. */ +#endif int offset; /* Vertical offset of text's baseline from * baseline of line. Used for superscripts and * subscripts. INT_MIN means option not specified. */ - Tcl_Obj *overstrikePtr; /* -overstrike option. NULL +#if TK_MAJOR_VERSION < 9 + char *overstrikeString; /* -overstrike option string (malloc-ed). NULL * means option not specified. */ +#endif int overstrike; /* > 0 means draw horizontal line through * middle of text. -1 means not specified. */ XColor *overstrikeColor; /* Color for the overstrike. NULL means same * color as foreground. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *rMarginObj; /* -rmargin option object. NULL * means option not specified. */ +#else + char *rMarginString; /* -rmargin option string (malloc-ed). NULL + * means option not specified. */ +#endif int rMargin; /* Right margin for text, in pixels. INT_MIN means option not specified. */ Tk_3DBorder rMarginColor; /* Used for drawing background in right margin. * NULL means no value specified here. */ @@ -386,16 +414,31 @@ typedef struct TkTextTag { * NULL means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *spacing1Obj; /* -spacing1 option object. NULL * means option not specified. */ +#else + char *spacing1String; /* -spacing1 option string (malloc-ed). NULL + * means option not specified. */ +#endif int spacing1; /* Extra spacing above first display line for * text line. INT_MIN means option not specified. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *spacing2Obj; /* -spacing2 option object. NULL * means option not specified. */ +#else + char *spacing2String; /* -spacing2 option string (malloc-ed). NULL + * means option not specified. */ +#endif int spacing2; /* Extra spacing between display lines for the * same text line. INT_MIN means option not specified. */ +#if TK_MAJOR_VERSION > 8 Tcl_Obj *spacing3Obj; /* -spacing3 option object. NULL * means option not specified. */ +#else + char *spacing3String; /* -spacing3 option string (malloc-ed). NULL + * means option not specified. */ +#endif int spacing3; /* Extra spacing below last display line for * text line. INT_MIN means option not specified. */ Tcl_Obj *tabStringPtr; /* -tabs option string. NULL means option not @@ -403,10 +446,15 @@ typedef struct TkTextTag { struct TkTextTabArray *tabArrayPtr; /* Info about tabs for tag (malloc-ed) or * NULL. Corresponds to tabString. */ +#if TK_MAJOR_VERSION > 8 TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR * or TK_TEXT_TABSTYLE_NULL (if not specified). */ - Tcl_Obj *underlinePtr; /* -underline option. NULL +#else + int tabStyle; /* One of TABULAR or WORDPROCESSOR or NONE (if + * not specified). */ + char *underlineString; /* -underline option string (malloc-ed). NULL * means option not specified. */ +#endif int underline; /* > 0 means draw underline underneath * text. -1 means not specified. */ XColor *underlineColor; /* Color for the underline. NULL means same @@ -415,8 +463,10 @@ typedef struct TkTextTag { * Must be TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD, * TEXT_WRAPMODE_NONE, or TEXT_WRAPMODE_NULL to * use wrapmode for whole widget. */ - Tcl_Obj *elideObj; /* -elide option. NULL +#if TK_MAJOR_VERSION < 9 + char *elideString; /* -elide option string (malloc-ed). NULL * means option not specified. */ +#endif int elide; /* > 0 means that data under this tag * should not be displayed. -1 means not specified. */ int affectsDisplay; /* Non-zero means that this tag affects the diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index e21f2ac..7d91201 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -25,7 +25,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, offsetof(TkTextTag, borderWidthPtr), offsetof(TkTextTag, borderWidth), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-elide", NULL, NULL, - NULL, offsetof(TkTextTag, elideObj), offsetof(TkTextTag, elide), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elide), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, @@ -34,7 +34,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_COLOR, "-foreground", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", NULL, NULL, - NULL, offsetof(TkTextTag, justifyObj), offsetof(TkTextTag, justify), TK_OPTION_NULL_OK, 0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, justify), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_PIXELS, "-lmargin1", NULL, NULL, NULL, offsetof(TkTextTag, lMargin1Obj), offsetof(TkTextTag, lMargin1), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_PIXELS, "-lmargin2", NULL, NULL, @@ -44,13 +44,13 @@ static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_PIXELS, "-offset", NULL, NULL, NULL, offsetof(TkTextTag, offsetObj), offsetof(TkTextTag, offset), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-overstrike", NULL, NULL, - NULL, offsetof(TkTextTag, overstrikePtr), offsetof(TkTextTag, overstrike), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrike), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", NULL, NULL, - NULL, offsetof(TkTextTag, reliefObj), offsetof(TkTextTag, relief), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, relief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-rmargin", NULL, NULL, NULL, offsetof(TkTextTag, rMarginObj), offsetof(TkTextTag, rMargin), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, @@ -71,7 +71,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle), TK_OPTION_NULL_OK|TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, 0}, {TK_OPTION_BOOLEAN, "-underline", NULL, NULL, - NULL, offsetof(TkTextTag, underlinePtr), offsetof(TkTextTag, underline), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underline), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor), @@ -945,13 +945,11 @@ TkTextCreateTag( tagPtr->border = NULL; tagPtr->borderWidth = 0; tagPtr->borderWidthPtr = NULL; - tagPtr->reliefObj = NULL; tagPtr->relief = TK_RELIEF_NULL; tagPtr->bgStipple = None; tagPtr->fgColor = NULL; tagPtr->tkfont = NULL; tagPtr->fgStipple = None; - tagPtr->justifyObj = NULL; tagPtr->justify = TK_JUSTIFY_NULL; tagPtr->lMargin1Obj = NULL; tagPtr->lMargin1 = INT_MIN; @@ -960,7 +958,6 @@ TkTextCreateTag( tagPtr->lMarginColor = NULL; tagPtr->offsetObj = NULL; tagPtr->offset = INT_MIN; - tagPtr->overstrikePtr = NULL; tagPtr->overstrike = -1; tagPtr->overstrikeColor = NULL; tagPtr->rMarginObj = NULL; @@ -977,10 +974,8 @@ TkTextCreateTag( tagPtr->tabStringPtr = NULL; tagPtr->tabArrayPtr = NULL; tagPtr->tabStyle = TK_TEXT_TABSTYLE_NULL; - tagPtr->underlinePtr = NULL; tagPtr->underline = -1; tagPtr->underlineColor = NULL; - tagPtr->elideObj = NULL; tagPtr->elide = -1; tagPtr->wrapMode = TEXT_WRAPMODE_NULL; tagPtr->affectsDisplay = 0; diff --git a/tests/textTag.test b/tests/textTag.test index f3bc53e..b33787e 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -169,7 +169,7 @@ test textTag-1.20 {tag configuration options} -body { .t tag cget x -overstrike } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] -} -result {on} +} -result 1 test textTag-1.21 {configuration options} -body { .t tag configure x -overstrike stupid } -cleanup { @@ -291,7 +291,7 @@ test textTag-1.34 {tag configuration options} -body { .t tag cget x -underline } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] -} -result {no} +} -result 0 test textTag-1.35 {configuration options} -body { .t tag configure x -underline stupid } -cleanup { @@ -501,7 +501,7 @@ test textTag-5.4 {TkTextTagCmd - "configure" option} -body { .t tag configure x -underline } -cleanup { .t tag delete x -} -result {-underline {} {} {} yes} +} -result {-underline {} {} {} 1} test textTag-5.4a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underlinefg lightgreen @@ -515,7 +515,7 @@ test textTag-5.5 {TkTextTagCmd - "configure" option} -body { .t tag cget x -overstrike } -cleanup { .t tag delete x -} -result {on} +} -result 1 test textTag-5.5a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -overstrikefg lightgreen -- cgit v0.12 From 3f7f4e17bc176671ee2a535f663482dd2f736f7f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 22 Jan 2024 12:48:59 +0000 Subject: Make updatePending and doubleBuffer "bool" variables --- generic/tkSquare.c | 19 ++++++++++--------- macosx/tkMacOSXImage.c | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 71b0267..8491aab 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -23,6 +23,7 @@ # define USE_TK_STUBS #endif #include "tkInt.h" +#include /* * A data structure of the following type is kept for each square widget @@ -53,10 +54,10 @@ typedef struct { Tcl_Obj *reliefPtr; GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ - int doubleBuffer; /* Non-zero means double-buffer redisplay with - * pixmap; zero means draw straight onto the + bool doubleBuffer; /* true means double-buffer redisplay with + * pixmap; false means draw straight onto the * display. */ - int updatePending; /* Non-zero means a call to SquareDisplay has + bool updatePending; /* true means a call to SquareDisplay has * already been scheduled. */ } Square; @@ -75,7 +76,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", "2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", - "1", TCL_INDEX_NONE, offsetof(Square, doubleBuffer), 0 , NULL, 0}, + "1", TCL_INDEX_NONE, offsetof(Square, doubleBuffer), TK_OPTION_VAR(bool) , NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", @@ -280,7 +281,7 @@ SquareWidgetObjCmd( } if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = 1; + squarePtr->updatePending = true; } } if (resultObjPtr != NULL) { @@ -351,7 +352,7 @@ SquareConfigure( Tk_SetInternalBorder(squarePtr->tkwin, borderWidth); if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = 1; + squarePtr->updatePending = true; } KeepInWindow(squarePtr); return TCL_OK; @@ -385,13 +386,13 @@ SquareObjEventProc( if (eventPtr->type == Expose) { if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = 1; + squarePtr->updatePending = true; } } else if (eventPtr->type == ConfigureNotify) { KeepInWindow(squarePtr); if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = 1; + squarePtr->updatePending = true; } } else if (eventPtr->type == DestroyNotify) { if (squarePtr->tkwin != NULL) { @@ -477,7 +478,7 @@ SquareDisplay( int borderWidth, size, relief; Tk_3DBorder bgBorder, fgBorder; - squarePtr->updatePending = 0; + squarePtr->updatePending = false; if (!Tk_IsMapped(tkwin)) { return; } diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 10e8116..adf5d39 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -1096,12 +1096,12 @@ struct TkMacOSXNSImageModel { int radius; /* Radius for rounded corners. */ int ring; /* Thickness of the focus ring. */ double alpha; /* Transparency, between 0.0 and 1.0*/ - bool pressed; /* Image is for use in a pressed button.*/ - bool templ; /* Image is for use as a template.*/ char *imageName ; /* Malloc'ed image name. */ char *source; /* Malloc'ed string describing the image. */ char *as; /* Malloc'ed interpretation of source */ int flags; /* Sundry flags, defined below. */ + bool pressed; /* Image is for use in a pressed button.*/ + bool templ; /* Image is for use as a template.*/ TkMacOSXNSImageInstance *instancePtr; /* Start of list of instances associated * with this model. */ NSImage *image; /* The underlying NSImage object. */ -- cgit v0.12 From cb5fcd062d96ada71eb0d93b671383162ccc5dab Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 22 Jan 2024 13:05:28 +0000 Subject: tagPtr->wrapMode is an enum with only 4 possible values, so no need to test for 3 of them --- generic/tkText.c | 4 +--- generic/tkTextDisp.c | 4 +--- generic/tkTextTag.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index ce39e0d..852646b 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2269,9 +2269,7 @@ ConfigureText( || (textPtr->selTagPtr->tabStringPtr != NULL) || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR) || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR) - || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_CHAR) - || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_NONE) - || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_WORD)) { + || (textPtr->selTagPtr->wrapMode != TEXT_WRAPMODE_NULL)) { textPtr->selTagPtr->affectsDisplay = 1; textPtr->selTagPtr->affectsDisplayGeometry = 1; } diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 4a4df6d..2b58958 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -984,9 +984,7 @@ GetStyle( styleValues.elide = tagPtr->elide > 0; elidePrio = tagPtr->priority; } - if (((tagPtr->wrapMode == TEXT_WRAPMODE_CHAR) - || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE) - || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) + if ((tagPtr->wrapMode != TEXT_WRAPMODE_NULL) && (tagPtr->priority > wrapPrio)) { styleValues.wrapMode = tagPtr->wrapMode; wrapPrio = tagPtr->priority; diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 7d91201..b53dfd6 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -442,9 +442,7 @@ TkTextTagCmd( || (tagPtr->tabStringPtr != NULL) || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR) || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR) - || (tagPtr->wrapMode == TEXT_WRAPMODE_CHAR) - || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE) - || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) { + || (tagPtr->wrapMode != TEXT_WRAPMODE_NULL)) { tagPtr->affectsDisplay = 1; tagPtr->affectsDisplayGeometry = 1; } -- cgit v0.12 From 526ebe552a464419505f982f6bc500ef6b155b58 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 23 Jan 2024 14:10:35 +0000 Subject: Someone might like to use "long double" in an option table, let's allow that. --- generic/tk.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index 4f72009..c2f3447 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -282,16 +282,20 @@ typedef struct Tk_SavedOption { Tcl_Obj *valuePtr; /* The old value of the option, in the form of * a Tcl object; may be NULL if the value was * not saved as an object. */ - double internalForm; /* The old value of the option, in some +#if TCL_MAJOR_VERSION > 8 + long double internalForm; /* The old value of the option, in some * internal representation such as an int or * (XColor *). Valid only if the field * optionPtr->specPtr->objOffset is -1. The * space must be large enough to accommodate a - * double, a long, or a pointer; right now it - * looks like a double (i.e., 8 bytes) is big - * enough. Also, using a double guarantees - * that the field is properly aligned for - * storing large values. */ + * long double, a double, a long, or a pointer; + * right now it looks like a long double (i.e., 16 + * bytes) is big enough. Also, using a long double + * guarantees that the field is properly aligned + * for storing large values. */ +#else + double internalForm; +#endif } Tk_SavedOption; #ifdef TCL_MEM_DEBUG -- cgit v0.12 From 0b9a066a03ff8422fac31240439c8fa5412dbb34 Mon Sep 17 00:00:00 2001 From: csaba Date: Tue, 23 Jan 2024 19:07:28 +0000 Subject: One more int -> TkTextTabStyle (eliminates a compiler warning). --- generic/tkTextDisp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 2b58958..0425efd 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -150,7 +150,8 @@ typedef struct StyleValues { int spacing3; /* Spacing below last dline in text line. */ TkTextTabArray *tabArrayPtr;/* Locations and types of tab stops (may be * NULL). */ - TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR + * or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int underline; /* Non-zero means draw underline underneath * text. */ XColor *underlineColor; /* Foreground color for underline underneath @@ -594,7 +595,7 @@ static int NextTabStop(Tk_Font tkfont, int x, int tabOrigin); static void UpdateDisplayInfo(TkText *textPtr); static void YScrollByLines(TkText *textPtr, int offset); static void YScrollByPixels(TkText *textPtr, int offset); -static int SizeOfTab(TkText *textPtr, int tabStyle, +static int SizeOfTab(TkText *textPtr, TkTextTabStyle tabStyle, TkTextTabArray *tabArrayPtr, int *indexPtr, int x, int maxX); static void TextChanged(TkText *textPtr, @@ -1169,7 +1170,8 @@ LayoutDLine( * chunk. */ TkTextTabArray *tabArrayPtr;/* Tab stops for line; taken from style for * the first character on line. */ - TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR + * or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int tabSize; /* Number of pixels consumed by current tab * stop. */ TkTextDispChunk *lastCharChunkPtr; -- cgit v0.12 From 2f4b99c2d164ebbc4b182ae7eb1f0d635aea6b87 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 25 Jan 2024 17:50:00 +0000 Subject: Another round of small fixes, especially spelling errors... --- doc/3DBorder.3 | 78 ++++++++--------- doc/AddOption.3 | 1 + doc/BindTable.3 | 17 ++-- doc/CanvPsY.3 | 1 + doc/CanvTkwin.3 | 3 +- doc/CanvTxtInfo.3 | 3 +- doc/Clipboard.3 | 1 + doc/ClrSelect.3 | 1 + doc/ConfigWidg.3 | 49 ++++++++--- doc/ConfigWind.3 | 1 + doc/CoordToWin.3 | 1 + doc/CrtCmHdlr.3 | 1 + doc/CrtConsoleChan.3 | 1 + doc/CrtErrHdlr.3 | 1 + doc/CrtGenHdlr.3 | 1 + doc/CrtImgType.3 | 3 +- doc/CrtItemType.3 | 13 +-- doc/CrtPhImgFmt.3 | 50 +++++------ doc/CrtSelHdlr.3 | 1 + doc/CrtWindow.3 | 1 + doc/DeleteImg.3 | 1 + doc/DrawFocHlt.3 | 3 +- doc/EventHndlr.3 | 1 + doc/FindPhoto.3 | 3 +- doc/FontId.3 | 9 +- doc/GeomReq.3 | 13 ++- doc/GetAnchor.3 | 7 +- doc/GetBitmap.3 | 99 ++++++++------------- doc/GetCapStyl.3 | 5 +- doc/GetClrmap.3 | 7 +- doc/GetColor.3 | 19 ++-- doc/GetCursor.3 | 21 +++-- doc/GetFont.3 | 19 ++-- doc/GetGC.3 | 3 +- doc/GetHINSTANCE.3 | 1 + doc/GetHWND.3 | 1 + doc/GetImage.3 | 1 + doc/GetJoinStl.3 | 5 +- doc/GetJustify.3 | 16 ++-- doc/GetOption.3 | 1 + doc/GetPixels.3 | 26 +++--- doc/GetPixmap.3 | 5 +- doc/GetRelief.3 | 7 +- doc/GetRootCrd.3 | 1 + doc/GetScroll.3 | 5 +- doc/GetSelect.3 | 1 + doc/GetUid.3 | 1 + doc/GetVRoot.3 | 3 +- doc/GetVisual.3 | 8 +- doc/Grab.3 | 2 +- doc/HWNDToWindow.3 | 1 + doc/HandleEvent.3 | 1 + doc/IdToWindow.3 | 1 + doc/ImgChanged.3 | 1 + doc/Inactive.3 | 5 +- doc/InternAtom.3 | 5 +- doc/MainLoop.3 | 1 + doc/MainWin.3 | 5 +- doc/MaintGeom.3 | 1 + doc/ManageGeom.3 | 1 + doc/MapWindow.3 | 1 + doc/MeasureChar.3 | 14 +-- doc/MoveToplev.3 | 3 +- doc/Name.3 | 1 + doc/NameOfImg.3 | 1 + doc/OwnSelect.3 | 1 + doc/ParseArgv.3 | 68 ++++++--------- doc/QWinEvent.3 | 1 + doc/Restack.3 | 1 + doc/RestrictEv.3 | 1 + doc/SetAppName.3 | 1 + doc/SetCaret.3 | 1 + doc/SetClass.3 | 1 + doc/SetClassProcs.3 | 3 +- doc/SetGrid.3 | 1 + doc/SetOptions.3 | 150 ++++++++++++++------------------ doc/SetVisual.3 | 3 +- doc/StrictMotif.3 | 1 + doc/TextLayout.3 | 23 +++-- doc/TkInitStubs.3 | 1 + doc/Tk_Init.3 | 10 +++ doc/WinUtil.3 | 9 +- doc/WindowId.3 | 3 +- doc/bind.n | 9 +- doc/bitmap.n | 6 ++ doc/busy.n | 11 +-- doc/button.n | 10 +-- doc/canvas.n | 233 +++++++++++++++++++++++++++++++++++--------------- doc/checkbutton.n | 10 +-- doc/chooseColor.n | 8 +- doc/chooseDirectory.n | 18 +++- doc/clipboard.n | 8 +- doc/colors.n | 3 +- doc/console.n | 3 +- doc/cursors.n | 2 + doc/dialog.n | 18 ++-- doc/entry.n | 20 ++++- doc/event.n | 29 ++++++- doc/focus.n | 13 +-- doc/focusNext.n | 7 +- doc/font.n | 74 ++++++++-------- doc/fontchooser.n | 40 ++++++--- doc/getOpenFile.n | 15 +++- doc/grab.n | 10 ++- doc/grid.n | 85 +++++++++--------- doc/image.n | 12 +-- doc/label.n | 18 ++-- doc/labelframe.n | 14 +-- doc/listbox.n | 26 +++--- doc/menu.n | 57 ++++++------ doc/messageBox.n | 45 +++++----- doc/nsimage.n | 45 +++++----- doc/option.n | 12 +-- doc/options.n | 2 +- doc/pack.n | 67 ++++++++++----- doc/palette.n | 4 +- doc/panedwindow.n | 31 +++---- doc/photo.n | 93 +++++++++++++------- doc/place.n | 34 ++++++-- doc/popup.n | 6 +- doc/radiobutton.n | 7 +- doc/raise.n | 10 +-- doc/scale.n | 4 +- doc/scrollbar.n | 27 +++--- doc/selection.n | 8 +- doc/send.n | 8 +- doc/spinbox.n | 17 +++- doc/sysnotify.n | 1 + doc/systray.n | 9 +- doc/text.n | 64 +++++++++++++- doc/tk_mac.n | 29 ++++++- doc/tkerror.n | 6 +- doc/tkvars.n | 10 +++ doc/tkwait.n | 4 +- doc/ttk_Geometry.3 | 3 +- doc/ttk_button.n | 2 +- doc/ttk_entry.n | 3 +- doc/ttk_image.n | 26 ++++-- doc/ttk_intro.n | 20 ++--- doc/ttk_notebook.n | 10 ++- doc/ttk_panedwindow.n | 2 + doc/ttk_sizegrip.n | 6 +- doc/ttk_spinbox.n | 6 +- doc/ttk_style.n | 18 +++- doc/ttk_treeview.n | 62 ++++++++------ doc/ttk_vsapi.n | 8 +- doc/ttk_widget.n | 48 +++-------- doc/winfo.n | 50 ++++++++++- doc/wish.1 | 21 ++++- doc/wm.n | 104 +++++++++++----------- 150 files changed, 1518 insertions(+), 1016 deletions(-) diff --git a/doc/3DBorder.3 b/doc/3DBorder.3 index a6deb30..d609d6d 100644 --- a/doc/3DBorder.3 +++ b/doc/3DBorder.3 @@ -13,58 +13,49 @@ Tk_Alloc3DBorderFromObj, Tk_ClipDrawableToRect, Tk_DrawHighlightBorder, Tk_Get3D .SH SYNOPSIS .nf \fB#include \fR -.sp + Tk_3DBorder -\fBTk_Alloc3DBorderFromObj(\fIinterp, tkwin, objPtr\fB)\fR +\fBTk_Alloc3DBorderFromObj\fR(\fIinterp, tkwin, objPtr\fR) .sp -void -\fBTk_ClipDrawableToRect(\fIdisplay, drawable, x, y, width, height\fB)\fR +\fBTk_ClipDrawableToRect\fR(\fIdisplay, drawable, x, y, width, height\fR) .sp -void -\fBTk_DrawHighlightBorder(\fItkwin, fgGC, bgGC, highlightWidth, drawable\fB)\fR +\fBTk_DrawHighlightBorder\fR(\fItkwin, fgGC, bgGC, highlightWidth, drawable\fR) .sp Tk_3DBorder -\fBTk_Get3DBorder(\fIinterp, tkwin, colorName\fB)\fR +\fBTk_Get3DBorder\fR(\fIinterp, tkwin, colorName\fR) .sp -void -\fBTk_Get3DBorderColors(\fIborder, bgColorPtr, darkColorPtr, lightColorPtr\fB)\fR +\fBTk_Get3DBorderColors\fR(\fIborder, bgColorPtr, darkColorPtr, lightColorPtr\fR) .sp Tk_3DBorder -\fBTk_Get3DBorderFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_Get3DBorderFromObj\fR(\fItkwin, objPtr\fR) .sp -void -\fBTk_Draw3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR +\fBTk_Draw3DRectangle\fR(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fR) .sp -void -\fBTk_Fill3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR +\fBTk_Fill3DRectangle\fR(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fR) .sp -void -\fBTk_Draw3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR +\fBTk_Draw3DPolygon\fR(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fR) .sp -void -\fBTk_Fill3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR +\fBTk_Fill3DPolygon\fR(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fR) .sp -void -\fBTk_3DVerticalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftBevel, relief\fB)\fR +\fBTk_3DVerticalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftBevel, relief\fR) .sp -void -\fBTk_3DHorizontalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftIn, rightIn, topBevel, relief\fB)\fR +\fBTk_3DHorizontalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftIn, rightIn, topBevel, relief\fR) .sp -void -\fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR +\fBTk_SetBackgroundFromBorder\fR(\fItkwin, border\fR) .sp const char * -\fBTk_NameOf3DBorder(\fIborder\fB)\fR +\fBTk_NameOf3DBorder\fR(\fIborder\fR) .sp XColor * -\fBTk_3DBorderColor(\fIborder\fB)\fR +\fBTk_3DBorderColor\fR(\fIborder\fR) .sp GC * -\fBTk_3DBorderGC(\fItkwin, border, which\fB)\fR +\fBTk_3DBorderGC\fR(\fItkwin, border, which\fR) .sp -\fBTk_Free3DBorderFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_Free3DBorderFromObj\fR(\fItkwin, objPtr\fR) .sp -\fBTk_Free3DBorder(\fIborder\fB)\fR +\fBTk_Free3DBorder\fR(\fIborder\fR) +.fi .SH ARGUMENTS .AS "Tk_3DBorder" borderWidth .AP Tcl_Interp *interp in @@ -100,7 +91,8 @@ Width of border in pixels. Positive means border is inside rectangle given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means border is outside rectangle. .AP int highlightWidth in -Width of ring around the outside of the widget if the widget has received the input focus. +Width of ring around the outside of the widget if the widget has received the +input focus. .AP int relief in Indicates 3-D position of interior of value relative to exterior; should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR, @@ -147,9 +139,11 @@ Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR. .AP XColor *bgColorPtr out Pointer to location in which to store the background color of the given border. .AP XColor *darkColorPtr out -Pointer to location in which to store the color for darker areas of the given border. +Pointer to location in which to store the color for darker areas of the +given border. .AP XColor *lightColorPtr out -Pointer to location in which to store the color for lighter areas of the given border. +Pointer to location in which to store the color for lighter areas of the +given border. .AP GC fgGC in Foreground X graphics context. .AP GC fgGC in @@ -180,12 +174,15 @@ information about the return value in \fIobjPtr\fR, which speeds up future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR and \fItkwin\fR. .PP -\fBTk_ClipDrawableToRect\fR will clip all drawing into the drawable d to the given rectangle. If width or height are negative, reset to no clipping. -Subsequent drawing into d is offset and clipped as specified. -The function is only used when \fBTK_NO_DOUBLE_BUFFERING\fR is specified at compile time. +\fBTk_ClipDrawableToRect\fR will clip all drawing into the drawable \fId\fR +to the given rectangle. If \fIwidth\fR or \fIheight\fR are negative, reset +to no clipping. +Subsequent drawing into \fId\fR is offset and clipped as specified. +The function is only used when \fBTK_NO_DOUBLE_BUFFERING\fR is specified at +compile time. .PP -\fBTk_DrawHighlightBorder\fR draws a rectangular ring around the outside of a widget -to indicate that it has received the input focus. +\fBTk_DrawHighlightBorder\fR draws a rectangular ring around the outside of +a widget to indicate that it has received the input focus. On the Macintosh, this puts a 1 pixel border in the bgGC color between the widget and the focus ring, except in the case where highlightWidth is 1, in which case the border is left out. @@ -226,8 +223,8 @@ which of several three-dimensional effects is desired: \fBTK_RELIEF_RAISED\fR means that the interior of the rectangle should appear raised relative to the exterior of the rectangle, and \fBTK_RELIEF_SUNKEN\fR means that the interior should appear depressed. -\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should appear to be -a groove or ridge around the exterior of the rectangle. +\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should +appear to be a groove or ridge around the exterior of the rectangle. .PP \fBTk_Fill3DRectangle\fR is somewhat like \fBTk_Draw3DRectangle\fR except that it first fills the rectangular area with the background color @@ -325,4 +322,5 @@ There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or \fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR or \fBTk_Get3DBorder\fR. .SH KEYWORDS -3D, background, border, color, depressed, illumination, value, polygon, raised, shadow, three-dimensional effect +3D, background, border, color, depressed, illumination, value, polygon, +raised, shadow, three-dimensional effect diff --git a/doc/AddOption.3 b/doc/AddOption.3 index fc46492..9d20a55 100644 --- a/doc/AddOption.3 +++ b/doc/AddOption.3 @@ -16,6 +16,7 @@ void .sp Tcl_Obj * \fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR) +.fi .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. diff --git a/doc/BindTable.3 b/doc/BindTable.3 index af2c8c5..960801d 100644 --- a/doc/BindTable.3 +++ b/doc/BindTable.3 @@ -15,24 +15,25 @@ Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding \fB#include \fR .sp Tk_BindingTable -\fBTk_CreateBindingTable(\fIinterp\fB)\fR +\fBTk_CreateBindingTable\fR(\fIinterp\fR) .sp -\fBTk_DeleteBindingTable(\fIbindingTable\fB)\fR +\fBTk_DeleteBindingTable\fR(\fIbindingTable\fR) .sp unsigned long -\fBTk_CreateBinding(\fIinterp, bindingTable, object, eventString, script, append\fB)\fR +\fBTk_CreateBinding\fR(\fIinterp, bindingTable, object, eventString, script, append\fR) .sp int -\fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR +\fBTk_DeleteBinding\fR(\fIinterp, bindingTable, object, eventString\fR) .sp const char * -\fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR +\fBTk_GetBinding\fR(\fIinterp, bindingTable, object, eventString\fR) .sp -\fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR +\fBTk_GetAllBindings\fR(\fIinterp, bindingTable, object\fR) .sp -\fBTk_DeleteAllBindings(\fIbindingTable, object\fB)\fR +\fBTk_DeleteAllBindings\fR(\fIbindingTable, object\fR) .sp -\fBTk_BindEvent(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fB)\fR +\fBTk_BindEvent\fR(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fR) +.fi .SH ARGUMENTS .AS Tk_BindingTable bindingTable .AP Tcl_Interp *interp in diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3 index 3678085..5b613fb 100644 --- a/doc/CanvPsY.3 +++ b/doc/CanvPsY.3 @@ -29,6 +29,7 @@ int .sp int \fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) +.fi .SH ARGUMENTS .AS Tcl_Size "numPoints" .AP Tk_Canvas canvas in diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3 index 5cb29fa..0862d82 100644 --- a/doc/CanvTkwin.3 +++ b/doc/CanvTkwin.3 @@ -30,6 +30,7 @@ int Tk_OptionParseProc *\fBTk_CanvasTagsParseProc\fR; .sp Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR; +.fi .SH ARGUMENTS .AS Tk_ItemType *drawableXPtr .AP Tk_Canvas canvas in @@ -149,7 +150,7 @@ static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc, static const Tk_ConfigSpec configSpecs[] = { ... - {TK_CONFIG_CUSTOM, "\-tags", NULL, NULL, + {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, ... }; diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3 index 1dd2354..9bc280b 100644 --- a/doc/CanvTxtInfo.3 +++ b/doc/CanvTxtInfo.3 @@ -15,6 +15,7 @@ Tk_CanvasTextInfo \- additional information for managing text items in canvases .sp Tk_CanvasTextInfo * \fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR) +.fi .SH ARGUMENTS .AS Tk_Canvas canvas .AP Tk_Canvas canvas in @@ -31,7 +32,7 @@ a structure that is shared between Tk and all the items that display text. The structure has the following form: .CS -typedef struct Tk_CanvasTextInfo { +typedef struct { Tk_3DBorder \fIselBorder\fR; int \fIselBorderWidth\fR; XColor *\fIselFgColorPtr\fR; diff --git a/doc/Clipboard.3 b/doc/Clipboard.3 index cc09018..a4fcb6b 100644 --- a/doc/Clipboard.3 +++ b/doc/Clipboard.3 @@ -19,6 +19,7 @@ int .sp int \fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) +.fi .SH ARGUMENTS .AS Tk_ClipboardClear tkwin .AP Tcl_Interp *interp in diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3 index 1b942b5..27dcd45 100644 --- a/doc/ClrSelect.3 +++ b/doc/ClrSelect.3 @@ -15,6 +15,7 @@ Tk_ClearSelection \- Deselect a selection \fB#include \fR .sp \fBTk_ClearSelection\fR(\fItkwin, selection\fR) +.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index 09e4df0..61c49e8 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -15,15 +15,16 @@ Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- proce \fB#include \fR .sp int -\fBTk_ConfigureWidget(\fIinterp, tkwin, specs, objc, objv, widgRec, flags\fB)\fR +\fBTk_ConfigureWidget\fR(\fIinterp, tkwin, specs, objc, objv, widgRec, flags\fR) .sp int -\fBTk_ConfigureInfo(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR +\fBTk_ConfigureInfo\fR(\fIinterp, tkwin, specs, widgRec, argvName, flags\fR) .sp int -\fBTk_ConfigureValue(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR +\fBTk_ConfigureValue\fR(\fIinterp, tkwin, specs, widgRec, argvName, flags\fR) .sp -\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR +\fBTk_FreeOptions\fR(\fIspecs, widgRec, display, flags\fR) +.fi .SH ARGUMENTS .AS void *widgRec in/out .AP Tcl_Interp *interp in @@ -62,8 +63,8 @@ order to free up resources. .BE .SH DESCRIPTION .PP -Note: \fBTk_ConfigureWidget\fR should be replaced with the new -\fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is +Note that \fBTk_ConfigureWidget\fR should be replaced with the new +\fBTcl_Obj\fR based API, \fBTk_SetOptions\fR. The old interface is retained for backward compatibility. .PP \fBTk_ConfigureWidget\fR is called to configure various aspects of a @@ -171,6 +172,7 @@ to do with the string value of that configuration option. The legal values for \fItype\fR, and the corresponding actions, are: .TP \fBTK_CONFIG_ACTIVE_CURSOR\fR +. The value must be an ASCII string identifying a cursor in a form suitable for passing to \fBTk_GetCursor\fR. @@ -185,12 +187,14 @@ If the previous value of the target was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeCursor\fR. .TP \fBTK_CONFIG_ANCHOR\fR +. The value must be an ASCII string identifying an anchor point in one of the ways accepted by \fBTk_GetAnchor\fR. The string is converted to a \fBTk_Anchor\fR by calling \fBTk_GetAnchor\fR and the result is stored in the target. .TP \fBTK_CONFIG_BITMAP\fR +. The value must be an ASCII string identifying a bitmap in a form suitable for passing to \fBTk_GetBitmap\fR. The value is converted to a \fBPixmap\fR by calling \fBTk_GetBitmap\fR and the result @@ -201,6 +205,7 @@ If the previous value of the target was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR. .TP \fBTK_CONFIG_BOOLEAN\fR +. The value must be an ASCII string specifying a boolean value. Any of the values .QW true , @@ -220,6 +225,7 @@ The target is expected to be an integer; for true values it will be set to 1 and for false values it will be set to 0. .TP \fBTK_CONFIG_BORDER\fR +. The value must be an ASCII string identifying a border color in a form suitable for passing to \fBTk_Get3DBorder\fR. The value is converted to a (\fBTk_3DBorder *\fR) by calling \fBTk_Get3DBorder\fR and the result @@ -230,6 +236,7 @@ If the previous value of the target was not NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR. .TP \fBTK_CONFIG_CAP_STYLE\fR +. The value must be an ASCII string identifying a cap style in one of the ways accepted by \fBTk_GetCapStyle\fR. @@ -238,6 +245,7 @@ to the cap style by calling \fBTk_GetCapStyle\fR and the result is stored in the target. .TP \fBTK_CONFIG_COLOR\fR +. The value must be an ASCII string identifying a color in a form suitable for passing to \fBTk_GetColor\fR. The value is converted to an (\fBXColor *\fR) by calling \fBTk_GetColor\fR and the result @@ -248,27 +256,32 @@ If the previous value of the target was not NULL, then it is freed by passing it to \fBTk_FreeColor\fR. .TP \fBTK_CONFIG_CURSOR\fR +. This option is identical to \fBTK_CONFIG_ACTIVE_CURSOR\fR except that the new cursor is not made the active one for \fItkwin\fR. .TP \fBTK_CONFIG_CUSTOM\fR +. This option allows applications to define new option types. The \fIcustomPtr\fR field of the entry points to a structure defining the new option type. See the section \fBCUSTOM OPTION TYPES\fR below for details. .TP \fBTK_CONFIG_DOUBLE\fR +. The value must be an ASCII floating-point number in the format accepted by \fBstrtol\fR. The string is converted to a \fBdouble\fR value, and the value is stored in the target. .TP \fBTK_CONFIG_END\fR +. Marks the end of the table. The last entry in \fIspecs\fR must have this type; all of its other fields are ignored and it will never match any arguments. .TP \fBTK_CONFIG_FONT\fR +. The value must be an ASCII string identifying a font in a form suitable for passing to \fBTk_GetFont\fR. The value is converted to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result @@ -279,6 +292,7 @@ If the previous value of the target was not NULL, then it is freed by passing it to \fBTk_FreeFont\fR. .TP \fBTK_CONFIG_INT\fR +. The value must be an ASCII integer string in the format accepted by \fBstrtol\fR (e.g. .QW 0 @@ -289,6 +303,7 @@ numbers, respectively). The string is converted to an integer value and the integer is stored in the target. .TP \fBTK_CONFIG_JOIN_STYLE\fR +. The value must be an ASCII string identifying a join style in one of the ways accepted by \fBTk_GetJoinStyle\fR. @@ -297,6 +312,7 @@ to the join style by calling \fBTk_GetJoinStyle\fR and the result is stored in the target. .TP \fBTK_CONFIG_JUSTIFY\fR +. The value must be an ASCII string identifying a justification method in one of the ways accepted by \fBTk_GetJustify\fR. @@ -304,26 +320,29 @@ The string is converted to a \fBTk_Justify\fR by calling \fBTk_GetJustify\fR and the result is stored in the target. .TP \fBTK_CONFIG_MM\fR +. The value must specify a screen distance in one of the forms acceptable to \fBTk_GetScreenMM\fR. The string is converted to double-precision floating-point distance in millimeters and the value is stored in the target. .TP \fBTK_CONFIG_PIXELS\fR +. The value must specify screen units in one of the forms acceptable to \fBTk_GetPixels\fR. The string is converted to an integer distance in pixels and the value is stored in the target. .TP \fBTK_CONFIG_RELIEF\fR +. The value must be an ASCII string identifying a relief in a form suitable for passing to \fBTk_GetRelief\fR. The value is converted to an integer relief value by calling \fBTk_GetRelief\fR and the result is stored in the target. .TP \fBTK_CONFIG_STRING\fR -A copy -of the value is made by allocating memory space with +. +A copy of the value is made by allocating memory space with \fBTcl_Alloc\fR and copying the value into the dynamically-allocated space. A pointer to the new string is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value @@ -332,6 +351,7 @@ If the previous value of the target was not NULL, then it is 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 \fIobjv\fR value matches the \fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used @@ -346,6 +366,7 @@ and .QW \-bg . .TP \fBTK_CONFIG_UID\fR +. The value is translated to a \fBTk_Uid\fR (by passing it to \fBTk_GetUid\fR). The resulting value is stored in the target. @@ -353,6 +374,7 @@ If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR and the value is an empty string then the target will be set to NULL. .TP \fBTK_CONFIG_WINDOW\fR +. The value must be a window path name. It is translated to a \fBTk_Window\fR token and the token is stored in the target. .SH "GROUPED ENTRIES" @@ -381,7 +403,8 @@ options. These values are used in three different ways as described below. .PP 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), +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 \fIobjv\fR then nothing happens: @@ -395,16 +418,19 @@ to control the processing of that entry. Each \fIspecFlags\fR field may consists of an OR-ed combination of the following values: .TP \fBTK_CONFIG_COLOR_ONLY\fR +. If this bit is set then the entry will only be considered if the display for \fItkwin\fR has more than one bit plane. If the display is monochromatic then this \fIspecs\fR entry will be ignored. .TP \fBTK_CONFIG_MONO_ONLY\fR +. If this bit is set then the entry will only be considered if the display for \fItkwin\fR has exactly one bit plane. If the display is not monochromatic then this \fIspecs\fR entry will be ignored. .TP \fBTK_CONFIG_NULL_OK\fR +. This bit is only relevant for some types of entries (see the descriptions of the various entry types above). If this bit is set, it indicates that an empty string value @@ -418,6 +444,7 @@ If this bit is not set then empty strings are processed as strings, which generally results in an error. .TP \fBTK_CONFIG_DONT_SET_DEFAULT\fR +. If this bit is one, it means that the \fIdefValue\fR field of the entry should only be used for returning the default value in \fBTk_ConfigureInfo\fR. @@ -428,7 +455,7 @@ This flag provides a performance optimization where it is expensive to process the default string: the client can compute the default once, save the value, and provide it before calling \fBTk_ConfigureWidget\fR. -.TP +.PP The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically used to specify different default values for monochrome and color displays. This is done by creating two @@ -525,7 +552,7 @@ Applications can extend the built-in configuration types with additional configuration types by writing procedures to parse and print options of the a type and creating a structure pointing to those procedures: .CS -typedef struct Tk_CustomOption { +typedef struct { Tk_OptionParseProc *\fIparseProc\fR; Tk_OptionPrintProc *\fIprintProc\fR; void *\fIclientData\fR; diff --git a/doc/ConfigWind.3 b/doc/ConfigWind.3 index 3e83387..c5e035a 100644 --- a/doc/ConfigWind.3 +++ b/doc/ConfigWind.3 @@ -39,6 +39,7 @@ Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetW \fBTk_DefineCursor\fR(\fItkwin, cursor\fR) .sp \fBTk_UndefineCursor\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS XSetWindowAttributes borderWidth .AP Tk_Window tkwin in diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3 index 1ebd681..be2663d 100644 --- a/doc/CoordToWin.3 +++ b/doc/CoordToWin.3 @@ -16,6 +16,7 @@ Tk_CoordsToWindow \- Find window containing a point .sp Tk_Window \fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) +.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP int rootX in diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3 index 1ba6f63..a19206c 100644 --- a/doc/CrtCmHdlr.3 +++ b/doc/CrtCmHdlr.3 @@ -16,6 +16,7 @@ Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate proced \fBTk_CreateClientMessageHandler\fR(\fIproc\fR) .sp \fBTk_DeleteClientMessageHandler\fR(\fIproc\fR) +.fi .SH ARGUMENTS .AP Tk_ClientMessageProc *proc in Procedure to invoke whenever a ClientMessage X event occurs on any display. diff --git a/doc/CrtConsoleChan.3 b/doc/CrtConsoleChan.3 index d8e0740..cae5242 100644 --- a/doc/CrtConsoleChan.3 +++ b/doc/CrtConsoleChan.3 @@ -14,6 +14,7 @@ Tk_InitConsoleChannels \- Install the console channels as standard channels \fB#include \fR .sp \fBTk_InitConsoleChannels\fR(\fIinterp\fR) +.fi .SH ARGUMENTS .AS Tcl_Interp *interp in .AP Tcl_Interp *interp in diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3 index 09dcf8b..6e874b7 100644 --- a/doc/CrtErrHdlr.3 +++ b/doc/CrtErrHdlr.3 @@ -18,6 +18,7 @@ Tk_ErrorHandler \fBTk_CreateErrorHandler\fR(\fIdisplay, error, request, minor, proc, clientData\fR) .sp \fBTk_DeleteErrorHandler\fR(\fIhandler\fR) +.fi .SH ARGUMENTS .AS "Tk_ErrorHandler" clientData .AP Display *display in diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3 index aaf3285..b203e19 100644 --- a/doc/CrtGenHdlr.3 +++ b/doc/CrtGenHdlr.3 @@ -17,6 +17,7 @@ Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback \fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) .sp \fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) +.fi .SH ARGUMENTS .AS "Tk_GenericProc" clientData .AP Tk_GenericProc *proc in diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index f59a78e..ddfbc54 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -18,6 +18,7 @@ Tk_CreateImageType, Tk_GetImageModelData \- define new kind of image .sp void * \fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR) +.fi .SH ARGUMENTS .AS "const Tk_ImageType" *typePtrPtr .AP "const Tk_ImageType" *typePtr in @@ -54,7 +55,7 @@ The first data structure is a Tk_ImageType structure, which contains the name of the image type and pointers to five procedures provided by the image manager to deal with images of this type: .CS -typedef struct Tk_ImageType { +typedef struct { const char *\fIname\fR; Tk_ImageCreateProc *\fIcreateProc\fR; Tk_ImageGetProc *\fIgetProc\fR; diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index 85320d6..3fb2d9f 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -17,10 +17,12 @@ Tk_CreateItemType, Tk_GetItemTypes \- define new kind of canvas item .sp Tk_ItemType * \fBTk_GetItemTypes\fR() +.fi .SH ARGUMENTS .AS Tk_ItemType *typePtr .AP Tk_ItemType *typePtr in Structure that defines the new type of canvas item. +Note that this is not \fIconst\fR; Tk may write to these structures. .BE .SH INTRODUCTION .PP @@ -82,7 +84,7 @@ typedef struct Tk_ItemType { Tk_ItemSelectionProc *\fIselectionProc\fR; Tk_ItemInsertProc *\fIinsertProc\fR; Tk_ItemDCharsProc *\fIdCharsProc\fR; - Tk_ItemType *\fInextPtr\fR; + struct Tk_ItemType *\fInextPtr\fR; .VS "8.7, TIP164" Tk_ItemRotateProc *\fIrotateProc\fR; .VE "8.7, TIP164" @@ -113,7 +115,7 @@ the first field. For example, the item record for bitmap items is defined as follows: .PP .CS -typedef struct BitmapItem { +typedef struct { Tk_Item \fIheader\fR; double \fIx\fR, \fIy\fR; Tk_Anchor \fIanchor\fR; @@ -250,7 +252,8 @@ to retrieve option information in the \fBitemcget\fR and \fBitemconfigure\fR widget commands. \fItypePtr\->configSpecs\fR must point to the configuration table for this type. -Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR +.PP +Note that Tk provides a custom option type \fBtk_CanvasTagsOption\fR for implementing the \fB\-tags\fR option; see an existing type manager for an example of how to use it in \fIconfigSpecs\fR. .SS CONFIGPROC @@ -560,8 +563,8 @@ they used to have coordinates \fIx\fR and \fIy\fR, they will have new coordinates \fIx\(fm\fR and \fIy\(fm\fR, where .PP .CS -\fIrelX\fR = \fIx\fR - \fIoriginX\fR -\fIrelY\fR = \fIy\fR - \fIoriginY\fR +\fIrelX\fR = \fIx\fR \(mi \fIoriginX\fR +\fIrelY\fR = \fIy\fR \(mi \fIoriginY\fR \fIx\(fm\fR = \fIoriginX\fR + \fIrelX\fR \(mu cos(\fIangleRad\fR) + \fIrelY\fR \(mu sin(\fIangleRad\fR) \fIy\(fm\fR = \fIoriginY\fR \(mi \fIrelX\fR \(mu sin(\fIangleRad\fR) + \fIrelY\fR \(mu cos(\fIangleRad\fR) .CE diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3 index 03a4046..0ba68fa 100644 --- a/doc/CrtPhImgFmt.3 +++ b/doc/CrtPhImgFmt.3 @@ -58,7 +58,7 @@ by the handler to deal with files and strings in this format. The Tk_PhotoImageFormatVersion3 structure contains the following fields: .VS 8.7 .CS -typedef struct Tk_PhotoImageFormatVersion3 { +typedef struct { const char *\fIname\fR; Tk_ImageFileMatchProcVersion3 *\fIfileMatchProc\fR; Tk_ImageStringMatchProcVersion3 *\fIstringMatchProc\fR; @@ -151,7 +151,7 @@ return 0. Tk to call to read data from an image file into a photo image. \fIformatPtr->fileReadProc\fR must match the following prototype: .CS -typedef int \fBTk_ImageFileReadProc\fR( +typedef int \fBTk_ImageFileReadProcVersion3\fR( Tcl_Interp *\fIinterp\fR, Tcl_Channel \fIchan\fR, const char *\fIfileName\fR, @@ -184,7 +184,7 @@ The return value is a standard Tcl return value. for Tk to call to read data from a string into a photo image. \fIformatPtr->stringReadProc\fR must match the following prototype: .CS -typedef int \fBTk_ImageStringReadProc\fR( +typedef int \fBTk_ImageStringReadProcVersion3\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIdata\fR, Tcl_Obj *\fIformat\fR, @@ -216,7 +216,7 @@ The return value is a standard Tcl return value. Tk to call to write data from a photo image to a file. \fIformatPtr->fileWriteProc\fR must match the following prototype: .CS -typedef int \fBTk_ImageFileWriteProc\fR( +typedef int \fBTk_ImageFileWriteProcVersion3\fR( Tcl_Interp *\fIinterp\fR, const char *\fIfileName\fR, Tcl_Obj *\fIformat\fR, @@ -245,7 +245,7 @@ for Tk to call to translate image data from a photo image into a string. \fIformatPtr->stringWriteProc\fR must match the following prototype: .CS -typedef int \fBTk_ImageStringWriteProc\fR( +typedef int \fBTk_ImageStringWriteProcVersion3\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, @@ -276,7 +276,6 @@ level by including dictionary keys into the metadata property of the image. Image metadata may be written to image data on file write or image data output. .PP -.PP .SS "METADATA KEYS" .PP The metadata may contain any key. @@ -285,16 +284,13 @@ documentation. See the photo image manual page for currently defined keys for the system drivers. .PP The following rules may give guidance to name metadata keys: -.RS -Abreviation are in upper case -.RE -.RS +.IP \(bu +Abbreviations are in upper case. +.IP \(bu Words are in US English in small case (except proper nouns) -.RE -.RS +.IP \(bu Vertical DPI is expressed as DPI/aspect. The reason is, that some image formats may feature aspect and no resolution value. -.RE .SS "METADATA INPUT" .PP Each driver function gets a Tcl object pointer \fBmetadataIn\fR as @@ -306,17 +302,20 @@ A typical driver code snipped to check for a metadata key is: .CS if (NULL != metadataIn) { Tcl_Obj *itemData; - Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1), &itemData)); + Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1), + &itemData)); + // use value reference in itemData +} .CE .PP -The \-metadata command option data of the following commands is passed +The \fB\-metadata\fR command option data of the following commands is passed to the driver: \fBimage create\fR, \fBconfigure\fR, \fBput\fR, \fBread\fR, \fBdata\fR and \fBwrite\fR. -If no \-metadata command option available or not given, the metadata +If no \fB\-metadata\fR command option available or not given, the metadata property of the image is passed to the driver using the following commands: \fBcget\fR, \fBconfigure\fR, \fBdata\fR and \fBwrite\fR. .PP -Note that setting the \-metadata property of an image using +Note that setting the \fB\-metadata\fR property of an image using \fBconfigure\fR without any other option does not invoke any driver function. .PP @@ -328,12 +327,12 @@ this purpose. .SS "METADATA OUTPUT" .PP The image match and read driver functions may set keys in a prepared -matadata dict to return them. -Those functions get a Tcl object pointer \fBmetadataOut\fR as +metadata dict to return them. +Those functions get a Tcl object pointer \fImetadataOut\fR as parameter. -metadataOut may be NULL to indicate, that no metadata return is -attended(\fBput\fR, \fBread\fR subcommands). -\fBmetadataOut\fR is initialized to an empty unshared dict object if +\fImetadataOut\fR may be NULL to indicate, that no metadata return is +required (\fBput\fR, \fBread\fR subcommands). The variable pointed to +by \fImetadataOut\fR is initialized to an empty unshared dict object if metadata return is attended (\fBimage create\fR command, \fBconfigure\fR subcommand). The driver may set dict keys in this object to return metadata. @@ -343,7 +342,9 @@ corresponding read function. A sample driver code snippet is: .CS if (NULL != metadataOut) { - Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1), Tcl_NewStringObj(xmpMetadata); + Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1), + Tcl_NewStringObj(xmpMetadata)); +} .CE .PP The metadata keys returned by the driver are merged into the present @@ -366,6 +367,7 @@ use the metadata dict for input or output. \fB#include \fR .sp \fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR) +.fi .SS ARGUMENTS .AS "const Tk_PhotoImageFormat" *formatPtr .AP "const Tk_PhotoImageFormat" *formatPtr in @@ -376,7 +378,7 @@ A driver using the version 2 interface invokes \fBTk_CreatePhotoImageFormat\fR for driver registration. The Tk_PhotoImageFormat structure contains the following fields: .CS -typedef struct Tk_PhotoImageFormat { +typedef struct { const char *\fIname\fR; Tk_ImageFileMatchProc *\fIfileMatchProc\fR; Tk_ImageStringMatchProc *\fIstringMatchProc\fR; diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3 index d6d27bb..1984c82 100644 --- a/doc/CrtSelHdlr.3 +++ b/doc/CrtSelHdlr.3 @@ -17,6 +17,7 @@ Tk_CreateSelHandler, Tk_DeleteSelHandler \- arrange to handle requests for a sel \fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR) .sp \fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR) +.fi .SH ARGUMENTS .AS Tk_SelectionProc clientData .AP Tk_Window tkwin in diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3 index b254460..e6b4437 100644 --- a/doc/CrtWindow.3 +++ b/doc/CrtWindow.3 @@ -26,6 +26,7 @@ Tk_Window \fBTk_DestroyWindow\fR(\fItkwin\fR) .sp \fBTk_MakeWindowExist\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS Tcl_Interp *topLevScreen .AP Tcl_Interp *interp out diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3 index eb6db1e..43944b7 100644 --- a/doc/DeleteImg.3 +++ b/doc/DeleteImg.3 @@ -14,6 +14,7 @@ Tk_DeleteImage \- Destroy an image. \fB#include \fR .sp \fBTk_DeleteImage\fR(\fIinterp, name\fR) +.fi .SH ARGUMENTS .AS Tcl_Interp *interp .AP Tcl_Interp *interp in diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3 index 59cd069..1e343e3 100644 --- a/doc/DrawFocHlt.3 +++ b/doc/DrawFocHlt.3 @@ -13,7 +13,8 @@ Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget .nf \fB#include \fR .sp -\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR +\fBTk_DrawFocusHighlight\fR(\fItkwin, gc, width, drawable\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tk_Window tkwin in diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3 index 128f8ee..4e3c9d9 100644 --- a/doc/EventHndlr.3 +++ b/doc/EventHndlr.3 @@ -21,6 +21,7 @@ Tk_CreateEventHandler, Tk_DeleteEventHandler, Tk_GetButtonMask, Tk_SendVirtualEv \fBTk_GetButtonMask\fR(\fIbutton\fR) .sp \fBTk_SendVirtualEvent\fR(\fItkwin, eventName, detail\fR) +.fi .SH ARGUMENTS .AS "unsigned long" clientData .AP unsigned button in diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3 index dc218bf..57d0b77 100644 --- a/doc/FindPhoto.3 +++ b/doc/FindPhoto.3 @@ -32,17 +32,16 @@ zoomX, zoomY, subsampleX, subsampleY, compRule\fR) int \fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR) .sp -void \fBTk_PhotoBlank\fR(\fIhandle\fR) .sp int \fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR) .sp -void \fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR) .sp int \fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR) +.fi .SH ARGUMENTS .AS Tk_PhotoImageBlock window_path .AP Tcl_Interp *interp in diff --git a/doc/FontId.3 b/doc/FontId.3 index 9d35ae6..fa1427c 100644 --- a/doc/FontId.3 +++ b/doc/FontId.3 @@ -15,12 +15,13 @@ fonts \fB#include \fR .sp Font -\fBTk_FontId(\fItkfont\fB)\fR +\fBTk_FontId\fR(\fItkfont\fR) .sp -\fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR +\fBTk_GetFontMetrics\fR(\fItkfont, fmPtr\fR) .sp int -\fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR +\fBTk_PostscriptFontName\fR(\fItkfont, dsPtr\fR) +.fi .SH ARGUMENTS .AS Tk_FontMetrics *dsPtr .AP Tk_Font tkfont in @@ -69,7 +70,7 @@ Postscript font name may be incorrect or not exist on the printer. The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to return information about a font and is defined as follows: .CS -typedef struct Tk_FontMetrics { +typedef struct { int \fIascent\fR; int \fIdescent\fR; int \fIlinespace\fR; diff --git a/doc/GeomReq.3 b/doc/GeomReq.3 index 7670521..e6f2eed 100644 --- a/doc/GeomReq.3 +++ b/doc/GeomReq.3 @@ -21,6 +21,7 @@ Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetIntern \fBTk_SetInternalBorder\fR(\fItkwin, width\fR) .sp \fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) +.fi .SH ARGUMENTS .AS baseHeight clientData .AP Tk_Window tkwin in @@ -36,13 +37,17 @@ Desired minimum requested height for \fItkwin\fR, in pixel units. .AP int width in Space to leave for internal border for \fItkwin\fR, in pixel units. .AP int left in -Space to leave for left side of internal border for \fItkwin\fR, in pixel units. +Space to leave for left side of internal border for \fItkwin\fR, +in pixel units. .AP int right in -Space to leave for right side of internal border for \fItkwin\fR, in pixel units. +Space to leave for right side of internal border for \fItkwin\fR, +in pixel units. .AP int top in -Space to leave for top side of internal border for \fItkwin\fR, in pixel units. +Space to leave for top side of internal border for \fItkwin\fR, +in pixel units. .AP int bottom in -Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. +Space to leave for bottom side of internal border for \fItkwin\fR, +in pixel units. .BE .SH DESCRIPTION .PP diff --git a/doc/GetAnchor.3 b/doc/GetAnchor.3 index 5d41ad6..658911a 100644 --- a/doc/GetAnchor.3 +++ b/doc/GetAnchor.3 @@ -15,13 +15,14 @@ Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings \fB#include \fR .sp int -\fBTk_GetAnchorFromObj(\fIinterp, objPtr, anchorPtr\fB)\fR +\fBTk_GetAnchorFromObj\fR(\fIinterp, objPtr, anchorPtr\fR) .sp int -\fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR +\fBTk_GetAnchor\fR(\fIinterp, string, anchorPtr\fR) .sp const char * -\fBTk_NameOfAnchor(\fIanchor\fB)\fR +\fBTk_NameOfAnchor\fR(\fIanchor\fR) +.fi .SH ARGUMENTS .AS "Tk_Anchor" *anchorPtr .AP Tcl_Interp *interp in diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3 index 88418c7..f470638 100644 --- a/doc/GetBitmap.3 +++ b/doc/GetBitmap.3 @@ -15,25 +15,26 @@ Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_Na \fB#include \fR .sp Pixmap -\fBTk_AllocBitmapFromObj(\fIinterp, tkwin, objPtr\fB)\fR +\fBTk_AllocBitmapFromObj\fR(\fIinterp, tkwin, objPtr\fR) .sp Pixmap -\fBTk_GetBitmap(\fIinterp, tkwin, info\fB)\fR +\fBTk_GetBitmap\fR(\fIinterp, tkwin, info\fR) .sp Pixmap -\fBTk_GetBitmapFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_GetBitmapFromObj\fR(\fItkwin, objPtr\fR) .sp int -\fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR +\fBTk_DefineBitmap\fR(\fIinterp, name, source, width, height\fR) .sp const char * -\fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR +\fBTk_NameOfBitmap\fR(\fIdisplay, bitmap\fR) .sp -\fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR +\fBTk_SizeOfBitmap\fR(\fIdisplay, bitmap, widthPtr, heightPtr\fR) .sp -\fBTk_FreeBitmapFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_FreeBitmapFromObj\fR(\fItkwin, objPtr\fR) .sp -\fBTk_FreeBitmap(\fIdisplay, bitmap\fB)\fR +\fBTk_FreeBitmap\fR(\fIdisplay, bitmap\fR) +.fi .SH ARGUMENTS .AS "unsigned long" *pixelPtr .AP Tcl_Interp *interp in @@ -80,98 +81,74 @@ creates a new one otherwise. \fIObjPtr\fR's value must have one of the following forms: .TP 20 \fB@\fIfileName\fR +. \fIFileName\fR must be the name of a file containing a bitmap description in the standard X11 format. .TP 20 \fIname\fR +. \fIName\fR must be the name of a bitmap defined previously with a call to \fBTk_DefineBitmap\fR. The following names are pre-defined by Tk: .RS -.TP 12 -\fBerror\fR +.IP \fBerror\fR 12 The international .QW don't symbol: a circle with a diagonal line across it. -.TP 12 -\fBgray75\fR +.IP \fBgray75\fR 12 75% gray: a checkerboard pattern where three out of four bits are on. -.TP 12 -\fBgray50\fR +.IP \fBgray50\fR 12 50% gray: a checkerboard pattern where every other bit is on. -.TP 12 -\fBgray25\fR +.IP \fBgray25\fR 12 25% gray: a checkerboard pattern where one out of every four bits is on. -.TP 12 -\fBgray12\fR +.IP \fBgray12\fR 12 12.5% gray: a pattern where one-eighth of the bits are on, consisting of every fourth pixel in every other row. -.TP 12 -\fBhourglass\fR +.IP \fBhourglass\fR 12 An hourglass symbol. -.TP 12 -\fBinfo\fR +.IP \fBinfo\fR 12 A large letter .QW i . -.TP 12 -\fBquesthead\fR +.IP \fBquesthead\fR 12 The silhouette of a human head, with a question mark in it. -.TP 12 -\fBquestion\fR +.IP \fBquestion\fR 12 A large question-mark. -.TP 12 -\fBwarning\fR +.IP \fBwarning\fR 12 A large exclamation point. .PP In addition, the following pre-defined names are available only on the \fBMacintosh\fR platform: -.TP 12 -\fBdocument\fR +.IP \fBdocument\fR 12 A generic document. -.TP 12 -\fBstationery\fR +.IP \fBstationery\fR 12 Document stationery. -.TP 12 -\fBedition\fR +.IP \fBedition\fR 12 The \fIedition\fR symbol. -.TP 12 -\fBapplication\fR +.IP \fBapplication\fR 12 Generic application icon. -.TP 12 -\fBaccessory\fR +.IP \fBaccessory\fR 12 A desk accessory. -.TP 12 -\fBfolder\fR +.IP \fBfolder\fR 12 Generic folder icon. -.TP 12 -\fBpfolder\fR +.IP \fBpfolder\fR 12 A locked folder. -.TP 12 -\fBtrash\fR +.IP \fBtrash\fR 12 A trash can. -.TP 12 -\fBfloppy\fR +.IP \fBfloppy\fR 12 A floppy disk. -.TP 12 -\fBramdisk\fR +.IP \fBramdisk\fR 12 A floppy disk with chip. -.TP 12 -\fBcdrom\fR +.IP \fBcdrom\fR 12 A cd disk icon. -.TP 12 -\fBpreferences\fR +.IP \fBpreferences\fR 12 A folder with prefs symbol. -.TP 12 -\fBquerydoc\fR +.IP \fBquerydoc\fR 12 A database document icon. -.TP 12 -\fBstop\fR +.IP \fBstop\fR 12 A stop sign. -.TP 12 -\fBnote\fR +.IP \fBnote\fR 12 A face with balloon words. -.TP 12 -\fBcaution\fR +.IP \fBcaution\fR 12 A triangle with an exclamation point. .RE .LP @@ -210,7 +187,7 @@ describe the bitmap. (e.g. a bitmap named \fInameId\fR has already been defined) then \fBTCL_ERROR\fR is returned and an error message is left in interpreter \fIinterp\fR's result. -Note: \fBTk_DefineBitmap\fR expects the memory pointed to by +Note that \fBTk_DefineBitmap\fR expects the memory pointed to by \fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make a private copy of this memory, but uses the bytes pointed to by \fIsource\fR later in calls to \fBTk_AllocBitmapFromObj\fR or diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3 index 4e5d1d5..bb087a1 100644 --- a/doc/GetCapStyl.3 +++ b/doc/GetCapStyl.3 @@ -15,10 +15,11 @@ Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles \fB#include \fR .sp int -\fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR +\fBTk_GetCapStyle\fR(\fIinterp, string, capPtr\fR) .sp const char * -\fBTk_NameOfCapStyle(\fIcap\fB)\fR +\fBTk_NameOfCapStyle\fR(\fIcap\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *capPtr .AP Tcl_Interp *interp in diff --git a/doc/GetClrmap.3 b/doc/GetClrmap.3 index 4b72b6c..2bfa4b9 100644 --- a/doc/GetClrmap.3 +++ b/doc/GetClrmap.3 @@ -15,11 +15,12 @@ Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colorm \fB#include \fR .sp Colormap -\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR +\fBTk_GetColormap\fR(\fIinterp, tkwin, string\fR) .sp -\fBTk_PreserveColormap(\fIdisplay, colormap\fB)\fR +\fBTk_PreserveColormap\fR(\fIdisplay, colormap\fR) .sp -\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR +\fBTk_FreeColormap\fR(\fIdisplay, colormap\fR) +.fi .SH ARGUMENTS .AS "Colormap" colormap .AP Tcl_Interp *interp in diff --git a/doc/GetColor.3 b/doc/GetColor.3 index 15254aa..bfb7ac0 100644 --- a/doc/GetColor.3 +++ b/doc/GetColor.3 @@ -15,26 +15,27 @@ Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_Na \fB#include \fR .sp XColor * -\fBTk_AllocColorFromObj(\fIinterp, tkwin, objPtr\fB)\fR +\fBTk_AllocColorFromObj\fR(\fIinterp, tkwin, objPtr\fR) .sp XColor * -\fBTk_GetColor(\fIinterp, tkwin, name\fB)\fR +\fBTk_GetColor\fR(\fIinterp, tkwin, name\fR) .sp XColor * -\fBTk_GetColorFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_GetColorFromObj\fR(\fItkwin, objPtr\fR) .sp XColor * -\fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR +\fBTk_GetColorByValue\fR(\fItkwin, prefPtr\fR) .sp const char * -\fBTk_NameOfColor(\fIcolorPtr\fB)\fR +\fBTk_NameOfColor\fR(\fIcolorPtr\fR) .sp GC -\fBTk_GCForColor(\fIcolorPtr, drawable\fB)\fR +\fBTk_GCForColor\fR(\fIcolorPtr, drawable\fR) .sp -\fBTk_FreeColorFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_FreeColorFromObj\fR(\fItkwin, objPtr\fR) .sp -\fBTk_FreeColor(\fIcolorPtr\fB)\fR +\fBTk_FreeColor\fR(\fIcolorPtr\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *colorPtr .AP Tcl_Interp *interp in @@ -71,6 +72,7 @@ in a particular window. The desired color is specified with a value whose string value must have one of the following forms: .TP 20 \fIcolorname\fR +. Any of the valid textual names for a color defined in the server's color database file, such as \fBred\fR or \fBPeachPuff\fR. .TP 20 @@ -81,6 +83,7 @@ server's color database file, such as \fBred\fR or \fBPeachPuff\fR. \fB#\fIRRRGGGBBB\fR .TP 20 \fB#\fIRRRRGGGGBBBB\fR +. A numeric specification of the red, green, and blue intensities to use to display the color. Each \fIR\fR, \fIG\fR, or \fIB\fR represents a single hexadecimal digit. The four forms permit diff --git a/doc/GetCursor.3 b/doc/GetCursor.3 index 403c05e..6f8e34f 100644 --- a/doc/GetCursor.3 +++ b/doc/GetCursor.3 @@ -15,23 +15,24 @@ Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData, \fB#include \fR .sp Tk_Cursor -\fBTk_AllocCursorFromObj(\fIinterp, tkwin, objPtr\fB)\fR +\fBTk_AllocCursorFromObj\fR(\fIinterp, tkwin, objPtr\fR) .sp Tk_Cursor -\fBTk_GetCursor(\fIinterp, tkwin, name\fB)\fR +\fBTk_GetCursor\fR(\fIinterp, tkwin, name\fR) .sp Tk_Cursor -\fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_GetCursorFromObj\fR(\fItkwin, objPtr\fR) .sp Tk_Cursor -\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR +\fBTk_GetCursorFromData\fR(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fR) .sp const char * -\fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR +\fBTk_NameOfCursor\fR(\fIdisplay, cursor\fR) .sp -\fBTk_FreeCursorFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_FreeCursorFromObj\fR(\fItkwin, objPtr\fR) .sp -\fBTk_FreeCursor(\fIdisplay, cursor\fB)\fR +\fBTk_FreeCursor\fR(\fIdisplay, cursor\fR) +.fi .SH ARGUMENTS .AS "unsigned long" *pixelPtr .AP Tcl_Interp *interp in @@ -87,6 +88,7 @@ if \fIinterp\fR is not NULL. \fIObjPtr\fR must contain a standard Tcl list with one of the following forms: .TP \fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]] +. \fIName\fR is the name of a cursor in the standard X cursor cursor, i.e., any of the names defined in \fBcursorcursor.h\fR, without the \fBXC_\fR. Some example values are \fBX_cursor\fR, \fBhand2\fR, @@ -115,6 +117,7 @@ in preference to black and white cursors. .RE .TP \fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR +. In this form, \fIsourceName\fR and \fImaskName\fR are the names of files describing cursors for the cursor's source bits and mask. Each file must be in standard X11 cursor format. @@ -124,12 +127,14 @@ cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This form of the command will not work on Macintosh or Windows computers. .TP \fB@\fIsourceName\0fgColor\fR +. This form is similar to the one above, except that the source is used as mask also. This means that the cursor's background is transparent. This form of the command will not work on Macintosh or Windows computers. .TP \fB@\fIsourceName\fR +. This form only works on Windows, and will load a Windows system cursor (\fB.ani\fR or \fB.cur\fR) from the file specified in \fIsourceName\fR. @@ -196,7 +201,7 @@ argument that was passed to \fBTk_GetCursor\fR to create the cursor. If \fIcursor\fR was created by a call to \fBTk_GetCursorFromData\fR, or by any other mechanism, then the return value is a hexadecimal string giving the X identifier for the cursor. -Note: the string returned by \fBTk_NameOfCursor\fR is +Note that the string returned by \fBTk_NameOfCursor\fR is only guaranteed to persist until the next call to \fBTk_NameOfCursor\fR. Also, this call is not portable except for cursors returned by \fBTk_GetCursor\fR. diff --git a/doc/GetFont.3 b/doc/GetFont.3 index 9497556..60e8232 100644 --- a/doc/GetFont.3 +++ b/doc/GetFont.3 @@ -15,25 +15,25 @@ Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FontGetDes \fB#include \fR .sp Tk_Font -\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR +\fBTk_AllocFontFromObj\fR(\fIinterp, tkwin, objPtr\fR) .sp Tk_Font -\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR +\fBTk_GetFont\fR(\fIinterp, tkwin, string\fR) .sp Tk_Font -\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_GetFontFromObj\fR(\fItkwin, objPtr\fR) .sp Tcl_Obj * -\fBTk_FontGetDescription(\fItkfont\fB)\fR +\fBTk_FontGetDescription\fR(\fItkfont\fR) .sp const char * -\fBTk_NameOfFont(\fItkfont\fB)\fR +\fBTk_NameOfFont\fR(\fItkfont\fR) .sp Tk_Font -\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR +\fBTk_FreeFontFromObj\fR(\fItkwin, objPtr\fR) .sp -void -\fBTk_FreeFont(\fItkfont\fB)\fR +\fBTk_FreeFont\fR(\fItkfont\fR) +.fi .SH ARGUMENTS .AS "const char" *tkfont .AP "Tcl_Interp" *interp in @@ -92,7 +92,8 @@ shared for all uses. The underlying resources will be freed automatically when no-one is using the font anymore. .PP The procedure \fBTk_FontGetDescription\fR returns information about the font -description as a Tcl list. One possible result is "{{DejaVu Sans} -16 bold underline}". +description as a Tcl list. One possible result is +.QW "{{DejaVu Sans} -16 bold underline}" . .PP The procedure \fBTk_NameOfFont\fR is roughly the inverse of \fBTk_GetFont\fR. Given a \fItkfont\fR that was created by diff --git a/doc/GetGC.3 b/doc/GetGC.3 index 6ee63a9..2b02c9d 100644 --- a/doc/GetGC.3 +++ b/doc/GetGC.3 @@ -17,7 +17,8 @@ Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts GC \fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) .sp -\fBTk_FreeGC(\fIdisplay, gc\fR) +\fBTk_FreeGC\fR(\fIdisplay, gc\fR) +.fi .SH ARGUMENTS .AS "unsigned long" valueMask .AP Tk_Window tkwin in diff --git a/doc/GetHINSTANCE.3 b/doc/GetHINSTANCE.3 index 8f82ee9..2069f3f 100644 --- a/doc/GetHINSTANCE.3 +++ b/doc/GetHINSTANCE.3 @@ -13,6 +13,7 @@ Tk_GetHINSTANCE \- retrieve the global application instance handle .sp HINSTANCE \fBTk_GetHINSTANCE\fR() +.fi .BE .SH DESCRIPTION .PP diff --git a/doc/GetHWND.3 b/doc/GetHWND.3 index 1e8cdc9..bf780b4 100644 --- a/doc/GetHWND.3 +++ b/doc/GetHWND.3 @@ -16,6 +16,7 @@ HWND .sp Window \fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) +.fi .SH ARGUMENTS .AP Window window in X token for window. diff --git a/doc/GetImage.3 b/doc/GetImage.3 index c437db7..7d899d8 100644 --- a/doc/GetImage.3 +++ b/doc/GetImage.3 @@ -22,6 +22,7 @@ Tk_Image \fBTk_SizeOfImage\fR(\fIimage, widthPtr, heightPtr\fR) .sp \fBTk_FreeImage\fR(\fIimage\fR) +.fi .SH ARGUMENTS .AS Tk_ImageChangedProc *changeProc .AP Tcl_Interp *interp in diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3 index 616719c..cef93c2 100644 --- a/doc/GetJoinStl.3 +++ b/doc/GetJoinStl.3 @@ -15,10 +15,11 @@ Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles \fB#include \fR .sp int -\fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR +\fBTk_GetJoinStyle\fR(\fIinterp, string, joinPtr\fR) .sp const char * -\fBTk_NameOfJoinStyle(\fIjoin\fB)\fR +\fBTk_NameOfJoinStyle\fR(\fIjoin\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in diff --git a/doc/GetJustify.3 b/doc/GetJustify.3 index 2e871cb..0d8d7ae 100644 --- a/doc/GetJustify.3 +++ b/doc/GetJustify.3 @@ -15,13 +15,14 @@ Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strin \fB#include \fR .sp int -\fBTk_GetJustifyFromObj(\fIinterp, objPtr, justifyPtr\fB)\fR +\fBTk_GetJustifyFromObj\fR(\fIinterp, objPtr, justifyPtr\fR) .sp int -\fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR +\fBTk_GetJustify\fR(\fIinterp, string, justifyPtr\fR) .sp const char * -\fBTk_NameOfJustify(\fIjustify\fB)\fR +\fBTk_NameOfJustify\fR(\fIjustify\fR) +.fi .SH ARGUMENTS .AS "Tk_Justify" *justifyPtr .AP Tcl_Interp *interp in @@ -48,16 +49,13 @@ Justification style (one of the values listed below). \fBTk_GetJustifyFromObj\fR places in \fI*justifyPtr\fR the justify value corresponding to \fIobjPtr\fR's value. This value will be one of the following: -.TP -\fBTK_JUSTIFY_LEFT\fR +.IP \fBTK_JUSTIFY_LEFT\fR Means that the text on each line should start at the left edge of the line; as a result, the right edges of lines may be ragged. -.TP -\fBTK_JUSTIFY_RIGHT\fR +.IP \fBTK_JUSTIFY_RIGHT\fR Means that the text on each line should end at the right edge of the line; as a result, the left edges of lines may be ragged. -.TP -\fBTK_JUSTIFY_CENTER\fR +.IP \fBTK_JUSTIFY_CENTER\fR Means that the text on each line should be centered; as a result, both the left and right edges of lines may be ragged. .PP diff --git a/doc/GetOption.3 b/doc/GetOption.3 index 799786d..b727965 100644 --- a/doc/GetOption.3 +++ b/doc/GetOption.3 @@ -16,6 +16,7 @@ Tk_GetOption \- retrieve an option from the option database .sp Tk_Uid \fBTk_GetOption\fR(\fItkwin, name, class\fR) +.fi .SH ARGUMENTS .AS Tk_Window *class .AP Tk_Window tkwin in diff --git a/doc/GetPixels.3 b/doc/GetPixels.3 index 568c601..8a05a81 100644 --- a/doc/GetPixels.3 +++ b/doc/GetPixels.3 @@ -15,19 +15,20 @@ Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM, Tk_GetDouble \fB#include \fR .sp int -\fBTk_GetPixelsFromObj(\fIinterp, tkwin, objPtr, intPtr\fB)\fR +\fBTk_GetPixelsFromObj\fR(\fIinterp, tkwin, objPtr, intPtr\fR) .sp int -\fBTk_GetDoublePixelsFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR +\fBTk_GetDoublePixelsFromObj\fR(\fIinterp, tkwin, objPtr, doublePtr\fR) .sp int -\fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR +\fBTk_GetPixels\fR(\fIinterp, tkwin, string, intPtr\fR) .sp int -\fBTk_GetMMFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR +\fBTk_GetMMFromObj\fR(\fIinterp, tkwin, objPtr, doublePtr\fR) .sp int -\fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR +\fBTk_GetScreenMM\fR(\fIinterp, tkwin, string, doublePtr\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in @@ -56,20 +57,15 @@ In either case, specifies a screen distance as a floating-point number followed by one of the following characters that indicates units: -.TP - +.IP The number specifies a distance in pixels. -.TP -\fBc\fR +.IP \fBc\fR The number specifies a distance in centimeters on the screen. -.TP -\fBi\fR +.IP \fBi\fR The number specifies a distance in inches on the screen. -.TP -\fBm\fR +.IP \fBm\fR The number specifies a distance in millimeters on the screen. -.TP -\fBp\fR +.IP \fBp\fR The number specifies a distance in printer's points (1/72 inch) on the screen. .PP diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3 index 65fae2d..e9388df 100644 --- a/doc/GetPixmap.3 +++ b/doc/GetPixmap.3 @@ -15,9 +15,10 @@ Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps \fB#include \fR .sp Pixmap -\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR +\fBTk_GetPixmap\fR(\fIdisplay, d, width, height, depth\fR) .sp -\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR +\fBTk_FreePixmap\fR(\fIdisplay, pixmap\fR) +.fi .SH ARGUMENTS .AS "Drawable" *pixelPtr .AP Display *display in diff --git a/doc/GetRelief.3 b/doc/GetRelief.3 index 5979662..528e1ba 100644 --- a/doc/GetRelief.3 +++ b/doc/GetRelief.3 @@ -15,13 +15,14 @@ Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings \fB#include \fR .sp int -\fBTk_GetReliefFromObj(\fIinterp, objPtr, reliefPtr\fB)\fR +\fBTk_GetReliefFromObj\fR(\fIinterp, objPtr, reliefPtr\fR) .sp int -\fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR +\fBTk_GetRelief\fR(\fIinterp, name, reliefPtr\fR) .sp const char * -\fBTk_NameOfRelief(\fIrelief\fB)\fR +\fBTk_NameOfRelief\fR(\fIrelief\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *reliefPtr .AP Tcl_Interp *interp in diff --git a/doc/GetRootCrd.3 b/doc/GetRootCrd.3 index 20520ea..46715c4 100644 --- a/doc/GetRootCrd.3 +++ b/doc/GetRootCrd.3 @@ -15,6 +15,7 @@ Tk_GetRootCoords \- Compute root-window coordinates of window \fB#include \fR .sp \fBTk_GetRootCoords\fR(\fItkwin, xPtr, yPtr\fR) +.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in diff --git a/doc/GetScroll.3 b/doc/GetScroll.3 index dc929b7..0322991 100644 --- a/doc/GetScroll.3 +++ b/doc/GetScroll.3 @@ -15,10 +15,11 @@ Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands \fB#include \fR .sp int -\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR +\fBTk_GetScrollInfoObj\fR(\fIinterp, objc, objv, fractionPtr, stepsPtr\fR) .sp int -\fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR +\fBTk_GetScrollInfo\fR(\fIinterp, argc, argv, fractionPtr, stepsPtr\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *fractionPtr .AP Tcl_Interp *interp in diff --git a/doc/GetSelect.3 b/doc/GetSelect.3 index 455b142..89760cc 100644 --- a/doc/GetSelect.3 +++ b/doc/GetSelect.3 @@ -16,6 +16,7 @@ Tk_GetSelection \- retrieve the contents of a selection .sp int \fBTk_GetSelection\fR(\fIinterp, tkwin, selection, target, proc, clientData\fR) +.fi .SH ARGUMENTS .AS Tk_GetSelProc clientData .AP Tcl_Interp *interp in diff --git a/doc/GetUid.3 b/doc/GetUid.3 index 2cd95ad..407179e 100644 --- a/doc/GetUid.3 +++ b/doc/GetUid.3 @@ -16,6 +16,7 @@ Tk_GetUid, Tk_Uid \- convert from string to unique identifier .sp Tk_Uid \fBTk_GetUid\fR(\fIstring\fR) +.fi .SH ARGUMENTS .AP char *string in String for which the corresponding unique identifier is diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3 index 7e6003a..777d0a3 100644 --- a/doc/GetVRoot.3 +++ b/doc/GetVRoot.3 @@ -14,7 +14,8 @@ Tk_GetVRootGeometry \- Get location and size of virtual root for window .nf \fB#include \fR .sp -\fBTk_GetVRootGeometry(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fB)\fR +\fBTk_GetVRootGeometry\fR(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fR) +.fi .SH ARGUMENTS .AS Tk_Window heightPtr .AP Tk_Window tkwin in diff --git a/doc/GetVisual.3 b/doc/GetVisual.3 index fc6b6f8..e88f69b 100644 --- a/doc/GetVisual.3 +++ b/doc/GetVisual.3 @@ -15,7 +15,8 @@ Tk_GetVisual \- translate from string to visual \fB#include \fR .sp Visual * -\fBTk_GetVisual(\fIinterp, tkwin, string, depthPtr, colormapPtr\fB)\fR +\fBTk_GetVisual\fR(\fIinterp, tkwin, string, depthPtr, colormapPtr\fR) +.fi .SH ARGUMENTS .AS "Tcl_Interp" *colormapPtr .AP Tcl_Interp *interp in @@ -48,6 +49,7 @@ The \fIstring\fR argument specifies the desired visual in one of the following ways: .TP 15 \fIclass depth\fR +. The string consists of a class name followed by an integer depth, with any amount of white space (including none) in between. \fIclass\fR selects what sort of visual is desired and must be one of @@ -62,17 +64,21 @@ looks first for a visual with greater depth, then one with less depth. .TP 15 \fBdefault\fR +. Use the default visual for \fItkwin\fR's screen. .TP 15 \fIpathName\fR +. Use the visual for the window given by \fIpathName\fR. \fIpathName\fR must be the name of a window on the same screen as \fItkwin\fR. .TP 15 \fInumber\fR +. Use the visual whose X identifier is \fInumber\fR. .TP 15 \fBbest\fR ?\fIdepth\fR? +. Choose the .QW "best possible" visual, using the following rules, in decreasing order of priority: diff --git a/doc/Grab.3 b/doc/Grab.3 index 4966edb..fc78dd2 100644 --- a/doc/Grab.3 +++ b/doc/Grab.3 @@ -14,8 +14,8 @@ Tk_Grab, Tk_Ungrab \- manipulate grab state in an application int \fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) .sp -void \fBTk_Ungrab\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AP Tcl_Interp *interp in Interpreter to use for error reporting diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3 index c5dafdd..64adebf 100644 --- a/doc/HWNDToWindow.3 +++ b/doc/HWNDToWindow.3 @@ -13,6 +13,7 @@ Tk_HWNDToWindow \- Find Tk's window information for a Windows window .sp Tk_Window \fBTk_HWNDToWindow\fR(\fIhwnd\fR) +.fi .SH ARGUMENTS .AP HWND hwnd in Windows handle for the window. diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3 index af3fde6..9b9ffc0 100644 --- a/doc/HandleEvent.3 +++ b/doc/HandleEvent.3 @@ -15,6 +15,7 @@ Tk_HandleEvent \- invoke event handlers for window system events \fB#include \fR .sp \fBTk_HandleEvent\fR(\fIeventPtr\fR) +.fi .SH ARGUMENTS .AS XEvent *eventPtr .AP XEvent *eventPtr in diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3 index f8ce1f9..5c7c896 100644 --- a/doc/IdToWindow.3 +++ b/doc/IdToWindow.3 @@ -15,6 +15,7 @@ Tk_IdToWindow \- Find Tk's window information for an X window .sp Tk_Window \fBTk_IdToWindow\fR(\fIdisplay, window\fR) +.fi .SH ARGUMENTS .AS Tk_Window display .AP Display *display in diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3 index ed47d26..9faa7aa 100644 --- a/doc/ImgChanged.3 +++ b/doc/ImgChanged.3 @@ -15,6 +15,7 @@ Tk_ImageChanged \- notify widgets that image needs to be redrawn \fB#include \fR .sp \fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR) +.fi .SH ARGUMENTS .AS Tk_ImageModel imageHeight .AP Tk_ImageModel model in diff --git a/doc/Inactive.3 b/doc/Inactive.3 index ea8d735..46327d2 100644 --- a/doc/Inactive.3 +++ b/doc/Inactive.3 @@ -12,9 +12,10 @@ Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity tim \fB#include \fR .sp long -\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR +\fBTk_GetUserInactiveTime\fR(\fIdisplay\fR) .sp -\fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR +\fBTk_ResetUserInactiveTime\fR(\fIdisplay\fR) +.fi .SH ARGUMENTS .AS Display *display .AP Display *display in diff --git a/doc/InternAtom.3 b/doc/InternAtom.3 index e6756a5..7f1a68b 100644 --- a/doc/InternAtom.3 +++ b/doc/InternAtom.3 @@ -15,10 +15,11 @@ Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms \fB#include \fR .sp Atom -\fBTk_InternAtom(\fItkwin, name\fR) +\fBTk_InternAtom\fR(\fItkwin, name\fR) .sp const char * -\fBTk_GetAtomName(\fItkwin, atom\fR) +\fBTk_GetAtomName\fR(\fItkwin, atom\fR) +.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in diff --git a/doc/MainLoop.3 b/doc/MainLoop.3 index 770f254..7dbda0f 100644 --- a/doc/MainLoop.3 +++ b/doc/MainLoop.3 @@ -15,6 +15,7 @@ Tk_MainLoop \- loop for events until all windows are deleted \fB#include \fR .sp \fBTk_MainLoop\fR() +.fi .BE .SH DESCRIPTION .PP diff --git a/doc/MainWin.3 b/doc/MainWin.3 index b11b6cd..d6da326 100644 --- a/doc/MainWin.3 +++ b/doc/MainWin.3 @@ -17,14 +17,13 @@ Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main window inform Tk_Window \fBTk_MainWindow\fR(\fIinterp\fR) .sp -void \fBTk_SetMainMenubar\fR(\fIinterp, tkwin, menuName\fR) .sp -void \fBTk_SetWindowMenubar\fR(\fIinterp, tkwin, oldMenuName, menuName\fR) .sp int \fBTk_GetNumMainWindows\fR() +.fi .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tcl_Interp *interp in/out @@ -52,7 +51,7 @@ leaves an error message in interpreter \fIinterp\fR's result. windows currently open in the current thread. \fBTk_SetMainMenubar\fR Called when a toplevel widget is brought to front. On the Macintosh, -sets up the menubar that goes accross the top of the main monitor. On +sets up the menubar that goes across the top of the main monitor. On other platforms, nothing is necessary. \fBTk_SetWindowMenubar\fR associates a menu with a window. The old menu clones for the menubar are thrown away, and a handler is diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3 index d6418b5..0196a0d 100644 --- a/doc/MaintGeom.3 +++ b/doc/MaintGeom.3 @@ -17,6 +17,7 @@ Tk_MaintainGeometry, Tk_UnmaintainGeometry \- maintain geometry of one window re \fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR) .sp \fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR) +.fi .SH ARGUMENTS .AS Tk_Window container .AP Tk_Window window in diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3 index dd69273..dd2703c 100644 --- a/doc/ManageGeom.3 +++ b/doc/ManageGeom.3 @@ -15,6 +15,7 @@ Tk_ManageGeometry \- arrange to handle geometry requests for a window \fB#include \fR .sp \fBTk_ManageGeometry\fR(\fItkwin, mgrPtr, clientData\fR) +.fi .SH ARGUMENTS .AS Tk_GeometryProc clientData .AP Tk_Window tkwin in diff --git a/doc/MapWindow.3 b/doc/MapWindow.3 index a3c6296..7de87df 100644 --- a/doc/MapWindow.3 +++ b/doc/MapWindow.3 @@ -18,6 +18,7 @@ Tk_Window \fBTk_MapWindow\fR(\fItkwin\fR) .sp \fBTk_UnmapWindow\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3 index 0922fd5..1f62a55 100644 --- a/doc/MeasureChar.3 +++ b/doc/MeasureChar.3 @@ -14,15 +14,15 @@ Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to me \fB#include \fR .sp int -\fBTk_MeasureChars(\fItkfont, string, numBytes, maxPixels, flags, lengthPtr\fB)\fR +\fBTk_MeasureChars\fR(\fItkfont, string, numBytes, maxPixels, flags, lengthPtr\fR) .sp int -\fBTk_TextWidth(\fItkfont, string, numBytes\fB)\fR +\fBTk_TextWidth\fR(\fItkfont, string, numBytes\fR) .sp -\fBTk_DrawChars(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fB)\fR -.sp -\fBTk_UnderlineChars(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fB)\fR +\fBTk_DrawChars\fR(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fR) .sp +\fBTk_UnderlineChars\fR(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fR) +.fi .SH ARGUMENTS .AS "const char" firstChar .AP Tk_Font tkfont in @@ -48,8 +48,8 @@ otherwise, a character must fit completely to be considered. \fBTK_WHOLE_WORDS\fR means stop on a word boundary, if possible. If \fBTK_AT_LEAST_ONE\fR is set, it means return at least one character even if no characters could fit in the length given by \fImaxPixels\fR. If -\fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if -not even one word fits on the line, return the first few letters of the +\fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means +that if not even one word fits on the line, return the first few letters of the word that did fit; if not even one letter of the word fit, then the first letter will still be returned. .AP int *lengthPtr out diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3 index f67627f..a8646f3 100644 --- a/doc/MoveToplev.3 +++ b/doc/MoveToplev.3 @@ -14,7 +14,8 @@ Tk_MoveToplevelWindow \- Adjust the position of a top-level window .nf \fB#include \fR .sp -\fBTk_MoveToplevelWindow(\fItkwin, x, y\fB)\fR +\fBTk_MoveToplevelWindow\fR(\fItkwin, x, y\fR) +.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in diff --git a/doc/Name.3 b/doc/Name.3 index 1653cf5..538c57c 100644 --- a/doc/Name.3 +++ b/doc/Name.3 @@ -22,6 +22,7 @@ char * .sp Tk_Window \fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR) +.fi .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tk_Window tkwin in diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3 index 781650f..afca117 100644 --- a/doc/NameOfImg.3 +++ b/doc/NameOfImg.3 @@ -15,6 +15,7 @@ Tk_NameOfImage \- Return name of image. .sp const char * \fBTk_NameOfImage\fR(\fIimageModel\fR) +.fi .SH ARGUMENTS .AS Tk_ImageModel imageModel .AP Tk_ImageModel imageModel in diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3 index 67bac55..eb8eabe 100644 --- a/doc/OwnSelect.3 +++ b/doc/OwnSelect.3 @@ -15,6 +15,7 @@ Tk_OwnSelection \- make a window the owner of the primary selection \fB#include \fR .sp \fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) +.fi .SH ARGUMENTS .AS Tk_LostSelProc clientData .AP Tk_Window tkwin in diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3 index 727dcfa..08ad292 100644 --- a/doc/ParseArgv.3 +++ b/doc/ParseArgv.3 @@ -16,6 +16,7 @@ Tk_ParseArgv \- process command-line options .sp int \fBTk_ParseArgv\fR(\fIinterp, tkwin, argcPtr, argv, argTable, flags\fR) +.fi .SH ARGUMENTS .AS Tk_ArgvInfo *argTable .AP Tcl_Interp *interp in @@ -113,18 +114,15 @@ after the matching argument, which is called .QW "the following argument" . The legal values for \fItype\fR, and the processing that they cause, are as follows: -.TP -\fBTK_ARGV_END\fR +.IP \fBTK_ARGV_END\fR Marks the end of the table. The last entry in \fIargTable\fR must have this type; all of its other fields are ignored and it will never match any arguments. -.TP -\fBTK_ARGV_CONSTANT\fR +.IP \fBTK_ARGV_CONSTANT\fR \fISrc\fR is treated as an integer and \fIdst\fR is treated as a pointer to an integer. \fISrc\fR is stored at \fI*dst\fR. The matching argument is discarded. -.TP -\fBTK_ARGV_INT\fR +.IP \fBTK_ARGV_INT\fR The following argument must contain an integer string in the format accepted by \fBstrtol\fR (e.g. .QW 0 @@ -135,22 +133,19 @@ numbers, respectively). \fIDst\fR is treated as a pointer to an integer; the following argument is converted to an integer value and stored at \fI*dst\fR. \fISrc\fR is ignored. The matching and following arguments are discarded from \fIargv\fR. -.TP -\fBTK_ARGV_FLOAT\fR +.IP \fBTK_ARGV_FLOAT\fR The following argument must contain a floating-point number in the format accepted by \fBstrtol\fR. \fIDst\fR is treated as the address of a double-precision floating point value; the following argument is converted to a double-precision value and stored at \fI*dst\fR. The matching and following arguments are discarded from \fIargv\fR. -.TP -\fBTK_ARGV_STRING\fR +.IP \fBTK_ARGV_STRING\fR In this form, \fIdst\fR is treated as a pointer to a (char *); \fBTk_ParseArgv\fR stores at \fI*dst\fR a pointer to the following argument, and discards the matching and following arguments from \fIargv\fR. \fISrc\fR is ignored. -.TP -\fBTK_ARGV_UID\fR +.IP \fBTK_ARGV_UID\fR This form is similar to \fBTK_ARGV_STRING\fR, except that the argument is turned into a Tk_Uid by calling \fBTk_GetUid\fR. \fIDst\fR is treated as a pointer to a @@ -158,32 +153,28 @@ Tk_Uid; \fBTk_ParseArgv\fR stores at \fI*dst\fR the Tk_Uid corresponding to the following argument, and discards the matching and following arguments from \fIargv\fR. \fISrc\fR is ignored. -.TP -\fBTK_ARGV_CONST_OPTION\fR +.IP \fBTK_ARGV_CONST_OPTION\fR This form causes a Tk option to be set (as if the \fBoption\fR command had been invoked). The \fIsrc\fR field is treated as a pointer to a string giving the value of an option, and \fIdst\fR is treated as a pointer to the name of the option. The matching argument is discarded. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). -.TP -\fBTK_ARGV_OPTION_VALUE\fR +.IP \fBTK_ARGV_OPTION_VALUE\fR This form is similar to \fBTK_ARGV_CONST_OPTION\fR, except that the value of the option is taken from the following argument instead of from \fIsrc\fR. \fIDst\fR is used as the name of the option. \fISrc\fR is ignored. The matching and following arguments are discarded. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). -.TP -\fBTK_ARGV_OPTION_NAME_VALUE\fR +.IP \fBTK_ARGV_OPTION_NAME_VALUE\fR In this case the following argument is taken as the name of a Tk option and the argument after that is taken as the value for that option. Both \fIsrc\fR and \fIdst\fR are ignored. All three arguments are discarded from \fIargv\fR. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). -.TP -\fBTK_ARGV_HELP\fR +.IP \fBTK_ARGV_HELP\fR When this kind of option is encountered, \fBTk_ParseArgv\fR uses the \fIhelp\fR fields of \fIargTable\fR to format a message describing all the valid arguments. The message is placed in interpreter @@ -194,8 +185,7 @@ field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will never match any arguments; in this case the specifier simply provides extra documentation, which will be included when some other \fBTK_ARGV_HELP\fR entry causes help information to be returned. -.TP -\fBTK_ARGV_REST\fR +.IP \fBTK_ARGV_REST\fR This option is used by programs or commands that allow the last several of their options to be the name and/or options for some other program. If a \fBTK_ARGV_REST\fR argument is found, then @@ -207,8 +197,7 @@ integer value, and stores at \fI*dst\fR the index of the first of the \fBTK_ARGV_REST\fR options in the returned \fIargv\fR. This allows the program to distinguish the \fBTK_ARGV_REST\fR options from other unprocessed options that preceded the \fBTK_ARGV_REST\fR. -.TP -\fBTK_ARGV_FUNC\fR +.IP \fBTK_ARGV_FUNC\fR For this kind of argument, \fIsrc\fR is treated as the address of a procedure, which is invoked to process the following argument. The procedure should have the following structure: @@ -232,8 +221,7 @@ should return 0 and \fBTkParseArgv\fR will process the following argument in the normal fashion. In either event the matching argument is discarded. .RE -.TP -\fBTK_ARGV_GENFUNC\fR +.IP \fBTK_ARGV_GENFUNC\fR This form provides a more general procedural escape. It treats \fIsrc\fR as the address of a procedure, and passes that procedure all of the remaining arguments. The procedure should have the following @@ -266,27 +254,23 @@ in the usual Tcl fashion, and return \-1; when this happens \fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR. .RE .SS "FLAGS" -.TP -\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR +.IP \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR \fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program or command name, and returns it to the caller just as if it had not matched \fIargTable\fR. If this flag is given, then \fIargv[0]\fR is not given special treatment. -.TP -\fBTK_ARGV_NO_ABBREV\fR +.IP \fBTK_ARGV_NO_ABBREV\fR Normally, \fBTk_ParseArgv\fR accepts unique abbreviations for \fIkey\fR values in \fIargTable\fR. If this flag is given then only exact matches will be acceptable. -.TP -\fBTK_ARGV_NO_LEFTOVERS\fR +.IP \fBTK_ARGV_NO_LEFTOVERS\fR Normally, \fBTk_ParseArgv\fR returns unrecognized arguments to the caller. If this bit is set in \fIflags\fR then \fBTk_ParseArgv\fR will return an error if it encounters any argument that does not match \fIargTable\fR. The only exception to this rule is \fIargv[0]\fR, which will be returned to the caller with no errors as long as \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR is not specified. -.TP -\fBTK_ARGV_NO_DEFAULTS\fR +.IP \fBTK_ARGV_NO_DEFAULTS\fR Normally, \fBTk_ParseArgv\fR searches an internal table of standard argument specifiers in addition to \fIargTable\fR. If this bit is set in \fIflags\fR, then \fBTk_ParseArgv\fR will @@ -312,11 +296,11 @@ Boolean exec = FALSE; * Define option descriptions. */ Tk_ArgvInfo argTable[] = { - {"\-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag, + {"-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag, "Turn on debugging printfs"}, - {"\-N", TK_ARGV_INT, NULL, &numReps, + {"-N", TK_ARGV_INT, NULL, &numReps, "Number of repetitions"}, - {"\-of", TK_ARGV_STRING, NULL, &fileName, + {"-of", TK_ARGV_STRING, NULL, &fileName, "Name of file for output"}, {"x", TK_ARGV_REST, NULL, &exec, "File to exec, followed by any arguments (must be last argument)."}, @@ -324,9 +308,7 @@ Tk_ArgvInfo argTable[] = { NULL} }; -main(argc, argv) - int argc; - char *argv[]; +int main(int argc, char *argv[]) { \&... @@ -346,9 +328,9 @@ Note that default values can be assigned to variables named in particular arguments are present in \fIargv\fR. Here are some example command lines and their effects. .CS -prog \-N 200 infile # just sets the numReps variable to 200 -prog \-of out200 infile # sets fileName to reference "out200" -prog \-XN 10 infile # sets the debug flag, also sets numReps +prog -N 200 infile # just sets the numReps variable to 200 +prog -of out200 infile # sets fileName to reference "out200" +prog -XN 10 infile # sets the debug flag, also sets numReps .CE In all of the above examples, \fIargc\fR will be set by \fBTk_ParseArgv\fR to 2, \fIargv\fR[0] will be diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3 index 9c43ce5..28db0c9 100644 --- a/doc/QWinEvent.3 +++ b/doc/QWinEvent.3 @@ -17,6 +17,7 @@ int \fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) .sp \fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) +.fi .SH ARGUMENTS .AS Tcl_QueuePosition position .AP Display *display in diff --git a/doc/Restack.3 b/doc/Restack.3 index 5cd02eb..59ab9ec 100644 --- a/doc/Restack.3 +++ b/doc/Restack.3 @@ -16,6 +16,7 @@ Tk_RestackWindow \- Change a window's position in the stacking order .sp int \fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) +.fi .SH ARGUMENTS .AS Tk_Window aboveBelow .AP Tk_Window tkwin in diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3 index f61e764..fdf2250 100644 --- a/doc/RestrictEv.3 +++ b/doc/RestrictEv.3 @@ -16,6 +16,7 @@ Tk_RestrictEvents \- filter and selectively delay X events .sp Tk_RestrictProc * \fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR) +.fi .SH ARGUMENTS .AS Tk_RestrictProc **prevArgPtr .AP Tk_RestrictProc *proc in diff --git a/doc/SetAppName.3 b/doc/SetAppName.3 index 91516a0..84984a7 100644 --- a/doc/SetAppName.3 +++ b/doc/SetAppName.3 @@ -16,6 +16,7 @@ Tk_SetAppName \- Set the name of an application for 'send' commands .sp const char * \fBTk_SetAppName\fR(\fItkwin, name\fR) +.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in diff --git a/doc/SetCaret.3 b/doc/SetCaret.3 index 24cc18c..401b57f 100644 --- a/doc/SetCaret.3 +++ b/doc/SetCaret.3 @@ -15,6 +15,7 @@ Tk_SetCaretPos \- set the display caret location .sp int \fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) +.fi .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. diff --git a/doc/SetClass.3 b/doc/SetClass.3 index 0ea81bb..c5a02c8 100644 --- a/doc/SetClass.3 +++ b/doc/SetClass.3 @@ -18,6 +18,7 @@ Tk_SetClass, Tk_Class \- set or retrieve a window's class .sp Tk_Uid \fBTk_Class\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3 index d8f89a4..c0a702f 100644 --- a/doc/SetClassProcs.3 +++ b/doc/SetClassProcs.3 @@ -14,6 +14,7 @@ Tk_SetClassProcs \- register widget specific procedures \fB#include \fR .sp \fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) +.fi .SH ARGUMENTS .AS Tk_ClassProc instanceData .AP Tk_Window tkwin in @@ -32,7 +33,7 @@ are used as callbacks in different places. .PP The structure pointed to by \fIprocs\fR contains the following: .CS -typedef struct Tk_ClassProcs { +typedef struct { size_t \fIsize\fR; Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; Tk_ClassCreateProc *\fIcreateProc\fR; diff --git a/doc/SetGrid.3 b/doc/SetGrid.3 index ea32afb..5440ebf 100644 --- a/doc/SetGrid.3 +++ b/doc/SetGrid.3 @@ -17,6 +17,7 @@ Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing \fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) .sp \fBTk_UnsetGrid\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS Tk_Window heightInc .AP Tk_Window tkwin in diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 5dea561..9db5d9d 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -14,27 +14,28 @@ Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_Fr \fB#include \fR .sp Tk_OptionTable -\fBTk_CreateOptionTable(\fIinterp, templatePtr\fB)\fR +\fBTk_CreateOptionTable\fR(\fIinterp, templatePtr\fR) .sp -\fBTk_DeleteOptionTable(\fIoptionTable\fB)\fR +\fBTk_DeleteOptionTable\fR(\fIoptionTable\fR) .sp int -\fBTk_InitOptions(\fIinterp, recordPtr, optionTable, tkwin\fB)\fR +\fBTk_InitOptions\fR(\fIinterp, recordPtr, optionTable, tkwin\fR) .sp int -\fBTk_SetOptions(\fIinterp, recordPtr, optionTable, objc, objv, tkwin, savePtr, maskPtr\fB)\fR +\fBTk_SetOptions\fR(\fIinterp, recordPtr, optionTable, objc, objv, tkwin, savePtr, maskPtr\fR) .sp -\fBTk_FreeSavedOptions(\fIsavedPtr\fB)\fR +\fBTk_FreeSavedOptions\fR(\fIsavedPtr\fR) .sp -\fBTk_RestoreSavedOptions(\fIsavedPtr\fB)\fR +\fBTk_RestoreSavedOptions\fR(\fIsavedPtr\fR) .sp Tcl_Obj * -\fBTk_GetOptionValue(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR +\fBTk_GetOptionValue\fR(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fR) .sp Tcl_Obj * -\fBTk_GetOptionInfo(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR +\fBTk_GetOptionInfo\fR(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fR) .sp -\fBTk_FreeConfigOptions(\fIrecordPtr, optionTable, tkwin\fB)\fR +\fBTk_FreeConfigOptions\fR(\fIrecordPtr, optionTable, tkwin\fR) +.fi .SH ARGUMENTS .AS Tk_SavedOptions "*const objv[]" in/out .AP Tcl_Interp *interp in @@ -98,7 +99,7 @@ practice the object may not actually be a widget. The term is used to refer to the C-level structure in which information about a particular widget or object is stored. .PP -Note: the easiest way to learn how to use these procedures is to +Note that the easiest way to learn how to use these procedures is to look at a working example. In Tk, the simplest example is the code that implements the button family of widgets, which is in \fBtkButton.c\fR. Other examples are in \fBtkSquare.c\fR and \fBtkMenu.c\fR. @@ -301,8 +302,7 @@ greater than or equal to zero. .PP The \fIflags\fR field consists of one or more bits ORed together. The following flags are supported: -.TP -\fBTK_OPTION_NULL_OK\fR +.IP \fBTK_OPTION_NULL_OK\fR If this bit is set for an option then an empty string will be accepted as the value for the option and the resulting internal form will be a NULL pointer, a zero value, or \fBNone\fR, depending on the type of the option. @@ -313,26 +313,24 @@ feature to be turned off entirely, e.g. set a cursor value to Not all option types support the \fBTK_OPTION_NULL_OK\fR flag; for those that do, there is an explicit indication of that fact in the descriptions below. -.TP -\fBTK_OPTION_DONT_SET_DEFAULT\fR +.IP \fBTK_OPTION_DONT_SET_DEFAULT\fR If this bit is set for an option then no default value will be set in \fBTk_InitOptions\fR for this option. Neither the option database, nor any system default value, nor \fIoptionTable\fR are used to give a default value to this option. Instead it is assumed that the caller has already supplied a default value in the widget code. -.TP -\fBTK_OPTION_ENUM_VAR\fR +.IP \fBTK_OPTION_ENUM_VAR\fR If this value is set for an option, then it indicates the the internalOffset points to an enum variable in stead of an int variable. Only useful in combination with \fBTK_OPTION_STRING_TABLE\fR, \fBTK_OPTION_BOOLEAN\fR, \fBTK_OPTION_ANCHOR\fR, \fBTK_OPTION_JUSTIFY\fR, or \fBTK_OPTION_ANCHOR\fR. -.TP -\fBTK_OPTION_VAR(type)\fR +.IP \fBTK_OPTION_VAR(\fItype\fB)\fR If this value is set for an option, then it indicates the the internalOffset points to a \fItype\fR variable in stead of an int variable. Only useful in combination with \fBTK_OPTION_STRING_TABLE\fR or \fBTK_OPTION_BOOLEAN\fR +.RS .PP The \fItype\fR field of each Tk_OptionSpec structure determines how to parse the value of that configuration option. The @@ -342,43 +340,38 @@ passed into procedures like \fBTk_SetOptions\fR, or if it uses the \fIclientData\fR field of the Tk_OptionSpec, then it is indicated explicitly; if not mentioned, the type requires neither \fItkwin\fR nor \fIclientData\fR. -.TP -\fBTK_OPTION_ANCHOR\fR +.RE +.IP \fBTK_OPTION_ANCHOR\fR The value must be a standard anchor position such as \fBne\fR or \fBcenter\fR. The internal form is a Tk_Anchor value like the ones -returned by \fBTk_GetAnchorFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR -flag; if the empty string is specified as the value for the option, -the integer relief value is set to \fBTK_ANCHOR_NULL\fR. -.TP -\fBTK_OPTION_BITMAP\fR +returned by \fBTk_GetAnchorFromObj\fR. This option type supports the +\fBTK_OPTION_NULL_OK\fR flag; if the empty string is specified as the +value for the option, the integer relief value is set to \fBTK_ANCHOR_NULL\fR. +.IP \fBTK_OPTION_BITMAP\fR The value must be a standard Tk bitmap name. The internal form is a Pixmap token like the ones returned by \fBTk_AllocBitmapFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fBTK_OPTION_BOOLEAN\fR +.IP \fBTK_OPTION_BOOLEAN\fR The value must be a standard boolean value such as \fBtrue\fR or -\fBno\fR. The internal form is an integer with value 0 or 1. Note: if the -\fIobjOffset\fR field is not used then information about the original value -of this option will be lost. This option type supports the +\fBno\fR. The internal form is an integer with value 0 or 1. Note that if +the \fIobjOffset\fR field is not used, information about the original +value of this option will be lost. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to -1. -.TP -\fBTK_OPTION_BORDER\fR +.IP \fBTK_OPTION_BORDER\fR The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR. The internal form is a Tk_3DBorder token like the ones returned by \fBTk_Alloc3DBorderFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fBTK_OPTION_COLOR\fR +.IP \fBTK_OPTION_COLOR\fR The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR. The internal form is an (XColor *) token like the ones returned by \fBTk_AllocColorFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fBTK_OPTION_CURSOR\fR +.IP \fBTK_OPTION_CURSOR\fR The value must be a standard cursor name such as \fBcross\fR or \fB@foo\fR. The internal form is a Tk_Cursor token like the ones returned by \fBTk_AllocCursorFromObj\fR. @@ -386,19 +379,16 @@ This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and when the option is set the cursor for the window is changed by calling \fBXDefineCursor\fR. This option type also supports the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fBTK_OPTION_CUSTOM\fR +.IP \fBTK_OPTION_CUSTOM\fR This option allows applications to define new option types. The clientData field of the entry points to a structure defining the new option type. See the section \fBCUSTOM OPTION TYPES\fR below for details. -.TP -\fBTK_OPTION_DOUBLE\fR +.IP \fBTK_OPTION_DOUBLE\fR The string value must be a floating-point number in the format accepted by \fBstrtol\fR. The internal form is a C \fBdouble\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to NaN. -.TP -\fBTK_OPTION_END\fR +.IP \fBTK_OPTION_END\fR Marks the end of the template. There must be a Tk_OptionSpec structure with \fItype\fR \fBTK_OPTION_END\fR at the end of each template. If the \fIclientData\fR field of this structure is not NULL, then it points to @@ -406,60 +396,54 @@ an additional array of Tk_OptionSpec's, which is itself terminated by another \fBTK_OPTION_END\fR entry. Templates may be chained arbitrarily deeply. This feature allows common options to be shared by several widget classes. -.TP -\fBTK_OPTION_FONT\fR +.IP \fBTK_OPTION_FONT\fR The value must be a standard font name such as \fBTimes 16\fR. The internal form is a Tk_Font handle like the ones returned by \fBTk_AllocFontFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fBTK_OPTION_INT\fR +.IP \fBTK_OPTION_INT\fR The string value must be an integer in the format accepted by \fBstrtol\fR (e.g. \fB0\fR and \fB0x\fR prefixes may be used to -specify octal or hexadecimal numbers, respectively). The internal -form is a C \fBint\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR +specify octal or hexadecimal numbers, respectively). The internal form is +a C \fBint\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. -.TP -\fBTK_OPTION_INDEX\fR -The string value must be an index in the format accepted by \fBTcl_GetIntForIndex()\fR +.IP \fBTK_OPTION_INDEX\fR +The string value must be an index in the format accepted by +\fBTcl_GetIntForIndex()\fR or the empty string. The internal form is a C \fBint\fR value. If the string -starts with \fB-\fR, the internal representation will be set to INT_MIN. If the +starts with \fB\-\fR, the internal representation will be set to INT_MIN. If the string has the form \fBend-???\fR, then the result will be a negative number: \fB-1\fR stands for \fBend\fR, \fB-2\fR stands for \fBend-1\fR and so on. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. -.TP -\fBTK_OPTION_JUSTIFY\fR +.IP \fBTK_OPTION_JUSTIFY\fR The value must be a standard justification value such as \fBleft\fR. The internal form is a Tk_Justify like the values returned by -\fBTk_GetJustifyFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR +\fBTk_GetJustifyFromObj\fR. This option type supports the +\fBTK_OPTION_NULL_OK\fR flag; if the empty string is specified as the value for the option, the integer relief value is set to \fBTK_JUSTIFY_NULL\fR. -.TP -\fBTK_OPTION_PIXELS\fR +.IP \fBTK_OPTION_PIXELS\fR The value must specify a screen distance such as \fB2i\fR or \fB6.4\fR. The internal form is an integer value giving a distance in pixels, like the values returned by -\fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field is not -used then information about the original value of this option will be lost. +\fBTk_GetPixelsFromObj\fR. Note that if the \fIobjOffset\fR field is not +used, information about the original value of this option will be lost. See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. -.TP -\fBTK_OPTION_RELIEF\fR +.IP \fBTK_OPTION_RELIEF\fR The value must be standard relief such as \fBraised\fR. The internal form is an integer relief value such as \fBTK_RELIEF_RAISED\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to \fBTK_RELIEF_NULL\fR. -.TP -\fBTK_OPTION_STRING\fR +.IP \fBTK_OPTION_STRING\fR The value may be any string. The internal form is a (char *) pointer that points to a dynamically allocated copy of the value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fBTK_OPTION_STRING_TABLE\fR +.IP \fBTK_OPTION_STRING_TABLE\fR For this type, \fIclientData\fR is a pointer to an array of strings suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must be one of the strings in the table, or a unique abbreviation of @@ -468,15 +452,13 @@ into the table of the matching string, like the return value from \fBTcl_GetStringFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to -1. -.TP -\fBTK_OPTION_SYNONYM\fR +.IP \fBTK_OPTION_SYNONYM\fR This type is used to provide alternative names for an option (for example, \fB\-bg\fR is often used as a synonym for \fB\-background\fR). The \fBclientData\fR field is a string that gives the name of another option in the same table. Whenever the synonym option is used, the information from the other option will be used instead. -.TP -\fBTK_OPTION_WINDOW\fR +.IP \fBTK_OPTION_WINDOW\fR The value must be a window path name. The internal form is a \fBTk_Window\fR token for the window. This option type requires \fItkwin\fR to be supplied to procedures @@ -526,8 +508,8 @@ the option is retrieved. In most cases it is convenient to use the \fIinternalOffset\fR field as well, so that the integer value is immediately available for use in the widget code (alternatively, \fBTk_GetPixelsFromObj\fR can be used to extract the integer value from -the object whenever it is needed). Note: the problem of losing information -on retrievals exists only for \fBTK_OPTION_PIXELS\fR options. +the object whenever it is needed). Note that the problem of losing +information on retrievals exists only for \fBTK_OPTION_PIXELS\fR options. .PP The second reason to use the \fIobjOffset\fR field is in order to implement new types of options not supported by these procedures. @@ -546,7 +528,7 @@ additional configuration types by writing procedures to parse, print, free, and restore saved copies of the type and creating a structure pointing to those procedures: .CS -typedef struct Tk_ObjCustomOption { +typedef struct { char *name; Tk_CustomOptionSetProc *\fIsetProc\fR; Tk_CustomOptionGetProc *\fIgetProc\fR; @@ -596,18 +578,14 @@ The \fIsetProc\fR procedure is invoked by \fBTk_SetOptions\fR to convert a Tcl_Obj into an internal representation and store the resulting value in the widget record. The arguments are: .RS -.TP -\fIclientData\fR +.IP \fIclientData\fR A copy of the \fIclientData\fR field in the Tk_ObjCustomOption structure. -.TP -\fIinterp\fR +.IP \fIinterp\fR A pointer to a Tcl interpreter, used for error reporting. -.TP -\fITkwin\fR +.IP \fITkwin\fR A copy of the \fItkwin\fR argument to \fBTk_SetOptions\fR -.TP -\fIvaluePtr\fR +.IP \fIvaluePtr\fR A pointer to a reference to a Tcl_Obj describing the new value for the option; it could have been specified explicitly in the call to \fBTk_SetOptions\fR or it could come from the option database or a @@ -617,22 +595,18 @@ pointer referenced by \fIvaluePtr\fR is the pointer that will be stored at the objOffset for the option. \fISetProc\fR may modify the value if necessary; for example, \fIsetProc\fR may change the value to NULL to support the \fBTK_OPTION_NULL_OK\fR flag. -.TP -\fIrecordPtr\fR +.IP \fIrecordPtr\fR A pointer to the start of the widget record to modify. -.TP -\fIinternalOffset\fR +.IP \fIinternalOffset\fR Offset in bytes from the start of the widget record to the location where the internal representation of the option value is to be placed. -.TP -\fIsaveInternalPtr\fR +.IP \fIsaveInternalPtr\fR A pointer to storage allocated in a Tk_SavedOptions structure for the internal representation of the original option value. Before setting the option to its new value, \fIsetProc\fR should set the value referenced by \fIsaveInternalPtr\fR to the original value of the option in order to support \fBTk_RestoreSavedOptions\fR. -.TP -\fIflags\fR +.IP \fIflags\fR A copy of the \fIflags\fR field in the Tk_OptionSpec structure for the option .RE diff --git a/doc/SetVisual.3 b/doc/SetVisual.3 index a5b9efd..a3b50d1 100644 --- a/doc/SetVisual.3 +++ b/doc/SetVisual.3 @@ -16,6 +16,7 @@ Tk_SetWindowVisual \- change visual characteristics of window .sp int \fBTk_SetWindowVisual\fR(\fItkwin, visual, depth, colormap\fR) +.fi .SH ARGUMENTS .AS "Tk_Window int" colormap .AP Tk_Window tkwin in @@ -43,7 +44,7 @@ is called then it returns 0 and does not make any changes; otherwise it returns 1 to signify that the operation completed successfully. .PP -Note: \fBTk_SetWindowVisual\fR should not be called if you just want +Note that \fBTk_SetWindowVisual\fR should not be called if you just want to change a window's colormap without changing its visual or depth; call \fBTk_SetWindowColormap\fR instead. .SH KEYWORDS diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3 index ec9319f..c8a6e08 100644 --- a/doc/StrictMotif.3 +++ b/doc/StrictMotif.3 @@ -15,6 +15,7 @@ Tk_StrictMotif \- Return value of tk_strictMotif variable .sp int \fBTk_StrictMotif\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in diff --git a/doc/TextLayout.3 b/doc/TextLayout.3 index 335ab39..5e83a7b 100644 --- a/doc/TextLayout.3 +++ b/doc/TextLayout.3 @@ -14,31 +14,28 @@ Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayo \fB#include \fR .sp Tk_TextLayout -\fBTk_ComputeTextLayout(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fB)\fR +\fBTk_ComputeTextLayout\fR(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fR) .sp -void -\fBTk_FreeTextLayout(\fIlayout\fB)\fR +\fBTk_FreeTextLayout\fR(\fIlayout\fR) .sp -void -\fBTk_DrawTextLayout(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fB)\fR +\fBTk_DrawTextLayout\fR(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fR) .sp -void -\fBTk_UnderlineTextLayout(\fIdisplay, drawable, gc, layout, x, y, underline\fB)\fR +\fBTk_UnderlineTextLayout\fR(\fIdisplay, drawable, gc, layout, x, y, underline\fR) .sp int -\fBTk_PointToChar(\fIlayout, x, y\fB)\fR +\fBTk_PointToChar\fR(\fIlayout, x, y\fR) .sp int -\fBTk_CharBbox(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fB)\fR +\fBTk_CharBbox\fR(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fR) .sp int -\fBTk_DistanceToTextLayout(\fIlayout, x, y\fB)\fR +\fBTk_DistanceToTextLayout\fR(\fIlayout, x, y\fR) .sp int -\fBTk_IntersectTextLayout(\fIlayout, x, y, width, height\fB)\fR +\fBTk_IntersectTextLayout\fR(\fIlayout, x, y, width, height\fR) .sp -void -\fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR +\fBTk_TextLayoutToPostscript\fR(\fIinterp, layout\fR) +.fi .SH ARGUMENTS .AS Tk_TextLayout "*xPtr, *yPtr" .AP Tk_Font tkfont in diff --git a/doc/TkInitStubs.3 b/doc/TkInitStubs.3 index 57ec9e6..4429bc9 100644 --- a/doc/TkInitStubs.3 +++ b/doc/TkInitStubs.3 @@ -15,6 +15,7 @@ Tk_InitStubs \- initialize the Tk stubs mechanism .sp const char * \fBTk_InitStubs\fR(\fIinterp, version, exact\fR) +.fi .SH ARGUMENTS .AS Tcl_Interp *interp in .AP Tcl_Interp *interp in diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3 index fc29318..1f769c6 100644 --- a/doc/Tk_Init.3 +++ b/doc/Tk_Init.3 @@ -47,38 +47,48 @@ all Tk commands that are considered unsafe. Those commands and the reasons for their exclusion are: .TP \fBbell\fR +. Continuous ringing of the bell is a nuisance. .TP \fBclipboard\fR +. A malicious script could replace the contents of the clipboard with the string .QW "\fBrm \-r *\fR" and lead to surprises when the contents of the clipboard are pasted. .TP \fBgrab\fR +. Grab can be used to block the user from using any other applications. .TP \fBmenu\fR +. Menus can be used to cover the entire screen and to steal input from the user. .TP \fBselection\fR +. See clipboard. .TP \fBsend\fR +. Send can be used to cause unsafe interpreters to execute commands. .TP \fBtk\fR +. The tk command recreates the send command, which is unsafe. .TP \fBtkwait\fR +. Tkwait can block the containing process forever .TP \fBtoplevel\fR +. Toplevels can be used to cover the entire screen and to steal input from the user. .TP \fBwm\fR +. If toplevels are ever allowed, wm can be used to remove decorations, move windows around, etc. .SH KEYWORDS diff --git a/doc/WinUtil.3 b/doc/WinUtil.3 index 253ed19..7208200 100644 --- a/doc/WinUtil.3 +++ b/doc/WinUtil.3 @@ -15,14 +15,15 @@ Tk_GetOtherWindow, Tk_MakeContainer, Tk_MakeWindow, Tk_UseWindow \- window utili \fB#include \fR .sp Tk_Window -\fBTk_GetOtherWindow(\fItkwin\fB)\fR +\fBTk_GetOtherWindow\fR(\fItkwin\fR) .sp -\fBTk_MakeContainer(\fItkwin\fB)\fR +\fBTk_MakeContainer\fR(\fItkwin\fR) .sp -\fBTk_MakeWindow(\fItkwin, parent\fB)\fR +\fBTk_MakeWindow\fR(\fItkwin, parent\fR) .sp int -\fBTk_UseWindow(\fIinterp, tkwin, string\fB)\fR +\fBTk_UseWindow\fR(\fIinterp, tkwin, string\fR) +.fi .SH ARGUMENTS .AS XSetWindowAttributes borderWidth .AP Tcl_Interp * interp in diff --git a/doc/WindowId.3 b/doc/WindowId.3 index 477efe1..68597d8 100644 --- a/doc/WindowId.3 +++ b/doc/WindowId.3 @@ -103,6 +103,7 @@ Tcl_Interp * .sp Tcl_Obj * \fBTk_NewWindowObj\fR(\fItkwin\fR) +.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in @@ -147,7 +148,7 @@ information plus a few other fields. \fBTk_Attributes\fR returns a pointer to an XSetWindowAttributes structure describing all of the attributes of the \fItkwin\fR's window, such as background pixmap, event mask, and so on (Tk keeps track of all this information -as it is changed by the application). Note: it is essential that +as it is changed by the application). Note that it is essential that applications use Tk procedures like \fBTk_ResizeWindow\fR instead of X procedures like \fBXResizeWindow\fR, so that Tk can keep its data structures up-to-date. diff --git a/doc/bind.n b/doc/bind.n index 3fe72f1..a388152 100644 --- a/doc/bind.n +++ b/doc/bind.n @@ -149,8 +149,9 @@ substantial mouse motion in between. For example, \fB\fR is equivalent to \fB\fR with the extra time and space requirement. .PP -The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are equivalents -of \fBMod1\fR up to \fBMod4\fR, they correspond to Macintosh-specific modifier keys. +The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are +equivalents of \fBMod1\fR up to \fBMod4\fR; they correspond to +Macintosh-specific modifier keys. .PP The \fBExtended\fR modifier is, at present, specific to Windows. It appears on events that are associated with the keys on the @@ -739,7 +740,7 @@ The \fBbgerror\fR command will be executed at global level Arrange for a string describing the motion of the mouse to be printed out when the mouse is double-clicked: .CS -\fBbind\fR . { +\fBbind\fR . { puts "hi from (%x,%y)" } .CE @@ -748,7 +749,7 @@ A little GUI that displays what the keysym name of the last key pressed is: .CS set keysym "Press any key" -pack [label .l \-textvariable keysym \-padx 2m \-pady 1m] +pack [label .l -textvariable keysym -padx 2m -pady 1m] \fBbind\fR . { set keysym "You pressed %K" } diff --git a/doc/bitmap.n b/doc/bitmap.n index 8afcdfd..3ef2254 100644 --- a/doc/bitmap.n +++ b/doc/bitmap.n @@ -39,6 +39,7 @@ data is zero. Like all images, bitmaps are created using the \fBimage create\fR command. Bitmaps support the following \fIoptions\fR: +.\" OPTION: -background .TP \fB\-background \fIcolor\fR . @@ -47,6 +48,7 @@ ways accepted by Tk. If this option is set to an empty string then the background pixels will be transparent. This effect is achieved by using the source bitmap as the mask bitmap, ignoring any \fB\-maskdata\fR or \fB\-maskfile\fR options. +.\" OPTION: -data .TP \fB\-data \fIstring\fR . @@ -55,6 +57,7 @@ The string must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). If both the \fB\-data\fR and \fB\-file\fR options are specified, the \fB\-data\fR option takes precedence. +.\" OPTION: -file .TP \fB\-file \fIname\fR . @@ -62,11 +65,13 @@ the \fB\-data\fR option takes precedence. source bitmap. The file must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). +.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR . Specifies a foreground color for the image in any of the standard ways accepted by Tk. +.\" OPTION: -maskdata .TP \fB\-maskdata \fIstring\fR . @@ -75,6 +80,7 @@ The string must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified, the \fB\-maskdata\fR option takes precedence. +.\" OPTION: -maskfile .TP \fB\-maskfile \fIname\fR . diff --git a/doc/busy.n b/doc/busy.n index 649187a..b1453bb 100644 --- a/doc/busy.n +++ b/doc/busy.n @@ -30,19 +30,15 @@ .SH NAME busy \- Make Tk widgets busy, temporarily blocking user interactions .SH SYNOPSIS +.nf \fBtk busy\fI window \fR?\fIoptions\fR? -.sp \fBtk busy busywindow \fIwindow\fR -.sp \fBtk busy hold\fI window \fR?\fIoptions\fR? -.sp \fBtk busy configure \fIwindow\fR ?\fIoption value\fR?... -.sp \fBtk busy forget\fI window \fR?\fIwindow \fR?... -.sp \fBtk busy current\fR ?\fIpattern\fR? -.sp \fBtk busy status \fIwindow\fR +.fi .BE .SH DESCRIPTION .PP @@ -116,7 +112,7 @@ The busy window has a configurable cursor. You can change the busy cursor using the \fBconfigure\fR operation. .PP .CS -\fBtk busy\fR configure .top \-cursor "watch" +\fBtk busy\fR configure .top -cursor "watch" .CE .PP Destroying the widget will also clean up any resources allocated by the \fBtk @@ -203,6 +199,7 @@ command returns the pathname of the busy window that was created (i.e. the transparent window shielding the window appearing busy). The following configuration options are valid: .RS +.\" OPTION: -cursor .TP \fB\-cursor \fIcursorName\fR . diff --git a/doc/button.n b/doc/button.n index 79cf14e..9850670 100644 --- a/doc/button.n +++ b/doc/button.n @@ -196,17 +196,17 @@ This is the classic Tk demonstration: .PP .CS -\fBbutton\fR .b \-text "Hello, World!" \-command exit +\fBbutton\fR .b -text "Hello, World!" -command exit pack .b .CE .PP This example demonstrates how to handle button accelerators: .PP .CS -\fBbutton\fR .b1 \-text Hello \-underline 0 -\fBbutton\fR .b2 \-text World \-underline 0 -bind . {.b1 flash; .b1 invoke} -bind . {.b2 flash; .b2 invoke} +\fBbutton\fR .b1 -text Hello -underline 0 +\fBbutton\fR .b2 -text World -underline 0 +bind . {.b1 flash; .b1 invoke} +bind . {.b2 flash; .b2 invoke} pack .b1 .b2 .CE .SH "SEE ALSO" diff --git a/doc/canvas.n b/doc/canvas.n index 52f27d6..7484a6e 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -256,9 +256,7 @@ tasks as inserting new text at the end of the item. Lines and Polygons do not support the insertion cursor and the selection. Their indices are supposed to be even always, because coordinates always appear in pairs. -.TP 10 -\fInumber\fR -. +.IP \fInumber\fR 10 A decimal number giving the position of the desired character within the text item. 0 refers to the first character, 1 to the next character, and @@ -271,30 +269,20 @@ polygons, numbers less than 0 or greater than the length of the coordinate list will be adjusted by adding or subtracting the length until the result is between zero and the length, inclusive. -.TP 10 -\fBend\fR -. +.IP \fBend\fR 10 Refers to the character or coordinate just after the last one in the item (same as the number of characters or coordinates in the item). -.TP 10 -\fBinsert\fR -. +.IP \fBinsert\fR 10 Refers to the character just before which the insertion cursor is drawn in this item. Not valid for lines and polygons. -.TP 10 -\fBsel.first\fR -. +.IP \fBsel.first\fR 10 Refers to the first selected character in the item. If the selection is not in this item then this form is illegal. -.TP 10 -\fBsel.last\fR -. +.IP \fBsel.last\fR 10 Refers to the last selected character in the item. If the selection is not in this item then this form is illegal. -.TP 10 -\fB@\fIx,y\fR -. +.IP \fB@\fIx,y\fR 10 Refers to the character or coordinate at the point given by \fIx\fR and \fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate system of the canvas. @@ -368,27 +356,19 @@ This command returns an empty string as result. \fISearchSpec\fR and \fIarg\fR's may take any of the following forms: .RS -.TP -\fBabove \fItagOrId\fR -. +.IP "\fBabove \fItagOrId\fR" Selects the item just after (above) the one given by \fItagOrId\fR in the display list. If \fItagOrId\fR denotes more than one item, then the last (topmost) of these items in the display list is used. -.TP -\fBall\fR -. +.IP \fBall\fR Selects all the items in the canvas. -.TP -\fBbelow \fItagOrId\fR -. +.IP "\fBbelow \fItagOrId\fR" Selects the item just before (below) the one given by \fItagOrId\fR in the display list. If \fItagOrId\fR denotes more than one item, then the first (lowest) of these items in the display list is used. -.TP -\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR? -. +.IP "\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR?" Selects the item closest to the point given by \fIx\fR and \fIy\fR. If more than one item is at the same closest distance (e.g. two items overlap the point), then the top-most of these items (the @@ -406,24 +386,18 @@ Instead of selecting the topmost closest item, this form will select the topmost closest item that is below \fIstart\fR in the display list; if no such item exists, then the selection behaves as if the \fIstart\fR argument had not been specified. -.TP -\fBenclosed\fI x1 y1 x2 y2\fR -. +.IP "\fBenclosed\fI x1 y1 x2 y2\fR" Selects all the items completely enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. -.TP -\fBoverlapping\fI x1 y1 x2 y2\fR -. +.IP "\fBoverlapping\fI x1 y1 x2 y2\fR" Selects all the items that overlap or are enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. -.TP -\fBwithtag \fItagOrId\fR -. +.IP "\fBwithtag \fItagOrId\fR" Selects all the items given by \fItagOrId\fR. .RE .\" METHOD: bbox @@ -673,26 +647,36 @@ If some or all of the items given by \fItagOrId\fR do not support an insertion cursor then this command has no effect on them. See \fBINDICES\fR above for a description of the legal forms for \fIindex\fR. -Note: the insertion cursor is only displayed in an item if +.RS +.PP +Note that the insertion cursor is only displayed in an item if that item currently has the keyboard focus (see the \fBfocus\fR widget command, above), but the cursor position may be set even when the item does not have the focus. +.PP This command returns an empty string. +.RE .\" METHOD: image .TP \fIpathName \fBimage \fIimagename\fR ?\fIsubsample\fR? ?\fIzoom\fR? . -Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB\-scrollregion\fR -has been defined then this will be the boundaries of the canvas region drawn and the -final size of the photo image. Otherwise the widget width and height with an origin -of 0,0 will be the size of the canvas region drawn and the final size of the photo -image. Optionally an integer \fIsubsample\fR factor may be given and the photo image -will be reduced in size. In addition to the \fIsubsample\fR an integer \fIzoom\fR -factor can also be given and the photo image will be enlarged. The image background -will be filled with the canvas background colour. The canvas widget does not need to -be mapped for this widget command to work, but at least one of it's ancestors must be -mapped. +Draw the canvas into the Tk photo image named \fIimagename\fR. +If a \fB\-scrollregion\fR has been defined then this will be the boundaries +of the canvas region drawn and the final size of the photo image. Otherwise +the widget width and height with an origin of 0,0 will be the size of the +canvas region drawn and the final size of the photo image. Optionally an +integer \fIsubsample\fR factor may be given and the photo image +will be reduced in size. +.RS +.PP +In addition to the \fIsubsample\fR an integer \fIzoom\fR factor can also +be given and the photo image will be enlarged. The image background will +be filled with the canvas background colour. The canvas widget does not +need to be mapped for this widget command to work, but at least one of +it's ancestors must be mapped. +.PP This command returns an empty string. +.RE .\" METHOD: imove .TP \fIpathName \fBimove \fItagOrId index x y\fR @@ -728,9 +712,13 @@ Text items interpret \fIbeforeThis\fR as an index to a character, line and polygon items interpret it as an index to a coordinate (an x,y pair). For lines and polygons the \fIstring\fR must be a valid coordinate sequence. +.RS +.PP See \fBINDICES\fR above for information about the forms allowed for \fIbeforeThis\fR. +.PP This command returns an empty string. +.RE .\" METHOD: itemcget .TP \fIpathName \fBitemcget\fI tagOrId option\fR @@ -777,7 +765,7 @@ but the relative order of the moved items will not be changed. \fIBelowThis\fR is a tag or id; if it refers to more than one item then the first (lowest) of these items in the display list is used as the destination location for the moved items. -Note: this command has no effect on window items. Window items always +Note that this command has no effect on window items. Window items always obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. @@ -831,6 +819,7 @@ The \fIoption\fR\-\fIvalue\fR argument pairs provide additional information to control the generation of Postscript. The following options are supported: .RS +.\" OPTION: -channel .TP \fB\-channel \fIchannelName\fR . @@ -838,6 +827,7 @@ Specifies the name of the channel to which to write the Postscript. If this option and the \fB\-file\fR option are not specified then the Postscript is returned as the result of the command. +.\" OPTION: -colormap .TP \fB\-colormap \fIvarName\fR . @@ -851,9 +841,13 @@ to see if there is an element of \fIvarName\fR with the same name as the color. If so, Tk uses the value of the element as the Postscript command to set the color. +.RS +.PP If this option has not been specified, or if there is no entry in \fIvarName\fR for a given color, then Tk uses the red, green, and blue intensities from the X color. +.RE +.\" OPTION: -colormode .TP \fB\-colormode \fImode\fR . @@ -861,6 +855,7 @@ Specifies how to output color information. \fIMode\fR must be either \fBcolor\fR (for full color output), \fBgray\fR (convert all colors to their gray-scale equivalents) or \fBmono\fR (convert all colors to black or white). +.\" OPTION: -file .TP \fB\-file \fIfileName\fR . @@ -868,6 +863,7 @@ Specifies the name of the file in which to write the Postscript. If this option and the \fB\-channel\fR option are not specified then the Postscript is returned as the result of the command. +.\" OPTION: -fontmap .TP \fB\-fontmap \fIvarName\fR . @@ -884,23 +880,32 @@ Otherwise Tk attempts to guess what Postscript font to use. Tk's guesses generally only work for well-known fonts such as Times and Helvetica and Courier, and only if the X font name does not omit any dashes up through the point size. +.RS +.PP For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but \fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to parse the font name). +.RE +.\" OPTION: -height .TP \fB\-height \fIsize\fR . Specifies the height of the area of the canvas to print. Defaults to the height of the canvas window. +.\" OPTION: -pageanchor .TP \fB\-pageanchor \fIanchor\fR . Specifies which point of the printed area of the canvas should appear over the positioning point on the page (which is given by the \fB\-pagex\fR and \fB\-pagey\fR options). +.RS +.PP For example, \fB\-pageanchor n\fR means that the top center of the area of the canvas being printed (as it appears in the canvas window) should be over the positioning point. Defaults to \fBcenter\fR. +.RE +.\" OPTION: -pageheight .TP \fB\-pageheight \fIsize\fR . @@ -913,6 +918,7 @@ Defaults to the height of the printed area on the screen. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling is not implemented). +.\" OPTION: -pagewidth .TP \fB\-pagewidth \fIsize\fR . @@ -923,6 +929,7 @@ Defaults to the width of the printed area on the screen. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling is not implemented). +.\" OPTION: -pagex .TP \fB\-pagex \fIposition\fR . @@ -931,6 +938,7 @@ the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. +.\" OPTION: -pagey .TP \fB\-pagey \fIposition\fR . @@ -939,6 +947,7 @@ the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. +.\" OPTION: -rotate .TP \fB\-rotate \fIboolean\fR . @@ -950,11 +959,13 @@ the short dimension of the page in rotated output the x-axis runs along the long dimension of the page .PQ landscape " orientation" . Defaults to non-rotated. +.\" OPTION: -width .TP \fB\-width \fIsize\fR . Specifies the width of the area of the canvas to print. Defaults to the width of the canvas window. +.\" OPTION: -x .TP \fB\-x \fIposition\fR . @@ -962,6 +973,7 @@ Specifies the x-coordinate of the left edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the left edge of the window. +.\" OPTION: -y .TP \fB\-y \fIposition\fR . @@ -984,7 +996,7 @@ as the destination location for the moved items. This command returns an empty string. .RS .PP -Note: this command has no effect on window items. Window items always +Note this this command has no effect on window items. Window items always obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. @@ -1255,6 +1267,7 @@ the coordinates of the item. .PP Many items share a common set of options. These options are explained here, and then referred to be each widget type for brevity. +.\" OPTION: -anchor .TP \fB\-anchor \fIanchorPos\fR . @@ -1265,18 +1278,22 @@ is \fBcenter\fR then the item is centered on the point; if \fIanchorPos\fR is \fBn\fR then the item will be drawn so that its top center point is at the positioning point. This option defaults to \fBcenter\fR. +.\" OPTION: -dash .TP \fB\-dash \fIpattern\fR +.\" OPTION: -activedash .TP \fB\-activedash \fIpattern\fR +.\" OPTION: -disableddash .TP \fB\-disableddash \fIpattern\fR . -This option specifies dash patterns for the normal, active +These options specify dash patterns for the normal, active state, and disabled state of an item. \fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. If the dash options are omitted then the default is a solid outline. See \fBDASH PATTERNS\fR for more information. +.\" OPTION: -dashoffset .TP \fB\-dashoffset \fIoffset\fR . @@ -1284,14 +1301,17 @@ The starting \fIoffset\fR in pixels into the pattern provided by the \fB\-dash\fR option. \fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern. The \fIoffset\fR may have any of the forms described in the \fBCOORDINATES\fR section above. +.\" OPTION: -fill .TP \fB\-fill \fIcolor\fR +.\" OPTION: -activefill .TP \fB\-activefill \fIcolor\fR +.\" OPTION: -disabledfill .TP \fB\-disabledfill \fIcolor\fR . -Specifies the color to be used to fill item's area. +These options specify the color to be used to fill item's area. in its normal, active, and disabled states. The even-odd fill rule is used. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. @@ -1299,18 +1319,22 @@ For the line item, it specifies the color of the line drawn. For the text item, it specifies the foreground color of the text. If \fIcolor\fR is an empty string (the default for all canvas items except line and text), then the item will not be filled. +.\" OPTION: -outline .TP \fB\-outline \fIcolor\fR +.\" OPTION: -activeoutline .TP \fB\-activeoutline \fIcolor\fR +.\" OPTION: -disabledoutline .TP \fB\-disabledoutline \fIcolor\fR . -This option specifies the color that should be used to draw the +These options specify the color that should be used to draw the outline of the item in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR is specified as an empty string then no outline is drawn for the item. +.\" OPTION: -offset .TP \fB\-offset \fIoffset\fR . @@ -1325,14 +1349,17 @@ used for stippling as well. For the line and polygon canvas items you can also specify an index as argument, which connects the stipple origin to one of the coordinate points of the line/polygon. Note that stipple offsets are \fIonly supported on X11\fR; they are silently ignored on other platforms. +.\" OPTION: -outlinestipple .TP \fB\-outlinestipple \fIbitmap\fR +.\" OPTION: -activeoutlinestipple .TP \fB\-activeoutlinestipple \fIbitmap\fR +.\" OPTION: -disabledoutlinestipple .TP \fB\-disabledoutlinestipple \fIbitmap\fR . -This option specifies stipple patterns that should be used to draw the +These options specify stipple patterns that should be used to draw the outline of the item in its normal, active and disabled states. Indicates that the outline for the item should be drawn with a stipple pattern; \fIbitmap\fR specifies the stipple pattern to use, in any of the @@ -1343,20 +1370,24 @@ If \fIbitmap\fR is an empty string (the default), then the outline is drawn in a solid fashion. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR +.\" OPTION: -outlineoffset .TP \fB\-outlineoffset \fIoffset\fR . Specifies the offset of the stipple pattern used for outlines, in the same way that the \fB\-outline\fR option controls fill stipples. (See the \fB\-outline\fR option for a description of the syntax of \fIoffset\fR.) +.\" OPTION: -stipple .TP \fB\-stipple \fIbitmap\fR +.\" OPTION: -activestipple .TP \fB\-activestipple \fIbitmap\fR +.\" OPTION: -disabledstipple .TP \fB\-disabledstipple \fIbitmap\fR . -This option specifies stipple patterns that should be used to fill +These options specify stipple patterns that should be used to fill the item in its normal, active and disabled states. \fIbitmap\fR specifies the stipple pattern to use, in any of the forms accepted by \fBTk_GetBitmap\fR. @@ -1367,26 +1398,31 @@ in a solid fashion. For the text item, it affects the actual text. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR +.\" OPTION: -state .TP \fB\-state \fIstate\fR . This allows an item to override the canvas widget's global \fIstate\fR option. It takes the same values: \fInormal\fR, \fIdisabled\fR or \fIhidden\fR. +.\" OPTION: -tags .TP \fB\-tags \fItagList\fR . Specifies a set of tags to apply to the item. \fITagList\fR consists of a list of tag names, which replace any existing tags for the item. \fITagList\fR may be an empty list. +.\" OPTION: -width .TP \fB\-width \fIoutlineWidth\fR +.\" OPTION: -activewidth .TP \fB\-activewidth \fIoutlineWidth\fR +.\" OPTION: -disabledwidth .TP \fB\-disabledwidth \fIoutlineWidth\fR . -Specifies the width of the outline to be drawn around +These options specify the width of the outline to be drawn around the item's region, in its normal, active and disabled states. \fIoutlineWidth\fR may be in any of the forms described in the \fBCOORDINATES\fR section above. @@ -1399,8 +1435,9 @@ arc's region. .PP Items of type \fBarc\fR appear on the display as arc-shaped regions. An arc is a section of an oval delimited by two angles (specified -by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR option) -and displayed in one of several ways (specified by the \fB\-style\fR option). +by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR +option) and displayed in one of several ways (specified by the \fB\-style\fR +option). Arcs are created with widget commands of the following form: .CS \fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR? @@ -1436,22 +1473,28 @@ The following standard options are supported by arcs: \fB\-disabledwidth\fR .DE The following extra options are supported for arcs: +.\" OPTION: -extent .TP \fB\-extent \fIdegrees\fR +. Specifies the size of the angular range occupied by the arc. The arc's range extends for \fIdegrees\fR degrees counter-clockwise from the starting angle given by the \fB\-start\fR option. \fIDegrees\fR may be negative. If it is greater than 360 or less than \-360, then \fIdegrees\fR modulo 360 is used as the extent. +.\" OPTION: -start .TP \fB\-start \fIdegrees\fR +. Specifies the beginning of the angular range occupied by the arc. \fIDegrees\fR is given in units of degrees measured counter-clockwise from the 3-o'clock position; it may be either positive or negative. +.\" OPTION: -height .TP \fB\-height \fIdistance\fR +. Provides a shortcut for creating a circular arc segment by defining the distance of the mid-point of the arc from its chord. When this option is used the coordinates are interpreted as the start and end coordinates @@ -1478,8 +1521,10 @@ choosing the minus sign for the minor arc and the plus sign for the major arc. Note that \fBitemcget \-height\fR always returns 0 so that introspection code can be kept simple. .RE +.\" OPTION: -style .TP \fB\-style \fItype\fR +. Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR (the default) then the arc's region is defined by a section of the oval's perimeter plus two line segments, one between the center @@ -1517,12 +1562,16 @@ The following standard options are supported by bitmaps: \fB\-tags\fR .DE The following extra options are supported for bitmaps: +.\" OPTION: -background .TP \fB\-background \fIcolor\fR +.\" OPTION: -activebackground .TP \fB\-activebackground \fIcolor\fR +.\" OPTION: -disabledbackground .TP \fB\-disabledbackground \fIcolor\fR +. Specifies the color to use for each of the bitmap's .QW 0 valued pixels in its normal, active and disabled states. @@ -1530,22 +1579,30 @@ valued pixels in its normal, active and disabled states. If this option is not specified, or if it is specified as an empty string, then nothing is displayed where the bitmap pixels are 0; this produces a transparent effect. +.\" OPTION: -bitmap .TP \fB\-bitmap \fIbitmap\fR +.\" OPTION: -activebitmap .TP \fB\-activebitmap \fIbitmap\fR +.\" OPTION: -disabledbitmap .TP \fB\-disabledbitmap \fIbitmap\fR -Specifies the bitmaps to display in the item in its normal, active and -disabled states. +. +These options specify the bitmaps to display in the item in its normal, +active and disabled states. \fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR. +.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR +.\" OPTION: -activeforeground .TP \fB\-activeforeground \fIcolor\fR +.\" OPTION: -disabledforeground .TP \fB\-disabledforeground \fIcolor\fR -Specifies the color to use for each of the bitmap's +. +These options specify the color to use for each of the bitmap's .QW 1 valued pixels in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. @@ -1575,12 +1632,16 @@ The following standard options are supported by images: \fB\-tags\fR .DE The following extra options are supported for images: +.\" OPTION: -image .TP \fB\-image \fIname\fR +.\" OPTION: -activeimage .TP \fB\-activeimage \fIname\fR +.\" OPTION: -disabledimage .TP \fB\-disabledimage \fIname\fR +. Specifies the name of the images to display in the item in is normal, active and disabled states. This image must have been created previously with the @@ -1620,8 +1681,10 @@ The following standard options are supported by lines: \fB\-disabledwidth\fR .DE The following extra options are supported for lines: +.\" OPTION: -arrow .TP \fB\-arrow \fIwhere\fR +. Indicates whether or not arrowheads are to be drawn at one or both ends of the line. \fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads), @@ -1635,8 +1698,10 @@ rather than at its tip so that the line doesn't extend past the edge of the arrowhead. This may trigger a \fBLeave\fR event if the mouse is hovering this line end. Conversely, when removing an arrowhead Tk adjusts the corresponding line point the other way round, which may trigger an \fBEnter\fR event. +.\" OPTION: -arrowshape .TP \fB\-arrowshape \fIshape\fR +. This option indicates how to draw arrowheads. The \fIshape\fR argument must be a list with three elements, each specifying a distance in any of the forms described in @@ -1650,16 +1715,20 @@ trailing points. If this option is not specified then Tk picks a .QW reasonable shape. +.\" OPTION: -capstyle .TP \fB\-capstyle \fIstyle\fR +. Specifies the ways in which caps are to be drawn at the endpoints of the line. \fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR (\fBbutt\fR, \fBprojecting\fR, or \fBround\fR). If this option is not specified then it defaults to \fBbutt\fR. Where arrowheads are drawn the cap style is ignored. +.\" OPTION: -joinstyle .TP \fB\-joinstyle \fIstyle\fR +. Specifies the ways in which joints are to be drawn at the vertices of the line. \fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR @@ -1667,12 +1736,15 @@ of the line. If this option is not specified then it defaults to \fBround\fR. If the line only contains two points then this option is irrelevant. +.\" OPTION: -smooth .TP \fB\-smooth \fIsmoothMethod\fR +. \fIsmoothMethod\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are -supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean +supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), +but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes \fBtrue\fR smoothing. If the smoothing method is \fBtrue\fR, this indicates that the line @@ -1689,8 +1761,10 @@ line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is a control point and not a knot point, the point is repeated (one or two times) so that it also becomes a knot point. +.\" OPTION: -splinesteps .TP \fB\-splinesteps \fInumber\fR +. Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. @@ -1747,8 +1821,8 @@ Polygons are created with widget commands of the following form: \fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value ...\fR? \fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value ...\fR? .CE -The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the coordinates for -three or more points that define a polygon. +The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the +coordinates for three or more points that define a polygon. The first point should not be repeated as the last to close the shape; Tk will automatically close the periphery between the first and last points. @@ -1777,18 +1851,23 @@ The following standard options are supported by polygons: \fB\-disabledwidth\fR .DE The following extra options are supported for polygons: +.\" OPTION: -joinstyle .TP \fB\-joinstyle \fIstyle\fR +. Specifies the ways in which joints are to be drawn at the vertices of the outline. \fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). If this option is not specified then it defaults to \fBround\fR. +.\" OPTION: -smooth .TP \fB\-smooth \fIboolean\fR +. \fIBoolean\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are -supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean +supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), +but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes \fBtrue\fR smoothing. If the smoothing method is \fBtrue\fR, this indicates that the polygon @@ -1806,8 +1885,10 @@ equal to their neighbouring knot points. If the last point is not the second point of a pair of control points, the point is repeated (one or two times) so that it also becomes the second point of a pair of control points (the associated knot point will be the first control point). +.\" OPTION: -splinesteps .TP \fB\-splinesteps \fInumber\fR +. Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. @@ -1898,6 +1979,7 @@ The following standard options are supported by text items: \fB\-tags\fR .DE The following extra options are supported for text items: +.\" OPTION: -angle .TP \fB\-angle \fIrotationDegrees\fR . @@ -1906,36 +1988,46 @@ about the positioning point for the text; it may have any floating-point value from 0.0 to 360.0. For example, if \fIrotationDegrees\fR is \fB90\fR, then the text will be drawn vertically from bottom to top. This option defaults to \fB0.0\fR. +.\" OPTION: -font .TP \fB\-font \fIfontName\fR +. Specifies the font to use for the text item. \fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR. If this option is not specified, it defaults to a system-dependent font. +.\" OPTION: -justify .TP \fB\-justify \fIhow\fR +. Specifies how to justify the text within its bounding region. \fIHow\fR must be one of the values \fBleft\fR, \fBright\fR, or \fBcenter\fR. This option will only matter if the text is displayed as multiple lines. If the option is omitted, it defaults to \fBleft\fR. +.\" OPTION: -text .TP \fB\-text \fIstring\fR +. \fIString\fR specifies the characters to be displayed in the text item. Newline characters cause line breaks. The characters in the item may also be changed with the \fBinsert\fR and \fBdelete\fR widget commands. This option defaults to an empty string. +.\" OPTION: -underline .TP -\fB\-underline \fI\fR +\fB\-underline \fInumber\fR +. Specifies the integer index of a character within the text to be underlined. 0 corresponds to the first character of the text displayed, 1 to the next character, and so on. \-1 means that no underline should be drawn (if the whole text item is to be underlined, the appropriate font should be used instead). +.\" OPTION: -width .TP \fB\-width \fIlineLength\fR +. Specifies a maximum line length for the text, in any of the forms described in the \fBCOORDINATES\fR section above. If this option is zero (the default) the text is broken into @@ -1974,6 +2066,7 @@ The following standard options are supported by window items: \fB\-tags\fR .DE The following extra options are supported for window items: +.\" OPTION: -height .TP \fB\-height \fIpixels\fR . @@ -1982,6 +2075,7 @@ Specifies the height to assign to the item's window. forms described in the \fBCOORDINATES\fR section above. If this option is not specified, or if it is specified as zero, then the window is given whatever height it requests internally. +.\" OPTION: -width .TP \fB\-width \fIpixels\fR . @@ -1990,6 +2084,7 @@ Specifies the width to assign to the item's window. forms described in the \fBCOORDINATES\fR section above. If this option is not specified, or if it is specified as zero, then the window is given whatever width it requests internally. +.\" OPTION: -window .TP \fB\-window \fIpathName\fR . @@ -1998,7 +2093,7 @@ The window specified by \fIpathName\fR must either be a child of the canvas widget or a child of some ancestor of the canvas widget. \fIPathName\fR may not refer to a top-level window. .PP -Note: due to restrictions in the ways that windows are managed, it is not +Note that, due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that overlap it, regardless of their order in the display list. Also note that diff --git a/doc/checkbutton.n b/doc/checkbutton.n index 0f27d49..ccfe691 100644 --- a/doc/checkbutton.n +++ b/doc/checkbutton.n @@ -291,11 +291,11 @@ individual widgets or by redefining the class bindings. This example shows a group of uncoupled checkbuttons. .PP .CS -labelframe .lbl \-text "Steps:" -\fBcheckbutton\fR .c1 \-text Lights \-variable lights -\fBcheckbutton\fR .c2 \-text Cameras \-variable cameras -\fBcheckbutton\fR .c3 \-text Action! \-variable action -pack .c1 .c2 .c3 \-in .lbl +labelframe .lbl -text "Steps:" +\fBcheckbutton\fR .c1 -text Lights -variable lights +\fBcheckbutton\fR .c2 -text Cameras -variable cameras +\fBcheckbutton\fR .c3 -text Action! -variable action +pack .c1 .c2 .c3 -in .lbl pack .lbl .CE .SH "SEE ALSO" diff --git a/doc/chooseColor.n b/doc/chooseColor.n index be24c8e..b485b77 100644 --- a/doc/chooseColor.n +++ b/doc/chooseColor.n @@ -18,17 +18,23 @@ tk_chooseColor \- pops up a dialog box for the user to select a color. The procedure \fBtk_chooseColor\fR pops up a dialog box for the user to select a color. The following \fIoption\-value\fR pairs are possible as command line arguments: +.\" OPTION: -initialcolor .TP \fB\-initialcolor\fI color\fR +. Specifies the color to display in the color dialog when it pops up. \fIcolor\fR must be in a form acceptable to the \fBTk_GetColor\fR function. +.\" OPTION: -parent .TP \fB\-parent\fI window\fR +. Makes \fIwindow\fR the logical parent of the color dialog. The color dialog is displayed on top of its parent window. +.\" OPTION: -title .TP \fB\-title\fI titleString\fR +. Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .LP @@ -39,7 +45,7 @@ string. .SH EXAMPLE .PP .CS -button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"] +button .b -bg [tk_chooseColor -initialcolor gray -title "Choose color"] .CE .SH KEYWORDS color, color selection, dialog diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n index 7de09b5..44e9530 100644 --- a/doc/chooseDirectory.n +++ b/doc/chooseDirectory.n @@ -16,15 +16,19 @@ tk_chooseDirectory \- pops up a dialog box for the user to select a directory. The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the user to select a directory. The following \fIoption\-value\fR pairs are possible as command line arguments: +.\" OPTION: -command .TP \fB\-command\fI string\fR +. Specifies the prefix of a Tcl command to invoke when the user closes the dialog after having selected an item. This callback is not called if the user cancelled the dialog. The actual command consists of \fIstring\fR followed by a space and the value selected by the user in the dialog. This is only available on Mac OS X. +.\" OPTION: -initialdir .TP \fB\-initialdir\fI dirname\fR +. Specifies that the directories in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory @@ -33,33 +37,41 @@ On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. +.\" OPTION: -message .TP \fB\-message\fI string\fR +. Specifies a message to include in the client area of the dialog. This is only available on Mac OS X. +.\" OPTION: -mustexist .TP \fB\-mustexist\fI boolean\fR +. Specifies whether the user may specify non-existent directories. If this parameter is true, then the user may only select directories that already exist. The default value is \fIfalse\fR. +.\" OPTION: -parent .TP \fB\-parent\fI window\fR +. Makes \fIwindow\fR the logical parent of the dialog. The dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window. +.\" OPTION: -title .TP \fB\-title\fI titleString\fR +. Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .SH EXAMPLE .PP .CS set dir [\fBtk_chooseDirectory\fR \e - \-initialdir ~ \-title "Choose a directory"] + -initialdir ~ -title "Choose a directory"] if {$dir eq ""} { - label .l \-text "No directory selected" + label .l -text "No directory selected" } else { - label .l \-text "Selected $dir" + label .l -text "Selected $dir" } .CE .SH "SEE ALSO" diff --git a/doc/clipboard.n b/doc/clipboard.n index 0be7936..587ab34 100644 --- a/doc/clipboard.n +++ b/doc/clipboard.n @@ -125,7 +125,7 @@ proc getItemConfig {canvas tag} { append script {$canvas create } [$canvas type $item] append script { } [$canvas coords $item] { } foreach config [$canvas itemconf $item] { - lassign $config name \- \- \- value + lassign $config name - - - value append script [list $name $value] { } } append script \en @@ -136,10 +136,10 @@ proc getItemConfig {canvas tag} { # Set up a binding on a canvas to cut and paste an item set c [canvas .c] pack $c -$c create text 150 30 \-text "cut and paste me" +$c create text 150 30 -text "cut and paste me" bind $c <> { \fBclipboard clear\fR - \fBclipboard append \-type\fR TkCanvasItem \e + \fBclipboard append -type\fR TkCanvasItem \e [getItemConfig %W current] # Delete because this is cut, not copy. %W delete current @@ -147,7 +147,7 @@ bind $c <> { bind $c <> { catch { set canvas %W - eval [\fBclipboard get \-type\fR TkCanvasItem] + eval [\fBclipboard get -type\fR TkCanvasItem] } } .CE diff --git a/doc/colors.n b/doc/colors.n index 9c64b1d..09c2289 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -896,7 +896,7 @@ systemTextColor . The numbered systemWindowBackgroundColors below are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets -to provide a contrasting background. Each numbered color constrasts +to provide a contrasting background. Each numbered color contrasts with its predecessor. .RS .DS @@ -911,7 +911,6 @@ systemWindowBackgroundColor7 .DE .RE .TP - \fBWindows\fR . On Windows, the following additional system colors are available diff --git a/doc/console.n b/doc/console.n index d3b5f9d..9ca7475 100644 --- a/doc/console.n +++ b/doc/console.n @@ -30,7 +30,8 @@ and stdin is \fB/dev/null\fR (as is the case e.g. when a bundled application embedding Tk is started by the macOS Launcher). To enable the command in that case, define the environment variable \fBTK_CONSOLE\fR. This can be done by modifying the Info.plist file by adding the LSEnvironment key -to the main dict and setting its value to be a dict with the key \fBTK_CONSOLE\fR. +to the main dict and setting its value to be a dict with the key +\fBTK_CONSOLE\fR. .PP .\" METHOD: eval .TP diff --git a/doc/cursors.n b/doc/cursors.n index bf8a05e..7a757f5 100644 --- a/doc/cursors.n +++ b/doc/cursors.n @@ -101,6 +101,7 @@ The \fBnone\fR cursor can be specified to eliminate the cursor. .SH "PORTABILITY ISSUES" .TP \fBWindows\fR +. On Windows systems, the following cursors are mapped to native cursors: .RS .CS @@ -131,6 +132,7 @@ wait .RE .TP \fBMac OS X\fR +. On Mac OS X systems, the following cursors are mapped to native cursors: .RS .CS diff --git a/doc/dialog.n b/doc/dialog.n index e4938d2..f1f63ef 100644 --- a/doc/dialog.n +++ b/doc/dialog.n @@ -19,31 +19,25 @@ tk_dialog \- Create modal dialog and wait for response This procedure is part of the Tk script library. It is largely \fIdeprecated\fR by the \fBtk_messageBox\fR. Its arguments describe a dialog box: -.TP -\fIwindow\fR +.IP \fIwindow\fR Name of top-level window to use for dialog. Any existing window by this name is destroyed. -.TP -\fItitle\fR +.IP \fItitle\fR Text to appear in the window manager's title bar for the dialog. -.TP -\fItext\fR +.IP \fItext\fR Message to appear in the top portion of the dialog box. -.TP -\fIbitmap\fR +.IP \fIbitmap\fR If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap) to display in the top portion of the dialog, to the left of the text. If this is an empty string then no bitmap is displayed in the dialog. -.TP -\fIdefault\fR +.IP \fIdefault\fR If this is an integer greater than or equal to zero, then it gives the index of the button that is to be the default button for the dialog (0 for the leftmost button, and so on). If less than zero or an empty string then there will not be any default button. -.TP -\fIstring\fR +.IP \fIstring\fR There will be one button for each of these arguments. Each \fIstring\fR specifies text to display in a button, in order from left to right. diff --git a/doc/entry.n b/doc/entry.n index f60bc20..747e99c 100644 --- a/doc/entry.n +++ b/doc/entry.n @@ -176,9 +176,9 @@ entry widget from within either the \fB\-validatecommand\fR or the \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the entry widget (for example set it to {}) during validation and still have the \fB\-validate\fR option set, you should -include the command +include the command: .CS -after idle {%W config \-validate %v} +after idle {%W config -validate %v} .CE in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the entry widget from). It is also recommended to not set an @@ -201,32 +201,39 @@ arguments. An index specifies a particular character in the entry's string, in any of the following ways: .TP 12 \fInumber\fR +. Specifies the character as a numerical index, where 0 corresponds to the first character in the string. .TP 12 \fBanchor\fR +. Indicates the anchor point for the selection, which is set with the \fBselect from\fR and \fBselect adjust\fR widget commands. .TP 12 \fBend\fR +. Indicates the character just after the last one in the entry's string. This is equivalent to specifying a numerical index equal to the length of the entry's string. .TP 12 \fBinsert\fR +. Indicates the character adjacent to and immediately following the insertion cursor. .TP 12 \fBsel.first\fR +. Indicates the first character in the selection. It is an error to use this form if the selection is not in the entry window. .TP 12 \fBsel.last\fR +. Indicates the character just after the last one in the selection. It is an error to use this form if the selection is not in the entry window. .TP 12 \fB@\fInumber\fR +. In this form, \fInumber\fR is treated as an x-coordinate in the entry's window; the character spanning that x-coordinate is used. For example, @@ -323,12 +330,14 @@ two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx\fR +. Records \fIx\fR and the current view in the entry window; used in conjunction with later \fBscan dragto\fR commands. Typically this command is associated with a mouse button press in the widget. It returns an empty string. .TP \fIpathName \fBscan dragto \fIx\fR +. This command computes the difference between its \fIx\fR argument and the \fIx\fR argument to the last \fBscan mark\fR command for the widget. It then adjusts the view left or right by 10 times the @@ -340,11 +349,13 @@ value is an empty string. .\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR +. This command is used to adjust the selection within an entry. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection adjust \fIindex\fR +. Locate the end of the selection nearest to the character given by \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR (i.e. including but not going beyond \fIindex\fR). The other @@ -356,20 +367,24 @@ selection anchor point, inclusive. Returns an empty string. .TP \fIpathName \fBselection clear\fR +. Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns an empty string. .TP \fIpathName \fBselection from \fIindex\fR +. Set the selection anchor point to just before the character given by \fIindex\fR. Does not change the selection. Returns an empty string. .TP \fIpathName \fBselection present\fR +. Returns 1 if there is are characters selected in the entry, 0 if nothing is selected. .TP \fIpathName \fBselection range \fIstart end\fR +. Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. @@ -377,6 +392,7 @@ If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the entry's selection is cleared. .TP \fIpathName \fBselection to \fIindex\fR +. If \fIindex\fR is before the anchor point, set the selection to the characters from \fIindex\fR up to but not including the anchor point. diff --git a/doc/event.n b/doc/event.n index a77861c..760efcc 100644 --- a/doc/event.n +++ b/doc/event.n @@ -93,6 +93,7 @@ The following options are supported for the \fBevent generate\fR command. These correspond to the .QW % expansions allowed in binding scripts for the \fBbind\fR command. +.\" OPTION: -above .TP \fB\-above\fI window\fR . @@ -100,6 +101,7 @@ expansions allowed in binding scripts for the \fBbind\fR command. either as a window path name or as an integer window id. Valid for \fBConfigure\fR events. Corresponds to the \fB%a\fR substitution for binding scripts. +.\" OPTION: -borderwidth .TP \fB\-borderwidth\fI size\fR . @@ -107,6 +109,7 @@ Corresponds to the \fB%a\fR substitution for binding scripts. \fIborder_width\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%B\fR substitution for binding scripts. +.\" OPTION: -button .TP \fB\-button\fI number\fR . @@ -114,18 +117,21 @@ Corresponds to the \fB%B\fR substitution for binding scripts. for a \fBButton\fR or \fBButtonRelease\fR event, overriding any button number provided in the base \fIevent\fR argument. Corresponds to the \fB%b\fR substitution for binding scripts. +.\" OPTION: -count .TP \fB\-count\fI number\fR . \fINumber\fR must be an integer; it specifies the \fIcount\fR field for the event. Valid for \fBExpose\fR events. Corresponds to the \fB%c\fR substitution for binding scripts. +.\" OPTION: -data .TP \fB\-data\fI string\fR . \fIString\fR may be any value; it specifies the \fIuser_data\fR field for the event. Only valid for virtual events. Corresponds to the \fB%d\fR substitution for virtual events in binding scripts. +.\" OPTION: -delta .TP \fB\-delta\fI number\fR . @@ -138,6 +144,7 @@ scroll the text widget up 4 lines and \-240 would scroll the text widget down 8 lines. Of course, other widgets may define different behaviors for mouse wheel motion. This field corresponds to the \fB%D\fR substitution for binding scripts. +.\" OPTION: -detail .TP \fB\-detail\fI detail\fR . @@ -155,6 +162,7 @@ Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR and \fBFocusOut\fR events. Corresponds to the \fB%d\fR substitution for binding scripts. .RE +.\" OPTION: -focus .TP \fB\-focus\fI boolean\fR . @@ -162,12 +170,14 @@ Corresponds to the \fB%d\fR substitution for binding scripts. field for the event. Valid for \fBEnter\fR and \fBLeave\fR events. Corresponds to the \fB%f\fR substitution for binding scripts. +.\" OPTION: -height .TP \fB\-height\fI size\fR . \fISize\fR must be a screen distance; it specifies the \fIheight\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%h\fR substitution for binding scripts. +.\" OPTION: -keycode .TP \fB\-keycode\fI number\fR . @@ -175,6 +185,7 @@ Corresponds to the \fB%h\fR substitution for binding scripts. field for the event. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%k\fR substitution for binding scripts. +.\" OPTION: -keysym .TP \fB\-keysym\fI name\fR . @@ -184,6 +195,7 @@ keycode value is used as the \fIkeycode\fR field for event, overriding any detail specified in the base \fIevent\fR argument. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%K\fR substitution for binding scripts. +.\" OPTION: -mode .TP \fB\-mode\fI notify\fR . @@ -193,6 +205,7 @@ one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events. Corresponds to the \fB%m\fR substitution for binding scripts. +.\" OPTION: -override .TP \fB\-override\fI boolean\fR . @@ -200,6 +213,7 @@ Corresponds to the \fB%m\fR substitution for binding scripts. \fIoverride_redirect\fR field for the event. Valid for \fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events. Corresponds to the \fB%o\fR substitution for binding scripts. +.\" OPTION: -place .TP \fB\-place\fI where\fR . @@ -207,6 +221,7 @@ Corresponds to the \fB%o\fR substitution for binding scripts. either \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR. Valid for \fBCirculate\fR events. Corresponds to the \fB%p\fR substitution for binding scripts. +.\" OPTION: -root .TP \fB\-root\fI window\fR . @@ -216,6 +231,7 @@ Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%R\fR substitution for binding scripts. +.\" OPTION: -rootx .TP \fB\-rootx\fI coord\fR . @@ -224,6 +240,7 @@ field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%X\fR substitution for binding scripts. +.\" OPTION: -rooty .TP \fB\-rooty\fI coord\fR . @@ -233,18 +250,21 @@ Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%Y\fR substitution for binding scripts. +.\" OPTION: -sendevent .TP \fB\-sendevent\fI boolean\fR . \fIBoolean\fR must be a boolean value; it specifies the \fIsend_event\fR field for the event. Valid for all events. Corresponds to the \fB%E\fR substitution for binding scripts. +.\" OPTION: -serial .TP \fB\-serial\fI number\fR . \fINumber\fR must be an integer; it specifies the \fIserial\fR field for the event. Valid for all events. Corresponds to the \fB%#\fR substitution for binding scripts. +.\" OPTION: -state .TP \fB\-state\fI state\fR . @@ -257,6 +277,7 @@ For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR, This option overrides any modifiers such as \fBMeta\fR or \fBControl\fR specified in the base \fIevent\fR. Corresponds to the \fB%s\fR substitution for binding scripts. +.\" OPTION: -subwindow .TP \fB\-subwindow\fI window\fR . @@ -265,16 +286,18 @@ as a path name for a Tk widget or as an integer window identifier. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Similar to \fB%S\fR substitution for binding scripts. +.\" OPTION: -time .TP \fB\-time\fI integer\fR . \fIInteger\fR must be an integer value; it specifies the \fItime\fR field -for the event. Additonally the special value \fBcurrent\fR is allowed, +for the event. Additionally, the special value \fBcurrent\fR is allowed; this value will be substituted by the current event time. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR, and \fBProperty\fR events. Corresponds to the \fB%t\fR substitution for binding scripts. +.\" OPTION: -warp .TP \fB\-warp\fI boolean\fR . @@ -283,6 +306,7 @@ the screen pointer should be warped as well. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, and \fBMotion\fR events. The pointer will only warp to a window if it is mapped. +.\" OPTION: -width .TP \fB\-width\fI size\fR . @@ -290,6 +314,7 @@ only warp to a window if it is mapped. for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%w\fR substitution for binding scripts. +.\" OPTION: -when .TP \fB\-when\fI when\fR . @@ -311,6 +336,7 @@ other events already queued with \fB\-when mark\fR. This option is useful when generating a series of events that should be processed in order but at the front of the queue. .RE +.\" OPTION: -x .TP \fB\-x\fI coord\fR . @@ -324,6 +350,7 @@ Corresponds to the \fB%x\fR substitution for binding scripts. If \fIWindow\fR is empty the coordinate is relative to the screen, and this option corresponds to the \fB%X\fR substitution for binding scripts. +.\" OPTION: -y .TP \fB\-y\fI coord\fR . diff --git a/doc/focus.n b/doc/focus.n index 2aebd53..8b50765 100644 --- a/doc/focus.n +++ b/doc/focus.n @@ -114,12 +114,13 @@ you use C code to query the X server directly. To make a window that only participates in the focus traversal ring when a variable is set, add the following bindings to the widgets \fIbefore\fR and \fIafter\fR it in that focus ring: +.PP .CS -button .before \-text "Before" -button .middle \-text "Middle" -button .after \-text "After" -checkbutton .flag \-variable traverseToMiddle \-takefocus 0 -pack .flag \-side left +button .before -text "Before" +button .middle -text "Middle" +button .after -text "After" +checkbutton .flag -variable traverseToMiddle -takefocus 0 +pack .flag -side left pack .before .middle .after bind .before { if {!$traverseToMiddle} { @@ -127,7 +128,7 @@ bind .before { break } } -bind .after { +bind .after { if {!$traverseToMiddle} { \fBfocus\fR .before break diff --git a/doc/focusNext.n b/doc/focusNext.n index 3283d4b..4740346 100644 --- a/doc/focusNext.n +++ b/doc/focusNext.n @@ -12,11 +12,11 @@ .SH NAME tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for managing the input focus. .SH SYNOPSIS +.nf \fBtk_focusNext \fIwindow\fR -.sp \fBtk_focusPrev \fIwindow\fR -.sp \fBtk_focusFollowsMouse\fR +.fi .BE .SH DESCRIPTION .PP @@ -49,7 +49,8 @@ Tk will automatically give it the input focus. The \fBfocus\fR command may be used to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to that window. -Note: at present there is no built-in support for returning the +.PP +Note that at present there is no built-in support for returning the application to an explicit focus model; to do this you will have to write a script that deletes the bindings created by \fBtk_focusFollowsMouse\fR. diff --git a/doc/font.n b/doc/font.n index ac503a1..c479e48 100644 --- a/doc/font.n +++ b/doc/font.n @@ -209,16 +209,19 @@ horizontal line where the bottom of most letters line up; certain letters, such as lower-case .QW g stick below the baseline. +.\" OPTION: -ascent .TP -\fB\-ascent \0\fR +\fB\-ascent\fR . The amount in pixels that the tallest letter sticks up above the baseline of the font, plus any extra blank space added by the designer of the font. +.\" OPTION: -descent .TP -\fB\-descent \0\fR +\fB\-descent\fR . The largest amount in pixels that any letter sticks down below the baseline of the font, plus any extra blank space added by the designer of the font. +.\" OPTION: -linespace .TP \fB\-linespace\fR . @@ -226,8 +229,9 @@ Returns how far apart vertically in pixels two lines of text using the same font should be placed so that none of the characters in one line overlap any of the characters in the other line. This is generally the sum of the ascent above the baseline line plus the descent below the baseline. +.\" OPTION: -fixed .TP -\fB\-fixed \0\fR +\fB\-fixed\fR . Returns a boolean flag that is .QW \fB1\fR @@ -244,6 +248,7 @@ included when calculating this value. The following options are supported on all platforms, and are used when constructing a named font or when specifying a font using style [5] as above: +.\" OPTION: -family .TP \fB\-family \fIname\fR . @@ -260,6 +265,7 @@ The \fIname\fR may also be the name of a native, platform-specific font family; in that case it will work as desired on one platform but may not display correctly on other platforms. If the family is unspecified or unrecognized, a platform-specific default font will be chosen. +.\" OPTION: -size .TP \fB\-size \fIsize\fR . @@ -279,6 +285,7 @@ to a fixed-size bitmap. The mapping between points and pixels is set when the application starts, based on properties of the installed monitor, but it can be overridden by calling the \fBtk scaling\fR command. .RE +.\" OPTION: -weight .TP \fB\-weight \fIweight\fR . @@ -286,20 +293,26 @@ The nominal thickness of the characters in the font. The value \fBnormal\fR specifies a normal weight font, while \fBbold\fR specifies a bold font. The closest available weight to the one specified will be chosen. The default weight is \fBnormal\fR. +.\" OPTION: -slant .TP \fB\-slant \fIslant\fR +. The amount the characters in the font are slanted away from the vertical. Valid values for slant are \fBroman\fR and \fBitalic\fR. A roman font is the normal, upright appearance of a font, while an italic font is one that is tilted some number of degrees from upright. The closest available slant to the one specified will be chosen. The default slant is \fBroman\fR. +.\" OPTION: -underline .TP \fB\-underline \fIboolean\fR +. The value is a boolean flag that specifies whether characters in this font should be underlined. The default value for underline is \fBfalse\fR. +.\" OPTION: -overstrike .TP \fB\-overstrike \fIboolean\fR +. The value is a boolean flag that specifies whether a horizontal line should be drawn through the middle of characters in this font. The default value for overstrike is \fBfalse\fR. @@ -307,41 +320,23 @@ for overstrike is \fBfalse\fR. .PP The following named fonts are supported on all systems, and default to values that match appropriate system defaults. -.TP -\fBTkDefaultFont\fR -. +.IP \fBTkDefaultFont\fR This font is the default for all GUI items not otherwise specified. -.TP -\fBTkTextFont\fR -. +.IP \fBTkTextFont\fR This font should be used for user text in entry widgets, listboxes etc. -.TP -\fBTkFixedFont\fR -. +.IP \fBTkFixedFont\fR This font is the standard fixed-width font. -.TP -\fBTkMenuFont\fR -. +.IP \fBTkMenuFont\fR This font is used for menu items. -.TP -\fBTkHeadingFont\fR -. +.IP \fBTkHeadingFont\fR This font should be used for column headings in lists and tables. -.TP -\fBTkCaptionFont\fR -. +.IP \fBTkCaptionFont\fR This font should be used for window and dialog caption bars. -.TP -\fBTkSmallCaptionFont\fR -. +.IP \fBTkSmallCaptionFont\fR This font should be used for captions on contained windows or tool dialogs. -.TP -\fBTkIconFont\fR -. +.IP \fBTkIconFont\fR This font should be used for icon captions. -.TP -\fBTkTooltipFont\fR -. +.IP \fBTkTooltipFont\fR This font should be used for tooltip windows (transient information windows). .LP It is \fInot\fR advised to change these fonts, as they may be modified by Tk @@ -352,9 +347,11 @@ modify that. The following system fonts are supported: .TP \fBX Windows\fR +. All valid X font names, including those listed by xlsfonts(1), are available. .TP \fBMS Windows\fR +. The following fonts are supported, and are mapped to the user's style defaults. .RS @@ -366,6 +363,7 @@ style defaults. .RE .TP \fBMac OS X\fR +. The following fonts are supported, and are mapped to the user's style defaults. .RS @@ -395,17 +393,17 @@ theme fonts: Fill a text widget with lots of font demonstrators, one for every font family installed on your system: .CS -pack [text .t \-wrap none] \-fill both \-expand 1 +pack [text .t -wrap none] -fill both -expand 1 set count 0 set tabwidth 0 -foreach family [lsort \-dictionary [\fBfont families\fR]] { - .t tag configure f[incr count] \-font [list $family 10] - .t insert end ${family}:\\t {} \e +foreach family [lsort -dictionary [\fBfont families\fR]] { + .t tag configure f[incr count] -font [list $family 10] + .t insert end ${family}:\et {} \e "This is a simple sampler\en" f$count - set w [\fBfont measure\fR [.t cget \-font] ${family}:] - if {$w+5 > $tabwidth} { - set tabwidth [expr {$w+5}] - .t configure \-tabs $tabwidth + set w [\fBfont measure\fR [.t cget -font] ${family}:] + if {$w + 5 > $tabwidth} { + set tabwidth [expr {$w + 5}] + .t configure -tabs $tabwidth } } .CE diff --git a/doc/fontchooser.n b/doc/fontchooser.n index 02c2d61..4e667e5 100644 --- a/doc/fontchooser.n +++ b/doc/fontchooser.n @@ -11,11 +11,11 @@ .SH NAME fontchooser \- control font selection dialog .SH SYNOPSIS +.nf \fBtk fontchooser\fR \fBconfigure\fR ?\fI\-option value ...\fR? -.sp \fBtk fontchooser\fR \fBshow\fR -.sp \fBtk fontchooser\fR \fBhide\fR +.fi .BE .SH DESCRIPTION .PP @@ -50,24 +50,32 @@ Hide the font selection dialog if it is visible and cause any pending \fBtk fontchooser\fR \fBshow\fR command to return. .PP .SH "CONFIGURATION OPTIONS" +.\" OPTION: -parent .TP \fB\-parent\fR +. Specifies/returns the logical parent window of the font selection dialog (similar to the \fB\-parent\fR option to other dialogs). The font selection dialog is hidden if it is visible when the parent window is destroyed. +.\" OPTION: -title .TP \fB\-title\fR +. Specifies/returns the title of the dialog. Has no effect on platforms where the font selection dialog does not support titles. +.\" OPTION: -font .TP \fB\-font\fR +. Specifies/returns the font that is currently selected in the dialog if it is visible, or that will be initially selected when the dialog is shown (if supported by the platform). Can be set to the empty string to indicate that no font should be selected. Fonts can be specified in any form given by the "FONT DESCRIPTION" section in the \fBfont\fR manual page. +.\" OPTION: -command .TP \fB\-command\fR +. Specifies/returns the command prefix to be called when a font selection has been made by the user. The command prefix is evaluated at the global level after having the specification of the selected font appended. On platforms @@ -77,8 +85,10 @@ evaluation. Can be set to the empty string to indicate that no callback should be invoked. Fonts are specified by a list of form [3] of the "FONT DESCRIPTION" section in the \fBfont\fR manual page (i.e. a list of the form \fI{family size style ?style ...?}\fR). +.\" OPTION: -visible .TP \fB\-visible\fR +. Read-only option that returns a boolean indicating whether the font selection dialog is currently visible. Attempting to set this option results in an error. @@ -86,6 +96,7 @@ dialog is currently visible. Attempting to set this option results in an error. .SH "VIRTUAL EVENTS" .TP \fB<>\fR +. Sent to the dialog parent whenever the visibility of the font selection dialog changes, both as a result of user action (e.g. disposing of the dialog via OK/Cancel button or close box) and of the \fBtk fontchooser\fR @@ -94,6 +105,7 @@ current visibility of the dialog by querying the \fB\-visible\fR configuration option. .TP \fB<>\fR +. Sent to the dialog parent whenever the font selection dialog is visible and the selected font changes, both as a result of user action and of the \fB\-font\fR configuration option being set. Binding scripts can determine the currently @@ -142,36 +154,36 @@ to ensure its selected font matches the new value of the named font. .CS proc fontchooserDemo {} { wm title . "Font Chooser Demo" - \fBtk fontchooser\fR \fBconfigure\fR \-parent . - button .b \-command fontchooserToggle \-takefocus 0 + \fBtk fontchooser\fR \fBconfigure\fR -parent . + button .b -command fontchooserToggle -takefocus 0 fontchooserVisibility .b - bind . \fB<>\fR \\ + bind . \fB<>\fR \e [list fontchooserVisibility .b] foreach w {.t1 .t2} { - text $w \-width 20 \-height 4 \-borderwidth 1 \-relief solid + text $w -width 20 -height 4 -borderwidth 1 -relief solid bind $w [list fontchooserFocus $w] $w insert end "Text Widget $w" } - .t1 configure \-font {Courier 14} - .t2 configure \-font {Times 16} + .t1 configure -font {Courier 14} + .t2 configure -font {Times 16} pack .b .t1 .t2; focus .t1 } proc fontchooserToggle {} { \fBtk fontchooser\fR [expr { - [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ? + [\fBtk fontchooser\fR \fBconfigure\fR -visible] ? "\fBhide\fR" : "\fBshow\fR"}] } proc fontchooserVisibility {w} { - $w configure \-text [expr { - [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ? + $w configure -text [expr { + [\fBtk fontchooser\fR \fBconfigure\fR -visible] ? "Hide Font Dialog" : "Show Font Dialog"}] } proc fontchooserFocus {w} { - \fBtk fontchooser\fR \fBconfigure\fR \-font [$w cget \-font] \\ - \-command [list fontchooserFontSelection $w] + \fBtk fontchooser\fR \fBconfigure\fR -font [$w cget -font] \e + -command [list fontchooserFontSelection $w] } proc fontchooserFontSelection {w font args} { - $w configure \-font [font actual $font] + $w configure -font [font actual $font] } fontchooserDemo .CE diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n index 747145d..757d91f 100644 --- a/doc/getOpenFile.n +++ b/doc/getOpenFile.n @@ -34,19 +34,24 @@ whether the existing file should be overwritten or not. .PP The following \fIoption\-value\fR pairs are possible as command line arguments to these two commands: +.\" OPTION: -command .TP \fB\-command\fI string\fR +. Specifies the prefix of a Tcl command to invoke when the user closes the dialog after having selected an item. This callback is not called if the user cancelled the dialog. The actual command consists of \fIstring\fR followed by a space and the value selected by the user in the dialog. This is only available on Mac OS X. +.\" OPTION: -confirmoverwrite .TP \fB\-confirmoverwrite\fI boolean\fR +. Configures how the Save dialog reacts when the selected file already exists, and saving would overwrite it. A true value requests a confirmation dialog be presented to the user. A false value requests that the overwrite take place without confirmation. Default value is true. +.\" OPTION: -defaultextension .TP \fB\-defaultextension\fI extension\fR . @@ -57,6 +62,7 @@ any case. This option is ignored on Mac OS X, which does not require extensions to filenames, and the UNIX implementation guesses reasonable values for this from the \fB\-filetypes\fR option when this is not supplied. +.\" OPTION: -filetypes .TP \fB\-filetypes\fI filePatternList\fR . @@ -68,6 +74,7 @@ empty list, or if the \fBFile types\fR listbox is not supported by the particular platform then all files are listed regardless of their types. See the section \fBSPECIFYING FILE PATTERNS\fR below for a discussion on the contents of \fIfilePatternList\fR. +.\" OPTION: -initialdir .TP \fB\-initialdir\fI directory\fR . @@ -79,30 +86,36 @@ On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. +.\" OPTION: -initialfile .TP \fB\-initialfile\fI filename\fR . Specifies a filename to be displayed in the dialog when it pops up. +.\" OPTION: -message .TP \fB\-message\fI string\fR . Specifies a message to include in the client area of the dialog. This is only available on Mac OS X. +.\" OPTION: -multiple .TP \fB\-multiple\fI boolean\fR . Allows the user to choose multiple files from the Open dialog. +.\" OPTION: -parent .TP \fB\-parent\fI window\fR . Makes \fIwindow\fR the logical parent of the file dialog. The file dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window. +.\" OPTION: -title .TP \fB\-title\fI titleString\fR . Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title is displayed. +.\" OPTION: -typevariable .TP \fB\-typevariable\fI variableName\fR . @@ -192,7 +205,7 @@ set types { {{GIF Files} {} GIFF} {{All Files} * } } -set filename [\fBtk_getOpenFile\fR \-filetypes $types] +set filename [\fBtk_getOpenFile\fR -filetypes $types] if {$filename ne ""} { # Open the file ... diff --git a/doc/grab.n b/doc/grab.n index 72bc8ee..fc4ce02 100644 --- a/doc/grab.n +++ b/doc/grab.n @@ -12,9 +12,10 @@ .SH NAME grab \- Confine pointer and keyboard events to a window sub-tree .SH SYNOPSIS +.nf \fBgrab \fR?\fB\-global\fR? \fIwindow\fR -.sp \fBgrab \fIoption \fR?\fIarg \fR...? +.fi .BE .SH DESCRIPTION .PP @@ -83,6 +84,7 @@ grab on a given display at once. The \fBgrab\fR command can take any of the following forms: .TP \fBgrab \fR?\fB\-global\fR? \fIwindow\fR +. Same as \fBgrab set\fR, described below. .\" METHOD: current .TP @@ -144,9 +146,9 @@ Set a grab so that only one button may be clicked out of a group. The other buttons are unresponsive to the mouse until the middle button is clicked. .CS -pack [button .b1 \-text "Click me! #1" \-command {destroy .b1}] -pack [button .b2 \-text "Click me! #2" \-command {destroy .b2}] -pack [button .b3 \-text "Click me! #3" \-command {destroy .b3}] +pack [button .b1 -text "Click me! #1" -command {destroy .b1}] +pack [button .b2 -text "Click me! #2" -command {destroy .b2}] +pack [button .b3 -text "Click me! #3" -command {destroy .b3}] \fBgrab\fR .b2 .CE .SH "SEE ALSO" diff --git a/doc/grid.n b/doc/grid.n index 3bcfd3f..eaeaf41 100644 --- a/doc/grid.n +++ b/doc/grid.n @@ -85,7 +85,7 @@ If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of -.QW "\-option value" +.QW "\fI\-option value\fR" pairs. .\" METHOD: configure .TP @@ -100,6 +100,7 @@ location of a \fIwindow\fR, as described in the \fBRELATIVE PLACEMENT\fR section, below. The following options are supported: .RS +.\" OPTION: -column .TP \fB\-column \fIn\fR . @@ -112,6 +113,7 @@ if it is the first window. For each \fBx\fR that immediately precedes the \fIwindow\fR, the column position is incremented by one. Thus the \fBx\fR represents a blank column for this row in the grid. +.\" OPTION: -columnspan .TP \fB\-columnspan \fIn\fR . @@ -119,12 +121,14 @@ Insert the window so that it occupies \fIn\fR columns in the grid. The default is one column, unless the window name is followed by a \fB\-\fR, in which case the columnspan is incremented once for each immediately following \fB\-\fR. +.\" OPTION: -in .TP \fB\-in \fIcontainer\fR . Insert the window(s) in the container window given by \fIcontainer\fR. The default is the first window's parent window. +.\" OPTION: -ipadx .TP \fB\-ipadx \fIamount\fR . @@ -133,6 +137,7 @@ leave on each side of the content. This is space is added inside the content border. The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. +.\" OPTION: -ipady .TP \fB\-ipady \fIamount\fR . @@ -140,6 +145,7 @@ The \fIamount\fR specifies how much vertical internal padding to leave on the top and bottom of the content. This space is added inside the content border. The \fIamount\fR defaults to 0. +.\" OPTION: -padx .TP \fB\-padx \fIamount\fR . @@ -149,6 +155,7 @@ leave on each side of the content, in screen units. of two values to specify padding for left and right separately. The \fIamount\fR defaults to 0. This space is added outside the content border. +.\" OPTION: -pady .TP \fB\-pady \fIamount\fR . @@ -158,6 +165,7 @@ leave on the top and bottom of the content, in screen units. of two values to specify padding for top and bottom separately. The \fIamount\fR defaults to 0. This space is added outside the content border. +.\" OPTION: -row .TP \fB\-row \fIn\fR . @@ -166,6 +174,7 @@ Row numbers start with 0. If this option is not supplied, then the content is arranged on the same row as the previous content specified on this call to \fBgrid\fR, or the next row after the highest occupied row if this is the first content. +.\" OPTION: -rowspan .TP \fB\-rowspan \fIn\fR . @@ -174,6 +183,7 @@ The default is one row. If the next \fBgrid\fR command contains \fB^\fR characters instead of \fIcontent\fR that line up with the columns of this \fIcontent\fR, then the \fBrowspan\fR of this \fIcontent\fR is extended by one. +.\" OPTION: -sticky .TP \fB\-sticky \fIstyle\fR . @@ -219,8 +229,8 @@ default settings are used. .RS .PP .VS "TIP 518" -If the last content window of the container becomes unmanaged, this will also send -the virtual event \fB<>\fR to the container; the container +If the last content window of the container becomes unmanaged, this will also +send the virtual event \fB<>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE @@ -238,10 +248,10 @@ where \fIcontainer\fR is the windows's container window. .TP \fBgrid location \fIwindow x y\fR . -Given \fIx\fR and \fIy\fR values in screen units relative to the container window, -the column and row number at that \fIx\fR and \fIy\fR location is returned. -For locations that are above or to the left of the grid, \fB\-1\fR is -returned. +Given \fIx\fR and \fIy\fR values in screen units relative to the container +window, the column and row number at that \fIx\fR and \fIy\fR location is +returned. For locations that are above or to the left of the grid, \fB\-1\fR +is returned. .\" METHOD: propagate .TP \fBgrid propagate \fIwindow\fR ?\fIboolean\fR? @@ -255,7 +265,10 @@ In either of these cases an empty string is returned. If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIwindow\fR. +.RS +.PP Propagation is enabled by default. +.RE .\" METHOD: rowconfigure .TP \fBgrid rowconfigure \fIwindow index \fR?\fI\-option value...\fR? @@ -267,9 +280,9 @@ and \fB\-pad\fR. If one or more options are provided, then \fIindex\fR may be given as a list of row indices to which the configuration options will operate on. Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR -the options apply to all rows currently occupied by content windows. For -a window name, that window must be a content window of this container and the options -apply to all rows currently occupied by the container window. +the options apply to all rows currently occupied by content windows. For a +window name, that window must be a content window of this container and the +options apply to all rows currently occupied by the container window. The \fB\-minsize\fR option sets the minimum size, in screen units, that will be permitted for this row. The \fB\-weight\fR option (an integer value) @@ -307,9 +320,9 @@ geometry manager, the previous values are retained. .RS .PP .VS "TIP 518" -If the last content window of the container becomes unmanaged, this will also send -the virtual event \fB<>\fR to the container; the container -may choose to resize itself (or otherwise respond) to such a change. +If the last content window of the container becomes unmanaged, this will also +send the virtual event \fB<>\fR to the container; the +container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE .\" METHOD: size @@ -341,21 +354,15 @@ relative to other \fIcontent\fRs in the same grid command, and the presence of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR command where \fIcontent\fR names are normally expected. .RS -.TP -\fB\-\fR -. +.IP \fB\-\fR This increases the \fB\-columnspan\fR of the \fIcontent\fR to the left. Several -\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR -may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIcontent\fR -argument to \fBgrid configure\fR. -.TP -\fBx\fR -. +\fB\-\fR's in a row will successively increase the number of columns spanned. +A \fB\-\fR may not follow a \fB^\fR or a \fBx\fR, nor may it be the first +\fIcontent\fR argument to \fBgrid configure\fR. +.IP \fBx\fR This leaves an empty column between the \fIcontent\fR on the left and the \fIcontent\fR on the right. -.TP -\fB^\fR -. +.IP \fB^\fR This extends the \fB\-rowspan\fR of the \fIcontent\fR above the \fB^\fR's in the grid. The number of \fB^\fR's in a row must match the number of columns spanned by the \fIcontent\fR above it. @@ -372,8 +379,8 @@ away from the layout as needed. For the final step, each content is positioned in its row(s) and column(s) based on the setting of its \fIsticky\fR flag. .PP -To compute the minimum size of a layout, the grid geometry manager -first looks at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, +To compute the minimum size of a layout, the grid geometry manager first looks +at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, and computes the nominal size of each row or column to be either the \fIminsize\fR for that row or column, or the sum of the \fIpad\fRding plus the size of the largest content, whichever is greater. After that @@ -454,17 +461,17 @@ A toplevel window containing a text widget and two scrollbars: .CS # Make the widgets toplevel .t -text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set} -scrollbar .t.v \-orient vertical \-command {.t.txt yview} -scrollbar .t.h \-orient horizontal \-command {.t.txt xview} +text .t.txt -wrap none -xscroll {.t.h set} -yscroll {.t.v set} +scrollbar .t.v -orient vertical -command {.t.txt yview} +scrollbar .t.h -orient horizontal -command {.t.txt xview} # Lay them out -\fBgrid\fR .t.txt .t.v \-sticky nsew -\fBgrid\fR .t.h \-sticky nsew +\fBgrid\fR .t.txt .t.v -sticky nsew +\fBgrid\fR .t.h -sticky nsew # Tell the text widget to take all the extra room -\fBgrid rowconfigure\fR .t .t.txt \-weight 1 -\fBgrid columnconfigure\fR .t .t.txt \-weight 1 +\fBgrid rowconfigure\fR .t .t.txt -weight 1 +\fBgrid columnconfigure\fR .t .t.txt -weight 1 .CE .PP Three widgets of equal width, despite their different @@ -472,12 +479,12 @@ Three widgets of equal width, despite their different widths: .PP .CS -button .b \-text "Foo" -entry .e \-textvariable foo ; set foo "Hello World!" -label .l \-text "This is a fairly long piece of text" +button .b -text "Foo" +entry .e -textvariable foo ; set foo "Hello World!" +label .l -text "This is a fairly long piece of text" -\fBgrid\fR .b .e .l \-sticky ew -\fBgrid columnconfigure\fR . "all" \-uniform allTheSame +\fBgrid\fR .b .e .l -sticky ew +\fBgrid columnconfigure\fR . "all" -uniform allTheSame .CE .SH "SEE ALSO" pack(n), place(n) diff --git a/doc/image.n b/doc/image.n index 9946544..0d14e02 100644 --- a/doc/image.n +++ b/doc/image.n @@ -99,21 +99,15 @@ page for the particular image type for details. The following image types are defined by Tk so they will be available in any Tk application. Individual applications or extensions may define additional types. -.TP -\fBbitmap\fR -. +.IP \fBbitmap\fR Each pixel in the image displays a foreground color, a background color, or nothing. See the \fBbitmap\fR manual entry for more information. -.TP -\fBphoto\fR -. +.IP \fBphoto\fR Displays a variety of full-color images, using dithering to approximate colors on displays with limited color capabilities. See the \fBphoto\fR manual entry for more information. -.TP -\fBnsimage\fR -. +.IP \fBnsimage\fR This type is only available in the Aqua platform. It is a full-color image which may be created from a named system image. It has options designed to facilitate the use of these images in buttons. An diff --git a/doc/label.n b/doc/label.n index 5d28e31..e50f8b1 100644 --- a/doc/label.n +++ b/doc/label.n @@ -112,18 +112,18 @@ labels are not intended to be interactive. .PP .CS # Make the widgets -\fBlabel\fR .t \-text "This widget is at the top" \-bg red -\fBlabel\fR .b \-text "This widget is at the bottom" \-bg green -\fBlabel\fR .l \-text "Left\enHand\enSide" -\fBlabel\fR .r \-text "Right\enHand\enSide" +\fBlabel\fR .t -text "This widget is at the top" -bg red +\fBlabel\fR .b -text "This widget is at the bottom" -bg green +\fBlabel\fR .l -text "Left\enHand\enSide" +\fBlabel\fR .r -text "Right\enHand\enSide" text .mid \&.mid insert end "This layout is like Java's BorderLayout" # Lay them out -pack .t \-side top \-fill x -pack .b \-side bottom \-fill x -pack .l \-side left \-fill y -pack .r \-side right \-fill y -pack .mid \-expand 1 \-fill both +pack .t -side top -fill x +pack .b -side bottom -fill x +pack .l -side left -fill y +pack .r -side right -fill y +pack .mid -expand 1 -fill both .CE .SH "SEE ALSO" labelframe(n), button(n), ttk::label(n) diff --git a/doc/labelframe.n b/doc/labelframe.n index da8eab9..4d3aacb 100644 --- a/doc/labelframe.n +++ b/doc/labelframe.n @@ -136,10 +136,10 @@ This shows how to build part of a GUI for a hamburger vendor. The the kinds of things that the choices are being made over. .PP .CS -grid [\fBlabelframe\fR .burger \-text "Burger"] \e - [\fBlabelframe\fR .bun \-text "Bun"] \-sticky news -grid [\fBlabelframe\fR .cheese \-text "Cheese Option"] \e - [\fBlabelframe\fR .pickle \-text "Pickle Option"] \-sticky news +grid [\fBlabelframe\fR .burger -text "Burger"] \e + [\fBlabelframe\fR .bun -text "Bun"] -sticky news +grid [\fBlabelframe\fR .cheese -text "Cheese Option"] \e + [\fBlabelframe\fR .pickle -text "Pickle Option"] -sticky news foreach {type name val} { burger Beef beef burger Lamb lamb @@ -161,9 +161,9 @@ foreach {type name val} { pickle Onions onion pickle Chili chili } { - set w [radiobutton .$type.$val \-text $name \-anchor w \e - \-variable $type \-value $val] - pack $w \-side top \-fill x + set w [radiobutton .$type.$val -text $name -anchor w \e + -variable $type -value $val] + pack $w -side top -fill x } set burger beef set bun white diff --git a/doc/listbox.n b/doc/listbox.n index 68f6e80..e1ac2de 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -95,37 +95,28 @@ Many of the widget commands for listboxes take one or more indices as arguments. An index specifies a particular element of the listbox, in any of the following ways: -.TP 12 -\fInumber\fR -. +.IP \fInumber\fR 12 Specifies the element as a numerical index, where 0 corresponds to the first element in the listbox. -.TP 12 -\fBactive\fR -. +.IP \fBactive\fR 12 Indicates the element that has the location cursor. This element will be displayed as specified by \fB\-activestyle\fR when the listbox has the keyboard focus, and it is specified with the \fBactivate\fR widget command. -.TP 12 -\fBanchor\fR -. +.IP \fBanchor\fR 12 Indicates the anchor point for the selection, which is set with the \fBselection anchor\fR widget command. -.TP 12 -\fBend\fR -. +.IP \fBend\fR 12 Indicates the end of the listbox. For most commands this refers to the last element in the listbox, but for a few commands such as \fBindex\fR and \fBinsert\fR it refers to the element just after the last one. -.TP 12 -\fB@\fIx\fB,\fIy\fR +.IP \fB@\fIx\fB,\fIy\fR 12 Indicates the element that covers the point in the listbox window specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no element covers that point, then the closest element to that point is used. -.LP +.PP Indexes support the same simple interpretation as for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. @@ -260,22 +251,26 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. The following options are currently supported for items: .RS +.\" OPTION: -background .TP \fB\-background \fIcolor\fR . \fIColor\fR specifies the background color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. +.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR . \fIColor\fR specifies the foreground color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. +.\" OPTION: -selectbackground .TP \fB\-selectbackground \fIcolor\fR . \fIcolor\fR specifies the background color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. +.\" OPTION: -selectforeground .TP \fB\-selectforeground \fIcolor\fR . @@ -426,6 +421,7 @@ It can take any of the following forms: .RS .TP \fIpathName \fByview\fR +. Returns a list containing two elements, both of which are real fractions between 0 and 1. The first element gives the position of the listbox element at the diff --git a/doc/menu.n b/doc/menu.n index 40ebf8c..9894a6c 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -15,6 +15,7 @@ menu, tk_menuSetFocus \- Create and manipulate 'menu' widgets and menubars .nf \fBmenu\fI pathName \fR?\fIoptions\fR? \fBtk_menuSetFocus\fI pathName\fR +.fi .SO \-activebackground \-borderwidth \-foreground \-activeborderwidth \-cursor \-relief @@ -312,52 +313,36 @@ Many of the widget commands for a menu take as one argument an indicator of which entry of the menu to operate on. These indicators are called \fIindex\fRes and may be specified in any of the following forms: -.TP 12 -\fBactive\fR -. +.IP \fBactive\fR 12 Indicates the entry that is currently active. If no entry is active then this form is equivalent to \fB{}\fR. This form may not be abbreviated. -.TP 12 -\fBend\fR -. +.IP \fBend\fR 12 Indicates the bottommost entry in the menu. If there are no entries in the menu then this form is equivalent to \fB{}\fR. This form may not be abbreviated. -.TP 12 -\fBlast\fR -. +.IP \fBlast\fR 12 Same as \fBend\fR. -.TP 12 -\fB{}\fR -. +.IP \fB{}\fR 12 Indicates .QW "no entry at all" ; this is used most commonly with the \fBactivate\fR option to deactivate all the entries in the menu. In most cases the specification of \fB{}\fR causes nothing to happen in the widget command. -.TP 12 -\fB@\fIx\fB,\fIy\fR -. +.IP \fB@\fIx\fB,\fIy\fR 12 Indicates the entry that covers the point in the menu's window specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no entry covers that point, then this form is equivalent to \fB{}\fR. If only a single number is specified, it is treated as the y-coordinate. -.TP 12 -\fInumber\fR -. +.IP \fInumber\fR 12 Specifies the entry numerically, where 0 corresponds to the top-most entry of the menu, 1 to the entry below it, and so on. -.TP 12 -\fIid\fR -. +.IP \fIid\fR 12 If the index does not satisfy one of the above forms then the menu is searched for an entry with the specified id. -.TP 12 -\fIpattern\fR -. +.IP \fIpattern\fR 12 If all of the above methods for finding an entry fail, this form is used. \fIPattern\fR is pattern-matched against the label of each entry in the menu, in order from the top down, until a @@ -555,6 +540,7 @@ window of the topmost pixel in the entry specified by \fIindex\fR. .SH "MENU ENTRY OPTIONS" The following options are allowed on menu entries. Most options are not supported by all entry types. +.\" OPTION: -activebackground .TP \fB\-activebackground \fIvalue\fR . @@ -566,6 +552,7 @@ If the \fBtk_strictMotif\fR variable has been set to request strict Motif compliance, then this option is ignored and the \fB\-background\fR option is used in its place. This option is not available for separator or tear-off entries. +.\" OPTION: -activeforeground .TP \fB\-activeforeground \fIvalue\fR . @@ -573,7 +560,7 @@ Specifies a foreground color to use for displaying this entry when it is active. This option is ignored on Aqua/macOS. If this option is specified as an empty string (the default), then the \fB\-activeforeground\fR option for the overall menu is used. -This option is not available for separator or tear-off entries. +.\" OPTION: -accelerator .TP \fB\-accelerator \fIvalue\fR . @@ -583,6 +570,7 @@ used to invoke the same function as the menu entry. This is a display option, it does not actually set the corresponding binding (which can be achieved using the \fBbind\fR command). This option is not available for separator or tear-off entries. +.\" OPTION: -background .TP \fB\-background \fIvalue\fR . @@ -592,6 +580,7 @@ This option is ignored on Aqua/macOS. If it is specified as an empty string (the default), then the \fB\-background\fR option for the overall menu is used. This option is not available for separator or tear-off entries. +.\" OPTION: -bitmap .TP \fB\-bitmap \fIvalue\fR . @@ -604,6 +593,7 @@ to an empty string to enable a textual label to be displayed. If a \fB\-image\fR option has been specified, it overrides \fB\-bitmap\fR. This option is not available for separator or tear-off entries. +.\" OPTION: -columnbreak .TP \fB\-columnbreak \fIvalue\fR . @@ -612,11 +602,13 @@ this option is one, the entry appears at the top of a new column in the menu. This option is ignored on Aqua/macOS, where menus are always a single column. +.\" OPTION: -command .TP \fB\-command \fIvalue\fR . Specifies a Tcl command to execute when the menu entry is invoked. Not available for separator or tear-off entries. +.\" OPTION: -compound .TP \fB\-compound \fIvalue\fR . @@ -627,6 +619,7 @@ Valid values for this option are \fBbottom\fR, \fBcenter\fR, is \fBnone\fR, meaning that the button will display either an image or text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR options. +.\" OPTION: -font .TP \fB\-font \fIvalue\fR . @@ -635,6 +628,7 @@ string in this entry. If this option is specified as an empty string (the default) then the \fB\-font\fR option for the overall menu is used. This option is not available for separator or tear-off entries. +.\" OPTION: -foreground .TP \fB\-foreground \fIvalue\fR . @@ -644,6 +638,7 @@ This option is ignored on Aqua/macOS. If it is specified as an empty string (the default), then the \fB\-foreground\fR option for the overall menu is used. This option is not available for separator or tear-off entries. +.\" OPTION: -hidemargin .TP \fB\-hidemargin \fIvalue\fR . @@ -651,6 +646,7 @@ Specifies whether the standard margins should be drawn for this menu entry. This is useful when creating palette with images in them, i.e., color palettes, pattern palettes, etc. 1 indicates that the margin for the entry is hidden; 0 means that the margin is used. +.\" OPTION: -image .TP \fB\-image \fIvalue\fR . @@ -663,34 +659,40 @@ This option overrides the \fB\-label\fR and \fB\-bitmap\fR options but may be reset to an empty string to enable a textual or bitmap label to be displayed. This option is not available for separator or tear-off entries. +.\" OPTION: -indicatoron .TP \fB\-indicatoron \fIvalue\fR . Available only for checkbutton and radiobutton entries. \fIValue\fR is a boolean that determines whether or not the indicator should be displayed. +.\" OPTION: -label .TP \fB\-label \fIvalue\fR . Specifies a string to display as an identifying label in the menu entry. Not available for separator or tear-off entries. +.\" OPTION: -menu .TP \fB\-menu \fIvalue\fR . Available only for cascade entries. Specifies the path name of the submenu associated with this entry. The submenu must be a child of the menu. +.\" OPTION: -offvalue .TP \fB\-offvalue \fIvalue\fR . Available only for checkbutton entries. Specifies the value to store in the entry's associated variable when the entry is deselected. +.\" OPTION: -onvalue .TP \fB\-onvalue \fIvalue\fR . Available only for checkbutton entries. Specifies the value to store in the entry's associated variable when the entry is selected. +.\" OPTION: -selectcolor .TP \fB\-selectcolor \fIvalue\fR . @@ -699,6 +701,7 @@ Specifies the color to display in the indicator when the entry is selected. If the value is an empty string (the default) then the \fB\-selectcolor\fR option for the menu determines the indicator color. +.\" OPTION: -selectimage .TP \fB\-selectimage \fIvalue\fR . @@ -709,6 +712,7 @@ the \fB\-image\fR option) when it is selected. by some previous invocation of \fBimage create\fR. This option is ignored unless the \fB\-image\fR option has been specified. +.\" OPTION: -state .TP \fB\-state \fIvalue\fR . @@ -726,6 +730,7 @@ In this state the entry is displayed according to the \fB\-disabledforeground\fR option for the menu and the \fB\-background\fR option from the entry. This option is not available for separator entries. +.\" OPTION: -underline .TP \fB\-underline \fIvalue\fR . @@ -736,6 +741,7 @@ implement keyboard traversal. 1 to the next character, and so on. If a bitmap or image is displayed in the entry then this option is ignored. This option is not available for separator or tear-off entries. +.\" OPTION: -value .TP \fB\-value \fIvalue\fR . @@ -743,6 +749,7 @@ Available only for radiobutton entries. Specifies the value to store in the entry's associated variable when the entry is selected. If an empty string is specified, then the \fB\-label\fR option for the entry as the value to store in the variable. +.\" OPTION: -variable .TP \fB\-variable \fIvalue\fR . diff --git a/doc/messageBox.n b/doc/messageBox.n index b7be4e8..33825dc 100644 --- a/doc/messageBox.n +++ b/doc/messageBox.n @@ -23,12 +23,15 @@ popped up, \fBtk_messageBox\fR waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. .PP The following option-value pairs are supported: +.\" OPTION: -command .TP \fB\-command\fI string\fR +. Specifies the prefix of a Tcl command to invoke when the user closes the dialog. The actual command consists of \fIstring\fR followed by a space and the name of the button clicked by the user to close the dialog. This is only available on Mac OS X. +.\" OPTION: -default .TP \fB\-default\fI name\fR . @@ -39,6 +42,7 @@ this message window ( and so on). See \fB\-type\fR for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default. +.\" OPTION: -detail .TP \fB\-detail\fI string\fR . @@ -46,6 +50,7 @@ Specifies an auxiliary message to the main message given by the \fB\-message\fR option. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message. +.\" OPTION: -icon .TP \fB\-icon\fI iconImage\fR . @@ -53,51 +58,43 @@ Specifies an icon to display. \fIIconImage\fR must be one of the following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or \fBwarning\fR. If this option is not specified, then the info icon will be displayed. +.\" OPTION: -message .TP \fB\-message\fI string\fR . Specifies the message to display in this message box. The default value is an empty string. +.\" OPTION: -parent .TP \fB\-parent\fI window\fR . Makes \fIwindow\fR the logical parent of the message box. The message box is displayed on top of its parent window. +.\" OPTION: -title .TP \fB\-title\fI titleString\fR . Specifies a string to display as the title of the message box. The default value is an empty string. +.\" OPTION: -type .TP \fB\-type\fI predefinedType\fR . Arranges for a predefined set of buttons to be displayed. The following values are possible for \fIpredefinedType\fR: .RS -.TP 18 -\fBabortretryignore\fR -. +.IP \fBabortretryignore\fR 18 Displays three buttons whose symbolic names are \fBabort\fR, \fBretry\fR and \fBignore\fR. -.TP 18 -\fBok\fR -. +.IP \fBok\fR 18 Displays one button whose symbolic name is \fBok\fR. -.TP 18 -\fBokcancel\fR -. +.IP \fBokcancel\fR 18 Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR. -.TP 18 -\fBretrycancel\fR -. +.IP \fBretrycancel\fR 18 Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR. -.TP 18 -\fByesno\fR -. +.IP \fByesno\fR 18 Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR. -.TP 18 -\fByesnocancel\fR -. +.IP \fByesnocancel\fR 18 Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR and \fBcancel\fR. .RE @@ -105,13 +102,13 @@ and \fBcancel\fR. .SH EXAMPLE .PP .CS -set answer [\fBtk_messageBox\fR \-message "Really quit?" \e - \-icon question \-type yesno \e - \-detail "Select \e"Yes\e" to make the application exit"] -switch \-\- $answer { +set answer [\fBtk_messageBox\fR -message "Really quit?" \e + -icon question -type yesno \e + -detail "Select \e"Yes\e" to make the application exit"] +switch -- $answer { yes exit - no {\fBtk_messageBox\fR \-message "I know you like this application!" \e - \-type ok} + no {\fBtk_messageBox\fR -message "I know you like this application!" \e + -type ok} } .CE .SH KEYWORDS diff --git a/doc/nsimage.n b/doc/nsimage.n index cf2fe82..d62416f 100644 --- a/doc/nsimage.n +++ b/doc/nsimage.n @@ -26,68 +26,68 @@ name. .SH OPTIONS .PP Valid \fIoptions\fR are: +.\" OPTION: -source .TP -\fB\-source\fR +\fB\-source\fI string\fR .PP The value of the \fB\-source\fR option is a string describing an NSimage. There are several ways to interpret this string, and the interpretation is determined by the value of the \fB\-as\fR option. This option is required. .PP +.\" OPTION: -as .TP -\fB\-as\fR +\fB\-as\fI type\fR .PP There are four possible values for the \fB\-as\fR option which specify how the source string should be interpreted. The allowed values and their meanings are: -.IP -\fBname\fR -.IP +.RS +.IP \fBname\fR The source should be interpreted as the name of a named NSImage provided by the system. This is the default if the \fB\-as\fR option is not specified. -.IP -\fBfile\fR -.IP +.IP \fBfile\fR The source should be interpreted as a path to an image file in one of the formats understood by the NSImage class. -.IP -\fBpath\fR -.IP +.IP \fBpath\fR The source should be interpreted as a path to an arbitrary file. The type of the file will be examined and the resulting image will be the system icon for files of that type. -.IP -\fBfiletype\fR -.IP +.IP \fBfiletype\fR The source is interpreted as a string identifying a particular file type. It may be a filename extension, an Apple Uniform Type Identifier or a 4-character OSType value as used in the HFS filesystem. +.RE +.\" OPTION: -width .TP -\fB\-width\fR +\fB\-width\fI pixels\fR .PP The value of the \fIwidth\fR option is an integer specifying the width in pixels of the nsimage. If the width is not specified it will be computed from the height so as to preserve the aspect ration. If neither width nor height are specified then the width and height of the underlying NSImage will be used. +.\" OPTION: -height .TP -\fB\-height\fR +\fB\-height\fI pixels\fR .PP The value of the \fIheight\fR option is an integer specifying the height in pixels of the nsimage. If the height is not specified it will be computed from the height so as to preserve the aspect ration. If neither width nor height are specified then the width and height of the underlying NSImage will be used. +.\" OPTION: -radius .TP -\fB\-radius\fR +\fB\-radius\fI pixels\fR .PP The value of the \fIradius\fR option is an integer. If non-zero the image will be clipped to a rounded rectangle with the same width and height as the image, but with circular arcs of the specified radius cutting off the corners of the rectangle. +.\" OPTION: -ring .TP -\fB\-ring\fR +\fB\-ring\fI pixels\fR .PP The value of the \fIring\fR option is an integer. If non-zero then it specifies the thickness of a focus ring which will be drawn around the @@ -96,15 +96,17 @@ Preferences. The image is resized to reduce its width and height by twice the thickness of the ring. Note that this may create a small amount of distortion. The aspect ration of a non-square image will change slightly. +.\" OPTION: -alpha .TP -\fB\-alpha\fR +\fB\-alpha\fI float\fR .PP The value of the \fIalpha\fR option should be a floating point number between 0.0 and 1.0. This alpha value will be applied to each pixel of the nsimage, producing a partially transparent image. The default value is 1.0, which makes the image opaque. +.\" OPTION: -pressed .TP -\fB\-pressed\fR +\fB\-pressed\fI boolean\fR .PP The \fIpressed\fR option takes a boolean value. If the value is true or 1 then the image will be algorithmically modified to become darker @@ -112,8 +114,9 @@ in light mode or lighter in dark mode. The default is false. For an image button, the primary image should use the value false while the pressed image should be the same image but with the \fIpressed\fR option set to true. +.\" OPTION: -template .TP -\fB\-template\fR +\fB\-template\fI boolean\fR .PP The \fItemplate\fR option takes a boolean value. If the value is true or 1 then the image will be marked as being a template image. This diff --git a/doc/option.n b/doc/option.n index 9ec408f..8411ce4 100644 --- a/doc/option.n +++ b/doc/option.n @@ -71,20 +71,16 @@ This cannot be changed, setting the [encoding system] has no effect. .PP The \fIpriority\fR arguments to the \fBoption\fR command are normally specified symbolically using one of the following values: -.TP -\fBwidgetDefault\fR +.IP \fBwidgetDefault\fR3 Level 20. Used for default values hard-coded into widgets. -.TP -\fBstartupFile\fR +.IP \fBstartupFile\fR Level 40. Used for options specified in application-specific startup files. -.TP -\fBuserDefault\fR +.IP \fBuserDefault\fR Level 60. Used for options specified in user-specific defaults files, such as \fB.Xdefaults\fR, resource databases loaded into the X server, or user-specific startup files. -.TP -\fBinteractive\fR +.IP \fBinteractive\fR Level 80. Used for options specified interactively after the application starts running. If \fIpriority\fR is not specified, it defaults to this level. diff --git a/doc/options.n b/doc/options.n index 913c912..f540c60 100644 --- a/doc/options.n +++ b/doc/options.n @@ -292,7 +292,7 @@ The script must return \fB0\fR, \fB1\fR, or an empty string: a \fB0\fR or \fB1\fR value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. -Note: this interpretation of the option is defined entirely by +Note that this interpretation of the option is defined entirely by the Tcl scripts that implement traversal: the widget implementations ignore the option entirely, so you can change its meaning if you redefine the keyboard traversal scripts. diff --git a/doc/pack.n b/doc/pack.n index ae12ead..3956be0 100644 --- a/doc/pack.n +++ b/doc/pack.n @@ -23,6 +23,7 @@ The \fBpack\fR command can have any of several forms, depending on the \fIoption\fR argument: .TP \fBpack \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? +. If the first argument to \fBpack\fR is a window name (any value starting with .QW . ), @@ -38,80 +39,98 @@ See \fBTHE PACKER ALGORITHM\fR below for details on how the options are used by the packer. The following options are supported: .RS +.\" OPTION: -after .TP \fB\-after \fIother\fR +. \fIOther\fR must the name of another window. Use its container as the container for the content, and insert the content just after \fIother\fR in the packing order. +.\" OPTION: -anchor .TP \fB\-anchor \fIanchor\fR +. \fIAnchor\fR must be a valid anchor position such as \fBn\fR or \fBsw\fR; it specifies where to position each content in its parcel. Defaults to \fBcenter\fR. +.\" OPTION: -before .TP \fB\-before \fIother\fR +. \fIOther\fR must the name of another window. Use its container as the container for the content, and insert the content just before \fIother\fR in the packing order. +.\" OPTION: -expand .TP \fB\-expand \fIboolean\fR +. Specifies whether the content should be expanded to consume extra space in their container. \fIBoolean\fR may have any proper boolean value, such as \fB1\fR or \fBno\fR. Defaults to 0. +.\" OPTION: -fill .TP \fB\-fill \fIstyle\fR +. If a content's parcel is larger than its requested dimensions, this option may be used to stretch the content. \fIStyle\fR must have one of the following values: .RS -.TP -\fBnone\fR +.IP \fBnone\fR Give the content its requested dimensions plus any internal padding requested with \fB\-ipadx\fR or \fB\-ipady\fR. This is the default. -.TP -\fBx\fR +.IP \fBx\fR Stretch the content horizontally to fill the entire width of its parcel (except leave external padding as specified by \fB\-padx\fR). -.TP -\fBy\fR +.IP \fBy\fR Stretch the content vertically to fill the entire height of its parcel (except leave external padding as specified by \fB\-pady\fR). -.TP -\fBboth\fR +.IP \fBboth\fR Stretch the content both horizontally and vertically. .RE +.\" OPTION: -in .TP \fB\-in \fIcontainer\fR +. Insert the window at the end of the packing order for the container window given by \fIcontainer\fR. +.\" OPTION: -ipadx .TP \fB\-ipadx \fIamount\fR +. \fIAmount\fR specifies how much horizontal internal padding to leave on each side of the content. \fIAmount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. +.\" OPTION: -ipady .TP \fB\-ipady \fIamount\fR +. \fIAmount\fR specifies how much vertical internal padding to leave on each side of the content. \fIAmount\fR defaults to 0. +.\" OPTION: -padx .TP \fB\-padx \fIamount\fR +. \fIAmount\fR specifies how much horizontal external padding to leave on each side of the content. \fIAmount\fR may be a list of two values to specify padding for left and right separately. \fIAmount\fR defaults to 0. +.\" OPTION: -pady .TP \fB\-pady \fIamount\fR +. \fIAmount\fR specifies how much vertical external padding to leave on each side of the content. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately. \fIAmount\fR defaults to 0. +.\" OPTION: -side .TP \fB\-side \fIside\fR +. Specifies which side of the container the content will be packed against. Must be \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. Defaults to \fBtop\fR. @@ -130,27 +149,29 @@ than receiving default values. .TP \fBpack content \fIwindow\fR . -Returns a list of all of the content windows in the packing order for \fIwindow\fR. -The order of the content windows in the list is the same as their order in -the packing order. +Returns a list of all of the content windows in the packing order for +\fIwindow\fR. The order of the content windows in the list is the same as +their order in the packing order. If \fIwindow\fR has no content then an empty string is returned. .\" METHOD: forget .TP \fBpack forget \fIwindow \fR?\fIwindow ...\fR? +. Removes each of the \fIwindow\fRs from the packing order for its container and unmaps their windows. The content will no longer be managed by the packer. .RS .PP .VS "TIP 518" -If the last content window of the container becomes unmanaged, this will also send -the virtual event \fB<>\fR to the container; the container -may choose to resize itself (or otherwise respond) to such a change. +If the last content window of the container becomes unmanaged, this will +also send the virtual event \fB<>\fR to the container; the +container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE .\" METHOD: info .TP \fBpack info \fIwindow\fR +. Returns a list whose elements are the current configuration state of the window given by \fIwindow\fR in the same option-value form that might be specified to \fBpack configure\fR. @@ -282,18 +303,18 @@ the stacking order of either the container or the content. .PP .CS # Make the widgets -label .t \-text "This widget is at the top" \-bg red -label .b \-text "This widget is at the bottom" \-bg green -label .l \-text "Left\enHand\enSide" -label .r \-text "Right\enHand\enSide" +label .t -text "This widget is at the top" -bg red +label .b -text "This widget is at the bottom" -bg green +label .l -text "Left\enHand\enSide" +label .r -text "Right\enHand\enSide" text .mid \&.mid insert end "This layout is like Java's BorderLayout" # Lay them out -\fBpack\fR .t \-side top \-fill x -\fBpack\fR .b \-side bottom \-fill x -\fBpack\fR .l \-side left \-fill y -\fBpack\fR .r \-side right \-fill y -\fBpack\fR .mid \-expand 1 \-fill both +\fBpack\fR .t -side top -fill x +\fBpack\fR .b -side bottom -fill x +\fBpack\fR .l -side left -fill y +\fBpack\fR .r -side right -fill y +\fBpack\fR .mid -expand 1 -fill both .CE .SH "SEE ALSO" grid(n), place(n) diff --git a/doc/palette.n b/doc/palette.n index 6a04450..ed0da59 100644 --- a/doc/palette.n +++ b/doc/palette.n @@ -11,11 +11,11 @@ .SH NAME tk_setPalette, tk_bisque \- Modify the Tk color palette .SH SYNOPSIS +.nf \fBtk_setPalette \fIbackground\fR -.sp \fBtk_setPalette \fIname value \fR?\fIname value ...\fR? -.sp \fBtk_bisque\fR +.fi .BE .SH DESCRIPTION .PP diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 54abb8f..1d19219 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -167,16 +167,19 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. The following options are supported: .RS +.\" OPTION: -after .TP \fB\-after \fIwindow\fR . Insert the window after the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. +.\" OPTION: -before .TP \fB\-before \fIwindow\fR . Insert the window before the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. +.\" OPTION: -height .TP \fB\-height \fIsize\fR . @@ -186,12 +189,14 @@ is an empty string, or if \fB\-height\fR is not specified, then the height requested internally by the window will be used initially; the height may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. +.\" OPTION: -hide .TP \fB\-hide \fIboolean\fR . Controls the visibility of a pane. When the \fIboolean\fR is true (according to \fBTcl_GetBoolean\fR) the pane will not be visible, but it will still be maintained in the list of panes. +.\" OPTION: -minsize .TP \fB\-minsize \fIn\fR . @@ -200,18 +205,21 @@ Specifies that the size of the window cannot be made less than paned dimension \(em the x dimension for horizontal panedwindows, the y dimension for vertical panedwindows. May be any value accepted by \fBTk_GetPixels\fR. +.\" OPTION: -padx .TP \fB\-padx \fIn\fR . Specifies a non-negative value indicating how much extra space to leave on each side of the window in the X-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. +.\" OPTION: -pady .TP \fB\-pady \fIn\fR . Specifies a non-negative value indicating how much extra space to leave on each side of the window in the Y-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. +.\" OPTION: -sticky .TP \fB\-sticky \fIstyle\fR . @@ -226,6 +234,7 @@ will to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are specified, the window will be stretched to fill the entire height (or width) of its cavity. +.\" OPTION: -stretch .TP \fB\-stretch \fIwhen\fR . @@ -238,29 +247,20 @@ for stretching. The space will be distributed based on each panes current ratio of the whole. The \fIwhen\fR values have the following definition: .RS -.TP -\fBalways\fR -. +.IP \fBalways\fR This pane will always stretch. -.TP -\fBfirst\fR -. +.IP \fBfirst\fR Only if this pane is the first pane (left-most or top-most) will it stretch. -.TP -\fBlast\fR -. +.IP \fBlast\fR Only if this pane is the last pane (right-most or bottom-most) will it stretch. This is the default value. -.TP -\fBmiddle\fR -. +.IP \fBmiddle\fR Only if this pane is not the first or last pane will it stretch. -.TP -\fBnever\fR -. +.IP \fBnever\fR This pane will never stretch. .RE +.\" OPTION: -width .TP \fB\-width \fIsize\fR . @@ -301,6 +301,7 @@ Place the proxy at the given \fIx\fR and \fIy\fR coordinates. .\" METHOD: sash .TP \fIpathName \fBsash \fR?\fIargs\fR? +. This command is used to query and change the position of sashes in the panedwindow. It can take any of the following forms: .RS diff --git a/doc/photo.n b/doc/photo.n index d8a48df..2a27d9b 100644 --- a/doc/photo.n +++ b/doc/photo.n @@ -50,7 +50,7 @@ and (read-only) SVG formats are supported, but an interface exists to allow additional image file formats to be added easily. A photo image is (semi)transparent if the image data it was obtained from had -transparency informaton. In regions where no image data has been +transparency information. In regions where no image data has been supplied, it is fully transparent. Transparency may also be modified with the \fBtransparency set\fR subcommand. .SH "CREATING PHOTOS" @@ -58,6 +58,7 @@ with the \fBtransparency set\fR subcommand. Like all images, photos are created using the \fBimage create\fR command. Photos support the following \fIoptions\fR: +.\" OPTION: -data .TP \fB\-data \fIstring\fR . @@ -72,20 +73,23 @@ format of the string must be one of those for which there is an image file format handler that will accept string data. If both the \fB\-data\fR and \fB\-file\fR options are specified, the \fB\-file\fR option takes precedence. +.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the file format for the data specified with the \fB\-data\fR or \fB\-file\fR option and optional arguments passed to -the format handler. Note: the value of this option must be a Tcl list. +the format handler. Note that the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. +.\" OPTION: -file .TP \fB\-file \fIname\fR . \fIname\fR gives the name of a file that is to be read to supply data for the photo image. The file format must be one of those for which there is an image file format handler that can read data. +.\" OPTION: -gamma .TP \fB\-gamma \fIvalue\fR . @@ -98,6 +102,7 @@ The value specified must be greater than zero. The default value is one (no correction). In general, values greater than one will make the image lighter, and values less than one will make it darker. +.\" OPTION: -height .TP \fB\-height \fInumber\fR . @@ -106,6 +111,7 @@ primarily in situations where the user wishes to build up the contents of the image piece by piece. A value of zero (the default) allows the image to expand or shrink vertically to fit the data stored in it. .VS 8.7 +.\" OPTION: -metadata .TP \fB\-metadata \fImetadata\fR . @@ -115,6 +121,7 @@ if image data is processed due to a \fB\-file\fR or \fB\-data\fR options and the driver outputs any metadata keys. See section \fBMETADATA DICTIONARY\fR below. .VE 8.7 +.\" OPTION: -palette .TP \fB\-palette \fIpalette-spec\fR . @@ -127,6 +134,7 @@ numbers separated by slashes (/), specifying the number of shades of red, green and blue to use, respectively. If the first form (a single number) is used, the image will be displayed in monochrome (i.e., grayscale). +.\" OPTION: -width .TP \fB\-width \fInumber\fR . @@ -161,7 +169,8 @@ The following commands are possible for photo images: . Blank the image; that is, set the entire image to have no data, so it will be displayed as transparent, and the background of whatever -window it is displayed in will show through. The metadata dict of the image is not changed. +window it is displayed in will show through. The metadata dict of the +image is not changed. .\" METHOD: cget .TP \fIimageName \fBcget\fI option\fR @@ -187,7 +196,7 @@ this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBimage create\fR \fBphoto\fR command. .VS 8.7 -Note: setting the \fB\-metadata\fR option without any other option +Note that setting the \fB\-metadata\fR option without any other option will not invoke the image format driver to recreate the bitmap. .VE 8.7 .\" METHOD: copy @@ -201,6 +210,7 @@ command copies the whole of \fIsourceImage\fR into \fIimageName\fR, starting at coordinates (0,0) in \fIimageName\fR. The following options may be specified: .RS +.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . @@ -211,6 +221,7 @@ default value is the bottom-right corner of the source image. The pixels copied will include the left and top edges of the specified rectangle but not the bottom or right edges. If the \fB\-from\fR option is not given, the default is the whole source image. +.\" OPTION: -to .TP \fB\-to \fIx1 y1 x2 y2\fR . @@ -221,6 +232,7 @@ the default value is (\fIx1,y1\fR) plus the size of the source region (after subsampling and zooming, if specified). If \fIx2\fR and \fIy2\fR are specified, the source region will be replicated if necessary to fill the destination region in a tiled fashion. +.\" OPTION: -shrink .TP \fB\-shrink\fR . @@ -229,6 +241,7 @@ necessary, so that the region being copied into is at the bottom-right corner of the image. This option will not affect the width or height of the image if the user has specified a non-zero value for the \fB\-width\fR or \fB\-height\fR configuration option, respectively. +.\" OPTION: -zoom .TP \fB\-zoom \fIx y\fR . @@ -238,6 +251,7 @@ is not given, the default value is the same as \fIx\fR. With this option, each pixel in the source image will be expanded into a block of \fIx\fR x \fIy\fR pixels in the destination image, all the same color. \fIx\fR and \fIy\fR must be greater than 0. +.\" OPTION: -subsample .TP \fB\-subsample \fIx y\fR . @@ -246,6 +260,7 @@ only every \fIx\fRth pixel in the X direction and \fIy\fRth pixel in the Y direction. Negative values will cause the image to be flipped about the Y or X axes, respectively. If \fIy\fR is not given, the default value is the same as \fIx\fR. +.\" OPTION: -compositingrule .TP \fB\-compositingrule \fIrule\fR . @@ -271,12 +286,14 @@ See \fBIMAGE FORMATS\fR below for details. .VE 8.7 The following options may be specified: .RS +.\" OPTION: -background .TP \fB\-background\fI color\fR . If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. +.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . @@ -292,9 +309,10 @@ per pixel/column) of colors in .QW \fB#\fIrrggbb\fR format (see \fBIMAGE FORMATS\fR below). .VE 8.7 -Note: the value of this option must be a Tcl list. +Note that the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. +.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . @@ -305,12 +323,14 @@ extends from \fI(x1,y1)\fR to the bottom-right corner of diagonally opposite corners of the rectangular region, including x1,y1 and excluding x2,y2. The default, if this option is not given, is the whole image. +.\" OPTION: -grayscale .TP \fB\-grayscale\fR . If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 +.\" OPTION: -metadata .TP \fB\-metadata\fI metadata\fR . @@ -345,6 +365,7 @@ See \fBIMAGE FORMATS\fR below for details on formats for image data. .VE 8.7 The following options may be specified: .RS +.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ..\fR?} . @@ -353,18 +374,20 @@ arguments to be passed to the format handler. Specifically, only image file format handlers whose names begin with \fIformat-name\fR will be used while searching for an image data format handler to read the data. -Note: the value of this option must be a Tcl list. +Note that the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .VS 8.7 +.\" OPTION: -metadata .TP \fB\-metadata\fI metadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. -Note: The current metadata of the image is not passed to the format driver +Note that the current metadata of the image is not passed to the format driver and is not changed by the command. .VE 8.7 +.\" OPTION: -to .TP \fB\-to \fIx1 y1\fR ?\fIx2 y2\fR? . @@ -373,7 +396,7 @@ of the region of \fIimageName\fR into which the image data will be copied. The default position is (0,0). If \fIx2\fR,\fIy2\fR is given and \fIdata\fR is not large enough to cover the rectangle specified by this option, the image data extracted will be tiled so it covers the -entire destination rectangle. If the region specified with this opion +entire destination rectangle. If the region specified with this option is smaller than the supplied \fIdata\fR, the exceeding data is silently discarded. Note that if \fIdata\fR specifies a single color value, then a region extending to the bottom-right corner @@ -390,6 +413,7 @@ in \fIfilename\fR, and then reads the image in \fIfilename\fR into \fIimageName\fR (the destination image). The following options may be specified: .RS +.\" OPTION: -format .TP \fB\-format {\fIformat-name\fR ?\fIoption value ..\fR?} . @@ -398,9 +422,10 @@ optionally, additional options to the format handler. Specifically, only image file format handlers whose names begin with \fIformat-name\fR will be used while searching for an image data format handler to read the data. -Note: the value of this option must be a Tcl list. +Note that the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. +.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . @@ -412,14 +437,16 @@ specified, they specify diagonally opposite corners or the region. The default, if this option is not specified, is the whole of the image in the image file. .VS 8.7 +.\" OPTION: -metadata .TP \fB\-metadata\fI metadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. -Note: The current metadata of the image is not passed to the format driver +Note that the current metadata of the image is not passed to the format driver and is not changed by the command. .VE 8.7 +.\" OPTION: -shrink .TP \fB\-shrink\fR . @@ -429,6 +456,7 @@ is at the bottom-right corner of the \fIimageName\fR. This option will not affect the width or height of the image if the user has specified a non-zero value for the \fB\-width\fR or \fB\-height\fR configuration option, respectively. +.\" OPTION: -to .TP \fB\-to \fIx y\fR . @@ -479,12 +507,14 @@ value for the pixel, which must be in the range 0 to 255. Writes image data from \fIimageName\fR to a file named \fIfilename\fR. The following options may be specified: .RS +.\" OPTION: -background .TP \fB\-background\fI color\fR . If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. +.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . @@ -496,9 +526,10 @@ and which has the capability to write an image file. If this option is not given, the format is guessed from the file extension. If that cannot be determined, this subcommand uses the first handler that has the capability to write an image file. -Note: the value of this option must be a Tcl list. +Note that the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. +.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . @@ -508,12 +539,14 @@ extends from \fI(x1,y1)\fR to the bottom-right corner of \fIimageName\fR. If all four coordinates are given, they specify diagonally opposite corners of the rectangular region. The default, if this option is not given, is the whole image. +.\" OPTION: -grayscale .TP \fB\-grayscale\fR . If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 +.\" OPTION: -metadata .TP \fB\-metadata\fI metadata\fR . @@ -580,12 +613,13 @@ the forms described in the \fBCOLOR FORMATS\fR section below. .SS "FORMAT SUBOPTIONS" .PP .VS 8.6 -Image formats may support sub-options, wich ahre specified using +Image formats may support sub-options, which are specified using additional words in the value to the \fB\-format\fR option. These suboptions can affect how image data is read or written to file or string. The nature and values of these options is up to the format handler. The built-in handlers support these suboptions: +.\" OPTION -colorformat .VS 8.7 .TP \fBdefault \-colorformat\fI formatType\fR @@ -598,6 +632,7 @@ pixel data in the form \fB#\fIRRGGBBAA\fR or \fBlist\fR to encode pixel data as a list with four elements. See \fBCOLOR FORMATS\fR below for details. The default is \fBrgb\fR. .VE 8.7 +.\" OPTION -index .TP \fBgif \-index\fI indexValue\fR . @@ -606,6 +641,7 @@ parsing a multi-part GIF image, Tk normally only accesses the first image. By giving the \fB\-index\fR sub-option, the \fIindexValue\fR'th value may be used instead. The \fIindexValue\fR must be an integer from 0 up to the number of image parts in the GIF data. +.\" OPTION -alpha .TP \fBpng \-alpha\fI alphaValue\fR . @@ -614,6 +650,10 @@ an additional alpha filtering for the overall image, which allows the background on which the image is displayed to show through. This usually also has the effect of desaturating the image. The \fIalphaValue\fR must be between 0.0 and 1.0. +.\" OPTION -dpi +.\" OPTION -scale +.\" OPTION -scaletowidth +.\" OPTION -scaletoheight .TP \fBsvg \-dpi\fI dpiValue \fB\-scale\fI scaleValue \fB\-scaletowidth\fI width \fB\-scaletoheight\fI height\fR . @@ -628,7 +668,7 @@ be greater than 0 and the default value is 1. will be adjusted to. Only one parameter among \fB\-scale\fR, \fB\-scaletowidth\fR and \fB\-scaletoheight\fR can be given at a time and the aspect ratio of the original image is always preserved. -The svg format supports a wide range of SVG features, but the +The \fBsvg\fR format supports a wide range of SVG features, but the full SVG standard is not available, for instance the 'text' feature is missing and silently ignored when reading the SVG data. The supported SVG features are: @@ -780,19 +820,13 @@ parsed, or may use metadata to be included in image files or formats. .PP Each image format driver supports an individual set of metadata dictionary keys. Predefined keys are: -.TP -\fBDPI\fR -. +.IP \fBDPI\fR Horizontal image resolution in DPI as a double value. Supported by format \fBpng\fR. -.TP -\fBaspect\fR -. +.IP \fBaspect\fR Aspect ratio horizontal divided by vertical as double value. Supported by formats \fBgif\fR and \fBpng\fR. -.TP -\fBcomment\fR -. +.IP \fBcomment\fR Image text comment. Supported by formats \fBgif\fR and \fBpng\fR. .PP @@ -807,7 +841,8 @@ The options are linked to each subimage selected by \fB\-index\fR. .TP \fBdelay time\fI time\fR . -Update delay time in 10ms units. This key is only present if the delay time is not 0. +Update delay time in 10ms units. +This key is only present if the delay time is not 0. .TP \fBdisposal method\fI method\fR . @@ -838,14 +873,14 @@ is useful for producing a tiled background: .PP .CS # These lines should be called once -\fBimage create photo\fR untiled \-file "theFile.ppm" +\fBimage create photo\fR untiled -file "theFile.ppm" \fBimage create photo\fR tiled # These lines should be called whenever .someWidget changes # size; a binding is useful here set width [winfo width .someWidget] set height [winfo height .someWidget] -tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink +tiled \fBcopy\fR untiled -to 0 0 $width $height -shrink .CE .PP .VS 8.6 @@ -854,10 +889,10 @@ during loading, which is useful for generating images suitable for disabled buttons: .PP .CS -\fBimage create photo\fR icon \-file "icon.png" -\fBimage create photo\fR iconDisabled \-file "icon.png" \e - \-format "png \-alpha 0.5" -button .b \-image icon \-disabledimage iconDisabled +\fBimage create photo\fR icon -file "icon.png" +\fBimage create photo\fR iconDisabled -file "icon.png" \e + -format "png -alpha 0.5" +button .b -image icon -disabledimage iconDisabled .CE .VE 8.6 .PP diff --git a/doc/place.n b/doc/place.n index b1189cd..22e9699 100644 --- a/doc/place.n +++ b/doc/place.n @@ -53,8 +53,10 @@ the command returns an empty string. .RS .PP The following \fIoption\-value\fR pairs are supported: +.\" OPTION: -anchor .TP \fB\-anchor \fIwhere\fR +. \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR, \fB\-relx\fR, and \fB\-rely\fR options. @@ -64,8 +66,10 @@ Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of \fIwindow\fR's border will appear at the given (x,y) location in the container. The anchor position defaults to \fBnw\fR. +.\" OPTION: -bordermode .TP \fB\-bordermode \fImode\fR +. \fIMode\fR determines the degree to which borders within the container are used in determining the placement of the content. The default and most common value is \fBinside\fR. @@ -87,8 +91,10 @@ to be its official X area, which includes any internal border but no external border. A bordermode of \fBignore\fR is probably not very useful. .RE +.\" OPTION: -height .TP \fB\-height \fIsize\fR +. \fISize\fR specifies the height for \fIwindow\fR in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR). The height will be the outer dimension of \fIwindow\fR including its @@ -96,8 +102,10 @@ border, if any. If \fIsize\fR is an empty string, or if no \fB\-height\fR or \fB\-relheight\fR option is specified, then the height requested internally by the window will be used. +.\" OPTION: -in .TP \fB\-in \fIcontainer\fR +. \fIContainer\fR specifies the path name of the window relative to which \fIwindow\fR is to be placed. \fIContainer\fR must either be \fIwindow\fR's parent or a descendant @@ -108,8 +116,10 @@ These restrictions are necessary to guarantee that \fIwindow\fR is visible whenever \fIcontainer\fR is visible. If this option is not specified then the other window defaults to \fIwindow\fR's parent. +.\" OPTION: -relheight .TP \fB\-relheight \fIsize\fR +. \fISize\fR specifies the height for \fIwindow\fR. In this case the height is specified as a floating-point number relative to the height of the container: 0.5 means \fIwindow\fR will @@ -118,8 +128,10 @@ the same height as the container, and so on. If both \fB\-height\fR and \fB\-relheight\fR are specified for a content, their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR makes the content 2 pixels shorter than the container. +.\" OPTION: -relwidth .TP \fB\-relwidth \fIsize\fR +. \fISize\fR specifies the width for \fIwindow\fR. In this case the width is specified as a floating-point number relative to the width of the container: 0.5 means \fIwindow\fR will @@ -128,8 +140,10 @@ the same width as the container, and so on. If both \fB\-width\fR and \fB\-relwidth\fR are specified for a content, their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR makes the content 5 pixels wider than the container. +.\" OPTION: -relx .TP \fB\-relx \fIlocation\fR +. \fILocation\fR specifies the x-coordinate within the container window of the anchor point for \fIwindow\fR. In this case the location is specified in a relative fashion @@ -140,8 +154,10 @@ If both \fB\-x\fR and \fB\-relx\fR are specified for a content then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR positions the left edge of the content 2 pixels to the left of the center of its container. +.\" OPTION: -rely .TP \fB\-rely \fIlocation\fR +. \fILocation\fR specifies the y-coordinate within the container window of the anchor point for \fIwindow\fR. In this case the value is specified in a relative fashion @@ -152,8 +168,10 @@ If both \fB\-y\fR and \fB\-rely\fR are specified for a content then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR positions the top edge of the content 3 pixels below the center of its container. +.\" OPTION: -width .TP \fB\-width \fIsize\fR +. \fISize\fR specifies the width for \fIwindow\fR in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR). The width will be the outer width of \fIwindow\fR including its @@ -161,15 +179,19 @@ border, if any. If \fIsize\fR is an empty string, or if no \fB\-width\fR or \fB\-relwidth\fR option is specified, then the width requested internally by the window will be used. +.\" OPTION: -x .TP \fB\-x \fIlocation\fR +. \fILocation\fR specifies the x-coordinate within the container window of the anchor point for \fIwindow\fR. The location is specified in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR) and need not lie within the bounds of the container window. +.\" OPTION: -y .TP \fB\-y \fIlocation\fR +. \fILocation\fR specifies the y-coordinate within the container window of the anchor point for \fIwindow\fR. The location is specified in screen units (i.e. any of the forms @@ -184,8 +206,9 @@ the most recent option is used and the older one is ignored. .TP \fBplace content \fIwindow\fR . -Returns a list of all the content windows for which \fIwindow\fR is the container. -If there is no content for \fIwindow\fR then an empty string is returned. +Returns a list of all the content windows for which \fIwindow\fR is the +container. If there is no content for \fIwindow\fR then an empty string +is returned. .\" METHOD: forget .TP \fBplace forget \fIwindow\fR @@ -257,13 +280,14 @@ frames and canvases that provide configuration options for this purpose. Make the label occupy the middle bit of the toplevel, no matter how it is resized: .CS -label .l \-text "In the\enMiddle!" \-bg black \-fg white -\fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35 +label .l -text "In the\enMiddle!" -bg black -fg white +\fBplace\fR .l -relwidth .3 -relx .35 -relheight .3 -rely .35 .CE .SH "SEE ALSO" grid(n), pack(n) .SH KEYWORDS -geometry manager, height, location, container, place, rubber sheet, content, width +geometry manager, height, location, container, place, rubber sheet, +content, width '\" Local Variables: '\" mode: nroff '\" End: diff --git a/doc/popup.n b/doc/popup.n index 9543750..ca9d485 100644 --- a/doc/popup.n +++ b/doc/popup.n @@ -31,11 +31,11 @@ How to attach a simple popup menu to a widget. .CS # Create a menu set m [menu .popupMenu] -$m add command \-label "Example 1" \-command bell -$m add command \-label "Example 2" \-command bell +$m add command -label "Example 1" -command bell +$m add command -label "Example 2" -command bell # Create something to attach it to -pack [label .l \-text "Click me!"] +pack [label .l -text "Click me!"] # Arrange for the menu to pop up when the label is clicked bind .l {\fBtk_popup\fR .popupMenu %X %Y} diff --git a/doc/radiobutton.n b/doc/radiobutton.n index 6033954..b51a7e6 100644 --- a/doc/radiobutton.n +++ b/doc/radiobutton.n @@ -65,8 +65,8 @@ The empty string is the default value. Specifies a background color to use when the button is selected. If \fBindicatorOn\fR is true then the color is used as the background for the indicator regardless of the select state. -If \fB\-indicatoron\fR is false, this color is used as the background -for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR, +If \fB\-indicatoron\fR is false, this color is used as the background for the +entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR, whenever the widget is selected. If specified as an empty string then no special color is used for displaying when the widget is selected. @@ -263,7 +263,8 @@ actions occur: the radiobutton is completely non-responsive. The behavior of radiobuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH "SEE ALSO" -checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), ttk::radiobutton(n) +checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), +ttk::radiobutton(n) .SH KEYWORDS radiobutton, widget '\" Local Variables: diff --git a/doc/raise.n b/doc/raise.n index 7741001..752bcd6 100644 --- a/doc/raise.n +++ b/doc/raise.n @@ -41,11 +41,11 @@ it. This is is often necessary when building GUIs in the style where you create your activity widgets first before laying them out on the display: .CS -button .b \-text "Hi there!" -pack [frame .f \-background blue] -pack [label .f.l1 \-text "This is above"] -pack .b \-in .f -pack [label .f.l2 \-text "This is below"] +button .b -text "Hi there!" +pack [frame .f -background blue] +pack [label .f.l1 -text "This is above"] +pack .b -in .f +pack [label .f.l2 -text "This is below"] \fBraise\fR .b .CE .SH "SEE ALSO" diff --git a/doc/scale.n b/doc/scale.n index 97e0de3..9aeb8c0 100644 --- a/doc/scale.n +++ b/doc/scale.n @@ -78,7 +78,9 @@ specified by the \fB\-activebackground\fR option. .OP \-tickinterval tickInterval TickInterval Must be a real value. Determines the spacing between numerical -tick marks displayed below or to the left of the slider. The values will all be displayed with the same number of decimal places, which will be enough to ensure they are all accurate to within 20% of a tick interval. +tick marks displayed below or to the left of the slider. The values will all +be displayed with the same number of decimal places, which will be enough to +ensure they are all accurate to within 20% of a tick interval. If 0, no tick marks will be displayed. .OP \-to to To Specifies a real value corresponding diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 86b6214..0bbfb70 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -81,20 +81,15 @@ below for details. .PP A scrollbar displays five elements, which are referred to in the widget commands for the scrollbar: -.TP 10 -\fBarrow1\fR +.IP \fBarrow1\fR 10 The top or left arrow in the scrollbar. -.TP 10 -\fBtrough1\fR +.IP \fBtrough1\fR 10 The region between the slider and \fBarrow1\fR. -.TP 10 -\fBslider\fR +.IP \fBslider\fR 10 The rectangle that indicates what is visible in the associated widget. -.TP 10 -\fBtrough2\fR +.IP \fBtrough2\fR 10 The region between the slider and \fBarrow2\fR. -.TP 10 -\fBarrow2\fR +.IP \fBarrow2\fR 10 The bottom or right arrow in the scrollbar. .SH "WIDGET COMMAND" .PP @@ -212,6 +207,7 @@ The command may take any of the following forms. In each case, \fIprefix\fR is the contents of the \fB\-command\fR option, which usually has a form like .QW "\fB.t yview\fR" . +.\" METHOD: moveto .TP \fIprefix \fBmoveto \fIfraction\fR . @@ -222,6 +218,7 @@ If \fIfraction\fR is 0 it refers to the beginning of the document. 1.0 refers to the end of the document, 0.333 refers to a point one-third of the way through the document, and so on. +.\" METHOD: scroll .TP \fIprefix \fBscroll \fInumber \fBpages\fR . @@ -316,11 +313,11 @@ The End key adjusts the view to the bottom (right edge) of the document. Create a window with a scrollable \fBtext\fR widget: .CS toplevel .tl -text .tl.t \-yscrollcommand {.tl.s set} -\fBscrollbar\fR .tl.s \-command {.tl.t yview} -grid .tl.t .tl.s \-sticky nsew -grid columnconfigure .tl 0 \-weight 1 -grid rowconfigure .tl 0 \-weight 1 +text .tl.t -yscrollcommand {.tl.s set} +\fBscrollbar\fR .tl.s -command {.tl.t yview} +grid .tl.t .tl.s -sticky nsew +grid columnconfigure .tl 0 -weight 1 +grid rowconfigure .tl 0 -weight 1 .CE .SH "SEE ALSO" ttk:scrollbar(n) diff --git a/doc/selection.n b/doc/selection.n index 19117ee..2f51d51 100644 --- a/doc/selection.n +++ b/doc/selection.n @@ -190,14 +190,14 @@ On X11 platforms, one of the standard selections available is the it using Tk: .PP .CS -set selContents [\fBselection get\fR \-selection SECONDARY] +set selContents [\fBselection get\fR -selection SECONDARY] .CE .PP Many different types of data may be available for a selection; the special type \fBTARGETS\fR allows you to get a list of available types: .PP .CS -foreach type [\fBselection get\fR \-type TARGETS] { +foreach type [\fBselection get\fR -type TARGETS] { puts "Selection PRIMARY supports type $type" } .CE @@ -207,7 +207,7 @@ data for the selection. Then you have to claim the selection... .CS # Set up the data handler ready for incoming requests set foo "This is a string with some data in it... blah blah" -\fBselection handle\fR \-selection SECONDARY . getData +\fBselection handle\fR -selection SECONDARY . getData proc getData {offset maxChars} { puts "Retrieving selection starting at $offset" return [string range $::foo $offset [expr {$offset+$maxChars-1}]] @@ -215,7 +215,7 @@ proc getData {offset maxChars} { # Now we grab the selection itself puts "Claiming selection" -\fBselection own\fR \-command lost \-selection SECONDARY . +\fBselection own\fR -command lost -selection SECONDARY . proc lost {} { puts "Lost selection" } diff --git a/doc/send.n b/doc/send.n index b8a92c5..943c92f 100644 --- a/doc/send.n +++ b/doc/send.n @@ -30,21 +30,27 @@ command to be executed, just as for the \fBeval\fR command. If the initial arguments of the command begin with .QW \- they are treated as options. The following options are currently defined: +.\" OPTION: -async .TP \fB\-async\fR +. Requests asynchronous invocation. In this case the \fBsend\fR command will complete immediately without waiting for \fIcmd\fR to complete in the target application; no result will be available and errors in the sent command will be ignored. If the target application is in the same process as the sending application then the \fB\-async\fR option is ignored. +.\" OPTION: -displayof .TP \fB\-displayof\fI pathName\fR +. Specifies that the target application's main window is on the display of the window given by \fIpathName\fR, instead of the display containing the application's main window. +.\" OPTION: -- .TP \fB\-\|\-\fR +. Serves no purpose except to terminate the list of options. This option is needed only if \fIapp\fR could contain a leading .QW \- @@ -90,7 +96,7 @@ This script fragment can be used to make an application that only runs once on a particular display. .CS if {[tk appname FoobarApp] ne "FoobarApp"} { - \fBsend\fR \-async FoobarApp RemoteStart $argv + \fBsend\fR -async FoobarApp RemoteStart $argv exit } # The command that will be called remotely, which raises diff --git a/doc/spinbox.n b/doc/spinbox.n index d358e62..e7ed8e0 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -168,8 +168,8 @@ The \fB\-validatecommand\fR will be called when the spinbox is edited. The \fB\-validatecommand\fR will be called for all above conditions. .PP It is possible to perform percent substitutions on the \fB\-validatecommand\fR -and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. The -following substitutions are recognized: +and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. +The following substitutions are recognized: .PP .IP \fB%d\fR 5 Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR, @@ -213,7 +213,7 @@ validated. If you wish to edit the value of the widget during validation and still have the \fB\-validate\fR option set, you should include the command .CS - \fI%W config \-validate %v\fR + \fI%W config -validate %v\fR .CE in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the spinbox widget from). It is also recommended to not set an @@ -224,7 +224,7 @@ Also, the \fB\-validate\fR option will set itself to \fBnone\fR when the spinbox value gets changed because of adjustment of \fB\-from\fR or \fB\-to\fR and the \fB\-validatecommand\fR returns false. For instance .CS - \fIspinbox pathName \-from 1 \-to 10 \-validate all \-validatecommand {return 0}\fR + \fIspinbox pathName -from 1 -to 10 -validate all -validatecommand {return 0}\fR .CE will in fact set the \fB\-validate\fR option to \fBnone\fR because the default value for the spinbox gets changed (due to the \fB\-from\fR and \fB\-to\fR @@ -250,32 +250,39 @@ arguments. An index specifies a particular character in the spinbox's string, in any of the following ways: .TP 12 \fInumber\fR +. Specifies the character as a numerical index, where 0 corresponds to the first character in the string. .TP 12 \fBanchor\fR +. Indicates the anchor point for the selection, which is set with the \fBselect from\fR and \fBselect adjust\fR widget commands. .TP 12 \fBend\fR +. Indicates the character just after the last one in the spinbox's string. This is equivalent to specifying a numerical index equal to the length of the spinbox's string. .TP 12 \fBinsert\fR +. Indicates the character adjacent to and immediately following the insertion cursor. .TP 12 \fBsel.first\fR +. Indicates the first character in the selection. It is an error to use this form if the selection is not in the spinbox window. .TP 12 \fBsel.last\fR +. Indicates the character just after the last one in the selection. It is an error to use this form if the selection is not in the spinbox window. .TP 12 \fB@\fInumber\fR +. In this form, \fInumber\fR is treated as an x-coordinate in the spinbox's window; the character spanning that x-coordinate is used. For example, @@ -385,12 +392,14 @@ two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx\fR +. Records \fIx\fR and the current view in the spinbox window; used in conjunction with later \fBscan dragto\fR commands. Typically this command is associated with a mouse button press in the widget. It returns an empty string. .TP \fIpathName \fBscan dragto \fIx\fR +. This command computes the difference between its \fIx\fR argument and the \fIx\fR argument to the last \fBscan mark\fR command for the widget. It then adjusts the view left or right by 10 times the diff --git a/doc/sysnotify.n b/doc/sysnotify.n index ea126b4..a80f316 100644 --- a/doc/sysnotify.n +++ b/doc/sysnotify.n @@ -7,6 +7,7 @@ '\" .TH tk sysnotify n "" Tk "Tk Built-In Commands" .so man.macros +.BS .SH NAME sysnotify \- Creates a notification window with a title and message. .SH SYNOPSIS diff --git a/doc/systray.n b/doc/systray.n index c215c29..44f5fda 100644 --- a/doc/systray.n +++ b/doc/systray.n @@ -7,17 +7,16 @@ '\" .TH tk systray n "" Tk "Tk Built-In Commands" .so man.macros +.BS .SH NAME systray \- Creates an icon display in the platform-specific system tray. .SH SYNOPSIS -\fBtk systray create \fI\-image image\fR \fI?\-text text\fR? \fI?\-button1 callback?\fR \fI?\-button3 callback?\fR -.sp +.nf +\fBtk systray create \fB\-image \fIimage\fR ?\fB\-text \fItext\fR? ?\fB\-button1 \fIcallback\fR? ?\fB\-button3 \fIcallback\fR? \fBtk systray configure \fI?option? ?value option value ...?\fR -.sp \fBtk systray exists\fR -.sp \fBtk systray destroy\fR -.BE +.fi .BE .SH DESCRIPTION .PP diff --git a/doc/text.n b/doc/text.n index bd1f029..088b524 100644 --- a/doc/text.n +++ b/doc/text.n @@ -17,6 +17,7 @@ text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate 'text' hype \fBtk_textCopy\fI pathName\fR \fBtk_textCut\fI pathName\fR \fBtk_textPaste\fI pathName\fR +.fi .SO \-background \-highlightthickness \-relief \-borderwidth \-insertbackground \-selectbackground @@ -415,11 +416,13 @@ individual tags using the widget command. If a character has been tagged, then the display options associated with the tag override the default display style. The following options are currently supported for tags: +.\" OPTION: -background .TP \fB\-background \fIcolor\fR . \fIColor\fR specifies the background color to use for characters associated with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR. +.\" OPTION: -bgstipple .TP \fB\-bgstipple \fIbitmap\fR . @@ -427,18 +430,21 @@ with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR. background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is specified as an empty string, then a solid fill will be used for the background. +.\" OPTION: -borderwidth .TP \fB\-borderwidth \fIpixels\fR . \fIPixels\fR specifies the width of a border to draw around the tag using any of the forms accepted by \fBTk_GetPixels\fR. This option should be used in conjunction with the \fB\-relief\fR option to provide the desired border. +.\" OPTION: -elide .TP \fB\-elide \fIboolean\fR . \fIElide\fR specifies whether the data should be elided. Elided data (characters, images, embedded windows, etc.) is not displayed and takes no space on screen, but further on behaves just as normal data. +.\" OPTION: -fgstipple .TP \fB\-fgstipple \fIbitmap\fR . @@ -447,17 +453,20 @@ text and other foreground information such as underlines. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is specified as an empty string, then a solid fill will be used. +.\" OPTION: -font .TP \fB\-font \fIfontName\fR . \fIFontName\fR is the name of a font to use for drawing characters. It may have any of the forms accepted by \fBTk_GetFont\fR. +.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR . \fIColor\fR specifies the color to use when drawing text and other foreground information such as underlines. It may have any of the forms accepted by \fBTk_GetColor\fR. +.\" OPTION: -justify .TP \fB\-justify \fIjustify\fR . @@ -466,6 +475,7 @@ option has been specified, then \fIjustify\fR determines how to justify the line. It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR. If a line wraps, then the justification for each line on the display is determined by the first non-elided character of that display line. +.\" OPTION: -lmargin1 .TP \fB\-lmargin1 \fIpixels\fR . @@ -475,6 +485,7 @@ should be indented from the left edge of the window. \fIPixels\fR may have any of the standard forms for screen distances. If a line of text wraps, this option only applies to the first line on the display; the \fB\-lmargin2\fR option controls the indentation for subsequent lines. +.\" OPTION: -lmargin2 .TP \fB\-lmargin2 \fIpixels\fR . @@ -485,6 +496,7 @@ much the line should be indented from the left edge of the window. \fIPixels\fR may have any of the standard forms for screen distances. This option is only used when wrapping is enabled, and it only applies to the second and later display lines for a text line. +.\" OPTION: -lmargincolor .TP \fB\-lmargincolor \fIcolor\fR . @@ -495,6 +507,7 @@ contain characters because they are indented by \fB\-lmargin1\fR or specified as an empty string, then the color used is specified by the \fB\-background\fR tag option (or, if this is also unspecified, by the \fB\-background\fR widget option). +.\" OPTION: -offset .TP \fB\-offset \fIpixels\fR . @@ -503,12 +516,14 @@ vertically from the baseline of the overall line, in pixels. For example, a positive offset can be used for superscripts and a negative offset can be used for subscripts. \fIPixels\fR may have any of the standard forms for screen distances. +.\" OPTION: -overstrike .TP \fB\-overstrike \fIboolean\fR . Specifies whether or not to draw a horizontal rule through the middle of characters. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. +.\" OPTION: -overstrikefg .TP \fB\-overstrikefg \fIcolor\fR . @@ -516,6 +531,7 @@ characters. \fIBoolean\fR may have any of the forms accepted by have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-foreground\fR tag option is used. +.\" OPTION: -relief .TP \fB\-relief \fIrelief\fR . @@ -523,6 +539,7 @@ specified by the \fB\-foreground\fR tag option is used. of the forms accepted by \fBTk_GetRelief\fR. This option is used in conjunction with the \fB\-borderwidth\fR option to enable to the desired border appearance. +.\" OPTION: -rmargin .TP \fB\-rmargin \fIpixels\fR . @@ -533,6 +550,7 @@ leave between the end of the line and the right edge of the window. option is only used when wrapping is enabled. If a text line wraps, the right margin for each line on the display is determined by the first non-elided character of that display line. +.\" OPTION: -rmargincolor .TP \fB\-rmargincolor \fIcolor\fR . @@ -542,38 +560,46 @@ have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color used is specified by the \fB\-background\fR tag option (or, if this is also unspecified, by the \fB\-background\fR widget option). +.\" OPTION: -selectbackground .TP \fB\-selectbackground \fIcolor\fR +. \fIColor\fR specifies the background color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-background\fR tag option is used. +.\" OPTION: -selectforeground .TP \fB\-selectforeground \fIcolor\fR +. \fIColor\fR specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-foreground\fR tag option is used. +.\" OPTION: -spacing1 .TP \fB\-spacing1 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left above each text line, using any of the standard forms for screen distances. If a line wraps, this option only applies to the first line on the display. +.\" OPTION: -spacing2 .TP \fB\-spacing2 \fIpixels\fR . For lines that wrap, this option specifies how much additional space to leave between the display lines for a single text line. \fIPixels\fR may have any of the standard forms for screen distances. +.\" OPTION: -spacing3 .TP \fB\-spacing3 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left below each text line, using any of the standard forms for screen distances. If a line wraps, this option only applies to the last line on the display. +.\" OPTION: -tabs .TP \fB\-tabs \fItabList\fR . @@ -585,6 +611,7 @@ unspecified for the tag (the default). If the option is specified as a non-empty string that is an empty list, such as \fB\-tags\0{\0}\fR, then it requests default 8-character tabs as described for the \fB\-tags\fR widget option. +.\" OPTION: -tabstyle .TP \fB\-tabstyle \fIstyle\fR . @@ -593,11 +620,13 @@ tabbing to use for the text widget. This option only applies to a display line if it applies to the first non-elided character on that display line. If this option is specified as an empty string, it cancels the option, leaving it unspecified for the tag (the default). +.\" OPTION: -underline .TP \fB\-underline \fIboolean\fR . \fIBoolean\fR specifies whether or not to draw an underline underneath characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. +.\" OPTION: -underlinefg .TP \fB\-underlinefg \fIcolor\fR . @@ -605,6 +634,7 @@ characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-foreground\fR tag option is used. +.\" OPTION: -wrap .TP \fB\-wrap \fImode\fR . @@ -706,6 +736,7 @@ When an embedded window is added to a text widget with the \fIpathName associated with it. These options may be modified later with the \fIpathName \fBwindow configure\fR widget command. The following options are currently supported: +.\" OPTION: -align .TP \fB\-align \fIwhere\fR . @@ -716,6 +747,7 @@ line), \fBcenter\fR (center the window within the range of the line), \fBbottom\fR (align the bottom of the window with the bottom of the line's area), or \fBbaseline\fR (align the bottom of the window with the baseline of the line). +.\" OPTION: -create .TP \fB\-create \fIscript\fR . @@ -728,18 +760,21 @@ the name of that window as its result. Two substitutions will be performed in the parent text widget, and \fI%%\fR will be substituted by a single \fI%\fR. If the annotation's window should ever be deleted, \fIscript\fR will be evaluated again the next time the annotation is displayed. +.\" OPTION: -padx .TP \fB\-padx \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on each side of the embedded window. It may have any of the usual forms defined for a screen distance. +.\" OPTION: -pady .TP \fB\-pady \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on the top and on the bottom of the embedded window. It may have any of the usual forms defined for a screen distance. +.\" OPTION: -stretch .TP \fB\-stretch \fIboolean\fR . @@ -748,6 +783,7 @@ line in which it is displayed, this option can be used to specify whether the window should be stretched vertically to fill its line. If the \fB\-pady\fR option has been specified as well, then the requested padding will be retained even if the window is stretched. +.\" OPTION: -window .TP \fB\-window \fIpathName\fR . @@ -796,6 +832,7 @@ When an embedded image is added to a text widget with the \fIpathName \fBimage create\fR widget command, several configuration options may be associated with it. These options may be modified later with the \fIpathName \fBimage configure\fR widget command. The following options are currently supported: +.\" OPTION: -align .TP \fB\-align \fIwhere\fR . @@ -805,11 +842,13 @@ of the values \fBtop\fR (align the top of the image with the top of the line), \fBcenter\fR (center the image within the range of the line), \fBbottom\fR (align the bottom of the image with the bottom of the line's area), or \fBbaseline\fR (align the bottom of the image with the baseline of the line). +.\" OPTION: -image .TP \fB\-image \fIimage\fR . Specifies the name of the Tk image to display in the annotation. If \fIimage\fR is not a valid Tk image, then an error is returned. +.\" OPTION: -name .TP \fB\-name \fIImageName\fR . @@ -817,12 +856,14 @@ Specifies the name by which this image instance may be referenced in the text widget. If \fIImageName\fR is not supplied, then the name of the Tk image is used instead. If the \fIimageName\fR is already in use, \fI#nn\fR is appended to the end of the name as described above. +.\" OPTION: -padx .TP \fB\-padx \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on each side of the embedded image. It may have any of the usual forms defined for a screen distance. +.\" OPTION: -pady .TP \fB\-pady \fIpixels\fR . @@ -1250,11 +1291,13 @@ the text, mark name, tag name, image name, or window name. The \fIindex\fR information is the index of the start of the text, mark, tag transition, image or window. One or more of the following switches (or abbreviations thereof) may be specified to control the dump: +.\" OPTION: -all .TP \fB\-all\fR . Return information about all elements: text, marks, tags, images and windows. This is the default. +.\" OPTION: -command .TP \fB\-command \fIcommand\fR . @@ -1262,20 +1305,24 @@ Instead of returning the information as the result of the dump operation, invoke the \fIcommand\fR on each element of the text widget within the range. The command has three arguments appended to it before it is evaluated: the \fIkey\fR, \fIvalue\fR, and \fIindex\fR. +.\" OPTION: -image .TP \fB\-image\fR . Include information about images in the dump results. +.\" OPTION: -mark .TP \fB\-mark\fR . Include information about marks in the dump results. +.\" OPTION: -tag .TP \fB\-tag\fR . Include information about tag transitions in the dump results. Tag information is returned as \fBtagon\fR and \fBtagoff\fR elements that indicate the begin and end of each range of each tag, respectively. +.\" OPTION: -text .TP \fB\-text\fR . @@ -1284,6 +1331,7 @@ to the next element or the end of range indicated by \fIindex2\fR. A text element does not span newlines. A multi-line block of text that contains no marks or tag transitions will still be dumped as a set of text segments that each end with a newline. The newline is part of the value. +.\" OPTION: -window .TP \fB\-window\fR . @@ -1570,12 +1618,14 @@ first character in the match is returned as result; otherwise an empty string is returned. One or more of the following switches (or abbreviations thereof) may be specified to control the search: .RS +.\" OPTION: -forwards .TP \fB\-forwards\fR . The search will proceed forward through the text, finding the first matching range starting at or after the position given by \fIindex\fR. This is the default. +.\" OPTION: -backwards .TP \fB\-backwards\fR . @@ -1585,11 +1635,13 @@ allowed to be at \fIindex\fR). Note that, for a variety of reasons, backwards searches can be substantially slower than forwards searches (particularly when using \fB\-regexp\fR), so it is recommended that performance-critical code use forward searches. +.\" OPTION: -exact .TP \fB\-exact\fR . Use exact matching: the characters in the matching range must be identical to those in \fIpattern\fR. This is the default. +.\" OPTION: -regexp .TP \fB\-regexp\fR . @@ -1601,6 +1653,7 @@ details). The default matching automatically passes both the \fB\-nolinestop\fR is used), so that \fI^$\fR match beginning and end of line, and \fI.\fR, \fI[^\fR sequences will never match the newline character \fI\en\fR. +.\" OPTION: -nolinestop .TP \fB\-nolinestop\fR . @@ -1609,10 +1662,12 @@ This allows \fI.\fR and \fI[^\fR sequences to match the newline character details). This option is only meaningful if \fB\-regexp\fR is also given, and an error will be thrown otherwise. For example, to match the entire text, use .QW "\fIpathName \fBsearch \-nolinestop \-regexp\fR \N'34'.*\N'34' 1.0" . +.\" OPTION: -nocase .TP \fB\-nocase\fR . Ignore case differences between the pattern and the text. +.\" OPTION: -count .TP \fB\-count\fI varName\fR . @@ -1623,6 +1678,7 @@ or windows in the matching range (and there are no elided characters if \fB\-elide\fR is not given), this is equivalent to the number of characters matched. In either case, the range \fImatchIdx\fR to \fImatchIdx + $count chars\fR will return the entire matched text. +.\" OPTION: -all .TP \fB\-all\fR . @@ -1642,6 +1698,7 @@ will just match twice, once for each word, and matching against .QW ZooZooZoo will just match once. +.\" OPTION: -overlap .TP \fB\-overlap\fR . @@ -1659,6 +1716,7 @@ against .QW ZooZooZoo will now match twice. An error will be thrown if this switch is used without \fB\-all\fR. +.\" OPTION: -strictlimits .TP \fB\-strictlimits\fR . @@ -1666,10 +1724,12 @@ When performing any search, the normal behaviour is that the start and stop limits are checked with respect to the start of the matching text. With the \fB\-strictlimits\fR flag, the entire matching range must lie inside the start and stop limits specified for the match to be valid. +.\" OPTION: -elide .TP \fB\-elide\fR . Find elided (hidden) text as well. By default only displayed text is searched. +.\" OPTION: -- .TP \fB\-\|\-\fR . @@ -2285,7 +2345,7 @@ practice this is a rare problem, but it can occur, for example: .CS pack [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" -\&.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0 +\&.t search -regexp -- {(a+|b+\enc+\enb+)+\ena+} 1.0 .CE will not find a match when one exists of 19 characters starting from the first .QW b . @@ -2301,7 +2361,7 @@ portions of the widget. For example: .CS pack [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n" -\&.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end +\&.t search -regexp -backward -- {b+\en|a+\en(b+\en)+} end .CE matches at .QW 5.0 diff --git a/doc/tk_mac.n b/doc/tk_mac.n index 9ea8f85..39be09c 100644 --- a/doc/tk_mac.n +++ b/doc/tk_mac.n @@ -44,6 +44,7 @@ The Aqua/Mac OS X application environment defines a number of additional events that applications should respond to. These events are mapped by Tk to calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if the command is absent, no action will be taken. +.\" COMMAND: DoScriptFile .TP \fB::tk::mac::DoScriptFile\fR . @@ -51,6 +52,7 @@ The default Apple Event handler for AEDoScriptHandler. This command executes a Tcl file when an AppleScript sends a .QW "do script" command to Wish with a file path as a parameter. +.\" COMMAND: DoScriptText .TP \fB::tk::mac::DoScriptText\fR . @@ -58,6 +60,7 @@ The default Apple Event handler for AEDoScriptHandler. This command executes Tcl code when an AppleScript sends a .QW "do script" command to Wish with Tcl code or a Tcl procedure as a parameter. +.\" COMMAND: ShowPreferences .TP \fB::tk::mac::ShowPreferences\fR . @@ -76,6 +79,7 @@ proc ::tk::mac::ShowPreferences {} { } .CE .RE +.\" COMMAND: OpenApplication .TP \fB::tk::mac::OpenApplication\fR . @@ -83,6 +87,7 @@ If a proc of this name is defined, this proc fill fire when your application is initially opened. It is the default Apple Event handler for kAEOpenApplication, .QW oapp . +.\" COMMAND: ReopenApplication .TP \fB::tk::mac::ReopenApplication\fR . @@ -105,6 +110,7 @@ proc ::tk::mac::ReopenApplication {} { } .CE .RE +.\" COMMAND: OpenDocument .TP \fB::tk::mac::OpenDocument \fIfile...\fR . @@ -123,6 +129,7 @@ proc ::tk::mac::OpenDocument {args} { } .CE .RE +.\" COMMAND: PrintDocument .TP \fB::tk::mac::PrintDocument \fIfile...\fR . @@ -131,6 +138,7 @@ kAEPrintDocuments, .QW pdoc , the Apple Event sent when your application is asked to print a document. It takes a single absolute file path as an argument. +.\" COMMAND: Quit .TP \fB::tk::mac::Quit\fR . @@ -141,17 +149,20 @@ the Apple Event sent when your application is asked to be quit, e.g. via the quit menu item in the application menu, the quit menu item in the Dock menu, or during a logout/restart/shutdown etc. If this is not defined, \fBexit\fR is called instead. +.\" COMMAND: OnHide .TP \fB::tk::mac::OnHide\fR . If defined, this is called when your application receives a kEventAppHidden event, e.g. via the hide menu item in the application or Dock menus. +.\" COMMAND: OnShow .TP \fB::tk::mac::OnShow\fR . If defined, this is called when your application receives a kEventAppShown event, e.g. via the show all menu item in the application menu, or by clicking the Dock icon of a hidden application. +.\" COMMAND: ShowHelp .TP \fB::tk::mac::ShowHelp\fR . @@ -161,6 +172,7 @@ platform-specific standard Help menu item performs the default Cocoa action of showing the Help Book configured in the application's Info.plist (or displaying an alert if no Help Book is set). +.\" COMMAND: PerformService .TP \fB::tk::mac::PerformService\fR . @@ -192,6 +204,7 @@ key in Wish's Info.plist file is currently set as .QW "Wish" ; if a developer changes the name of the Wish executable to something else, this key should be modified with the same name. +.\" COMMAND: LaunchURL .TP \fB::tk::mac::LaunchURL \fIURL...\fR . @@ -201,8 +214,8 @@ an RSS feed, rather than launching a default application to handle the URL, although it can defined as such. Wish includes a stub URL scheme of .QW foo:// -in the CFBundleURLSchemes key of its Info.plist file; this should be customized for the specific URL -scheme the developer wants to support. +in the CFBundleURLSchemes key of its Info.plist file; this should be +customized for the specific URL scheme the developer wants to support. .TP \fB::tk::mac::GetAppPath\fR . @@ -212,6 +225,7 @@ Returns the current applications's file path. .PP The Aqua/Mac OS X defines additional dialogs that applications should support. +.\" COMMAND: standardAboutPanel .TP \fB::tk::mac::standardAboutPanel\fR . @@ -230,22 +244,26 @@ procedure will be called instead of opening the standardAboutPanel. .PP There are a number of additional global configuration options that control the details of how Tk renders by default. +.\" COMMAND: useCompatibilityMetrics .TP \fB::tk::mac::useCompatibilityMetrics \fIboolean\fR . Preserves compatibility with older Tk/Aqua metrics; set to \fBfalse\fR for more native spacing. +.\" COMMAND: CGAntialiasLimit .TP \fB::tk::mac::CGAntialiasLimit \fIlimit\fR . Sets the antialiasing limit; lines thinner that \fIlimit\fR pixels will not be antialiased. Integer, set to 0 by default, making all lines be antialiased. +.\" COMMAND: antialiasedtext .TP \fB::tk::mac::antialiasedtext \fInumber\fR . Sets anti-aliased text. Controls text antialiasing, possible values for \fInumber\fR are -1 (default, use system default for text AA), 0 (no text AA), 1 (use text AA). +.\" COMMAND: useThemedToplevel .TP \fB::tk::mac::useThemedToplevel \fIboolean\fR . @@ -254,6 +272,7 @@ background. Equivalent to configuring the toplevel with .QW "\fB\-background systemWindowHeaderBackground\fR" , or to using a \fBttk::frame\fR. .SH "SUPPORT COMMANDS" +.\" COMMAND: iconBitmap .TP \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR . @@ -275,26 +294,32 @@ NSImage url string .PP The \fIwidth\fR and \fIheight\fR arguments to \fBtk::mac::iconBitmap\fR define the dimensions of the image to create, and \fI\-kind\fR must be one of: +.\" OPTION: -file .TP \fB\-file\fR . icon of file at given path +.\" OPTION: -fileType .TP \fB\-fileType\fR . icon of given file type +.\" OPTION: -osType .TP \fB\-osType\fR . icon of given 4-char OSType file type +.\" OPTION: -systemType .TP \fB\-systemType\fR . icon for given IconServices 4-char OSType +.\" OPTION: -namedImage .TP \fB\-namedImage\fR . named NSImage for given name +.\" OPTION: -imageFile .TP \fB\-imageFile\fR . diff --git a/doc/tkerror.n b/doc/tkerror.n index 53cb0d1..b1e4b81 100644 --- a/doc/tkerror.n +++ b/doc/tkerror.n @@ -18,13 +18,15 @@ tkerror \- Command invoked to process background errors .PP Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to \fBbgerror\fR because the event loop (which is what usually invokes -it) is now part of Tcl. For backward compatibility +it) is now part of Tcl. Using the \fBtkerror\fR name is deprecated. +.PP +For backward compatibility the \fBbgerror\fR provided by the current Tk version still tries to call \fBtkerror\fR if there is one (or an auto loadable one), so old script defining that error handler should still work, but you should anyhow modify your scripts to use \fBbgerror\fR instead of \fBtkerror\fR because that support for the old name might vanish -in the near future. If that call fails, \fBbgerror\fR +in the future. If that call fails, \fBbgerror\fR posts a dialog showing the error and offering to see the stack trace to the user. If you want your own error management you should directly override \fBbgerror\fR instead of \fBtkerror\fR. diff --git a/doc/tkvars.n b/doc/tkvars.n index e211575..cd69906 100644 --- a/doc/tkvars.n +++ b/doc/tkvars.n @@ -16,6 +16,7 @@ geometry, tk_library, tk_patchLevel, tk::scalingPct, tk_strictMotif, tk::svgFmt, .PP The following Tcl variables are either set or used by Tk at various times in its execution: +.\" VARIABLE: tk_library .TP 15 \fBtk_library\fR . @@ -40,6 +41,7 @@ working directory. The variable can be modified by an application to switch to a different library. .RE +.\" VARIABLE: tk_patchLevel .TP \fBtk_patchLevel\fR . @@ -52,6 +54,7 @@ it uniquely identifies an official version of Tk. This value is normally the same as the result of .QW "\fBpackage require\fR \fBtk\fR" . .RE +.\" VARIABLE: scalingPct .TP \fBtk::scalingPct\fR . @@ -87,6 +90,7 @@ additional step, Tk synchronizes the scaling factor used to convert between physical units and pixels with the scaling percentage, with the aid of the \fBtk scaling\fR command. .RE +.\" VARIABLE: tk_strictMotif .TP \fBtk_strictMotif\fR . @@ -96,6 +100,7 @@ closely as possible to Motif look-and-feel standards. For example, active elements such as buttons and scrollbar sliders will not change color when the pointer passes over them. Modern applications should not normally set this variable. +.\" VARIABLE: svgFmt .TP \fBtk::svgFmt\fR . @@ -119,6 +124,7 @@ read-only! Note also that whenever the scaling factor used to convert between physical units and pixels is changed via \fBtk scaling\fR, the value of the variable \fBtk::svgFmt\fR is automatically updated. .RE +.\" VARIABLE: tk_version .TP \fBtk_version\fR . @@ -134,6 +140,7 @@ major version number changes. .SS "INTERNAL AND DEBUGGING VARIABLES" .PP These variables should not normally be set by user code. +.\" VARIABLE: Priv .TP \fBtk::Priv\fR . @@ -141,6 +148,8 @@ This variable is an array containing several pieces of information that are private to Tk. The elements of \fBtk::Priv\fR are used by Tk library procedures and default bindings. They should not be accessed by any code outside Tk. +.\" VARIABLE: tk_textRedraw +.\" VARIABLE: tk_textRelayout .TP \fBtk_textRedraw\fR .TP @@ -154,6 +163,7 @@ used by Tk's test suite. The following variables are only guaranteed to exist in \fBwish\fR executables; the Tk library does not define them itself but many Tk environments do. +.\" VARIABLE: geometry .TP \fBgeometry\fR . diff --git a/doc/tkwait.n b/doc/tkwait.n index 42d5ea6..958d4f3 100644 --- a/doc/tkwait.n +++ b/doc/tkwait.n @@ -12,11 +12,11 @@ .SH NAME tkwait \- Wait for variable to change or window to be destroyed .SH SYNOPSIS +.nf \fBtkwait variable \fIname\fR -.sp \fBtkwait visibility \fIname\fR -.sp \fBtkwait window \fIname\fR +.fi .BE .SH DESCRIPTION .PP diff --git a/doc/ttk_Geometry.3 b/doc/ttk_Geometry.3 index 0f8a171..20295d1 100644 --- a/doc/ttk_Geometry.3 +++ b/doc/ttk_Geometry.3 @@ -100,7 +100,8 @@ A bitmask containing one or more of the bits \fBTTK_STICK_E\fR (east, or right), \fBTTK_STICK_N\fR (north, or top), and \fBTTK_STICK_S\fR (south, or bottom). -\fBTTK_FILL_X\fR is defined as a synonym for (\fBTTK_STICK_W\fR|\fBTTK_STICK_E\fR), +\fBTTK_FILL_X\fR is defined as a synonym for +(\fBTTK_STICK_W\fR|\fBTTK_STICK_E\fR), \fBTTK_FILL_Y\fR is a synonym for (\fBTTK_STICK_N\fR|\fBTTK_STICK_S\fR), and \fBTTK_FILL_BOTH\fR is a synonym for (\fBTTK_FILL_X\fR|\fBTTK_FILL_Y\fR). diff --git a/doc/ttk_button.n b/doc/ttk_button.n index cd54add..4c24a45 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -105,7 +105,7 @@ are: .RS \fB\-shiftrelief\fP specifies how far the button contents are shifted down and right in the \fIpressed\fP state. -This action provides additional skeumorphic feedback. +This action provides additional skeuomorphic feedback. .RE \fB\-width\fP \fIamount\fP .PP diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n index 7f7b202..c4176ec 100644 --- a/doc/ttk_entry.n +++ b/doc/ttk_entry.n @@ -442,7 +442,8 @@ value is specified for \fB\-fieldbackground\fP. Otherwise it is ignored. .br \fB\-fieldbackground\fP \fIcolor\fP .RS -Some themes use a graphical background and their field background colors cannot be changed. +Some themes use a graphical background and their field background colors +cannot be changed. .RE \fB\-foreground\fP \fIcolor\fP .br diff --git a/doc/ttk_image.n b/doc/ttk_image.n index 8bc1b9e..09cf1f8 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -25,24 +25,30 @@ in a particular state or combination of states. .SH OPTIONS .PP Valid \fIoptions\fR are: +.\" OPTION: -border .TP \fB\-border\fI padding\fR +. \fIpadding\fR is a list of up to four integers, specifying the left, top, right, and bottom borders, respectively. If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, \fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. -In other words, a list of three numbers specify the left, vertical, and right border; -a list of two numbers specify the horizontal and the vertical border; +In other words, a list of three numbers specify the left, vertical, and right +border; a list of two numbers specify the horizontal and the vertical border; a single number specifies the same border all the way around the element. See \fBIMAGE STRETCHING\fR, below. +.\" OPTION: -height .TP \fB\-height \fIheight\fR +. Specifies a minimum height for the element. If less than zero, the base image's height is used as a default. +.\" OPTION: -padding .TP \fB\-padding\fI padding\fR +. Specifies the element's interior padding. The padding is a list of up to four length specifications \fIleft top right bottom\fR. @@ -50,12 +56,14 @@ If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, \fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. -In other words, a list of three numbers specify the left, vertical, and right padding; -a list of two numbers specify the horizontal and the vertical padding; +In other words, a list of three numbers specify the left, vertical, and right +padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget. Defaults to \fB\-border\fR if not specified. +.\" OPTION: -sticky .TP \fB\-sticky\fI spec\fR +. Specifies how the image is placed within the final parcel. \fIspec\fR contains zero or more characters .QW n , @@ -63,8 +71,10 @@ Specifies how the image is placed within the final parcel. .QW w , or .QW e . +.\" OPTION: -width .TP \fB\-width \fIwidth\fR +. Specifies a minimum width for the element. If less than zero, the base image's width is used as a default. .SH "IMAGE STRETCHING" @@ -85,12 +95,12 @@ as a background image) should use \fB\-width 0\fR and \fB\-height 0\fR. .SH "EXAMPLE" .PP .CS -set img1 [image create photo \-file button.png] -set img2 [image create photo \-file button-pressed.png] -set img3 [image create photo \-file button-active.png] +set img1 [image create photo -file button.png] +set img2 [image create photo -file button-pressed.png] +set img3 [image create photo -file button-active.png] ttk::style element create Button.button image \e [list $img1 pressed $img2 active $img3] \e - \-border {2 4} \-sticky we + -border {2 4} -sticky we .CE .SH "SEE ALSO" ttk::intro(n), ttk::style(n), ttk_vsapi(n), image(n), photo(n) diff --git a/doc/ttk_intro.n b/doc/ttk_intro.n index c146dd1..783ebb6 100644 --- a/doc/ttk_intro.n +++ b/doc/ttk_intro.n @@ -83,10 +83,10 @@ For example, the layout for a horizontal scrollbar is: .PP .CS ttk::\fBstyle layout\fR Horizontal.TScrollbar { - Scrollbar.trough \-children { - Scrollbar.leftarrow \-side left \-sticky w - Scrollbar.rightarrow \-side right \-sticky e - Scrollbar.thumb \-sticky ew + Scrollbar.trough -children { + Scrollbar.leftarrow -side left -sticky w + Scrollbar.rightarrow -side right -sticky e + Scrollbar.thumb -sticky ew } } .CE @@ -151,9 +151,9 @@ For example: .PP .CS ttk::\fBstyle configure\fR TButton \e - \-background #d9d9d9 \e - \-foreground black \e - \-relief raised \e + -background #d9d9d9 \e + -foreground black \e + -relief raised \e ; .CE .PP @@ -165,9 +165,9 @@ for a particular style: .PP .CS ttk::\fBstyle map\fR TButton \e - \-background [list disabled #d9d9d9 active #ececec] \e - \-foreground [list disabled #a3a3a3] \e - \-relief [list {pressed !disabled} sunken] \e + -background [list disabled #d9d9d9 active #ececec] \e + -foreground [list disabled #a3a3a3] \e + -relief [list {pressed !disabled} sunken] \e ; .CE .SH "SEE ALSO" diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index f93f234..b7844a7 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -41,8 +41,8 @@ If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, \fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. -In other words, a list of three numbers specify the left, vertical, and right padding; -a list of two numbers specify the horizontal and the vertical padding; +In other words, a list of three numbers specify the left, vertical, and right +padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget. .OP \-width width Width If present and greater than zero, @@ -144,9 +144,11 @@ The following subcommands are supported: .RS .TP \fIpathname \fBidentify element\fI x y\fR +. Returns the name of the element at the specified location. .TP \fIpathname \fBidentify tab\fI x y\fR +. Returns the index of the tab at the specified location. .RE .\" METHOD: index @@ -219,8 +221,8 @@ virtual event after a new tab is selected. .SH "EXAMPLE" .CS pack [\fBttk::notebook\fR .nb] -\&.nb add [frame .nb.f1] \-text "First tab" -\&.nb add [frame .nb.f2] \-text "Second tab" +\&.nb add [frame .nb.f1] -text "First tab" +\&.nb add [frame .nb.f2] -text "Second tab" \&.nb select .nb.f2 ttk::notebook::enableTraversal .nb .CE diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n index adf92bb..695f668 100644 --- a/doc/ttk_panedwindow.n +++ b/doc/ttk_panedwindow.n @@ -77,9 +77,11 @@ The following subcommands are supported: .RS .TP \fIpathname \fBidentify element \fIx y\fR +. Returns the name of the element at the specified location. .TP \fIpathname \fBidentify sash \fIx y\fR +. Returns the index of the sash at the specified location. .RE .\" METHOD: insert diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n index 1f63821..050d0bf 100644 --- a/doc/ttk_sizegrip.n +++ b/doc/ttk_sizegrip.n @@ -37,14 +37,14 @@ the built-in grip will just mask the widget. .PP Using pack: .CS -pack [ttk::frame $top.statusbar] \-side bottom \-fill x -pack [\fBttk::sizegrip\fR $top.statusbar.grip] \-side right \-anchor se +pack [ttk::frame $top.statusbar] -side bottom -fill x +pack [\fBttk::sizegrip\fR $top.statusbar.grip] -side right -anchor se .CE .PP Using grid: .CS grid [\fBttk::sizegrip\fR $top.statusbar.grip] \e - \-row $lastRow \-column $lastColumn \-sticky se + -row $lastRow -column $lastColumn -sticky se # ... optional: add vertical scrollbar in $lastColumn, # ... optional: add horizontal scrollbar in $lastRow .CE diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n index 3b038f0..c976095 100644 --- a/doc/ttk_spinbox.n +++ b/doc/ttk_spinbox.n @@ -36,15 +36,15 @@ when using the \fB\-from\fR and \fB\-to\fR range. This must be a format specifier of the form \fB%.f\fR, as it will format a floating-point number. .OP \-from from From -A floating\-point value specifying the lowest value for the spinbox. This is +A floating-point value specifying the lowest value for the spinbox. This is used in conjunction with \fB\-to\fR and \fB\-increment\fR to set a numerical range. .OP \-increment increment Increment -A floating\-point value specifying the change in value to be applied each +A floating-point value specifying the change in value to be applied each time one of the widget spin buttons is pressed. The up button applies a positive increment, the down button applies a negative increment. .OP \-to to To -A floating\-point value specifying the highest permissible value for the +A floating-point value specifying the highest permissible value for the widget. See also \fB\-from\fR and \fB\-increment\fR. range. .OP \-values values Values diff --git a/doc/ttk_style.n b/doc/ttk_style.n index dcd5567..85d6a06 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -148,17 +148,24 @@ Valid options are: .\" -border should remain undocumented for now (dubious usefulness) .\" .TP .\" \fB\-border\fI boolean\fR +.\" . .\" Specifies whether the element is drawn after its children. Defaults to 0. +.\" OPTION: -children .TP \fB\-children { \fIsublayout...\fB }\fR +. Specifies a list of elements to place inside the element. +.\" OPTION: -expand .TP \fB\-expand\fI boolean\fR +. Specifies whether the allocated parcel is the entire cavity. If so, simultaneous specification of \fB\-side\fR is ignored. Defaults to 0. +.\" OPTION: -side .TP \fB\-side \fIside\fR +. Specifies which side of the cavity to place the element; one of \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. For instance, \fB\-side top\fR allocates the parcel along the top of @@ -166,24 +173,27 @@ the cavity having width and height respectively the width of the cavity and the height of the element. If omitted, the allocated parcel is the entire cavity (same effect as \fB\-expand\fR 1). +.\" OPTION: -sticky .TP \fB\-sticky\fR \fB[\fInswe\fB]\fR +. Specifies the actual parcel position and size inside the allocated parcel. If specified as an empty string then the actual parcel is centered in the allocated parcel. Default is \fBnswe\fR. .\" -unit should remain undocumented for now (dubious usefulness) .\" .TP .\" \fB\-unit\fI boolean\fR +.\" . .\" Specifies whether the element propagates its state to its children. .\" Defaults to 0. .PP For example: .CS ttk::style layout Horizontal.TScrollbar { - Scrollbar.trough \-children { - Scrollbar.leftarrow \-side left - Scrollbar.rightarrow \-side right - Horizontal.Scrollbar.thumb \-side left \-sticky ew + Scrollbar.trough -children { + Scrollbar.leftarrow -side left + Scrollbar.rightarrow -side right + Horizontal.Scrollbar.thumb -side left -sticky ew } } .CE diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index d2ef877..8ff0091 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -62,7 +62,7 @@ If set to \fB#all\fP (the default), all columns are shown in the order given. .OP \-height height Height Specifies the number of rows which should be visible. -Note: +Note that the requested width is determined from the sum of the column widths. .OP \-selectmode selectMode SelectMode Controls how the built-in class bindings manage the selection. @@ -95,13 +95,13 @@ even if \fB\-show tree\fR is not specified. .RE .OP \-striped striped Striped Boolean specifying zebra striped item coloring. -Note: -Striped items uses the \fB\-stripedbackground\fR option if set by the theme or a tag. -If not supported by the current theme, it will not show. +Note that +striped items uses the \fB\-stripedbackground\fR option if set by the theme or +a tag. If not supported by the current theme, it will not show. .OP \-titlecolumns titleColumns TitleColumns -Number of display columns at the left that should not be scrolled. The tree column counts, even -if \fB\-show tree\fR is not specified. Thus for value N of this option, column #N is -the first one that is scrollable. Default is 0. +Number of display columns at the left that should not be scrolled. The tree +column counts, even if \fB\-show tree\fR is not specified. Thus for value N of +this option, column #N is the first one that is scrollable. Default is 0. .OP \-titleitems titleItems TitleItems Number of items at the top that should not be vertically scrolled. Default is 0. .SH "WIDGET COMMAND" @@ -116,14 +116,13 @@ treeview widgets support the following additional commands: \fIpathname \fBbbox \fIitem\fR ?\fIcolumn\fR? . Returns the bounding box (relative to the treeview widget's window) -of the specified \fIitem\fR -in the form \fIx y width height\fR. +of the specified \fIitem\fR in the form \fIx y width height\fR. If the \fIitem\fR is not visible -(i.e., if it is a descendant of a closed item or is vertically scrolled offscreen), -returns the empty list. -If \fIcolumn\fR is specified and is not hidden (by the \fB\-displaycolumns\fR option), -returns the bounding box of that cell within \fIitem\fR (even if the cell -is horizontally scrolled offscreen). +(i.e., if it is a descendant of a closed item or is vertically scrolled +offscreen), returns the empty list. +If \fIcolumn\fR is specified and is not hidden (by the \fB\-displaycolumns\fR +option), returns the bounding box of that cell within \fIitem\fR +(even if the cell is horizontally scrolled offscreen). .\" METHOD: cellselection .TP \fIpathname \fBcellselection\fR ?\fIselop arg ...\fR? @@ -197,6 +196,7 @@ returns the value of that option. Otherwise, the options are updated with the specified values. The following options may be set on each column: .RS +.\" OPTION: -id .TP \fB\-id \fIname\fR . @@ -204,6 +204,7 @@ The column name. This is a read-only option. For example, [\fI$pathname \fBcolumn #\fIn \fB\-id\fR] returns the data column associated with display column \fIn\fR. The tree column has \fB\-id #0\fR. +.\" OPTION: -anchor .TP \fB\-anchor \fIanchor\fR . @@ -211,6 +212,7 @@ Specifies how the text in this column should be aligned with respect to the cell. \fIAnchor\fR is one of \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. +.\" OPTION: -minwidth .TP \fB\-minwidth \fIminwidth\fR . @@ -218,11 +220,13 @@ The minimum width of the column in pixels. The treeview widget will not make the column any smaller than \fB\-minwidth\fR when the widget is resized or the user drags a heading column separator. Default is 20 pixels. +.\" OPTION: -separator .TP \fB\-separator \fIboolean\fR . Specifies whether or not a column separator should be drawn to the right of the column. Default is false. +.\" OPTION: -stretch .TP \fB\-stretch \fIboolean\fR . @@ -230,6 +234,7 @@ Specifies whether or not the column width should be adjusted when the widget is resized or the user drags a heading column separator. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. By default columns are stretchable. +.\" OPTION: -width .TP \fB\-width \fIwidth\fR . @@ -287,19 +292,23 @@ Otherwise, returns the current focus item, or \fB{}\fR if there is none. Query or modify the heading options for the specified \fIcolumn\fR. Valid options are: .RS +.\" OPTION: -text .TP \fB\-text \fItext\fR . The text to display in the column heading. +.\" OPTION: -image .TP \fB\-image \fIimageName\fR . Specifies an image to display to the right of the column heading. +.\" OPTION: -anchor .TP \fB\-anchor \fIanchor\fR . Specifies how the heading text should be aligned. One of the standard Tk anchor values. +.\" OPTION: -command .TP \fB\-command \fIscript\fR . @@ -511,7 +520,7 @@ The binding \fIscript\fR undergoes \fB%\fR-substitutions before evaluation; see \fBbind\fR(n) for details. .RE .TP -\fIpathName \fBtag cell \fIsubcmd...\fR +\fIpathName \fBtag cell \fIsubcommand...\fR . Manages tags on individual cells. A \fIcellList\fR argument may be a single cell or a list of cells. @@ -550,8 +559,8 @@ See \fBTAG OPTIONS\fR for the list of available options. .TP \fIpathName \fBtag delete \fItagName\fR . -Deletes all tag information for the \fItagName\fR argument. The -command removes the tag from all items and cells in the widget and also deletes any +Deletes all tag information for the \fItagName\fR argument. The command +removes the tag from all items and cells in the widget and also deletes any other information associated with the tag, such as bindings and display information. The command returns an empty string. .TP @@ -582,10 +591,11 @@ The textual label to display for the item in the tree column. .IP \fB\-height\fR The height for the item, in integer multiples of \fB\-rowheight\fP. Default is 1. .IP \fB\-image\fR -A Tk image, displayed next to the label in the tree column, placed according to \fB\-imageanchor\fR. +A Tk image, displayed next to the label in the tree column, placed according +to \fB\-imageanchor\fR. .IP \fB\-imageanchor\fR -Specifies how the \fB\-image\fR is displayed relative to the text. Default is \fBw\fR. -One of the standard Tk anchor values. +Specifies how the \fB\-image\fR is displayed relative to the text. +Default is \fBw\fR. One of the standard Tk anchor values. .IP \fB\-values\fR The list of values associated with the item. .RS @@ -622,17 +632,19 @@ Specifies the cell or item image anchor. .IP \fB\-padding\fR Specifies the cell padding. A data cell will have a default padding of {4 0} .IP \fB\-stripedbackground\fR -Specifies the cell or item background color for alternate lines, if \fB\-striped\fR is true. +Specifies the cell or item background color for alternate lines, +if \fB\-striped\fR is true. .PP .\" .PP .\" \fI(@@@ TODO: sort out order of precedence for options)\fR .PP Tags on cells have precedence over tags on items. Then, tag priority is decided by the creation order: tags created first receive higher priority. -An item's options, like \fB\-image\fR and \fB\-imageanchor\fR, have priority over tags. +An item's options, like \fB\-image\fR and \fB\-imageanchor\fR, have priority +over tags. .SH "IMAGES" -The -image option on an item, and on an item tag, controls the image next to the label -in the tree column. +The -image option on an item, and on an item tag, controls the image next to +the label in the tree column. Other cells can have images through the cell tag -image option. .SH "COLUMN IDENTIFIERS" .PP @@ -724,7 +736,7 @@ way to how the default value is set: .PP .CS ttk::style configure Treeview \\ - \-rowheight [expr {[font metrics \fIfont\fP \-linespace] + 2}] + -rowheight [expr {[font metrics \fIfont\fP -linespace] + 2}] .CE .br \fB\-stripedbackground\fP \fIcolor\fP diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index 52b18c9..4b7e3cc 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -28,6 +28,7 @@ Visual Styles API states (see \fBSTATE MAP\fR). .SH "OPTIONS" .PP Valid \fIoptions\fR are: +.\" OPTION: -padding .TP \fB\-padding \fIpadding\fR . @@ -38,10 +39,11 @@ If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, \fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. -In other words, a list of three numbers specify the left, vertical, and right padding; -a list of two numbers specify the horizontal and the vertical padding; +In other words, a list of three numbers specify the left, vertical, and right +padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget. This option may not be mixed with any other options. +.\" OPTION: -margins .TP \fB\-margins \fIpadding\fR . @@ -49,6 +51,7 @@ Specifies the elements exterior padding. \fIpadding\fR is a list of up to four integers specifying the left, top, right and bottom padding quantities respectively. This option may not be mixed with any other options. +.\" OPTION: -width .TP \fB\-width \fIwidth\fR . @@ -57,6 +60,7 @@ the Visual Styles API will not be queried for the recommended size or the part. If this option is set then \fB\-height\fR should also be set. The \fB\-width\fR and \fB\-height\fR options cannot be mixed with the \fB\-padding\fR or \fB\-margins\fR options. +.\" OPTION: -height .TP \fB\-height \fIheight\fR . diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index e286eb0..03d45c1 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -125,12 +125,12 @@ If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, \fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. -In other words, a list of three numbers specify the left, vertical, and right padding; -a list of two numbers specify the horizontal and the vertical padding; +In other words, a list of three numbers specify the left, vertical, and right +padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget. .OP \-text text Text -Specifies a text string to be displayed inside the widget -(unless overridden by \fB\-textvariable\fR for the widgets supporting this option). +Specifies a text string to be displayed inside the widget (unless overridden +by \fB\-textvariable\fR for the widgets supporting this option). .OP \-textvariable textVariable Variable Specifies the name of a global variable whose value will be used in place of the \fB\-text\fR resource. @@ -337,9 +337,7 @@ If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by .SH "WIDGET STATES" The widget state is a bitmap of independent state flags. Widget state flags include: -.TP -\fBactive\fR -. +.IP \fBactive\fR The mouse cursor is over the widget and pressing a mouse button will cause some action to occur. (aka .QW prelight @@ -347,60 +345,42 @@ and pressing a mouse button will cause some action to occur. (aka .QW hot (Windows), .QW hover ). -.TP -\fBdisabled\fR -. +.IP \fBdisabled\fR Widget is disabled under program control (aka .QW unavailable , .QW inactive ). -.TP -\fBfocus\fR -. +.IP \fBfocus\fR Widget has keyboard focus. -.TP -\fBpressed\fR -. +.IP \fBpressed\fR Widget is being pressed (aka .QW armed in Motif). -.TP -\fBselected\fR -. +.IP \fBselected\fR .QW On , .QW true , or .QW current for things like checkbuttons and radiobuttons. -.TP -\fBbackground\fR -. +.IP \fBbackground\fR Windows and the Mac have a notion of an .QW active or foreground window. The \fBbackground\fR state is set for widgets in a background window, and cleared for those in the foreground window. -.TP -\fBreadonly\fR -. +.IP \fBreadonly\fR Widget should not allow user modification. -.TP -\fBalternate\fR -. +.IP \fBalternate\fR A widget-specific alternate display format. For example, used for checkbuttons and radiobuttons in the .QW tristate or .QW mixed state, and for buttons with \fB\-default active\fR. -.TP -\fBinvalid\fR -. +.IP \fBinvalid\fR The widget's value is invalid. (Potential uses: scale widget value out of bounds, entry widget value failed validation.) -.TP -\fBhover\fR -. +.IP \fBhover\fR The mouse cursor is within the widget. This is similar to the \fBactive\fP state; it is used in some themes for widgets that diff --git a/doc/winfo.n b/doc/winfo.n index 136eaf7..e37e0a7 100644 --- a/doc/winfo.n +++ b/doc/winfo.n @@ -22,6 +22,7 @@ depending on the \fIoption\fR argument. The legal forms are: .\" METHOD: atom .TP \fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR +. Returns a decimal string giving the integer identifier for the atom whose name is \fIname\fR. If no atom exists with the name \fIname\fR then a new one is created. @@ -31,6 +32,7 @@ the display of the application's main window. .\" METHOD: atomname .TP \fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR +. Returns the textual name for the atom whose integer identifier is \fIid\fR. If the \fB\-displayof\fR option is given then the identifier is looked @@ -41,11 +43,13 @@ It generates an error if no such atom exists. .\" METHOD: cells .TP \fBwinfo cells \fIwindow\fR +. Returns a decimal string giving the number of cells in the color map for \fIwindow\fR. .\" METHOD: children .TP \fBwinfo children \fIwindow\fR +. Returns a list containing the path names of all the children of \fIwindow\fR. Top-level windows are returned as children of their logical parents. The list is in stacking order, with @@ -55,10 +59,12 @@ command to query the stacking order of Top-level windows. .\" METHOD: class .TP \fBwinfo class \fIwindow\fR +. Returns the class name for \fIwindow\fR. .\" METHOD: colormapfull .TP \fBwinfo colormapfull \fIwindow\fR +. Returns 1 if the colormap for \fIwindow\fR is known to be full, 0 otherwise. The colormap for a window is .QW known @@ -69,6 +75,7 @@ failed allocation. .\" METHOD: containing .TP \fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR +. Returns the path name for the window containing the point given by \fIrootX\fR and \fIrootY\fR. \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e. @@ -89,16 +96,19 @@ chosen. .\" METHOD: depth .TP \fBwinfo depth \fIwindow\fR +. Returns a decimal string giving the depth of \fIwindow\fR (number of bits per pixel). .\" METHOD: exists .TP \fBwinfo exists \fIwindow\fR +. Returns 1 if there exists a window named \fIwindow\fR, 0 if no such window exists. .\" METHOD: fpixels .TP \fBwinfo fpixels \fIwindow number\fR +. Returns a floating-point value giving the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable @@ -111,12 +121,14 @@ The return value may be fractional; for an integer value, use .\" METHOD: geometry .TP \fBwinfo geometry \fIwindow\fR +. Returns the geometry for \fIwindow\fR, in the form \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are in pixels. .\" METHOD: height .TP \fBwinfo height \fIwindow\fR +. Returns a decimal string giving \fIwindow\fR's height in pixels. When a window is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfil @@ -128,6 +140,7 @@ instead of its actual height. .\" METHOD: id .TP \fBwinfo id \fIwindow\fR +. Returns a hexadecimal string giving a low-level platform-specific identifier for \fIwindow\fR. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows @@ -135,6 +148,7 @@ HWND. On the Macintosh the value has no meaning outside Tk. .\" METHOD: interps .TP \fBwinfo interps \fR?\fB\-displayof \fIwindow\fR? +. Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for a particular display. If the \fB\-displayof\fR option is given then the return value refers @@ -143,6 +157,7 @@ the display of the application's main window. .\" METHOD: ismapped .TP \fBwinfo ismapped \fIwindow\fR +. Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise. .\" METHOD: manager .TP @@ -158,17 +173,20 @@ name is the widget's class command, such as \fBcanvas\fR. .\" METHOD: name .TP \fBwinfo name \fIwindow\fR +. Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed to its full path name). The command \fBwinfo name .\fR will return the name of the application. .\" METHOD: parent .TP \fBwinfo parent \fIwindow\fR +. Returns the path name of \fIwindow\fR's parent, or an empty string if \fIwindow\fR is the main window of the application. .\" METHOD: pathname .TP \fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR +. Returns the path name of the window whose X identifier is \fIid\fR. \fIId\fR must be a decimal, hexadecimal, or octal integer and must correspond to a window in the invoking application. @@ -178,6 +196,7 @@ the display of the application's main window. .\" METHOD: pixels .TP \fBwinfo pixels \fIwindow number\fR +. Returns the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable @@ -190,6 +209,7 @@ fractional result, use \fBwinfo fpixels\fR. .\" METHOD: pointerx .TP \fBwinfo pointerx \fIwindow\fR +. If the mouse pointer is on the same screen as \fIwindow\fR, returns the pointer's x coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is @@ -199,6 +219,7 @@ If the mouse pointer is not on the same screen as \fIwindow\fR then .\" METHOD: pointerxy .TP \fBwinfo pointerxy \fIwindow\fR +. If the mouse pointer is on the same screen as \fIwindow\fR, returns a list with two elements, which are the pointer's x and y coordinates measured in pixels in the screen's root window. @@ -209,6 +230,7 @@ both of the returned coordinates are \-1. .\" METHOD: pointery .TP \fBwinfo pointery \fIwindow\fR +. If the mouse pointer is on the same screen as \fIwindow\fR, returns the pointer's y coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position @@ -218,18 +240,21 @@ If the mouse pointer is not on the same screen as \fIwindow\fR then .\" METHOD: reqheight .TP \fBwinfo reqheight \fIwindow\fR +. Returns a decimal string giving \fIwindow\fR's requested height, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. .\" METHOD: reqwidth .TP \fBwinfo reqwidth \fIwindow\fR +. Returns a decimal string giving \fIwindow\fR's requested width, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. .\" METHOD: rgb .TP \fBwinfo rgb \fIwindow color\fR +. Returns a list containing three decimal values in the range 0 to 65535, which are the red, green, and blue intensities that correspond to \fIcolor\fR in @@ -239,6 +264,7 @@ option. .\" METHOD: rootx .TP \fBwinfo rootx \fIwindow\fR +. Returns a decimal string giving the x-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it @@ -246,6 +272,7 @@ has no border). .\" METHOD: rooty .TP \fBwinfo rooty \fIwindow\fR +. Returns a decimal string giving the y-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it @@ -253,36 +280,43 @@ has no border). .\" METHOD: screen .TP \fBwinfo screen \fIwindow\fR +. Returns the name of the screen associated with \fIwindow\fR, in the form \fIdisplayName\fR.\fIscreenIndex\fR. .\" METHOD: screencells .TP \fBwinfo screencells \fIwindow\fR +. Returns a decimal string giving the number of cells in the default color map for \fIwindow\fR's screen. .\" METHOD: screendepth .TP \fBwinfo screendepth \fIwindow\fR +. Returns a decimal string giving the depth of the root window of \fIwindow\fR's screen (number of bits per pixel). .\" METHOD: screenheight .TP \fBwinfo screenheight \fIwindow\fR +. Returns a decimal string giving the height of \fIwindow\fR's screen, in pixels. .\" METHOD: screenmmheight .TP \fBwinfo screenmmheight \fIwindow\fR +. Returns a decimal string giving the height of \fIwindow\fR's screen, in millimeters. .\" METHOD: screenmmwidth .TP \fBwinfo screenmmwidth \fIwindow\fR +. Returns a decimal string giving the width of \fIwindow\fR's screen, in millimeters. .\" METHOD: screenvisual .TP \fBwinfo screenvisual \fIwindow\fR +. Returns one of the following strings to indicate the default visual class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or @@ -290,11 +324,13 @@ class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, .\" METHOD: screenwidth .TP \fBwinfo screenwidth \fIwindow\fR +. Returns a decimal string giving the width of \fIwindow\fR's screen, in pixels. .\" METHOD: server .TP \fBwinfo server \fIwindow\fR +. Returns a string containing information about the server for \fIwindow\fR's display. The exact format of this string may vary from platform to platform. For X servers the string @@ -307,18 +343,21 @@ is an integer release number provided by the server. .\" METHOD: toplevel .TP \fBwinfo toplevel \fIwindow\fR +. Returns the path name of the top-of-hierarchy window containing \fIwindow\fR. In standard Tk this will always be a \fBtoplevel\fR widget, but extensions may create other kinds of top-of-hierarchy widgets. .\" METHOD: viewable .TP \fBwinfo viewable \fIwindow\fR +. Returns 1 if \fIwindow\fR and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped. .\" METHOD: visual .TP \fBwinfo visual \fIwindow\fR +. Returns one of the following strings to indicate the visual class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or @@ -326,10 +365,12 @@ class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR, .\" METHOD: visualid .TP \fBwinfo visualid \fIwindow\fR +. Returns the X identifier for the visual for \fIwindow\fR. .\" METHOD: visualsavailable .TP \fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR? +. Returns a list whose elements describe the visuals available for \fIwindow\fR's screen. Each element consists of a visual class followed by an integer depth. @@ -340,16 +381,19 @@ depth is followed by the X identifier for the visual. .\" METHOD: vrootheight .TP \fBwinfo vrootheight \fIwindow\fR +. Returns the height of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the height of \fIwindow\fR's screen. .\" METHOD: vrootwidth .TP \fBwinfo vrootwidth \fIwindow\fR +. Returns the width of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the width of \fIwindow\fR's screen. .\" METHOD: vrootx .TP \fBwinfo vrootx \fIwindow\fR +. Returns the x-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. @@ -357,6 +401,7 @@ Returns 0 if there is no virtual root window for \fIwindow\fR. .\" METHOD: vrooty .TP \fBwinfo vrooty \fIwindow\fR +. Returns the y-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. @@ -364,6 +409,7 @@ Returns 0 if there is no virtual root window for \fIwindow\fR. .\" METHOD: width .TP \fBwinfo width \fIwindow\fR +. Returns a decimal string giving \fIwindow\fR's width in pixels. When a window is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfil @@ -375,6 +421,7 @@ instead of its actual width. .\" METHOD: x .TP \fBwinfo x \fIwindow\fR +. Returns a decimal string giving the x-coordinate, in \fIwindow\fR's parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it @@ -382,6 +429,7 @@ has no border). .\" METHOD: y .TP \fBwinfo y \fIwindow\fR +. Returns a decimal string giving the y-coordinate, in \fIwindow\fR's parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it @@ -391,7 +439,7 @@ has no border). Print where the mouse pointer is and what window it is currently over: .CS lassign [\fBwinfo pointerxy\fR .] x y -puts \-nonewline "Mouse pointer at ($x,$y) which is " +puts -nonewline "Mouse pointer at ($x,$y) which is " set win [\fBwinfo containing\fR $x $y] if {$win eq ""} { puts "over no window" diff --git a/doc/wish.1 b/doc/wish.1 index 115911e..920c1f3 100644 --- a/doc/wish.1 +++ b/doc/wish.1 @@ -14,25 +14,32 @@ wish \- Simple windowing shell .SH SYNOPSIS \fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg ...\fR? .SH OPTIONS +.\" OPTION: -encoding .IP "\fB\-encoding \fIname\fR" 20 Specifies the encoding of the text stored in \fIfileName\fR. This option is only recognized prior to the \fIfileName\fR argument. +.\" OPTION: -colormap .IP "\fB\-colormap \fInew\fR" 20 Specifies that the window should have a new private colormap instead of using the default colormap for the screen. +.\" OPTION: -display .IP "\fB\-display \fIdisplay\fR" 20 Display (and screen) on which to display window. +.\" OPTION: -geometry .IP "\fB\-geometry \fIgeometry\fR" 20 Initial geometry to use for window. If this option is specified, its value is stored in the \fBgeometry\fR global variable of the application's Tcl interpreter. +.\" OPTION: -name .IP "\fB\-name \fIname\fR" 20 Use \fIname\fR as the title to be displayed in the window, and as the name of the interpreter for \fBsend\fR commands. +.\" OPTION: -sync .IP "\fB\-sync\fR" 20 Execute all X server commands synchronously, so that errors are reported immediately. This will result in much slower execution, but it is useful for debugging. +.\" OPTION: -use .IP "\fB\-use\fR \fIid\fR" 20 Specifies that the main window for the application is to be embedded in the window whose identifier is \fIid\fR, instead of being created as an @@ -44,10 +51,12 @@ Note that on some platforms this will only work correctly if \fIid\fR refers to a Tk \fBframe\fR or \fBtoplevel\fR that has its \fB\-container\fR option enabled. .RE +.\" OPTION: -visual .IP "\fB\-visual \fIvisual\fR" 20 Specifies the visual to use for the window. \fIVisual\fR may have any of the forms supported by the \fBTk_GetVisual\fR procedure. +.\" OPTION: -- .IP "\fB\-\|\-\fR" 20 Pass all remaining arguments through to the script's \fBargv\fR variable without interpreting them. @@ -117,30 +126,40 @@ file, is the same as its name except that the first letter is capitalized. .SH "VARIABLES" .PP -\fBWish\fR sets the following Tcl variables: +\fBWish\fR sets the following global Tcl variables: +.\" VARIABLE: argc .TP 15 \fBargc\fR +. Contains a count of the number of \fIarg\fR arguments (0 if none), not including the options described above. +.\" VARIABLE: argv .TP 15 \fBargv\fR +. Contains a Tcl list whose elements are the \fIarg\fR arguments that follow a \fB\-\|\-\fR option or do not match any of the options described in \fBOPTIONS\fR above, in order, or an empty string if there are no such arguments. +.\" VARIABLE: argv0 .TP 15 \fBargv0\fR +. Contains \fIfileName\fR if it was specified. Otherwise, contains the name by which \fBwish\fR was invoked. +.\" VARIABLE: geometry .TP 15 \fBgeometry\fR +. If the \fB\-geometry\fR option is specified, \fBwish\fR copies its value into this variable. If the variable still exists after \fIfileName\fR has been evaluated, \fBwish\fR uses the value of the variable in a \fBwm geometry\fR command to set the main window's geometry. +.\" VARIABLE: tcl_interactive .TP 15 \fBtcl_interactive\fR +. Contains 1 if \fBwish\fR is reading commands interactively (\fIfileName\fR was not specified and standard input is a terminal-like device), 0 otherwise. diff --git a/doc/wm.n b/doc/wm.n index ce5a4c5..5f76384 100644 --- a/doc/wm.n +++ b/doc/wm.n @@ -60,6 +60,7 @@ values are as follows: .PP All platforms support the following attributes (though X11 users should see the notes below): +.\" OPTION: -alpha .TP \fB\-alpha\fR . @@ -67,26 +68,31 @@ Specifies the alpha transparency level of the toplevel. It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque). Values outside that range will be constrained. Where not supported, the \fB\-alpha\fR value remains at \fB1.0\fR. +.\" OPTION: -fullscreen .TP \fB\-fullscreen\fR . Places the window in a mode that takes up the entire screen, has no borders, and covers the general use area (i.e. Start menu and taskbar on Windows, dock and menubar on OSX, general window decorations on X11). +.\" OPTION: -topmost .TP \fB\-topmost\fR . Specifies whether this is a topmost window (displays above all other windows). .PP On Windows, the following attributes may be set. +.\" OPTION: -disabled .TP \fB\-disabled\fR . Specifies whether the window is in a disabled state. +.\" OPTION: -toolwindow .TP \fB\-toolwindow\fR . Specifies a toolwindow style window (as defined in the MSDN). +.\" OPTION: -transparentcolor .TP \fB\-transparentcolor\fR . @@ -97,6 +103,7 @@ value accepted by \fBTk_GetColor\fR. If the empty string is specified at \fB{}\fR. .PP On MacOS, the following attributes may be set. +.\" OPTION: -appearance .TP \fB\-appearance\fR . @@ -104,6 +111,7 @@ Specifies whether the window is rendered in "dark mode". Allowed values are \fBauto\fR, \fBaqua\fR and \fBdarkaqua\fR. If the setting is auto then the appearance of the window is controlled by the System Settings. +.\" OPTION: -class .TP \fB\-class\fR . @@ -117,21 +125,25 @@ does not correspond to an existing window. Doing that causes the class name to be cached for later use. When a toplevel with that pathname is eventually created, the cached class name will determine which class is used for the underlying Aqua window. +.\" OPTION: -isdark .TP \fB\-isdark\fR . Returns a boolean value which is true if the window is currently in dark mode. +.\" OPTION: -modified .TP \fB\-modified\fR . Specifies the modification state of the window (determines whether the window close widget contains the modification indicator and whether the proxy icon is draggable). +.\" OPTION: -notify .TP \fB\-notify\fR . Specifies process notification state (bouncing of the application dock icon). +.\" OPTION: -stylemask .TP \fB\-stylemask\fR . @@ -145,6 +157,7 @@ bits will be set to 0. The allowed bitnames are: \fBtitled\fR, \fBnonactivatingpanel\fR, and \fBHUDwindow\fR. Note that a side effect of setting the fullsizecontentview bit is that the window title bar becomes transparent. +.\" OPTION: -tabbingid .TP \fB\-tabbingid\fR . @@ -158,6 +171,7 @@ a normal non-tabbed toplevel. It is allowed to set the tabbingid before the toplevel is created. If the pathname provided in the command does not correspond to a toplevel, the value will be cached and used later when the toplevel is actually created. +.\" OPTION: -tabbingmode .TP \fB\-tabbingmode\fR . @@ -171,11 +185,13 @@ Settings application. It is allowed to set the tabbingmode before the toplevel is created. If the pathname provided in the command does not correspond to a toplevel, the value will be cached and used later when the toplevel is actually created. +.\" OPTION: -titlepath .TP \fB\-titlepath\fR . Specifies the path of the file referenced as the window proxy icon (which can be dragged and dropped in lieu of the file's finder icon). +.\" OPTION: -transparent .TP \fB\-transparent\fR . @@ -187,6 +203,7 @@ color with some alpha, e.g. On X11, the following attributes may be set. These are not supported by all window managers, and will have no effect under older WMs. .\" See https://www.freedesktop.org/wiki/Specifications/wm-spec/ +.\" OPTION: -type .TP \fB\-type\fR .VS 8.6 @@ -197,76 +214,49 @@ entirely up to the window manager. A list of types may be used, in order of preference. The following values are mapped to constants defined in the EWMH specification (using others is possible, but not advised): .RS -.TP -\fBdesktop\fR -. +.IP \fBdesktop\fR indicates a desktop feature, -.TP -\fBdock\fR -. +.IP \fBdock\fR indicates a dock/panel feature, -.TP -\fBtoolbar\fR -. +.IP \fBtoolbar\fR indicates a toolbar window that should be acting on behalf of another window, as indicated with \fBwm transient\fR, -.TP -\fBmenu\fR -. +.IP \fBmenu\fR indicates a torn-off menu that should be acting on behalf of another window, as indicated with \fBwm transient\fR, -.TP -\fButility\fR -. +.IP \fButility\fR indicates a utility window (e.g., palette or toolbox) that should be acting on behalf of another window, as indicated with \fBwm transient\fR, -.TP -\fBsplash\fR -. +.IP \fBsplash\fR indicates a splash screen, displayed during application start up, -.TP -\fBdialog\fR -. +.IP \fBdialog\fR indicates a general dialog window, that should be acting on behalf of another window, as indicated with \fBwm transient\fR, -.TP -\fBdropdown_menu\fR -. +.IP \fBdropdown_menu\fR indicates a menu summoned from a menu bar, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), -.TP -\fBpopup_menu\fR -. +.IP \fBpopup_menu\fR indicates a popup menu, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), -.TP -\fBtooltip\fR -. +.IP \fBtooltip\fR indicates a tooltip window, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), -.TP -\fBnotification\fR -. +.IP \fBnotification\fR indicates a window that provides a background notification of some event, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), -.TP -\fBcombo\fR -. +.IP \fBcombo\fR indicates the drop-down list of a combobox widget, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), -.TP -\fBdnd\fR -. +.IP \fBdnd\fR indicates a window that represents something being dragged, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), -.TP -\fBnormal\fR -. +.IP \fBnormal\fR indicates a window that has no special interpretation. .RE .VE 8.6 +.\" OPTION: -zoomed .TP \fB\-zoomed\fR . @@ -466,7 +456,7 @@ four elements corresponding to the current \fIbaseWidth\fR, \fIwindow\fR is not currently gridded, then an empty string is returned. .PP -Note: this command should not be needed very often, since the +Note that this command should not be needed very often, since the \fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option provide easier access to the same functionality. .RE @@ -495,9 +485,9 @@ of the developer. .RS .PP On X11, for this command to work, -the variable \fB::tk::icons::base_icon($window)\fR must be set to the image that is -being used for the window icon of $window. On Windows and X11, the iconphoto -images work best at 32x32 or a similar dimension, as +the variable \fB::tk::icons::base_icon($window)\fR must be set to the image +that is being used for the window icon of $window. On Windows and X11, the +iconphoto images work best at 32x32 or a similar dimension, as the badge images are provided by Tk and drawn to overlay the icon images using native (Windows) API's or Tk rendering. On macOS, the icon badge is rendered by a system API and is not provided by Tk. The icon image itself @@ -508,7 +498,7 @@ The icon badge is intended for display in the Dock (macOS), taskbar displayed in the Dock, regardless of how many different icon badges may be assigned to different windows. On Windows, the taskbar display depends on whether the taskbar buttons are combined or not (this is an OS setting -available to the user): if combined the behavior is the same as on macOS, +available to the user): if combined, the behavior is the same as on macOS, otherwise each button in the taskbar shows the badge it was assigned. Badge display on macOS is configured in the system preferences. App panel display behavior on X11 will depend on the window manager and/or @@ -639,7 +629,8 @@ Button press events are disabled for \fIwindow\fR as long as it is an icon window; this is needed in order to allow window managers to .QW own those events. -Note: not all window managers support the notion of an icon window. +Note that not all window managers support the notion of an icon window, and +the concept is entirely meaningless on non-X11 platforms. .\" METHOD: manage .TP \fBwm manage \fIwidget\fR @@ -877,7 +868,7 @@ has never been mapped, then this command causes the window to be mapped in the withdrawn state. Not all window managers appear to know how to handle windows that are mapped in the withdrawn state. -Note: it sometimes seems to be necessary to withdraw a +Note that it sometimes seems to be necessary to withdraw a window and then re-map it (e.g. with \fBwm deiconify\fR) to get some window managers to pay attention to changes in window attributes such as group. @@ -975,10 +966,10 @@ A simple dialog-like window, centred on the screen: .CS # Create and arrange the dialog contents. toplevel .msg -label .msg.l \-text "This is a very simple dialog demo." -button .msg.ok \-text OK \-default active \-command {destroy .msg} -pack .msg.ok \-side bottom \-fill x -pack .msg.l \-expand 1 \-fill both +label .msg.l -text "This is a very simple dialog demo." +button .msg.ok -text OK -default active -command {destroy .msg} +pack .msg.ok -side bottom -fill x +pack .msg.l -expand 1 -fill both # Now set the widget up as a centred dialog. @@ -987,8 +978,8 @@ pack .msg.l \-expand 1 \-fill both # event loop with the widget hidden completely... \fBwm withdraw\fR .msg update -set x [expr {([winfo screenwidth .]\-[winfo width .msg])/2}] -set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}] +set x [expr {([winfo screenwidth .] - [winfo width .msg]) / 2}] +set y [expr {([winfo screenheight .] - [winfo height .msg]) / 2}] \fBwm geometry\fR .msg +$x+$y \fBwm transient\fR .msg . \fBwm title\fR .msg "Dialog demo" @@ -997,7 +988,8 @@ set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}] .SH "SEE ALSO" toplevel(n), winfo(n) .SH KEYWORDS -aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager +aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, +increments, position, size, title, top-level window, units, window manager '\" Local Variables: '\" mode: nroff '\" End: -- cgit v0.12 From 1fd741b0b4c30061a7a61056f53dd0421e9353b4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 26 Jan 2024 16:17:54 +0000 Subject: Possible fix for [55e742aea6]: In text, Ctrl+Left and Ctrl+Right behave different in Windows and Linux. Text-widget only (for now). Entry and Spinbox will need the same change. For discussion. --- library/text.tcl | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/library/text.tcl b/library/text.tcl index 99d5841..15bdef2 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -138,7 +138,7 @@ bind Text <> { tk::TextKeySelect %W [tk::TextPrevPos %W insert tk::startOfPreviousWord] } bind Text <> { - tk::TextKeySelect %W [tk::TextNextWord %W insert] + tk::TextKeySelect %W [tk::TextSelectNextWord %W insert] } bind Text <> { tk::TextKeySelect %W [tk::TextPrevPara %W insert] @@ -1086,26 +1086,31 @@ proc ::tk_textPaste w { } # ::tk::TextNextWord -- -# Returns the index of the next word position after a given position in the -# text. The next word is platform dependent and may be either the next -# end-of-word position or the next start-of-word position after the next -# end-of-word position. +# Returns the index of the next start-of-word position after the next +# end-of-word position after a given position in the text. # # Arguments: # w - The text window in which the cursor is to move. # start - Position at which to start search. -if {[tk windowingsystem] eq "win32"} { - proc ::tk::TextNextWord {w start} { - TextNextPos $w [TextNextPos $w $start tk::endOfWord] \ - tk::startOfNextWord - } -} else { - proc ::tk::TextNextWord {w start} { - TextNextPos $w $start tk::endOfWord - } +proc ::tk::TextNextWord {w start} { + TextNextPos $w [TextNextPos $w $start tk::endOfWord] \ + tk::startOfNextWord +} + +# ::tk::TextSelectNextWord -- +# Returns the index of the next end-of-word position after a given +# position in the text. +# +# Arguments: +# w - The text window in which the cursor is to move. +# start - Position at which to start search. + +proc ::tk::TextSelectNextWord {w start} { + TextNextPos $w $start tk::endOfWord } + # ::tk::TextNextPos -- # Returns the index of the next position after the given starting # position in the text as computed by a specified function. -- cgit v0.12 From c8a2197a8f8889526bac61c8f6bc61f27ec225f4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 27 Jan 2024 00:13:30 +0000 Subject: Same change for Entry en (ttk::)spinbox --- library/entry.tcl | 60 +++++++++++++++++++++++++++------------------------ library/spinbox.tcl | 2 +- library/ttk/entry.tcl | 31 ++++++++++++++++++-------- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/library/entry.tcl b/library/entry.tcl index e8f260b..2090fa7 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -143,7 +143,7 @@ bind Entry <> { tk::EntrySeeInsert %W } bind Entry <> { - tk::EntryKeySelect %W [tk::EntryNextWord %W insert] + tk::EntryKeySelect %W [tk::EntrySelectNextWord %W insert] tk::EntrySeeInsert %W } bind Entry <> { @@ -588,40 +588,44 @@ proc ::tk::EntryTranspose w { } # ::tk::EntryNextWord -- -# Returns the index of the next word position after a given position in the -# entry. The next word is platform dependent and may be either the next -# end-of-word position or the next start-of-word position after the next -# end-of-word position. +# Returns the index of the next start-of-word position after the next +# end-of-word position after a given position in the text. # # Arguments: # w - The entry window in which the cursor is to move. # start - Position at which to start search. -if {[tk windowingsystem] eq "win32"} { - proc ::tk::EntryNextWord {w start} { - if {[$w cget -show] ne ""} { - return end - } - set pos [tk::endOfWord [$w get] [$w index $start]] - if {$pos >= 0} { - set pos [tk::startOfNextWord [$w get] $pos] - } - if {$pos < 0} { - return end - } - return $pos +proc ::tk::EntryNextWord {w start} { + if {[$w cget -show] ne ""} { + return end } -} else { - proc ::tk::EntryNextWord {w start} { - if {[$w cget -show] ne ""} { - return end - } - set pos [tk::endOfWord [$w get] [$w index $start]] - if {$pos < 0} { - return end - } - return $pos + set pos [tk::endOfWord [$w get] [$w index $start]] + if {$pos >= 0} { + set pos [tk::startOfNextWord [$w get] $pos] + } + if {$pos < 0} { + return end + } + return $pos +} + +# ::tk::EntryNextWord -- +# Returns the index of the next end-of-word position after a given +# position in the text. +# +# Arguments: +# w - The entry window in which the cursor is to move. +# start - Position at which to start search. + +proc ::tk::EntrySelectNextWord {w start} { + if {[$w cget -show] ne ""} { + return end } + set pos [tk::endOfWord [$w get] [$w index $start]] + if {$pos < 0} { + return end + } + return $pos } # ::tk::EntryPreviousWord -- diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 1430800..094be29 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -153,7 +153,7 @@ bind Spinbox <> { ::tk::EntrySeeInsert %W } bind Spinbox <> { - ::tk::EntryKeySelect %W [::tk::EntryNextWord %W insert] + ::tk::EntryKeySelect %W [::tk::EntrySelectNextWord %W insert] ::tk::EntrySeeInsert %W } bind Spinbox <> { diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index d5170fd..b01e6a2 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -104,7 +104,7 @@ bind TEntry <> { ttk::entry::Move %W end } bind TEntry <> { ttk::entry::Extend %W prevchar } bind TEntry <> { ttk::entry::Extend %W nextchar } bind TEntry <> { ttk::entry::Extend %W prevword } -bind TEntry <> { ttk::entry::Extend %W nextword } +bind TEntry <> { ttk::entry::Extend %W selectnextword } bind TEntry <> { ttk::entry::Extend %W home } bind TEntry <> { ttk::entry::Extend %W end } @@ -248,21 +248,17 @@ proc ttk::entry::See {w {index insert}} { } } -## NextWord -- Find the next word position. -# Note: The "next word position" follows platform conventions: -# either the next end-of-word position, or the start-of-word -# position following the next end-of-word position. +## NextWord -- +# Returns the index of the next start-of-word position after the next +# end-of-word position after a given position in the text. # -set ::ttk::entry::State(startNext) \ - [string equal [tk windowingsystem] "win32"] - proc ttk::entry::NextWord {w start} { if {[$w cget -show] ne ""} { return end } variable State set pos [tk::endOfWord [$w get] [$w index $start]] - if {$pos >= 0 && $State(startNext)} { + if {$pos >= 0} { set pos [tk::startOfNextWord [$w get] $pos] } if {$pos < 0} { @@ -271,6 +267,22 @@ proc ttk::entry::NextWord {w start} { return $pos } +## SelectNextWord -- +# Returns the index of the next end-of-word position after a given +# position in the text. +# +proc ttk::entry::SelectNextWord {w start} { + if {[$w cget -show] ne ""} { + return end + } + variable State + set pos [tk::endOfWord [$w get] [$w index $start]] + if {$pos < 0} { + return end + } + return $pos +} + ## PrevWord -- Find the previous word position. # proc ttk::entry::PrevWord {w start} { @@ -313,6 +325,7 @@ proc ttk::entry::RelIndex {w where {index insert}} { nextchar { NextChar $w $index } prevword { PrevWord $w $index } nextword { NextWord $w $index } + selectnextword { SelectNextWord $w $index } home { return 0 } end { $w index end } default { error "Bad relative index $index" } -- cgit v0.12 From 331436fe3c1504028557d2b648bbf4cdbf8fa78f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 29 Jan 2024 22:27:52 +0000 Subject: Test <> --- tests/spinbox.test | 11 +++++++++-- tests/ttk/spinbox.test | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/spinbox.test b/tests/spinbox.test index 4187966..6cb52e9 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -3892,15 +3892,22 @@ test spinbox-25.3 {Bugs [2a32225cd1] and [9fa3e08243]} -setup { destroy .s pack [spinbox .s] update + set res {} } -body { .s insert end "A sample text" .s icursor end event generate .s <> ; # shall move insert to index 9 .s delete insert end - .s get + lappend res [.s get] + .s delete 0 end + .s insert end "A sample text" + .s icursor 2 + event generate .s <> ; # shall move insert to index 9 + .s delete 0 insert + lappend res [.s get] } -cleanup { destroy .s -} -result {A sample } +} -result {{A sample } text} # Collected comments about lacks from the test # XXX Still need to write tests for SpinboxBlinkProc, SpinboxFocusProc, diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test index 0a3f943..1f32049 100644 --- a/tests/ttk/spinbox.test +++ b/tests/ttk/spinbox.test @@ -291,15 +291,22 @@ test spinbox-11.2 {Bugs [2a32225cd1] and [9fa3e08243]} -setup { destroy .s pack [ttk::spinbox .s] update + set res {} } -body { .s insert end "A sample text" .s icursor end event generate .s <> ; # shall move insert to index 9 .s delete insert end - .s get + lappend res [.s get] + .s delete 0 end + .s insert end "A sample text" + .s icursor 2 + event generate .s <> ; # shall move insert to index 9 + .s delete 0 insert + lappend res [.s get] } -cleanup { destroy .s -} -result {A sample } +} -result {{A sample } text} # nostomp: NB intentional difference between ttk::spinbox and tk::spinbox; -- cgit v0.12 From f0a436515e8b902ba61c47a70a6c77fd5e20ab9a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 30 Jan 2024 21:05:03 +0000 Subject: Minor compiler warning fix --- generic/ttk/ttkPanedwindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 4e268d9..62b11a4 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -850,7 +850,7 @@ static int PanedSashposCommand( } if (sashIndex < 0 || sashIndex >= Ttk_NumberContent(pw->paned.mgr) - 1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "sash index %" TCL_SIZE_MODIFIER "d out of range", sashIndex)); + "sash index %" TCL_LL_MODIFIER "d out of range", sashIndex)); Tcl_SetErrorCode(interp, "TTK", "PANE", "SASH_INDEX", NULL); return TCL_ERROR; } -- cgit v0.12 From d15b757a1eeb4d2fb77ad0d71e802f640672eeff Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 31 Jan 2024 23:11:05 +0000 Subject: Fix [c311666f9c]: library/menu.tcl typo --- library/menu.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/menu.tcl b/library/menu.tcl index d74c9d2..57dc963 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -827,7 +827,7 @@ proc ::tk::MenuNextEntry {menu count} { set length [expr {$last+1}] set quitAfter $length set activeindex [$menu index active] - if {$actactiveindexive < 0} { + if {$activeindex < 0} { set i 0 } else { set i [expr {$activeindex + $count}] -- cgit v0.12 From 6ac394149e10e4b63889c9c65cbc8d93067b13f9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 2 Feb 2024 11:45:04 +0000 Subject: Use Tcl_Obj * in stead of char * where possible in text widget --- generic/tkText.c | 66 ++++++++++++++++++++++++++++------------------------ generic/tkText.h | 12 +++++++--- generic/tkTextDisp.c | 12 +++++----- generic/tkTextTag.c | 32 ++++++++++++------------- 4 files changed, 65 insertions(+), 57 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 852646b..6182acd 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -222,7 +222,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_TEXT_TABSTYLE, TCL_INDEX_NONE, offsetof(TkText, tabStyle), TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_TEXT_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(TkText, takeFocus), + DEF_TEXT_TAKE_FOCUS, offsetof(TkText, takeFocusObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-undo", "undo", "Undo", DEF_TEXT_UNDO, TCL_INDEX_NONE, offsetof(TkText, undo), @@ -234,10 +234,10 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_TEXT_WRAP, TCL_INDEX_NONE, offsetof(TkText, wrapMode), TK_OPTION_ENUM_VAR, tkTextWrapStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_TEXT_XSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, xScrollCmd), + DEF_TEXT_XSCROLL_COMMAND, offsetof(TkText, xScrollCmdObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - DEF_TEXT_YSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, yScrollCmd), + DEF_TEXT_YSCROLL_COMMAND, offsetof(TkText, yScrollCmdObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0} }; @@ -256,7 +256,7 @@ static const Tk_OptionSpec optionSpecs[] = { struct SearchSpec; /* Forward declaration. */ -typedef ClientData SearchAddLineProc(int lineNum, +typedef void *SearchAddLineProc(int lineNum, struct SearchSpec *searchSpecPtr, Tcl_Obj *theLine, int *lenPtr, int *extraLinesPtr); @@ -330,7 +330,7 @@ int tkTextDebug = 0; */ static int ConfigureText(Tcl_Interp *interp, - TkText *textPtr, int objc, Tcl_Obj *const objv[]); + TkText *textPtr, Tcl_Size objc, Tcl_Obj *const objv[]); static int DeleteIndexRange(TkSharedText *sharedPtr, TkText *textPtr, const TkTextIndex *indexPtr1, const TkTextIndex *indexPtr2, int viewUpdate); @@ -346,7 +346,7 @@ static void TextBlinkProc(void *clientData); static void TextCmdDeletedProc(void *clientData); static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin, Tcl_Interp *interp, const TkText *parent, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static void TextEventProc(void *clientData, XEvent *eventPtr); static Tcl_Size TextFetchSelection(void *clientData, Tcl_Size offset, @@ -355,26 +355,26 @@ static int TextIndexSortProc(const void *first, const void *second); static int TextInsertCmd(TkSharedText *sharedTextPtr, TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], + Tcl_Size objc, Tcl_Obj *const objv[], const TkTextIndex *indexPtr, int viewUpdate); static int TextReplaceCmd(TkText *textPtr, Tcl_Interp *interp, const TkTextIndex *indexFromPtr, const TkTextIndex *indexToPtr, - int objc, Tcl_Obj *const objv[], int viewUpdate); + Tcl_Size objc, Tcl_Obj *const objv[], int viewUpdate); static int TextSearchCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int TextEditCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int TextWidgetObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int SharedTextObjCmd(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static void TextWorldChangedCallback(void *instanceData); static void TextWorldChanged(TkText *textPtr, int mask); static int TextDumpCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int DumpLine(Tcl_Interp *interp, TkText *textPtr, int what, TkTextLine *linePtr, int start, int end, int lineno, Tcl_Obj *command); @@ -397,7 +397,7 @@ static void TextPushUndoAction(TkText *textPtr, static Tcl_Size TextSearchIndexInLine(const SearchSpec *searchSpecPtr, TkTextLine *linePtr, Tcl_Size byteIndex); static int TextPeerCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static TkUndoProc TextUndoRedoCallback; /* @@ -483,7 +483,7 @@ CreateWidget( Tcl_Interp *interp, /* Current interpreter. */ const TkText *parent, /* If non-NULL then take default start, end * from this parent. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { TkText *textPtr; @@ -823,7 +823,8 @@ TextWidgetObjCmd( break; case TEXT_COUNT: { const TkTextIndex *indexFromPtr, *indexToPtr; - int i, found = 0, update = 0; + Tcl_Size i; + int found = 0, update = 0; Tcl_Obj *objPtr = NULL; if (objc < 4) { @@ -1103,7 +1104,7 @@ TextWidgetObjCmd( TkTextIndex *indices, *ixStart, *ixEnd, *lastStart; char *useIdx; - int i; + Tcl_Size i; objc -= 2; objv += 2; @@ -1239,7 +1240,8 @@ TextWidgetObjCmd( break; case TEXT_GET: { Tcl_Obj *objPtr = NULL; - int i, found = 0, visible = 0; + Tcl_Size i; + int found = 0, visible = 0; const char *name; Tcl_Size length; @@ -1445,7 +1447,8 @@ TextWidgetObjCmd( * unnecessarily. */ - int deleteInsertOffset, insertLength, j, indexFromLine, indexFromByteOffset; + int deleteInsertOffset, insertLength, indexFromLine, indexFromByteOffset; + Tcl_Size j; insertLength = 0; for (j = 4; j < objc; j += 2) { @@ -1587,7 +1590,7 @@ static int SharedTextObjCmd( void *clientData, /* Information about shared test B-tree. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { TkSharedText *sharedPtr = (TkSharedText *)clientData; @@ -1693,7 +1696,7 @@ static int TextPeerCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = textPtr->tkwin; @@ -1776,7 +1779,7 @@ TextReplaceCmd( /* Index from which to replace. */ const TkTextIndex *indexToPtr, /* Index to which to replace. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ int viewUpdate) /* Update vertical view if set. */ { @@ -2060,7 +2063,7 @@ ConfigureText( Tcl_Interp *interp, /* Used for error reporting. */ TkText *textPtr, /* Information about widget; may or may not * already have values for some fields. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; @@ -3694,13 +3697,13 @@ TextInsertCmd( TkSharedText *sharedTextPtr,/* Shared portion of peer widgets. */ TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ const TkTextIndex *indexPtr,/* Index at which to insert. */ int viewUpdate) /* Update the view if set. */ { TkTextIndex index1, index2; - int j; + Tcl_Size j; if (sharedTextPtr == NULL) { sharedTextPtr = textPtr->sharedTextPtr; @@ -3773,10 +3776,11 @@ static int TextSearchCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, argsLeft, code; + Tcl_Size i, argsLeft; + int code; SearchSpec searchSpec; static const char *const switchStrings[] = { @@ -3848,7 +3852,7 @@ TextSearchCmd( searchSpec.backwards = 1; break; case TK_TEXT_SEARCH_COUNT: - if (i >= objc-1) { + if (i + 1 >= objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "no value given for \"-count\" option", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "TEXT", "VALUE", NULL); @@ -4120,7 +4124,7 @@ TextSearchIndexInLine( *---------------------------------------------------------------------- */ -static ClientData +static void * TextSearchAddNextLine( int lineNum, /* Line we must add. */ SearchSpec *searchSpecPtr, /* Search parameters. */ @@ -4631,13 +4635,13 @@ static int TextDumpCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "dump". */ { TkTextIndex index1, index2; - int arg; + Tcl_Size arg; int lineno; /* Current line number. */ int what = 0; /* bitfield to select segment types. */ int atEnd; /* True if dumping up to logical end. */ @@ -5212,7 +5216,7 @@ static int TextEditCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int index, setModified, oldModified; diff --git a/generic/tkText.h b/generic/tkText.h index bbaf6c5..c30a3e2 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -822,13 +822,19 @@ typedef struct TkText { * Miscellaneous additional information: */ - char *takeFocus; /* Value of -takeFocus option; not used in the +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *takeFocusObj; /* Value of -takeFocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ - char *xScrollCmd; /* Prefix of command to issue to update + Tcl_Obj *xScrollCmdObj; /* Prefix of command to issue to update * horizontal scrollbar when view changes. */ - char *yScrollCmd; /* Prefix of command to issue to update + Tcl_Obj *yScrollCmdObj; /* Prefix of command to issue to update * vertical scrollbar when view changes. */ +#else + char *takeFocus; + char *xScrollCmd; + char *yScrollCmd; +#endif int flags; /* Miscellaneous flags; see below for * definitions. */ Tk_OptionTable optionTable; /* Token representing the configuration diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 9a827fc..6fe48a1 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4649,7 +4649,7 @@ DisplayText( doScrollbars: if (textPtr->flags & UPDATE_SCROLLBARS) { textPtr->flags &= ~UPDATE_SCROLLBARS; - if (textPtr->yScrollCmd != NULL) { + if (textPtr->yScrollCmdObj != NULL) { GetYView(textPtr->interp, textPtr, 1); } @@ -4665,7 +4665,7 @@ DisplayText( * Update the horizontal scrollbar, if any. */ - if (textPtr->xScrollCmd != NULL) { + if (textPtr->xScrollCmdObj != NULL) { GetXView(textPtr->interp, textPtr, 1); } } @@ -6530,7 +6530,7 @@ GetXView( } dInfoPtr->xScrollFirst = first; dInfoPtr->xScrollLast = last; - if (textPtr->xScrollCmd != NULL) { + if (textPtr->xScrollCmdObj != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; Tcl_DString buf; @@ -6540,7 +6540,7 @@ GetXView( Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); Tcl_DStringInit(&buf); - Tcl_DStringAppend(&buf, textPtr->xScrollCmd, TCL_INDEX_NONE); + Tcl_DStringAppend(&buf, Tcl_GetString(textPtr->xScrollCmdObj), TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL); @@ -6815,7 +6815,7 @@ GetYView( dInfoPtr->yScrollFirst = first; dInfoPtr->yScrollLast = last; - if (textPtr->yScrollCmd != NULL) { + if (textPtr->yScrollCmdObj != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; Tcl_DString buf; @@ -6825,7 +6825,7 @@ GetYView( Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); Tcl_DStringInit(&buf); - Tcl_DStringAppend(&buf, textPtr->yScrollCmd, TCL_INDEX_NONE); + Tcl_DStringAppend(&buf, Tcl_GetString(textPtr->yScrollCmdObj), TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL); diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index b53dfd6..1c5e6e7 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -351,8 +351,6 @@ TkTextTagCmd( Tcl_SetObjResult(interp, objPtr); return TCL_OK; } else { - int result = TCL_OK; - if (Tk_SetOptions(interp, tagPtr, tagPtr->optionTable, objc-4, objv+4, textPtr->tkwin, NULL, NULL) != TCL_OK) { return TCL_ERROR; @@ -413,18 +411,18 @@ TkTextTagCmd( */ if (tagPtr == textPtr->selTagPtr) { - if (tagPtr->selBorder == NULL) { - textPtr->selBorder = tagPtr->border; - } else { - textPtr->selBorder = tagPtr->selBorder; - } + if (tagPtr->selBorder == NULL) { + textPtr->selBorder = tagPtr->border; + } else { + textPtr->selBorder = tagPtr->selBorder; + } textPtr->selBorderWidth = tagPtr->borderWidth; textPtr->selBorderWidthPtr = tagPtr->borderWidthPtr; - if (tagPtr->selFgColor == NULL) { - textPtr->selFgColorPtr = tagPtr->fgColor; - } else { - textPtr->selFgColorPtr = tagPtr->selFgColor; - } + if (tagPtr->selFgColor == NULL) { + textPtr->selFgColorPtr = tagPtr->fgColor; + } else { + textPtr->selFgColorPtr = tagPtr->selFgColor; + } } tagPtr->affectsDisplay = 0; @@ -454,11 +452,11 @@ TkTextTagCmd( || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) || (tagPtr->overstrike >= 0) - || (tagPtr->overstrikeColor != NULL) + || (tagPtr->overstrikeColor != NULL) || (tagPtr->underline >= 0) - || (tagPtr->underlineColor != NULL) - || (tagPtr->lMarginColor != NULL) - || (tagPtr->rMarginColor != NULL)) { + || (tagPtr->underlineColor != NULL) + || (tagPtr->lMarginColor != NULL) + || (tagPtr->rMarginColor != NULL)) { tagPtr->affectsDisplay = 1; } if (!newTag) { @@ -476,7 +474,7 @@ TkTextTagCmd( TkTextRedrawTag(textPtr->sharedTextPtr, NULL, NULL, NULL, tagPtr, 1); } - return result; + return TCL_OK; } break; } -- cgit v0.12 From 94a77ec467d4d7a9d99c233691fd0b57185a3f31 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Feb 2024 21:07:02 +0000 Subject: Modify TkTextGetTabs() signature: textPtr -> tkwin --- generic/tkText.c | 8 ++++---- generic/tkText.h | 2 +- generic/tkTextTag.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index cde36e4..a6142ed 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2227,7 +2227,7 @@ ConfigureText( textPtr->tabArrayPtr = NULL; } if (textPtr->tabOptionPtr != NULL) { - textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr, + textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr->tkwin, textPtr->tabOptionPtr); if (textPtr->tabArrayPtr == NULL) { Tcl_AddErrorInfo(interp,"\n (while processing -tabs option)"); @@ -4483,7 +4483,7 @@ TextSearchFoundMatch( TkTextTabArray * TkTextGetTabs( Tcl_Interp *interp, /* Used for error reporting. */ - const TkText *textPtr, /* Information about the text widget. */ + Tk_Window tkwin, /* Information about the window. */ Tcl_Obj *stringPtr) /* Description of the tab stops. See the text * manual entry for details. */ { @@ -4534,7 +4534,7 @@ TkTextGetTabs( * downwards, to find the right integer pixel position. */ - if (Tk_GetPixelsFromObj(interp, textPtr->tkwin, objv[i], + if (Tk_GetPixelsFromObj(interp, tkwin, objv[i], &tabPtr->location) != TCL_OK) { goto error; } @@ -4548,7 +4548,7 @@ TkTextGetTabs( } prevStop = lastStop; - if (Tk_GetDoublePixelsFromObj(interp, textPtr->tkwin, objv[i], + if (Tk_GetDoublePixelsFromObj(interp, tkwin, objv[i], &lastStop) != TCL_OK) { goto error; } diff --git a/generic/tkText.h b/generic/tkText.h index 18a6cce..22f1b53 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -1133,7 +1133,7 @@ MODULE_SCOPE int TkTextSharedGetObjIndex(Tcl_Interp *interp, MODULE_SCOPE const TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *objPtr); MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp, - const TkText *textPtr, Tcl_Obj *stringPtr); + Tk_Window tkwin, Tcl_Obj *stringPtr); MODULE_SCOPE void TkTextFindDisplayLineEnd(TkText *textPtr, TkTextIndex *indexPtr, int end, int *xOffset); MODULE_SCOPE void TkTextIndexBackChars(const TkText *textPtr, diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index e232f85..541fc74 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -387,7 +387,7 @@ TkTextTagCmd( } if (tagPtr->tabStringPtr != NULL) { tagPtr->tabArrayPtr = - TkTextGetTabs(interp, textPtr, tagPtr->tabStringPtr); + TkTextGetTabs(interp, textPtr->tkwin, tagPtr->tabStringPtr); if (tagPtr->tabArrayPtr == NULL) { return TCL_ERROR; } -- cgit v0.12 From abc232173f3047e842ac38f26ec31e3a4acafc77 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 14 Feb 2024 22:15:10 +0000 Subject: variable "State" no longer necessary --- library/ttk/entry.tcl | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index b0fdff1..3d2ef90 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -257,7 +257,6 @@ proc ttk::entry::NextWord {w start} { if {[winfo class $w] eq "TEntry" && [$w cget -show] ne ""} { return end } - variable State set pos [tk::endOfWord [$w get] [$w index $start]] if {$pos >= 0} { set pos [tk::startOfNextWord [$w get] $pos] @@ -277,7 +276,6 @@ proc ttk::entry::SelectNextWord {w start} { if {[winfo class $w] eq "TEntry" && [$w cget -show] ne ""} { return end } - variable State set pos [tk::endOfWord [$w get] [$w index $start]] if {$pos < 0} { return end -- cgit v0.12