From 4ddfabceb1dd92219b221373226f24345bd86759 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 25 Jun 2022 10:01:36 +0000 Subject: TIP #628 for Tk: Shared 8.7/9.0 build environment --- .github/workflows/linux-with-tcl9-build.yml | 4 +- generic/tk.decls | 34 +++---- generic/tk.h | 136 +++++++--------------------- generic/tk3d.c | 6 +- generic/tk3d.h | 4 +- generic/tkBind.c | 3 +- generic/tkCanvArc.c | 10 +- generic/tkCanvBmap.c | 2 +- generic/tkCanvImg.c | 2 +- generic/tkCanvLine.c | 42 ++++----- generic/tkCanvPoly.c | 22 ++--- generic/tkCanvPs.c | 2 +- generic/tkCanvText.c | 52 +++++------ generic/tkCanvUtil.c | 18 ++-- generic/tkCanvWind.c | 2 +- generic/tkCanvas.c | 48 +++++----- generic/tkCanvas.h | 2 +- generic/tkClipboard.c | 40 ++++---- generic/tkCmds.c | 10 +- generic/tkColor.h | 4 +- generic/tkConfig.c | 9 +- generic/tkDecls.h | 59 ++++++------ generic/tkEntry.c | 82 ++++++++--------- generic/tkEntry.h | 18 ++-- generic/tkFileFilter.c | 6 +- generic/tkFont.c | 28 +++--- generic/tkFont.h | 4 +- generic/tkFrame.c | 6 +- generic/tkGrab.c | 2 +- generic/tkGrid.c | 6 +- generic/tkImgGIF.c | 4 +- generic/tkImgListFormat.c | 2 +- generic/tkImgPNG.c | 12 +-- generic/tkImgPPM.c | 2 +- generic/tkImgPhoto.c | 8 +- generic/tkImgSVGnano.c | 16 ++-- generic/tkInt.decls | 26 +++--- generic/tkInt.h | 51 ++++------- generic/tkIntDecls.h | 52 +++++------ generic/tkListbox.c | 26 +++--- generic/tkMain.c | 2 +- generic/tkMenu.c | 56 ++++++------ generic/tkMenu.h | 14 +-- generic/tkMenuDraw.c | 6 +- generic/tkObj.c | 8 +- generic/tkOption.c | 4 +- generic/tkPack.c | 4 +- generic/tkPanedWindow.c | 12 +-- generic/tkRectOval.c | 2 +- generic/tkScale.h | 2 +- generic/tkScrollbar.c | 2 +- generic/tkSelect.c | 12 +-- generic/tkSelect.h | 4 +- generic/tkStubInit.c | 6 -- generic/tkTest.c | 4 +- generic/tkText.c | 114 +++++++++++------------ generic/tkText.h | 30 +++--- generic/tkTextBTree.c | 16 ++-- generic/tkTextDisp.c | 16 ++-- generic/tkTextImage.c | 6 +- generic/tkTextIndex.c | 26 +++--- generic/tkTextMark.c | 10 +- generic/tkTextTag.c | 16 ++-- generic/tkTextWind.c | 6 +- generic/tkUtil.c | 18 ++-- generic/tkWindow.c | 4 +- generic/ttk/ttkEntry.c | 74 +++++++-------- generic/ttk/ttkFrame.c | 4 +- generic/ttk/ttkLabel.c | 2 +- generic/ttk/ttkManager.c | 40 ++++---- generic/ttk/ttkManager.h | 24 ++--- generic/ttk/ttkNotebook.c | 72 +++++++-------- generic/ttk/ttkPanedwindow.c | 24 ++--- generic/ttk/ttkTagSet.c | 4 +- generic/ttk/ttkTheme.h | 10 +- generic/ttk/ttkTreeview.c | 110 +++++++++++----------- macosx/tkMacOSXCursor.c | 2 +- macosx/tkMacOSXFont.c | 18 ++-- macosx/tkMacOSXMenu.c | 4 +- unix/configure | 10 +- unix/configure.ac | 10 +- unix/tkUnixCursor.c | 6 +- unix/tkUnixFont.c | 16 ++-- unix/tkUnixKey.c | 2 +- unix/tkUnixRFont.c | 16 ++-- unix/tkUnixWm.c | 4 +- win/configure | 12 ++- win/configure.ac | 12 ++- win/rules.vc | 20 +++- win/tkWinCursor.c | 2 +- win/tkWinDialog.c | 2 +- win/tkWinFont.c | 14 +-- win/tkWinInit.c | 2 +- win/tkWinMenu.c | 6 +- win/tkWinWm.c | 14 +-- win/ttkWinXPTheme.c | 6 +- 96 files changed, 870 insertions(+), 934 deletions(-) diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml index 0a6c46a..6b4e9df 100644 --- a/.github/workflows/linux-with-tcl9-build.yml +++ b/.github/workflows/linux-with-tcl9-build.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tcl8-compat path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | @@ -121,7 +121,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tcl8-compat path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | diff --git a/generic/tk.decls b/generic/tk.decls index 7c459b2..c147943 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -54,7 +54,7 @@ declare 5 { } declare 6 { void Tk_BindEvent(Tk_BindingTable bindingTable, - XEvent *eventPtr, Tk_Window tkwin, int numObjects, + XEvent *eventPtr, Tk_Window tkwin, Tcl_Size numObjects, ClientData *objectPtr) } declare 7 { @@ -88,7 +88,7 @@ declare 13 { } declare 14 { void Tk_CanvasPsPath(Tcl_Interp *interp, - Tk_Canvas canvas, double *coordPtr, int numPoints) + Tk_Canvas canvas, double *coordPtr, Tcl_Size numPoints) } declare 15 { int Tk_CanvasPsStipple(Tcl_Interp *interp, @@ -102,11 +102,11 @@ declare 17 { } declare 18 { int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 19 { const char *Tk_CanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 20 { Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas) @@ -155,7 +155,7 @@ declare 30 { } declare 31 { Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, - const char *str, int numChars, int wrapLength, + const char *str, Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr) } @@ -253,7 +253,7 @@ declare 56 { declare 57 { void Tk_Draw3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, - XPoint *pointPtr, int numPoints, int borderWidth, + XPoint *pointPtr, Tcl_Size numPoints, int borderWidth, int leftRelief) } declare 58 { @@ -263,7 +263,7 @@ declare 58 { } declare 59 { void Tk_DrawChars(Display *display, Drawable drawable, GC gc, - Tk_Font tkfont, const char *source, int numBytes, int x, int y) + Tk_Font tkfont, const char *source, Tcl_Size numBytes, int x, int y) } declare 60 { void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, int width, @@ -277,7 +277,7 @@ declare 61 { declare 62 { void Tk_Fill3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, - XPoint *pointPtr, int numPoints, int borderWidth, + XPoint *pointPtr, Tcl_Size numPoints, int borderWidth, int leftRelief) } declare 63 { @@ -504,7 +504,7 @@ declare 125 { } declare 126 { int Tk_MeasureChars(Tk_Font tkfont, - const char *source, int numBytes, int maxPixels, + const char *source, Tcl_Size numBytes, int maxPixels, int flags, int *lengthPtr) } declare 127 { @@ -672,7 +672,7 @@ declare 175 { void Tk_TextLayoutToPostscript(Tcl_Interp *interp, Tk_TextLayout layout) } declare 176 { - int Tk_TextWidth(Tk_Font font, const char *str, int numBytes) + int Tk_TextWidth(Tk_Font font, const char *str, Tcl_Size numBytes) } declare 177 { void Tk_UndefineCursor(Tk_Window window) @@ -680,8 +680,8 @@ declare 177 { declare 178 { void Tk_UnderlineChars(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, - const char *source, int x, int y, int firstByte, - int lastByte) + const char *source, int x, int y, Tcl_Size firstByte, + Tcl_Size lastByte) } declare 179 { void Tk_UnderlineTextLayout(Display *display, Drawable drawable, GC gc, @@ -806,7 +806,7 @@ declare 211 { Tk_OptionTable optionToken, Tk_Window tkwin) } declare 212 {nostub {Don't use this function in a stub-enabled extension}} { - void Tk_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc, + void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp) } declare 213 { @@ -814,7 +814,7 @@ declare 213 { } declare 214 { int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, - Tk_OptionTable optionTable, int objc, + Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr) } @@ -892,7 +892,7 @@ declare 234 { } declare 235 { void Tk_PostscriptPath(Tcl_Interp *interp, Tk_PostscriptInfo psInfo, - double *coordPtr, int numPoints) + double *coordPtr, Tcl_Size numPoints) } declare 236 { int Tk_PostscriptStipple(Tcl_Interp *interp, Tk_Window tkwin, @@ -1216,11 +1216,11 @@ export { int exact) } export { - void Tk_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc, + void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp) } export { - void Tk_MainExW(int argc, wchar_t **argv, + void Tk_MainExW(Tcl_Size argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); } diff --git a/generic/tk.h b/generic/tk.h index dd82f64..5001753 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -141,6 +141,14 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; */ typedef const char *Tk_Uid; + +#ifndef Tcl_Size +# if TCL_MAJOR_VERSION > 8 +# define Tcl_Size size_t +# else +# define Tcl_Size int +# endif +#endif /* *---------------------------------------------------------------------- @@ -190,14 +198,13 @@ typedef struct Tk_OptionSpec { const char *defValue; /* Default value for option if not specified * in command line, the option database, or * the system. */ -#if TCL_MAJOR_VERSION > 8 - size_t objOffset; /* Where in record to store a Tcl_Obj * that + Tcl_Size objOffset; /* Where in record to store a Tcl_Obj * that * holds the value of this option, specified * as an offset in bytes from the start of the * record. Use the offsetof macro to generate * values for this. TCL_INDEX_NONE means don't * store the Tcl_Obj in the record. */ - size_t internalOffset; /* Where in record to store the internal + Tcl_Size internalOffset; /* Where in record to store the internal * representation of the value of this option, * such as an int or XColor *. This field is * specified as an offset in bytes from the @@ -205,10 +212,6 @@ typedef struct Tk_OptionSpec { * macro to generate values for it. * TCL_INDEX_NONE means don't store the * internal representation in the record. */ -#else - int objOffset; - int internalOffset; -#endif int flags; /* Any combination of the values defined * below. */ const void *clientData; /* An alternate place to put option-specific @@ -237,19 +240,11 @@ typedef struct Tk_OptionSpec { * option config code to handle a custom option. */ -#if TCL_MAJOR_VERSION > 8 typedef int (Tk_CustomOptionSetProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec, - size_t offset, char *saveInternalPtr, int flags); + Tcl_Size offset, char *saveInternalPtr, int flags); typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, size_t offset); -#else -typedef int (Tk_CustomOptionSetProc) (ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec, - int offset, char *saveInternalPtr, int flags); -typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset); -#endif + Tk_Window tkwin, char *widgRec, Tcl_Size offset); typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData, Tk_Window tkwin, char *internalPtr, char *saveInternalPtr); typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin, @@ -325,11 +320,7 @@ typedef struct Tk_SavedOptions { * configuration options. */ Tk_Window tkwin; /* Window associated with recordPtr; needed to * restore certain options. */ -#if TCL_MAJOR_VERSION > 8 - size_t numItems; /* The number of valid items in items field. */ -#else - int numItems; -#endif + Tcl_Size numItems; /* The number of valid items in items field. */ Tk_SavedOption items[TK_NUM_SAVED_OPTIONS]; /* Items used to hold old values. */ struct Tk_SavedOptions *nextPtr; @@ -353,17 +344,10 @@ typedef struct Tk_SavedOptions { #ifndef __NO_OLD_CONFIG -#if TCL_MAJOR_VERSION > 8 typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, size_t offset); + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); typedef const char *(Tk_OptionPrintProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, size_t offset, Tcl_FreeProc **freeProcPtr); -#else -typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset); -typedef const char *(Tk_OptionPrintProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); -#endif + Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); typedef struct Tk_CustomOption { Tk_OptionParseProc *parseProc; @@ -394,13 +378,9 @@ typedef struct Tk_ConfigSpec { Tk_Uid dbClass; /* Class for option in database. */ Tk_Uid defValue; /* Default value for option if not specified * in command line or database. */ -#if TCL_MAJOR_VERSION > 8 - size_t offset; /* Where in widget record to store value; use + Tcl_Size offset; /* Where in widget record to store value; use * offsetof macro to generate values for * this. */ -#else - int offset; -#endif int specFlags; /* Any combination of the values defined * below; other bits are used internally by * tkConfig.c. */ @@ -609,11 +589,7 @@ typedef void (Tk_ClassWorldChangedProc) (ClientData instanceData); typedef void (Tk_ClassModalProc) (Tk_Window tkwin, XEvent *eventPtr); typedef struct Tk_ClassProcs { -#if TCL_MAJOR_VERSION > 8 - size_t size; -#else - unsigned int size; -#endif + Tcl_Size size; Tk_ClassWorldChangedProc *worldChangedProc; /* Procedure to invoke when the widget needs * to respond in some way to a change in the @@ -837,13 +813,8 @@ typedef struct Tk_FakeWin { XIC dummy9; /* inputContext */ #endif /* TK_USE_INPUT_METHODS */ ClientData *dummy10; /* tagPtr */ -#if TCL_MAJOR_VERSION > 8 - size_t dummy11; /* numTags */ - size_t dummy12; /* optionLevel */ -#else - int dummy11; - int dummy12; -#endif + Tcl_Size dummy11; /* numTags */ + Tcl_Size dummy12; /* optionLevel */ char *dummy13; /* selHandlerList */ char *dummy14; /* geomMgrPtr */ ClientData dummy15; /* geomData */ @@ -990,12 +961,8 @@ typedef struct Tk_SmoothMethod { #define TK_TAG_SPACE 3 typedef struct Tk_Item { -#if TCL_MAJOR_VERSION > 8 - size_t id; /* Unique identifier for this item (also + Tcl_Size id; /* Unique identifier for this item (also * serves as first tag for item). */ -#else - int id; -#endif struct Tk_Item *nextPtr; /* Next in display list of all items in this * canvas. Later items in list are drawn on * top of earlier ones. */ @@ -1004,14 +971,10 @@ typedef struct Tk_Item { Tk_Uid *tagPtr; /* Pointer to array of tags. Usually points to * staticTagSpace, but may point to malloc-ed * space if there are lots of tags. */ -#if TCL_MAJOR_VERSION > 8 - size_t tagSpace; /* Total amount of tag space available at + Tcl_Size tagSpace; /* Total amount of tag space available at * tagPtr. */ - size_t numTags; /* Number of tag slots actually used at + Tcl_Size numTags; /* Number of tag slots actually used at * *tagPtr. */ -#else - int tagSpace, numTags; -#endif struct Tk_ItemType *typePtr;/* Table of procedures that implement this * type of item. */ int x1, y1, x2, y2; /* Bounding box for item, in integer canvas @@ -1073,17 +1036,10 @@ typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, int flags); typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); -#if TCL_MAJOR_VERSION > 8 typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t beforeThis, Tcl_Obj *string); + Tcl_Size beforeThis, Tcl_Obj *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Obj *indexString, size_t *indexPtr); -#else -typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int beforeThis, Tcl_Obj *string); -typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Obj *indexString, int *indexPtr); -#endif + 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); @@ -1103,33 +1059,20 @@ typedef void (Tk_ItemScaleProc)(Tk_Canvas canvas, Tk_Item *itemPtr, double scaleY); typedef void (Tk_ItemTranslateProc)(Tk_Canvas canvas, Tk_Item *itemPtr, double deltaX, double deltaY); -#if TCL_MAJOR_VERSION > 8 typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t index); + Tcl_Size index); typedef size_t (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t offset, char *buffer, size_t maxBytes); + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t first, size_t last); -#else -typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int index); -typedef int (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int offset, char *buffer, int maxBytes); -typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int first, int last); -#endif + Tcl_Size first, Tcl_Size last); #ifndef __NO_OLD_CONFIG typedef struct Tk_ItemType { const char *name; /* The name of this type of item, such as * "line". */ -#if TCL_MAJOR_VERSION > 8 - size_t itemSize; /* Total amount of space needed for item's + Tcl_Size itemSize; /* Total amount of space needed for item's * record. */ -#else - int itemSize; -#endif Tk_ItemCreateProc *createProc; /* Procedure to create a new item of this * type. */ @@ -1211,25 +1154,17 @@ typedef struct Tk_CanvasTextInfo { Tk_Item *selItemPtr; /* Pointer to selected item. NULL means * selection isn't in this canvas. Writable by * items. */ -#if TCL_MAJOR_VERSION > 8 - size_t selectFirst; /* Character index of first selected + Tcl_Size selectFirst; /* Character index of first selected * character. Writable by items. */ - size_t selectLast; /* Character index of last selected character. + Tcl_Size selectLast; /* Character index of last selected character. * Writable by items. */ -#else - int selectFirst, selectLast; -#endif Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not * necessarily selItemPtr. Read-only to * items. */ -#if TCL_MAJOR_VERSION > 8 - size_t selectAnchor; /* Character index of fixed end of selection + Tcl_Size selectAnchor; /* Character index of fixed end of selection * (i.e. "select to" operation will use this * as one end of the selection). Writable by * items. */ -#else - int selectAnchor; -#endif Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion * cursor. Read-only to items. */ int insertWidth; /* Total width of insertion cursor. Read-only @@ -1689,13 +1624,8 @@ typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp, typedef void (Tk_LostSelProc) (ClientData clientData); typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData, XEvent *eventPtr); -#if TCL_MAJOR_VERSION > 8 -typedef size_t (Tk_SelectionProc) (ClientData clientData, size_t offset, - char *buffer, size_t maxBytes); -#else -typedef int (Tk_SelectionProc) (ClientData clientData, int offset, - char *buffer, int maxBytes); -#endif +typedef size_t (Tk_SelectionProc) (ClientData clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); /* *---------------------------------------------------------------------- diff --git a/generic/tk3d.c b/generic/tk3d.c index 65ae8d0..c8549de 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -748,7 +748,7 @@ Tk_Draw3DPolygon( XPoint *pointPtr, /* Array of points describing polygon. All * points must be absolute * (CoordModeOrigin). */ - int numPoints, /* Number of points at *pointPtr. */ + Tcl_Size numPoints1, /* Number of points at *pointPtr. */ int borderWidth, /* Width of border, measured in pixels to the * left of the polygon's trajectory. May be * negative. */ @@ -763,6 +763,7 @@ Tk_Draw3DPolygon( GC gc; int i, lightOnLeft, dx, dy, parallel, pointsSeen; Display *display = Tk_Display(tkwin); + int numPoints = numPoints1; if (borderPtr->lightGC == NULL) { TkpGetShadows(borderPtr, tkwin); @@ -1017,7 +1018,7 @@ Tk_Fill3DPolygon( XPoint *pointPtr, /* Array of points describing polygon. All * points must be absolute * (CoordModeOrigin). */ - int numPoints, /* Number of points at *pointPtr. */ + Tcl_Size numPoints1, /* Number of points at *pointPtr. */ int borderWidth, /* Width of border, measured in pixels to the * left of the polygon's trajectory. May be * negative. */ @@ -1027,6 +1028,7 @@ Tk_Fill3DPolygon( * TK_RELIEF_SUNKEN. */ { TkBorder *borderPtr = (TkBorder *) border; + int numPoints = numPoints1; XFillPolygon(Tk_Display(tkwin), drawable, borderPtr->bgGC, pointPtr, numPoints, Complex, CoordModeOrigin); diff --git a/generic/tk3d.h b/generic/tk3d.h index 7c22398..6a93199 100644 --- a/generic/tk3d.h +++ b/generic/tk3d.h @@ -28,7 +28,7 @@ typedef struct TkBorder { * the border will be used. */ Colormap colormap; /* Colormap out of which pixels are * allocated. */ - TkSizeT resourceRefCount; /* Number of active uses of this color (each + Tcl_Size resourceRefCount; /* Number of active uses of this color (each * active use corresponds to a call to * Tk_Alloc3DBorderFromObj or Tk_Get3DBorder). * If this count is 0, then this structure is @@ -37,7 +37,7 @@ typedef struct TkBorder { * because there are objects referring to it. * The structure is freed when objRefCount and * resourceRefCount are both 0. */ - TkSizeT objRefCount; /* The number of Tcl objects that reference + Tcl_Size objRefCount; /* The number of Tcl objects that reference * this structure. */ XColor *bgColorPtr; /* Background color (intensity between * lightColorPtr and darkColorPtr). */ diff --git a/generic/tkBind.c b/generic/tkBind.c index 9f3016f..58a1c3c 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2175,7 +2175,7 @@ Tk_BindEvent( XEvent *eventPtr, /* What actually happened. */ Tk_Window tkwin, /* Window on display where event occurred (needed in order to * locate display information). */ - int numObjects, /* Number of objects at *objArr. */ + Tcl_Size numObjects1, /* Number of objects at *objArr. */ ClientData *objArr) /* Array of one or more objects to check for a matching binding. */ { Tcl_Interp *interp; @@ -2200,6 +2200,7 @@ Tk_BindEvent( unsigned arraySize; unsigned newArraySize; unsigned i, k; + int numObjects = numObjects1; assert(bindPtr); assert(eventPtr); diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index b9cc335..2c42f0e 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -88,9 +88,9 @@ typedef struct ArcItem { static int StyleParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, - char *widgRec, TkSizeT offset); + char *widgRec, Tcl_Size offset); static const char * StylePrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) @@ -99,7 +99,7 @@ static const Tk_CustomOption styleOption = { StyleParseProc, StylePrintProc, NULL }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -2198,7 +2198,7 @@ StyleParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { int c; size_t length; @@ -2259,7 +2259,7 @@ StylePrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Ignored. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 69a37bd..7ef7ba3 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -45,7 +45,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 5cb26e5..6e4626b 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -47,7 +47,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 987040e..57719a6 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -92,14 +92,14 @@ static void DisplayLine(Tk_Canvas canvas, int x, int y, int width, int height); static int GetLineIndex(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - Tcl_Obj *obj, TkSizeT *indexPtr); + Tcl_Obj *obj, Tcl_Size *indexPtr); static int LineCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void LineDeleteCoords(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT first, TkSizeT last); + Tk_Item *itemPtr, Tcl_Size first, Tcl_Size last); static void LineInsert(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT beforeThis, Tcl_Obj *obj); + Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *obj); static int LineToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double LineToPoint(Tk_Canvas canvas, @@ -108,15 +108,15 @@ static int LineToPostscript(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass); static int ArrowParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *recordPtr, TkSizeT offset); + const char *value, char *recordPtr, Tcl_Size offset); static const char * ArrowPrintProc(ClientData clientData, - Tk_Window tkwin, char *recordPtr, TkSizeT offset, + Tk_Window tkwin, char *recordPtr, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); static int ParseArrowShape(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *recordPtr, TkSizeT offset); + const char *value, char *recordPtr, Tcl_Size offset); static const char * PrintArrowShape(ClientData clientData, - Tk_Window tkwin, char *recordPtr, TkSizeT offset, + Tk_Window tkwin, char *recordPtr, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); static void RotateLine(Tk_Canvas canvas, Tk_Item *itemPtr, double originX, double originY, double angleRad); @@ -145,7 +145,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -955,7 +955,7 @@ static void LineInsert( Tk_Canvas canvas, /* Canvas containing text item. */ Tk_Item *itemPtr, /* Line item to be modified. */ - TkSizeT beforeThis, /* Index before which new coordinates are to + Tcl_Size beforeThis, /* Index before which new coordinates are to * be inserted. */ Tcl_Obj *obj) /* New coordinates to be inserted. */ { @@ -979,7 +979,7 @@ LineInsert( if (beforeThis == TCL_INDEX_NONE) { beforeThis = 0; } - if (beforeThis + 1 > (TkSizeT)length + 1) { + if (beforeThis + 1 > (Tcl_Size)length + 1) { beforeThis = length; } @@ -1210,8 +1210,8 @@ static void LineDeleteCoords( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Item in which to delete characters. */ - TkSizeT first, /* Index of first character to delete. */ - TkSizeT last) /* Index of last character to delete. */ + Tcl_Size first, /* Index of first character to delete. */ + Tcl_Size last) /* Index of last character to delete. */ { LineItem *linePtr = (LineItem *) itemPtr; int count, i, first1, last1, nbDelPoints; @@ -1864,9 +1864,9 @@ GetLineIndex( * specified. */ Tcl_Obj *obj, /* Specification of a particular coord in * itemPtr's line. */ - TkSizeT *indexPtr) /* Where to store converted index. */ + Tcl_Size *indexPtr) /* Where to store converted index. */ { - TkSizeT idx, length; + Tcl_Size idx, length; LineItem *linePtr = (LineItem *) itemPtr; const char *string; (void)canvas; @@ -1874,10 +1874,10 @@ GetLineIndex( if (TCL_OK == TkGetIntForIndex(obj, 2*linePtr->numPoints - 1, 1, &idx)) { if (idx == TCL_INDEX_NONE) { idx = 0; - } else if (idx > (2*(TkSizeT)linePtr->numPoints)) { + } else if (idx > (2*(Tcl_Size)linePtr->numPoints)) { idx = 2*linePtr->numPoints; } else { - idx &= (TkSizeT)-2; /* If index is odd, make it even. */ + idx &= (Tcl_Size)-2; /* If index is odd, make it even. */ } *indexPtr = idx; return TCL_OK; @@ -2054,12 +2054,12 @@ ParseArrowShape( const char *value, /* Textual specification of arrow shape. */ char *recordPtr, /* Pointer to item record in which to store * arrow information. */ - TkSizeT offset) /* Offset of shape information in widget + Tcl_Size offset) /* Offset of shape information in widget * record. */ { LineItem *linePtr = (LineItem *) recordPtr; double a, b, c; - TkSizeT argc; + Tcl_Size argc; const char **argv = NULL; if ((size_t)offset != offsetof(LineItem, arrowShapeA)) { @@ -2120,7 +2120,7 @@ PrintArrowShape( TCL_UNUSED(Tk_Window), /* Window associated with linePtr's widget. */ char *recordPtr, /* Pointer to item record containing current * shape information. */ - TCL_UNUSED(TkSizeT), /* Offset of arrow information in record. */ + TCL_UNUSED(Tcl_Size), /* Offset of arrow information in record. */ Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free * string here. */ { @@ -2158,7 +2158,7 @@ ArrowParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { int c; size_t length; @@ -2223,7 +2223,7 @@ ArrowPrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 86e21f0..a9efc33 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -62,7 +62,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -163,14 +163,14 @@ static void DisplayPolygon(Tk_Canvas canvas, int x, int y, int width, int height); static int GetPolygonIndex(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - Tcl_Obj *obj, TkSizeT *indexPtr); + Tcl_Obj *obj, Tcl_Size *indexPtr); static int PolygonCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void PolygonDeleteCoords(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT first, TkSizeT last); + Tk_Item *itemPtr, Tcl_Size first, Tcl_Size last); static void PolygonInsert(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT beforeThis, Tcl_Obj *obj); + Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *obj); static int PolygonToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double PolygonToPoint(Tk_Canvas canvas, @@ -1016,7 +1016,7 @@ static void PolygonInsert( Tk_Canvas canvas, /* Canvas containing text item. */ Tk_Item *itemPtr, /* Line item to be modified. */ - TkSizeT beforeThis, /* Index before which new coordinates are to + Tcl_Size beforeThis, /* Index before which new coordinates are to * be inserted. */ Tcl_Obj *obj) /* New coordinates to be inserted. */ { @@ -1208,8 +1208,8 @@ static void PolygonDeleteCoords( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Item in which to delete characters. */ - TkSizeT first, /* Index of first character to delete. */ - TkSizeT last) /* Index of last character to delete. */ + Tcl_Size first, /* Index of first character to delete. */ + Tcl_Size last) /* Index of last character to delete. */ { PolygonItem *polyPtr = (PolygonItem *) itemPtr; int count, i; @@ -1711,12 +1711,12 @@ GetPolygonIndex( * specified. */ Tcl_Obj *obj, /* Specification of a particular coord in * itemPtr's line. */ - TkSizeT *indexPtr) /* Where to store converted index. */ + Tcl_Size *indexPtr) /* Where to store converted index. */ { - TkSizeT length, idx; + Tcl_Size length, idx; PolygonItem *polyPtr = (PolygonItem *) itemPtr; const char *string; - TkSizeT count = 2*(polyPtr->numPoints - polyPtr->autoClosed); + Tcl_Size count = 2*(polyPtr->numPoints - polyPtr->autoClosed); if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX - 1) - ((INT_MAX) % count), 1, &idx)) { if (idx == TCL_INDEX_NONE) { @@ -1724,7 +1724,7 @@ GetPolygonIndex( } else if (idx >= INT_MAX - ((INT_MAX) % count)) { idx = count; } else { - idx = (idx & (TkSizeT)-2) % count; + idx = (idx & (Tcl_Size)-2) % count; } *indexPtr = idx; return TCL_OK; diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index 8831402..6604148 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -1059,7 +1059,7 @@ Tk_PostscriptPath( * generated. */ double *coordPtr, /* Pointer to first in array of 2*numPoints * coordinates giving points for path. */ - int numPoints) /* Number of points at *coordPtr. */ + Tcl_Size numPoints) /* Number of points at *coordPtr. */ { TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo; Tcl_Obj *psObj; diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index ebcbd85..d7219b8 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -32,7 +32,7 @@ typedef struct TextItem { */ double x, y; /* Positioning point for text. */ - TkSizeT insertPos; /* Character index of character just before + Tcl_Size insertPos; /* Character index of character just before * which the insertion cursor is displayed. */ /* @@ -62,8 +62,8 @@ typedef struct TextItem { * configuration settings above. */ - TkSizeT numChars; /* Length of text in characters. */ - TkSizeT numBytes; /* Length of text in bytes. */ + Tcl_Size numChars; /* Length of text in characters. */ + Tcl_Size numBytes; /* Length of text in bytes. */ Tk_TextLayout textLayout; /* Cached text layout information. */ int actualWidth; /* Width of text as computed. Used to make * selections of wrapped text display @@ -87,7 +87,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption offsetOption = { TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) @@ -100,12 +100,12 @@ UnderlineParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item (ignored). */ + Tcl_Size offset) /* Offset into item (ignored). */ { int *underlinePtr = (int *) (widgRec + offset); Tcl_Obj obj; int code; - TkSizeT underline; + Tcl_Size underline; (void)dummy; (void)tkwin; @@ -141,7 +141,7 @@ UnderlinePrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Pointer to record for item. */ + Tcl_Size offset, /* Pointer to record for item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -235,24 +235,24 @@ static void DeleteText(Tk_Canvas canvas, static void DisplayCanvText(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height); -static TkSizeT GetSelText(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT offset, char *buffer, - TkSizeT maxBytes); +static Tcl_Size GetSelText(Tk_Canvas canvas, + Tk_Item *itemPtr, Tcl_Size offset, char *buffer, + Tcl_Size maxBytes); static int GetTextIndex(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - Tcl_Obj *obj, TkSizeT *indexPtr); + Tcl_Obj *obj, Tcl_Size *indexPtr); static void ScaleText(Tk_Canvas canvas, Tk_Item *itemPtr, double originX, double originY, double scaleX, double scaleY); static void SetTextCursor(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT index); + Tk_Item *itemPtr, Tcl_Size index); static int TextCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void TextDeleteChars(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT first, TkSizeT last); + Tk_Item *itemPtr, Tcl_Size first, Tcl_Size last); static void TextInsert(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT beforeThis, Tcl_Obj *obj); + Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *obj); static int TextToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double TextToPoint(Tk_Canvas canvas, @@ -880,7 +880,7 @@ DisplayCanvText( { TextItem *textPtr; Tk_CanvasTextInfo *textInfoPtr; - TkSizeT selFirstChar, selLastChar; + Tcl_Size selFirstChar, selLastChar; short drawableX, drawableY; Pixmap stipple; Tk_State state = itemPtr->state; @@ -1087,13 +1087,13 @@ static void TextInsert( Tk_Canvas canvas, /* Canvas containing text item. */ Tk_Item *itemPtr, /* Text item to be modified. */ - TkSizeT index, /* Character index before which string is to + Tcl_Size index, /* Character index before which string is to * be inserted. */ Tcl_Obj *obj) /* New characters to be inserted. */ { TextItem *textPtr = (TextItem *) itemPtr; int byteIndex, charsAdded; - TkSizeT byteCount; + Tcl_Size byteCount; char *newStr, *text; const char *string; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; @@ -1169,9 +1169,9 @@ static void TextDeleteChars( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Item in which to delete characters. */ - TkSizeT first, /* Character index of first character to + Tcl_Size first, /* Character index of first character to * delete. */ - TkSizeT last) /* Character index of last character to delete + Tcl_Size last) /* Character index of last character to delete * (inclusive). */ { TextItem *textPtr = (TextItem *) itemPtr; @@ -1458,11 +1458,11 @@ GetTextIndex( * specified. */ Tcl_Obj *obj, /* Specification of a particular character in * itemPtr's text. */ - TkSizeT *indexPtr) /* Where to store converted character + Tcl_Size *indexPtr) /* Where to store converted character * index. */ { TextItem *textPtr = (TextItem *) itemPtr; - TkSizeT length, idx; + Tcl_Size length, idx; int c; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; const char *string; @@ -1558,7 +1558,7 @@ SetTextCursor( TCL_UNUSED(Tk_Canvas), /* Record describing canvas widget. */ Tk_Item *itemPtr, /* Text item in which cursor position is to be * set. */ - TkSizeT index) /* Character index of character just before + Tcl_Size index) /* Character index of character just before * which cursor is to be positioned. */ { TextItem *textPtr = (TextItem *) itemPtr; @@ -1592,19 +1592,19 @@ SetTextCursor( *-------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size GetSelText( TCL_UNUSED(Tk_Canvas), /* Canvas containing selection. */ Tk_Item *itemPtr, /* Text item containing selection. */ - TkSizeT offset, /* Byte offset within selection of first + Tcl_Size offset, /* Byte offset within selection of first * character to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { TextItem *textPtr = (TextItem *) itemPtr; - TkSizeT byteCount; + Tcl_Size byteCount; char *text; const char *selStart, *selEnd; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 99f9072..ea8e2e4 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -402,16 +402,16 @@ Tk_CanvasGetTextInfo( */ int -TkCanvasTagsParseProc( +Tk_CanvasTagsParseProc( ClientData dummy, /* Not used.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option (list of tag names). */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item (ignored). */ + Tcl_Size offset) /* Offset into item (ignored). */ { Tk_Item *itemPtr = (Tk_Item *) widgRec; - TkSizeT argc, i; + Tcl_Size argc, i; const char **argv; Tk_Uid *newPtr; (void)dummy; @@ -472,11 +472,11 @@ TkCanvasTagsParseProc( */ const char * -TkCanvasTagsPrintProc( +Tk_CanvasTagsPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Ignored. */ + Tcl_Size offset, /* Ignored. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -523,7 +523,7 @@ TkCanvasDashParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { (void)dummy; (void)tkwin; @@ -558,7 +558,7 @@ TkCanvasDashPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset in record for item. */ + Tcl_Size offset, /* Offset in record for item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -747,7 +747,7 @@ TkSmoothParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { const Tk_SmoothMethod **smoothPtr = (const Tk_SmoothMethod **) (widgRec + offset); @@ -839,7 +839,7 @@ TkSmoothPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 12bc69d..1ee42c7 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -41,7 +41,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 05c77a9..31a3504 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -51,7 +51,7 @@ typedef struct TagSearch { int searchOver; /* Non-zero means NextItem should always * return NULL. */ int type; /* Search type (see #defs below) */ - TkSizeT id; /* Item id for searches by id */ + Tcl_Size id; /* Item id for searches by id */ const char *string; /* Tag expression string */ int stringIndex; /* Current position in string scan */ int stringLength; /* Length of tag expression string */ @@ -222,14 +222,14 @@ static void CanvasCmdDeletedProc(void *clientData); static void CanvasDoEvent(TkCanvas *canvasPtr, XEvent *eventPtr); static void CanvasEventProc(void *clientData, XEvent *eventPtr); -static TkSizeT CanvasFetchSelection(void *clientData, TkSizeT offset, - char *buffer, TkSizeT maxBytes); +static Tcl_Size CanvasFetchSelection(void *clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); static Tk_Item * CanvasFindClosest(TkCanvas *canvasPtr, double coords[2]); static void CanvasFocusProc(TkCanvas *canvasPtr, int gotFocus); static void CanvasLostSelection(void *clientData); static void CanvasSelectTo(TkCanvas *canvasPtr, - Tk_Item *itemPtr, TkSizeT index); + Tk_Item *itemPtr, Tcl_Size index); static void CanvasSetOrigin(TkCanvas *canvasPtr, int xOrigin, int yOrigin); static void CanvasUpdateScrollbars(TkCanvas *canvasPtr); @@ -471,7 +471,7 @@ ItemIndex( TkCanvas *canvasPtr, Tk_Item *itemPtr, Tcl_Obj *objPtr, - TkSizeT *indexPtr) + Tcl_Size *indexPtr) { Tcl_Interp *interp = canvasPtr->interp; @@ -598,7 +598,7 @@ DefaultRotateImplementation( double y, double angleRadians) { - TkSizeT i, objc; + Tcl_Size i, objc; int ok = 1; Tcl_Obj **objv, **newObjv; double *coordv; @@ -1194,7 +1194,7 @@ CanvasWidgetCmd( tmpObj = Tcl_NewListObj(2, objv+4); FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto doneImove) { - TkSizeT index; + Tcl_Size index; int x1, x2, y1, y2; int dontRedraw1, dontRedraw2; @@ -1250,7 +1250,7 @@ CanvasWidgetCmd( int isNew = 0; Tcl_HashEntry *entryPtr; const char *arg; - TkSizeT length; + Tcl_Size length; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg ...?"); @@ -1339,7 +1339,7 @@ CanvasWidgetCmd( break; } case CANV_DCHARS: { - TkSizeT first, last; + Tcl_Size first, last; int x1, x2, y1, y2; if ((objc != 4) && (objc != 5)) { @@ -1442,7 +1442,7 @@ CanvasWidgetCmd( } case CANV_DTAG: { Tk_Uid tag; - TkSizeT i; + Tcl_Size i; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?tagToDelete?"); @@ -1537,7 +1537,7 @@ CanvasWidgetCmd( } break; case CANV_ICURSOR: { - TkSizeT index; + Tcl_Size index; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "tagOrId index"); @@ -1562,7 +1562,7 @@ CanvasWidgetCmd( break; } case CANV_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "tagOrId string"); @@ -1590,7 +1590,7 @@ CanvasWidgetCmd( break; } case CANV_INSERT: { - TkSizeT beforeThis; + Tcl_Size beforeThis; int x1, x2, y1, y2; if (objc != 5) { @@ -1807,7 +1807,7 @@ CanvasWidgetCmd( break; } case CANV_RCHARS: { - TkSizeT first, last; + Tcl_Size first, last; int x1, x2, y1, y2; int dontRedraw1, dontRedraw2; @@ -1960,7 +1960,7 @@ CanvasWidgetCmd( break; } case CANV_SELECT: { - TkSizeT index; + Tcl_Size index; int optionindex; static const char *const optionStrings[] = { "adjust", "clear", "from", "item", "to", NULL @@ -2383,7 +2383,7 @@ ConfigureCanvas( canvasPtr->scrollX2 = 0; canvasPtr->scrollY2 = 0; if (canvasPtr->regionString != NULL) { - TkSizeT argc2; + Tcl_Size argc2; const char **argv2; if (Tcl_SplitList(canvasPtr->interp, canvasPtr->regionString, @@ -5314,7 +5314,7 @@ PickCurrentItem( && !(canvasPtr->flags & LEFT_GRABBED_ITEM)) { XEvent event; Tk_Item *itemPtr = canvasPtr->currentItemPtr; - TkSizeT i; + Tcl_Size i; event = canvasPtr->pickEvent; event.type = LeaveNotify; @@ -5472,7 +5472,7 @@ CanvasDoEvent( #define NUM_STATIC 3 void *staticObjects[NUM_STATIC]; void **objectPtr; - TkSizeT numObjects, i; + Tcl_Size numObjects, i; Tk_Item *itemPtr; TagSearchExpr *expr; int numExprs; @@ -5663,10 +5663,10 @@ static void CanvasSelectTo( TkCanvas *canvasPtr, /* Information about widget. */ Tk_Item *itemPtr, /* Item that is to hold selection. */ - TkSizeT index) /* Index of element that is to become the + Tcl_Size index) /* Index of element that is to become the * "other" end of the selection. */ { - TkSizeT oldFirst, oldLast; + Tcl_Size oldFirst, oldLast; Tk_Item *oldSelPtr; oldFirst = canvasPtr->textInfo.selectFirst; @@ -5724,13 +5724,13 @@ CanvasSelectTo( *-------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size CanvasFetchSelection( void *clientData, /* Information about canvas widget. */ - TkSizeT offset, /* Offset within selection of first character + Tcl_Size offset, /* Offset within selection of first character * to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { @@ -6292,7 +6292,7 @@ Tk_CanvasPsPath( * generated. */ double *coordPtr, /* Pointer to first in array of 2*numPoints * coordinates giving points for path. */ - int numPoints) /* Number of points at *coordPtr. */ + Tcl_Size numPoints) /* Number of points at *coordPtr. */ { Tk_PostscriptPath(interp, Canvas(canvas)->psInfo, coordPtr, numPoints); } diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index e4fb8fc..9be431b 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.h @@ -214,7 +214,7 @@ typedef struct TkCanvas { * when converting coordinates. */ int flags; /* Various flags; see below for * definitions. */ - TkSizeT nextId; /* Number to use as id for next item created + Tcl_Size nextId; /* Number to use as id for next item created * in widget. */ Tk_PostscriptInfo psInfo; /* Pointer to information used for generating * Postscript for the canvas. NULL means no diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 1ae11da..64fcaeb 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -19,12 +19,12 @@ * Prototypes for functions used only in this file: */ -static TkSizeT ClipboardAppHandler(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); -static TkSizeT ClipboardHandler(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); -static TkSizeT ClipboardWindowHandler(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); +static Tcl_Size ClipboardAppHandler(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); +static Tcl_Size ClipboardHandler(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); +static Tcl_Size ClipboardWindowHandler(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); static void ClipboardLostSel(ClientData clientData); static int ClipboardGetProc(ClientData clientData, Tcl_Interp *interp, const char *portion); @@ -48,20 +48,20 @@ static int ClipboardGetProc(ClientData clientData, *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ClipboardHandler( ClientData clientData, /* Information about data to fetch. */ - TkSizeT offset, /* Return selection bytes starting at this + Tcl_Size offset, /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TkSizeT maxBytes) /* Maximum # of bytes to store at buffer. */ + Tcl_Size maxBytes) /* Maximum # of bytes to store at buffer. */ { TkClipboardTarget *targetPtr = (TkClipboardTarget *)clientData; TkClipboardBuffer *cbPtr; char *srcPtr, *destPtr; - TkSizeT count = 0; - TkSizeT scanned = 0; - TkSizeT length, freeCount; + Tcl_Size count = 0; + Tcl_Size scanned = 0; + Tcl_Size length, freeCount; /* * Skip to buffer containing offset byte @@ -126,16 +126,16 @@ ClipboardHandler( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ClipboardAppHandler( ClientData clientData, /* Pointer to TkDisplay structure. */ - TkSizeT offset, /* Return selection bytes starting at this + Tcl_Size offset, /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TkSizeT maxBytes) /* Maximum # of bytes to store at buffer. */ + Tcl_Size maxBytes) /* Maximum # of bytes to store at buffer. */ { TkDisplay *dispPtr = (TkDisplay *)clientData; - TkSizeT length; + Tcl_Size length; const char *p; p = dispPtr->clipboardAppPtr->winPtr->nameUid; @@ -171,13 +171,13 @@ ClipboardAppHandler( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ClipboardWindowHandler( TCL_UNUSED(void *), /* Not used. */ - TCL_UNUSED(TkSizeT), /* Return selection bytes starting at this + TCL_UNUSED(Tcl_Size), /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TCL_UNUSED(TkSizeT)) /* Maximum # of bytes to store at buffer. */ + TCL_UNUSED(Tcl_Size)) /* Maximum # of bytes to store at buffer. */ { buffer[0] = '.'; buffer[1] = 0; @@ -451,7 +451,7 @@ Tk_ClipboardObjCmd( }; enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT, APPEND_TYPE }; int subIndex; - TkSizeT length; + Tcl_Size length; for (i = 2; i < objc - 1; i++) { string = Tcl_GetStringFromObj(objv[i], &length); diff --git a/generic/tkCmds.c b/generic/tkCmds.c index ec48f91..a50ee8c 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -269,7 +269,7 @@ TkBindEventProc( #define MAX_OBJS 20 void *objects[MAX_OBJS], **objPtr; TkWindow *topLevPtr; - TkSizeT i, count; + Tcl_Size i, count; char *p; Tcl_HashEntry *hPtr; @@ -349,7 +349,7 @@ Tk_BindtagsObjCmd( { Tk_Window tkwin = (Tk_Window)clientData; TkWindow *winPtr, *winPtr2; - TkSizeT i, length; + Tcl_Size i, length; const char *p; Tcl_Obj *listPtr, **tags; @@ -400,7 +400,7 @@ Tk_BindtagsObjCmd( winPtr->numTags = length; winPtr->tagPtr = (void **)ckalloc(length * sizeof(void *)); - for (i = 0; i < (TkSizeT)length; i++) { + for (i = 0; i < (Tcl_Size)length; i++) { p = Tcl_GetString(tags[i]); if (p[0] == '.') { char *copy; @@ -444,7 +444,7 @@ void TkFreeBindingTags( TkWindow *winPtr) /* Window whose tags are to be released. */ { - TkSizeT i; + Tcl_Size i; const char *p; for (i = 0; i < winPtr->numTags; i++) { @@ -1863,7 +1863,7 @@ TkGetDisplayOf( * present. */ { const char *string; - TkSizeT length; + Tcl_Size length; if (objc < 1) { return 0; diff --git a/generic/tkColor.h b/generic/tkColor.h index 59344c1..d4a1fa7 100644 --- a/generic/tkColor.h +++ b/generic/tkColor.h @@ -38,7 +38,7 @@ typedef struct TkColor { Colormap colormap; /* Colormap from which this entry was * allocated. */ Visual *visual; /* Visual associated with colormap. */ - TkSizeT resourceRefCount; /* Number of active uses of this color (each + Tcl_Size resourceRefCount; /* Number of active uses of this color (each * active use corresponds to a call to * Tk_AllocColorFromObj or Tk_GetColor). If * this count is 0, then this TkColor @@ -48,7 +48,7 @@ typedef struct TkColor { * referring to it. The structure is freed * when resourceRefCount and objRefCount are * both 0. */ - TkSizeT objRefCount; /* The number of Tcl objects that reference + Tcl_Size objRefCount; /* The number of Tcl objects that reference * this structure. */ int type; /* TK_COLOR_BY_NAME or TK_COLOR_BY_VALUE. */ Tcl_HashEntry *hashPtr; /* Pointer to hash table entry for this diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 6314bb2..5fe5b18 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -664,7 +664,7 @@ DoObjConfig( break; } case TK_OPTION_INDEX: { - TkSizeT newIndex; + Tcl_Size newIndex; if (TkGetIntForIndex(valuePtr, TCL_INDEX_END, 0, &newIndex) != TCL_OK) { if (interp) { @@ -674,7 +674,7 @@ DoObjConfig( return TCL_ERROR; } if (newIndex == TCL_INDEX_NONE) { - newIndex = (TkSizeT)INT_MIN; + newIndex = (Tcl_Size)INT_MIN; } else if ((size_t)newIndex > (size_t)TCL_INDEX_END>>1) { newIndex++; } @@ -717,7 +717,7 @@ DoObjConfig( case TK_OPTION_STRING: { char *newStr; const char *value; - TkSizeT length; + Tcl_Size length; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; @@ -1305,7 +1305,7 @@ Tk_SetOptions( * then no error message is returned.*/ void *recordPtr, /* The record to configure. */ Tk_OptionTable optionTable, /* Describes valid options. */ - int objc, /* The number of elements in objv. */ + Tcl_Size objc1, /* The number of elements in objv. */ Tcl_Obj *const objv[], /* Contains one or more name-value pairs. */ Tk_Window tkwin, /* Window associated with the thing being * configured; needed for some options (such @@ -1324,6 +1324,7 @@ Tk_SetOptions( Option *optionPtr; Tk_SavedOptions *lastSavePtr, *newSavePtr; int mask; + int objc = objc1; if (savePtr != NULL) { savePtr->recordPtr = recordPtr; diff --git a/generic/tkDecls.h b/generic/tkDecls.h index dc3563a..72cc243 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -64,7 +64,7 @@ EXTERN void Tk_AddOption(Tk_Window tkwin, const char *name, /* 6 */ EXTERN void Tk_BindEvent(Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, - int numObjects, ClientData *objectPtr); + Tcl_Size numObjects, ClientData *objectPtr); /* 7 */ EXTERN void Tk_CanvasDrawableCoords(Tk_Canvas canvas, double x, double y, short *drawableXPtr, @@ -90,7 +90,7 @@ EXTERN int Tk_CanvasPsFont(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font); /* 14 */ EXTERN void Tk_CanvasPsPath(Tcl_Interp *interp, Tk_Canvas canvas, - double *coordPtr, int numPoints); + double *coordPtr, Tcl_Size numPoints); /* 15 */ EXTERN int Tk_CanvasPsStipple(Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap); @@ -101,11 +101,12 @@ EXTERN void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc); /* 18 */ EXTERN int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + Tcl_Size offset); /* 19 */ EXTERN const char * Tk_CanvasTagsPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 20 */ EXTERN Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas); /* 21 */ @@ -149,7 +150,7 @@ EXTERN void Tk_ConfigureWindow(Tk_Window tkwin, XWindowChanges *valuePtr); /* 31 */ EXTERN Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, const char *str, - int numChars, int wrapLength, + Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 32 */ @@ -230,7 +231,7 @@ EXTERN int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x, /* 57 */ EXTERN void Tk_Draw3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, - int numPoints, int borderWidth, + Tcl_Size numPoints, int borderWidth, int leftRelief); /* 58 */ EXTERN void Tk_Draw3DRectangle(Tk_Window tkwin, @@ -240,7 +241,7 @@ EXTERN void Tk_Draw3DRectangle(Tk_Window tkwin, /* 59 */ EXTERN void Tk_DrawChars(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, - int numBytes, int x, int y); + Tcl_Size numBytes, int x, int y); /* 60 */ EXTERN void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, int width, Drawable drawable); @@ -252,7 +253,7 @@ EXTERN void Tk_DrawTextLayout(Display *display, /* 62 */ EXTERN void Tk_Fill3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, - int numPoints, int borderWidth, + Tcl_Size numPoints, int borderWidth, int leftRelief); /* 63 */ EXTERN void Tk_Fill3DRectangle(Tk_Window tkwin, @@ -437,7 +438,7 @@ EXTERN void Tk_ManageGeometry(Tk_Window tkwin, EXTERN void Tk_MapWindow(Tk_Window tkwin); /* 126 */ EXTERN int Tk_MeasureChars(Tk_Font tkfont, const char *source, - int numBytes, int maxPixels, int flags, + Tcl_Size numBytes, int maxPixels, int flags, int *lengthPtr); /* 127 */ EXTERN void Tk_MoveResizeWindow(Tk_Window tkwin, int x, int y, @@ -578,14 +579,14 @@ EXTERN void Tk_TextLayoutToPostscript(Tcl_Interp *interp, Tk_TextLayout layout); /* 176 */ EXTERN int Tk_TextWidth(Tk_Font font, const char *str, - int numBytes); + Tcl_Size numBytes); /* 177 */ EXTERN void Tk_UndefineCursor(Tk_Window window); /* 178 */ EXTERN void Tk_UnderlineChars(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, - int firstByte, int lastByte); + Tcl_Size firstByte, Tcl_Size lastByte); /* 179 */ EXTERN void Tk_UnderlineTextLayout(Display *display, Drawable drawable, GC gc, @@ -682,14 +683,14 @@ EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, int objc, EXTERN int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 212 */ -EXTERN void Tk_MainEx(int argc, char **argv, +EXTERN void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 213 */ EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr); /* 214 */ EXTERN int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, - Tk_OptionTable optionTable, int objc, + Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 215 */ @@ -753,7 +754,7 @@ EXTERN int Tk_PostscriptImage(Tk_Image image, /* 235 */ EXTERN void Tk_PostscriptPath(Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, - int numPoints); + Tcl_Size numPoints); /* 236 */ EXTERN int Tk_PostscriptStipple(Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, @@ -944,7 +945,7 @@ typedef struct TkStubs { void (*tk_3DHorizontalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief); /* 3 */ void (*tk_3DVerticalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief); /* 4 */ void (*tk_AddOption) (Tk_Window tkwin, const char *name, const char *value, int priority); /* 5 */ - void (*tk_BindEvent) (Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, int numObjects, ClientData *objectPtr); /* 6 */ + void (*tk_BindEvent) (Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, Tcl_Size numObjects, ClientData *objectPtr); /* 6 */ void (*tk_CanvasDrawableCoords) (Tk_Canvas canvas, double x, double y, short *drawableXPtr, short *drawableYPtr); /* 7 */ void (*tk_CanvasEventuallyRedraw) (Tk_Canvas canvas, int x1, int y1, int x2, int y2); /* 8 */ int (*tk_CanvasGetCoord) (Tcl_Interp *interp, Tk_Canvas canvas, const char *str, double *doublePtr); /* 9 */ @@ -952,12 +953,12 @@ typedef struct TkStubs { int (*tk_CanvasPsBitmap) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height); /* 11 */ int (*tk_CanvasPsColor) (Tcl_Interp *interp, Tk_Canvas canvas, XColor *colorPtr); /* 12 */ int (*tk_CanvasPsFont) (Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font); /* 13 */ - void (*tk_CanvasPsPath) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, int numPoints); /* 14 */ + void (*tk_CanvasPsPath) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, Tcl_Size numPoints); /* 14 */ int (*tk_CanvasPsStipple) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap); /* 15 */ double (*tk_CanvasPsY) (Tk_Canvas canvas, double y); /* 16 */ void (*tk_CanvasSetStippleOrigin) (Tk_Canvas canvas, GC gc); /* 17 */ - int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 18 */ - const char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 19 */ + int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 18 */ + const char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 19 */ 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 */ @@ -969,7 +970,7 @@ typedef struct TkStubs { 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, int argc, const char **argv, char *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, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */ + 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 */ unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, const char *script, int append); /* 33 */ Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */ @@ -995,12 +996,12 @@ typedef struct TkStubs { void (*tk_DestroyWindow) (Tk_Window tkwin); /* 54 */ const char * (*tk_DisplayName) (Tk_Window tkwin); /* 55 */ int (*tk_DistanceToTextLayout) (Tk_TextLayout layout, int x, int y); /* 56 */ - void (*tk_Draw3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 57 */ + void (*tk_Draw3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, Tcl_Size numPoints, int borderWidth, int leftRelief); /* 57 */ 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, int numBytes, int x, int y); /* 59 */ + 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_Fill3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 62 */ + 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 */ Font (*tk_FontId) (Tk_Font font); /* 65 */ @@ -1064,7 +1065,7 @@ typedef struct TkStubs { void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */ void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, ClientData clientData); /* 124 */ void (*tk_MapWindow) (Tk_Window tkwin); /* 125 */ - int (*tk_MeasureChars) (Tk_Font tkfont, const char *source, int numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */ + int (*tk_MeasureChars) (Tk_Font tkfont, const char *source, Tcl_Size numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */ void (*tk_MoveResizeWindow) (Tk_Window tkwin, int x, int y, int width, int height); /* 127 */ void (*tk_MoveWindow) (Tk_Window tkwin, int x, int y); /* 128 */ void (*tk_MoveToplevelWindow) (Tk_Window tkwin, int x, int y); /* 129 */ @@ -1114,9 +1115,9 @@ typedef struct TkStubs { void (*tk_SizeOfImage) (Tk_Image image, int *widthPtr, int *heightPtr); /* 173 */ int (*tk_StrictMotif) (Tk_Window tkwin); /* 174 */ void (*tk_TextLayoutToPostscript) (Tcl_Interp *interp, Tk_TextLayout layout); /* 175 */ - int (*tk_TextWidth) (Tk_Font font, const char *str, int numBytes); /* 176 */ + int (*tk_TextWidth) (Tk_Font font, const char *str, Tcl_Size numBytes); /* 176 */ void (*tk_UndefineCursor) (Tk_Window window); /* 177 */ - void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, int firstByte, int lastByte); /* 178 */ + void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, Tcl_Size firstByte, Tcl_Size lastByte); /* 178 */ void (*tk_UnderlineTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline); /* 179 */ void (*tk_Ungrab) (Tk_Window tkwin); /* 180 */ void (*tk_UnmaintainGeometry) (Tk_Window window, Tk_Window container); /* 181 */ @@ -1150,9 +1151,9 @@ typedef struct TkStubs { int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */ int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */ int (*tk_InitOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */ - TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tk_MainEx) (int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */ + TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tk_MainEx) (Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */ void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */ - int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */ + 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 (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */ @@ -1173,7 +1174,7 @@ typedef struct TkStubs { int (*tk_PostscriptColor) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, XColor *colorPtr); /* 232 */ int (*tk_PostscriptFont) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, Tk_Font font); /* 233 */ int (*tk_PostscriptImage) (Tk_Image image, Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass); /* 234 */ - void (*tk_PostscriptPath) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, int numPoints); /* 235 */ + void (*tk_PostscriptPath) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, Tcl_Size numPoints); /* 235 */ int (*tk_PostscriptStipple) (Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap); /* 236 */ double (*tk_PostscriptY) (double y, Tk_PostscriptInfo psInfo); /* 237 */ int (*tk_PostscriptPhoto) (Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo, int width, int height); /* 238 */ diff --git a/generic/tkEntry.c b/generic/tkEntry.c index b291acd..a6743d6 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -403,7 +403,7 @@ static const char *const selElementNames[] = { static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, int objc, Tcl_Obj *const objv[]); -static int DeleteChars(Entry *entryPtr, TkSizeT index, TkSizeT count); +static int DeleteChars(Entry *entryPtr, Tcl_Size index, Tcl_Size count); static void DestroyEntry(void *memPtr); static void DisplayEntry(ClientData clientData); static void EntryBlinkProc(ClientData clientData); @@ -412,22 +412,22 @@ static void EntryComputeGeometry(Entry *entryPtr); static void EntryEventProc(ClientData clientData, XEvent *eventPtr); static void EntryFocusProc(Entry *entryPtr, int gotFocus); -static TkSizeT EntryFetchSelection(ClientData clientData, TkSizeT offset, - char *buffer, TkSizeT maxBytes); +static Tcl_Size EntryFetchSelection(ClientData clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); static void EntryLostSelection(ClientData clientData); static void EventuallyRedraw(Entry *entryPtr); static void EntryScanTo(Entry *entryPtr, int y); static void EntrySetValue(Entry *entryPtr, const char *value); -static void EntrySelectTo(Entry *entryPtr, TkSizeT index); +static void EntrySelectTo(Entry *entryPtr, Tcl_Size index); static char * EntryTextVarProc(ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); static void EntryUpdateScrollbar(Entry *entryPtr); static int EntryValidate(Entry *entryPtr, char *cmd); static int EntryValidateChange(Entry *entryPtr, const char *change, - const char *newStr, TkSizeT index, int type); + const char *newStr, Tcl_Size index, int type); static void ExpandPercents(Entry *entryPtr, const char *before, - const char *change, const char *newStr, TkSizeT index, + const char *change, const char *newStr, Tcl_Size index, int type, Tcl_DString *dsPtr); static int EntryValueChanged(Entry *entryPtr, const char *newValue); @@ -438,8 +438,8 @@ static int EntryWidgetObjCmd(ClientData clientData, Tcl_Obj *const objv[]); static void EntryWorldChanged(ClientData instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, - Tcl_Obj *indexObj, TkSizeT *indexPtr); -static int InsertChars(Entry *entryPtr, TkSizeT index, const char *string); + Tcl_Obj *indexObj, Tcl_Size *indexPtr); +static int InsertChars(Entry *entryPtr, Tcl_Size index, const char *string); /* * These forward declarations are the spinbox specific ones: @@ -626,7 +626,7 @@ EntryWidgetObjCmd( Tcl_Preserve(entryPtr); switch ((enum entryCmd) cmdIndex) { case COMMAND_BBOX: { - TkSizeT index; + Tcl_Size index; int x, y, width, height; Tcl_Obj *bbox[4]; @@ -680,7 +680,7 @@ EntryWidgetObjCmd( break; case COMMAND_DELETE: { - TkSizeT first, last; + Tcl_Size first, last; int code; if ((objc < 3) || (objc > 4)) { @@ -727,7 +727,7 @@ EntryWidgetObjCmd( break; case COMMAND_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -742,7 +742,7 @@ EntryWidgetObjCmd( } case COMMAND_INSERT: { - TkSizeT index; + Tcl_Size index; int code; if (objc != 4) { @@ -794,7 +794,7 @@ EntryWidgetObjCmd( } case COMMAND_SELECTION: { - TkSizeT index, index2; + Tcl_Size index, index2; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "option ?index?"); @@ -833,7 +833,7 @@ EntryWidgetObjCmd( goto error; } if (entryPtr->selectFirst != TCL_INDEX_NONE) { - TkSizeT half1, half2; + Tcl_Size half1, half2; half1 = (entryPtr->selectFirst + entryPtr->selectLast)/2; half2 = (entryPtr->selectFirst + entryPtr->selectLast + 1)/2; @@ -948,7 +948,7 @@ EntryWidgetObjCmd( } case COMMAND_XVIEW: { - TkSizeT index; + Tcl_Size index; if (objc == 2) { double first, last; @@ -1261,7 +1261,7 @@ ConfigureEntry( sbPtr->listObj = NULL; if (sbPtr->valueStr != NULL) { Tcl_Obj *newObjPtr; - TkSizeT nelems; + Tcl_Size nelems; newObjPtr = Tcl_NewStringObj(sbPtr->valueStr, -1); if (Tcl_ListObjLength(interp, newObjPtr, &nelems) @@ -1786,7 +1786,7 @@ DisplayEntry( * Draw the selected and unselected portions separately. */ - TkSizeT selFirst; + Tcl_Size selFirst; if (entryPtr->selectFirst + 1 < entryPtr->leftIndex + 1) { selFirst = entryPtr->leftIndex; @@ -1973,7 +1973,7 @@ EntryComputeGeometry( Entry *entryPtr) /* Widget record for entry. */ { int totalLength, overflow, rightX; - TkSizeT maxOffScreen; + Tcl_Size maxOffScreen; int height, width, i; Tk_FontMetrics fm; char *p; @@ -2157,7 +2157,7 @@ EntryComputeGeometry( static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ - TkSizeT index, /* Add the new elements before this character + Tcl_Size index, /* Add the new elements before this character * index. */ const char *value) /* New characters to add (NULL-terminated * string). */ @@ -2256,8 +2256,8 @@ InsertChars( static int DeleteChars( Entry *entryPtr, /* Entry widget to modify. */ - TkSizeT index, /* Index of first character to delete. */ - TkSizeT count) /* How many characters to delete. */ + Tcl_Size index, /* Index of first character to delete. */ + Tcl_Size count) /* How many characters to delete. */ { int byteIndex, byteCount, newByteCount; const char *string; @@ -2675,9 +2675,9 @@ GetEntryIndex( Entry *entryPtr, /* Entry for which the index is being * specified. */ Tcl_Obj *indexObj, /* Specifies character in entryPtr. */ - TkSizeT *indexPtr) /* Where to store converted character index */ + Tcl_Size *indexPtr) /* Where to store converted character index */ { - TkSizeT length, idx; + Tcl_Size length, idx; const char *string; if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->numChars - 1, 1, &idx)) { @@ -2792,7 +2792,7 @@ EntryScanTo( Entry *entryPtr, /* Information about widget. */ int x) /* X-coordinate to use for scan operation. */ { - TkSizeT newLeftIndex; + Tcl_Size newLeftIndex; /* * Compute new leftIndex for entry by amplifying the difference between @@ -2848,10 +2848,10 @@ EntryScanTo( static void EntrySelectTo( Entry *entryPtr, /* Information about widget. */ - TkSizeT index) /* Character index of element that is to + Tcl_Size index) /* Character index of element that is to * become the "other" end of the selection. */ { - TkSizeT newFirst, newLast; + Tcl_Size newFirst, newLast; /* * Grab the selection if we don't own it already. @@ -2911,17 +2911,17 @@ EntrySelectTo( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size EntryFetchSelection( ClientData clientData, /* Information about entry widget. */ - TkSizeT offset, /* Byte offset within selection of first + Tcl_Size offset, /* Byte offset within selection of first * character to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NUL character. */ { Entry *entryPtr = (Entry *)clientData; - TkSizeT byteCount; + Tcl_Size byteCount; const char *string; const char *selStart, *selEnd; @@ -3397,7 +3397,7 @@ EntryValidateChange( const char *change, /* Characters to be added/deleted * (NUL-terminated string). */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete, -1 otherwise */ + Tcl_Size index, /* index of insert/delete, -1 otherwise */ int type) /* forced, delete, insert, focusin or * focusout */ { @@ -3543,7 +3543,7 @@ ExpandPercents( const char *change, /* Characters to added/deleted (NUL-terminated * string). */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete */ + Tcl_Size index, /* index of insert/delete */ int type, /* INSERT or DELETE */ Tcl_DString *dsPtr) /* Dynamic string in which to append new * command. */ @@ -3864,7 +3864,7 @@ SpinboxWidgetObjCmd( Tcl_Preserve(entryPtr); switch ((enum sbCmd) cmdIndex) { case SB_CMD_BBOX: { - TkSizeT index; + Tcl_Size index; int x, y, width, height; Tcl_Obj *bbox[4]; @@ -3917,7 +3917,7 @@ SpinboxWidgetObjCmd( break; case SB_CMD_DELETE: { - TkSizeT first, last; + Tcl_Size first, last; int code; if ((objc < 3) || (objc > 4)) { @@ -3985,7 +3985,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -4000,7 +4000,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_INSERT: { - TkSizeT index; + Tcl_Size index; int code; if (objc != 4) { @@ -4069,7 +4069,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_SELECTION: { - TkSizeT index, index2; + Tcl_Size index, index2; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "option ?index?"); @@ -4108,7 +4108,7 @@ SpinboxWidgetObjCmd( goto error; } if (entryPtr->selectFirst != TCL_INDEX_NONE) { - TkSizeT half1, half2; + Tcl_Size half1, half2; half1 = (entryPtr->selectFirst + entryPtr->selectLast)/2; half2 = (entryPtr->selectFirst + entryPtr->selectLast + 1)/2; @@ -4263,7 +4263,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_XVIEW: { - TkSizeT index; + Tcl_Size index; if (objc == 2) { double first, last; @@ -4426,8 +4426,8 @@ SpinboxInvoke( * there. If not, move to the first element of the list. */ - TkSizeT i, listc; - TkSizeT elemLen, length = entryPtr->numChars; + Tcl_Size i, listc; + Tcl_Size elemLen, length = entryPtr->numChars; const char *bytes; Tcl_Obj **listv; diff --git a/generic/tkEntry.h b/generic/tkEntry.h index 939206b..fd71282 100644 --- a/generic/tkEntry.h +++ b/generic/tkEntry.h @@ -45,18 +45,18 @@ typedef struct { const char *string; /* Pointer to storage for string; * NULL-terminated; malloc-ed. */ - TkSizeT insertPos; /* Character index before which next typed + Tcl_Size insertPos; /* Character index before which next typed * character will be inserted. */ /* * Information about what's selected, if any. */ - TkSizeT selectFirst; /* Character index of first selected character + Tcl_Size selectFirst; /* Character index of first selected character * (-1 means nothing selected. */ - TkSizeT selectLast; /* Character index just after last selected + Tcl_Size selectLast; /* Character index just after last selected * character (-1 means nothing selected. */ - TkSizeT selectAnchor; /* Fixed end of selection (i.e. "select to" + Tcl_Size selectAnchor; /* Fixed end of selection (i.e. "select to" * operation will use this as one end of the * selection). */ @@ -134,7 +134,7 @@ typedef struct { Tk_TextLayout placeholderLayout;/* Cached placeholder text layout information. */ char *placeholderString; /* String value of placeholder. */ - TkSizeT placeholderChars; /* Number of chars in placeholder. */ + Tcl_Size placeholderChars; /* Number of chars in placeholder. */ XColor *placeholderColorPtr;/* Color value of placeholder foreground. */ GC placeholderGC; /* For drawing placeholder text. */ int placeholderX; /* Origin for layout. */ @@ -151,13 +151,13 @@ typedef struct { * malloced memory with the same character * length as string but whose characters are * all equal to showChar. */ - TkSizeT numBytes; /* Length of string in bytes. */ - TkSizeT numChars; /* Length of string in characters. Both string + Tcl_Size numBytes; /* Length of string in bytes. */ + Tcl_Size numChars; /* Length of string in characters. Both string * and displayString have the same character * length, but may have different byte lengths * due to being made from different UTF-8 * characters. */ - TkSizeT numDisplayBytes; /* Length of displayString in bytes. */ + Tcl_Size numDisplayBytes; /* Length of displayString in bytes. */ int inset; /* Number of pixels on the left and right * sides that are taken up by XPAD, * borderWidth (if any), and highlightWidth @@ -166,7 +166,7 @@ typedef struct { int layoutX, layoutY; /* Origin for layout. */ int leftX; /* X position at which character at leftIndex * is drawn (varies depending on justify). */ - TkSizeT leftIndex; /* Character index of left-most character + Tcl_Size leftIndex; /* Character index of left-most character * visible in window. */ Tcl_TimerToken insertBlinkHandler; /* Timer handler used to blink cursor on and diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c index 47f8802..809f036 100644 --- a/generic/tkFileFilter.c +++ b/generic/tkFileFilter.c @@ -262,7 +262,7 @@ AddClause( */ for (i=0; i 0 && globList != NULL) { for (i=0; i 4) { @@ -1841,12 +1841,12 @@ int Tk_TextWidth( Tk_Font tkfont, /* Font in which text will be measured. */ const char *string, /* String whose width will be computed. */ - int numBytes) /* Number of bytes to consider from string, or - * < 0 for strlen(). */ + Tcl_Size numBytes) /* Number of bytes to consider from string, or + * TCL_INDEX_NONE for strlen(). */ { int width; - if (numBytes < 0) { + if (numBytes == TCL_INDEX_NONE) { numBytes = strlen(string); } Tk_MeasureChars(tkfont, string, numBytes, -1, 0, &width); @@ -1888,8 +1888,8 @@ Tk_UnderlineChars( * underlined or overstruck. */ int x, int y, /* Coordinates at which first character of * string is drawn. */ - int firstByte, /* Index of first byte of first character. */ - int lastByte) /* Index of first byte after the last + Tcl_Size firstByte, /* Index of first byte of first character. */ + Tcl_Size lastByte) /* Index of first byte after the last * character. */ { TkUnderlineCharsInContext(display, drawable, gc, tkfont, string, @@ -1907,11 +1907,11 @@ TkUnderlineCharsInContext( * dimensions, etc. */ const char *string, /* String containing characters to be * underlined or overstruck. */ - int numBytes, /* Number of bytes in string. */ + Tcl_Size numBytes, /* Number of bytes in string. */ int x, int y, /* Coordinates at which the first character of * the whole string would be drawn. */ - int firstByte, /* Index of first byte of first character. */ - int lastByte) /* Index of first byte after the last + Tcl_Size firstByte, /* Index of first byte of first character. */ + Tcl_Size lastByte) /* Index of first byte after the last * character. */ { TkFont *fontPtr = (TkFont *) tkfont; @@ -1961,8 +1961,8 @@ Tk_ComputeTextLayout( Tk_Font tkfont, /* Font that will be used to display text. */ const char *string, /* String whose dimensions are to be * computed. */ - int numChars, /* Number of characters to consider from - * string, or < 0 for strlen(). */ + Tcl_Size numChars, /* Number of characters to consider from + * string, or TCL_INDEX_NONE for strlen(). */ int wrapLength, /* Longest permissible line length, in pixels. * <= 0 means no automatic wrapping: just let * lines get as long as needed. */ @@ -2000,7 +2000,7 @@ Tk_ComputeTextLayout( height = fmPtr->ascent + fmPtr->descent; - if (numChars < 0) { + if (numChars == TCL_INDEX_NONE) { numChars = Tcl_NumUtfChars(string, -1); } if (wrapLength == 0) { @@ -3299,7 +3299,7 @@ Tk_TextLayoutToPostscript( int baseline = chunkPtr->y; Tcl_Obj *psObj = Tcl_NewObj(); int i, j; - TkSizeT len; + Tcl_Size len; const char *p, *glyphname; char uindex[5], c, *ps; int ch; @@ -3672,7 +3672,7 @@ ParseFontNameObj( { const char *dash; int result, n; - TkSizeT objc, i; + Tcl_Size objc, i; Tcl_Obj **objv; const char *string; diff --git a/generic/tkFont.h b/generic/tkFont.h index 892d8da..3ac34db 100644 --- a/generic/tkFont.h +++ b/generic/tkFont.h @@ -89,7 +89,7 @@ typedef struct TkFont { * Fields used and maintained exclusively by generic code. */ - TkSizeT resourceRefCount; /* Number of active uses of this font (each + Tcl_Size resourceRefCount; /* Number of active uses of this font (each * active use corresponds to a call to * Tk_AllocFontFromTable or Tk_GetFont). If * this count is 0, then this TkFont structure @@ -99,7 +99,7 @@ typedef struct TkFont { * The structure is freed when * resourceRefCount and objRefCount are both * 0. */ - TkSizeT objRefCount; /* The number of Tcl objects that reference + Tcl_Size objRefCount; /* The number of Tcl objects that reference * this structure. */ Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure, * used when deleting it. */ diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 0e44db0..012f474 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -489,7 +489,7 @@ TkListCreateFrame( * Gives the base name to use for the new * application. */ { - TkSizeT objc; + Tcl_Size objc; Tcl_Obj **objv; if (TCL_OK != Tcl_ListObjGetElements(interp, listObj, &objc, &objv)) { @@ -519,7 +519,7 @@ CreateFrame( const char *className, *screenName, *visualName, *colormapName; const char *arg, *useOption; int i, depth; - TkSizeT length; + Tcl_Size length; unsigned int mask; Colormap colormap; Visual *visual; @@ -776,7 +776,7 @@ FrameWidgetObjCmd( Frame *framePtr = (Frame *)clientData; int result = TCL_OK, index; int c, i; - TkSizeT length; + Tcl_Size length; Tcl_Obj *objPtr; if (objc < 2) { diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 24bfd83..24d1f67 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -180,7 +180,7 @@ Tk_GrabObjCmd( TkDisplay *dispPtr; const char *arg; int index; - TkSizeT len; + Tcl_Size len; static const char *const optionStrings[] = { "current", "release", "set", "status", NULL }; diff --git a/generic/tkGrid.c b/generic/tkGrid.c index d796110..59da151 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -983,11 +983,11 @@ GridRowColumnConfigureCommand( int slot; /* the column or row number */ int slotType; /* COLUMN or ROW */ int size; /* the configuration value */ - TkSizeT lObjc; /* Number of items in index list */ + Tcl_Size lObjc; /* Number of items in index list */ Tcl_Obj **lObjv; /* array of indices */ int ok; /* temporary TCL result code */ int i, first, last; - TkSizeT j; + Tcl_Size j; const char *string; static const char *const optionStrings[] = { "-minsize", "-pad", "-uniform", "-weight", NULL @@ -2987,7 +2987,7 @@ ConfigureContent( firstChar = 0; for (numWindows=0, i=0; i < objc; i++) { - TkSizeT length; + Tcl_Size length; char prevChar = firstChar; string = Tcl_GetStringFromObj(objv[i], &length); diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index b9c908b..90510bd 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -858,7 +858,7 @@ StringMatchGIF( TCL_UNUSED(Tcl_Obj *)) /* metadata return dict, may be NULL */ { unsigned char *data, header[10]; - TkSizeT got, length; + Tcl_Size got, length; MFile handle; data = Tcl_GetByteArrayFromObj(dataObj, &length); @@ -929,7 +929,7 @@ StringReadGIF( Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ { MFile handle, *hdlPtr = &handle; - TkSizeT length; + Tcl_Size length; const char *xferFormat; unsigned char *data = Tcl_GetByteArrayFromObj(dataObj, &length); diff --git a/generic/tkImgListFormat.c b/generic/tkImgListFormat.c index f5b416a..ae45b04 100644 --- a/generic/tkImgListFormat.c +++ b/generic/tkImgListFormat.c @@ -775,7 +775,7 @@ ParseColor( unsigned char *alphaPtr) { const char *specString; - TkSizeT length; + Tcl_Size length; /* * Find out which color format we have diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index ea9c54a..079bed1 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -126,7 +126,7 @@ typedef struct { Tcl_Channel channel; /* Channel for from-file reads. */ Tcl_Obj *objDataPtr; unsigned char *strDataBuf; /* Raw source data for from-string reads. */ - TkSizeT strDataLen; /* Length of source data. */ + Tcl_Size strDataLen; /* Length of source data. */ unsigned char *base64Data; /* base64 encoded string data. */ unsigned char base64Bits; /* Remaining bits from last base64 read. */ unsigned char base64State; /* Current state of base64 decoder. */ @@ -647,7 +647,7 @@ ReadData( } while (destSz) { - TkSizeT blockSz = PNG_MIN(destSz, PNG_BLOCK_SZ); + Tcl_Size blockSz = PNG_MIN(destSz, PNG_BLOCK_SZ); blockSz = Tcl_Read(pngPtr->channel, (char *)destPtr, blockSz); if (blockSz == TCL_IO_FAILURE) { @@ -2199,7 +2199,7 @@ ReadIDAT( */ while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream)) { - TkSizeT len1, len2; + Tcl_Size len1, len2; /* * Read another block of input into the zlib stream if data remains. @@ -2255,7 +2255,7 @@ ReadIDAT( } Tcl_GetByteArrayFromObj(pngPtr->thisLineObj, &len2); - if (len2 == (TkSizeT)pngPtr->phaseSize) { + if (len2 == (Tcl_Size)pngPtr->phaseSize) { if (pngPtr->phase > 7) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "extra data after final scan line of final phase", @@ -3044,7 +3044,7 @@ WriteData( */ if (pngPtr->objDataPtr) { - TkSizeT objSz; + Tcl_Size objSz; unsigned char *destPtr; Tcl_GetByteArrayFromObj(pngPtr->objDataPtr, &objSz); @@ -3339,7 +3339,7 @@ WriteIDAT( int rowNum, flush = TCL_ZLIB_NO_FLUSH, result; Tcl_Obj *outputObj; unsigned char *outputBytes; - TkSizeT outputSize; + Tcl_Size outputSize; /* * Filter and compress each row one at a time. diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index ed21927..db24fa3 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -764,7 +764,7 @@ ReadPPMStringHeader( #define BUFFER_SIZE 1000 char buffer[BUFFER_SIZE], c; int i, numFields, type = 0; - TkSizeT dataSize; + Tcl_Size dataSize; unsigned char *dataBuffer; dataBuffer = Tcl_GetByteArrayFromObj(dataPtr, &dataSize); diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 209de6f..789078e 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -467,7 +467,7 @@ ImgPhotoCmd( Tk_PhotoImageBlock block; Tk_PhotoImageFormat *imageFormat; Tk_PhotoImageFormatVersion3 *imageFormatVersion3; - TkSizeT length; + Tcl_Size length; int imageWidth, imageHeight, matched, oldformat = 0; Tcl_Channel chan; Tk_PhotoHandle srcHandle; @@ -1673,7 +1673,7 @@ ParseSubcommandOptions( * TK_PHOTO_COMPOSITE_* constants. */ NULL }; - TkSizeT length; + Tcl_Size length; int index, c, bit, currentBit; int values[4], numValues, maxValues, argIndex; const char *option, *expandedOption, *needed; @@ -1967,7 +1967,7 @@ ImgPhotoConfigureModel( Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL, *metadataInObj = NULL, *metadataOutObj = NULL; Tcl_Obj *tempdata, *tempformat; - TkSizeT length; + Tcl_Size length; int i, j, result, imageWidth, imageHeight, oldformat; double oldGamma; Tcl_Channel chan; @@ -2069,7 +2069,7 @@ ImgPhotoConfigureModel( * Force into ByteArray format, which most (all) image handlers will * use anyway. Empty length means ignore the -data option. */ - TkSizeT bytesize; + Tcl_Size bytesize; (void) Tcl_GetByteArrayFromObj(data, &bytesize); if (bytesize) { diff --git a/generic/tkImgSVGnano.c b/generic/tkImgSVGnano.c index 427b2c0..338b078 100644 --- a/generic/tkImgSVGnano.c +++ b/generic/tkImgSVGnano.c @@ -68,7 +68,7 @@ static int StringReadSVG(Tcl_Interp *interp, Tcl_Obj *dataObj, int destX, int destY, int width, int height, int srcX, int srcY); static NSVGimage * ParseSVGWithOptions(Tcl_Interp *interp, - const char *input, TkSizeT length, Tcl_Obj *format, + const char *input, Tcl_Size length, Tcl_Obj *format, RastOpts *ropts); static int RasterizeSVG(Tcl_Interp *interp, Tk_PhotoHandle imageHandle, NSVGimage *nsvgImage, @@ -166,7 +166,7 @@ FileMatchSVG( int *widthPtr, int *heightPtr, Tcl_Interp *interp) { - TkSizeT length; + Tcl_Size length; Tcl_Obj *dataObj = Tcl_NewObj(); const char *data; RastOpts ropts; @@ -238,7 +238,7 @@ FileReadSVG( int width, int height, int srcX, int srcY) { - TkSizeT length; + Tcl_Size length; const char *data; RastOpts ropts; NSVGimage *nsvgImage = GetCachedSVG(interp, chan, formatObj, &ropts); @@ -291,7 +291,7 @@ StringMatchSVG( int *widthPtr, int *heightPtr, Tcl_Interp *interp) { - TkSizeT length, testLength; + Tcl_Size length, testLength; const char *data; RastOpts ropts; NSVGimage *nsvgImage; @@ -347,7 +347,7 @@ StringReadSVG( int width, int height, int srcX, int srcY) { - TkSizeT length; + Tcl_Size length; const char *data; RastOpts ropts; NSVGimage *nsvgImage = GetCachedSVG(interp, dataObj, formatObj, &ropts); @@ -383,7 +383,7 @@ static NSVGimage * ParseSVGWithOptions( Tcl_Interp *interp, const char *input, - TkSizeT length, + Tcl_Size length, Tcl_Obj *formatObj, RastOpts *ropts) { @@ -757,7 +757,7 @@ CacheSVG( NSVGimage *nsvgImage, RastOpts *ropts) { - TkSizeT length; + Tcl_Size length; const char *data; NSVGcache *cachePtr = GetCachePtr(interp); @@ -797,7 +797,7 @@ GetCachedSVG( Tcl_Obj *formatObj, RastOpts *ropts) { - TkSizeT length; + Tcl_Size length; const char *data; NSVGcache *cachePtr = GetCachePtr(interp); NSVGimage *nsvgImage = NULL; diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 28cddd2..5af661d 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -538,7 +538,7 @@ declare 162 { int byteIndex, struct TkTextIndex *indexPtr) } declare 163 { - TkSizeT TkTextPrintIndex(const struct TkText *textPtr, + Tcl_Size TkTextPrintIndex(const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string) } declare 164 { @@ -567,51 +567,51 @@ declare 168 { # Next group of functions exposed due to [Bug 2768945]. declare 169 { int TkStateParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 170 { const char *TkStatePrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 171 { int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 172 { const char *TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 173 { int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 174 { const char *TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 175 { int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 176 { const char *TkPixelPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 177 { int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 178 { const char *TkOrientPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 179 { int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 180 { const char *TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } # Angled text API, exposed for Emiliano Gavilán's RBC work. diff --git a/generic/tkInt.h b/generic/tkInt.h index 20db643..cbb6fb8 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -75,14 +75,6 @@ # endif #endif -#ifndef TkSizeT -# if TCL_MAJOR_VERSION > 8 -# define TkSizeT size_t -# else -# define TkSizeT int -# 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) @@ -185,7 +177,7 @@ typedef struct TkCursor { Tk_Cursor cursor; /* System specific identifier for cursor. */ Display *display; /* Display containing cursor. Needed for * disposal and retrieval of cursors. */ - TkSizeT resourceRefCount; /* Number of active uses of this cursor (each + Tcl_Size resourceRefCount; /* Number of active uses of this cursor (each * active use corresponds to a call to * Tk_AllocPreserveFromObj or Tk_Preserve). If * this count is 0, then this structure is no @@ -194,7 +186,7 @@ typedef struct TkCursor { * there are objects referring to it. The * structure is freed when resourceRefCount * and objRefCount are both 0. */ - TkSizeT objRefCount; /* Number of Tcl objects that reference this + Tcl_Size objRefCount; /* Number of Tcl objects that reference this * structure.. */ Tcl_HashTable *otherTable; /* Second table (other than idTable) used to * index this entry. */ @@ -346,7 +338,7 @@ typedef struct TkDisplay { /* First in list of error handlers for this * display. NULL means no handlers exist at * present. */ - TkSizeT deleteCount; /* Counts # of handlers deleted since last + Tcl_Size deleteCount; /* Counts # of handlers deleted since last * time inactive handlers were garbage- * collected. When this number gets big, * handlers get cleaned up. */ @@ -568,7 +560,7 @@ typedef struct TkDisplay { #endif /* TK_USE_INPUT_METHODS */ Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */ - TkSizeT refCount; /* Reference count of how many Tk applications + Tcl_Size refCount; /* Reference count of how many Tk applications * are using this display. Used to clean up * the display when we no longer have any Tk * applications using it. */ @@ -678,7 +670,7 @@ typedef struct TkEventHandler { */ typedef struct TkMainInfo { - TkSizeT refCount; /* Number of windows whose "mainPtr" fields + Tcl_Size refCount; /* Number of windows whose "mainPtr" fields * point here. When this becomes zero, can * free up the structure (the reference count * is zero because windows can get deleted in @@ -846,13 +838,13 @@ typedef struct TkWindow { ClientData *tagPtr; /* Points to array of tags used for bindings * on this window. Each tag is a Tk_Uid. * Malloc'ed. NULL means no tags. */ - TkSizeT numTags; /* Number of tags at *tagPtr. */ + Tcl_Size numTags; /* Number of tags at *tagPtr. */ /* * Information used by tkOption.c to manage options for the window. */ - TkSizeT optionLevel; /* TCL_INDEX_NONE means no option information is currently + Tcl_Size optionLevel; /* TCL_INDEX_NONE means no option information is currently * cached for this window. Otherwise this * gives the level in the option stack at * which info is cached. */ @@ -959,7 +951,7 @@ typedef struct { * adding), or NULL if that has not been * computed yet. If non-NULL, this string was * allocated with ckalloc(). */ - TkSizeT charValueLen; /* Length of string in charValuePtr when that + Tcl_Size charValueLen; /* Length of string in charValuePtr when that * is non-NULL. */ KeySym keysym; /* Key symbol computed after input methods * have been invoked */ @@ -983,7 +975,7 @@ typedef struct { # define TCL_INDEX_NONE (-1) #endif #ifndef TCL_INDEX_END -# define TCL_INDEX_END ((TkSizeT)-2) +# define TCL_INDEX_END ((Tcl_Size)-2) #endif /* @@ -1346,15 +1338,6 @@ MODULE_SCOPE int TkGetDoublePixels(Tcl_Interp *interp, Tk_Window tkwin, MODULE_SCOPE int TkPostscriptImage(Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, XImage *ximage, int x, int y, int width, int height); -#if TCL_MAJOR_VERSION > 8 -MODULE_SCOPE int TkCanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, size_t offset); -MODULE_SCOPE const char *TkCanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, size_t offset, Tcl_FreeProc **freeProcPtr); -#else -#define TkCanvasTagsParseProc Tk_CanvasTagsParseProc -#define TkCanvasTagsPrintProc Tk_CanvasTagsPrintProc -#endif MODULE_SCOPE void TkMapTopFrame(Tk_Window tkwin); MODULE_SCOPE XEvent * TkpGetBindingXEvent(Tcl_Interp *interp); MODULE_SCOPE void TkCreateExitHandler(Tcl_ExitProc *proc, @@ -1380,16 +1363,16 @@ MODULE_SCOPE void TkpDrawCharsInContext(Display * display, int rangeLength, int x, int y); MODULE_SCOPE void TkpDrawAngledCharsInContext(Display * display, Drawable drawable, GC gc, Tk_Font tkfont, - const char *source, int numBytes, int rangeStart, - int rangeLength, double x, double y, double angle); + const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, + Tcl_Size rangeLength, double x, double y, double angle); MODULE_SCOPE int TkpMeasureCharsInContext(Tk_Font tkfont, - const char *source, int numBytes, int rangeStart, - int rangeLength, int maxLength, int flags, + const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, + Tcl_Size rangeLength, int maxLength, int flags, int *lengthPtr); MODULE_SCOPE void TkUnderlineCharsInContext(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, - const char *string, int numBytes, int x, int y, - int firstByte, int lastByte); + const char *string, Tcl_Size numBytes, int x, int y, + Tcl_Size firstByte, Tcl_Size lastByte); MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, int c, struct TkFontAttributes *faPtr); MODULE_SCOPE void TkpDrawFrameEx(Tk_Window tkwin, Drawable drawable, @@ -1421,13 +1404,13 @@ MODULE_SCOPE int TkListCreateFrame(ClientData clientData, MODULE_SCOPE void TkRotatePoint(double originX, double originY, double sine, double cosine, double *xPtr, double *yPtr); -MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, TkSizeT, int lastOK, TkSizeT*); +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) (((TkSizeT)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj(value)) +# define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj(value)) # define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL #endif diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index de7e9fc..960d233 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -462,7 +462,7 @@ EXTERN struct TkTextIndex * TkTextMakeByteIndex(TkTextBTree tree, const struct TkText *textPtr, int lineIndex, int byteIndex, struct TkTextIndex *indexPtr); /* 163 */ -EXTERN TkSizeT TkTextPrintIndex(const struct TkText *textPtr, +EXTERN Tcl_Size TkTextPrintIndex(const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 164 */ @@ -490,56 +490,56 @@ EXTERN void TkTextInsertDisplayProc(struct TkText *textPtr, EXTERN int TkStateParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 170 */ EXTERN const char * TkStatePrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 171 */ EXTERN int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 172 */ EXTERN const char * TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 173 */ EXTERN int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 174 */ EXTERN const char * TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 175 */ EXTERN int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 176 */ EXTERN const char * TkPixelPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 177 */ EXTERN int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 178 */ EXTERN const char * TkOrientPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 179 */ EXTERN int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 180 */ EXTERN const char * TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 181 */ EXTERN void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc, @@ -766,24 +766,24 @@ typedef struct TkIntStubs { int (*tkTextIndexBackBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 160 */ int (*tkTextIndexForwBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 161 */ struct TkTextIndex * (*tkTextMakeByteIndex) (TkTextBTree tree, const struct TkText *textPtr, int lineIndex, int byteIndex, struct TkTextIndex *indexPtr); /* 162 */ - TkSizeT (*tkTextPrintIndex) (const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 163 */ + Tcl_Size (*tkTextPrintIndex) (const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 163 */ struct TkTextSegment * (*tkTextSetMark) (struct TkText *textPtr, const char *name, struct TkTextIndex *indexPtr); /* 164 */ int (*tkTextXviewCmd) (struct TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 165 */ void (*tkTextChanged) (struct TkSharedText *sharedTextPtr, struct TkText *textPtr, const struct TkTextIndex *index1Ptr, const struct TkTextIndex *index2Ptr); /* 166 */ int (*tkBTreeNumLines) (TkTextBTree tree, const struct TkText *textPtr); /* 167 */ void (*tkTextInsertDisplayProc) (struct TkText *textPtr, struct TkTextDispChunk *chunkPtr, int x, int y, int height, int baseline, Display *display, Drawable dst, int screenY); /* 168 */ - int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 169 */ - const char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 170 */ - int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 171 */ - const char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 172 */ - int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 173 */ - const char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 174 */ - int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 175 */ - const char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 176 */ - int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 177 */ - const char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 178 */ - int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 179 */ - const char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 180 */ + int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 169 */ + const char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 170 */ + int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 171 */ + const char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 172 */ + int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 173 */ + const char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 174 */ + int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 175 */ + const char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 176 */ + int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 177 */ + const char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 178 */ + int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 179 */ + const char * (*tkSmoothPrintProc) (ClientData 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 (*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 */ diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 10ab4ee..612e22e 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -405,8 +405,8 @@ static void ListboxComputeGeometry(Listbox *listPtr, int fontChanged, int maxIsStale, int updateGrid); static void ListboxEventProc(ClientData clientData, XEvent *eventPtr); -static TkSizeT ListboxFetchSelection(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); +static Tcl_Size ListboxFetchSelection(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); static void ListboxLostSelection(ClientData clientData); static void GenerateListboxSelectEvent(Listbox *listPtr); static void EventuallyRedrawRange(Listbox *listPtr, @@ -1100,7 +1100,7 @@ ListboxBboxSubCmd( Tcl_Obj *el, *results[4]; const char *stringRep; int pixelWidth, x, y, result; - TkSizeT stringLen; + Tcl_Size stringLen; Tk_FontMetrics fm; /* @@ -1841,7 +1841,7 @@ DisplayListbox( Tk_Window tkwin = listPtr->tkwin; GC gc; int i, limit, x, y, prevSelected, freeGC; - TkSizeT stringLen; + Tcl_Size stringLen; Tk_FontMetrics fm; Tcl_Obj *curElement; Tcl_HashEntry *entry; @@ -2238,7 +2238,7 @@ ListboxComputeGeometry( * window. */ { int width, height, pixelWidth, pixelHeight, i, result; - TkSizeT textLength; + Tcl_Size textLength; Tk_FontMetrics fm; Tcl_Obj *element; const char *text; @@ -2326,7 +2326,7 @@ ListboxInsertSubCmd( Tcl_Obj *const objv[]) /* New elements (one per entry). */ { int i, oldMaxWidth, pixelWidth, result; - TkSizeT length; + Tcl_Size length; Tcl_Obj *newListObj; const char *stringRep; @@ -2441,7 +2441,7 @@ ListboxDeleteSubCmd( int last) /* Index of last element to delete. */ { int count, i, widthChanged, result, pixelWidth; - TkSizeT length; + Tcl_Size length; Tcl_Obj *newListObj, *element; const char *stringRep; Tcl_HashEntry *entry; @@ -2733,12 +2733,12 @@ GetListboxIndex( int *indexPtr) /* Where to store converted index. */ { int result, index; - TkSizeT idx; + Tcl_Size idx; const char *stringRep; result = TkGetIntForIndex(indexObj, listPtr->nElements - 1, lastOK, &idx); if (result == TCL_OK) { - if ((idx != TCL_INDEX_NONE) && (idx > (TkSizeT)listPtr->nElements)) { + if ((idx != TCL_INDEX_NONE) && (idx > (Tcl_Size)listPtr->nElements)) { idx = listPtr->nElements; } *indexPtr = (int)idx; @@ -3108,20 +3108,20 @@ ListboxSelect( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ListboxFetchSelection( ClientData clientData, /* Information about listbox widget. */ - TkSizeT offset, /* Offset within selection of first byte to be + Tcl_Size offset, /* Offset within selection of first byte to be * returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { Listbox *listPtr = (Listbox *)clientData; Tcl_DString selection; int count, needNewline, i; - TkSizeT length, stringLen; + Tcl_Size length, stringLen; Tcl_Obj *curElement; const char *stringRep; Tcl_HashEntry *entry; diff --git a/generic/tkMain.c b/generic/tkMain.c index c58fc64..e98911f 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -160,7 +160,7 @@ static void StdinProc(ClientData clientData, int mask); void Tk_MainEx( - int argc, /* Number of arguments. */ + Tcl_Size argc, /* Number of arguments. */ TCHAR **argv, /* Array of argument strings. */ Tcl_AppInitProc *appInitProc, /* Application-specific initialization diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 4730575..27a984b 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -335,9 +335,9 @@ static void DestroyMenuHashTable(ClientData clientData, Tcl_Interp *interp); static void DestroyMenuInstance(TkMenu *menuPtr); static void DestroyMenuEntry(void *memPtr); -static TkSizeT GetIndexFromCoords(Tcl_Interp *interp, +static Tcl_Size GetIndexFromCoords(Tcl_Interp *interp, TkMenu *menuPtr, const char *string, - TkSizeT *indexPtr); + Tcl_Size *indexPtr); static int MenuDoYPosition(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *objPtr); static int MenuDoXPosition(Tcl_Interp *interp, @@ -346,7 +346,7 @@ static int MenuAddOrInsert(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc, Tcl_Obj *const objv[]); static void MenuCmdDeletedProc(ClientData clientData); -static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, TkSizeT index, int type); +static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, Tcl_Size index, int type); static char * MenuVarProc(ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); @@ -359,7 +359,7 @@ static void RecursivelyDeleteMenu(TkMenu *menuPtr); static void UnhookCascadeEntry(TkMenuEntry *mePtr); static void MenuCleanup(ClientData unused); static int GetMenuIndex(Tcl_Interp *interp, TkMenu *menuPtr, - Tcl_Obj *objPtr, int lastOK, TkSizeT *indexPtr); + Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr); /* * The structure below is a list of procs that respond to certain window @@ -630,7 +630,7 @@ MenuWidgetObjCmd( switch ((enum options) option) { case MENU_ACTIVATE: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -714,7 +714,7 @@ MenuWidgetObjCmd( break; } case MENU_DELETE: { - TkSizeT first, last; + Tcl_Size first, last; Tcl_WideInt w; if ((objc != 3) && (objc != 4)) { @@ -757,7 +757,7 @@ MenuWidgetObjCmd( break; } case MENU_ENTRYCGET: { - TkSizeT index; + Tcl_Size index; Tcl_Obj *resultPtr; if (objc != 4) { @@ -782,7 +782,7 @@ MenuWidgetObjCmd( break; } case MENU_ENTRYCONFIGURE: { - TkSizeT index; + Tcl_Size index; Tcl_Obj *resultPtr; if (objc < 3) { @@ -823,7 +823,7 @@ MenuWidgetObjCmd( break; } case MENU_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -851,7 +851,7 @@ MenuWidgetObjCmd( } break; case MENU_INVOKE: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -868,7 +868,7 @@ MenuWidgetObjCmd( } case MENU_POST: { int x, y; - TkSizeT index = TCL_INDEX_NONE; + Tcl_Size index = TCL_INDEX_NONE; if (objc != 4 && objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "x y ?index?"); @@ -903,7 +903,7 @@ MenuWidgetObjCmd( break; } case MENU_POSTCASCADE: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -921,7 +921,7 @@ MenuWidgetObjCmd( break; } case MENU_TYPE: { - TkSizeT index; + Tcl_Size index; const char *typeStr; if (objc != 3) { @@ -996,7 +996,7 @@ int TkInvokeMenu( Tcl_Interp *interp, /* The interp that the menu lives in. */ TkMenu *menuPtr, /* The menu we are invoking. */ - TkSizeT index) /* The zero based index of the item we are + Tcl_Size index) /* The zero based index of the item we are * invoking. */ { int result = TCL_OK; @@ -1484,7 +1484,7 @@ MenuWorldChanged( ClientData instanceData) /* Information about widget. */ { TkMenu *menuPtr = (TkMenu *)instanceData; - TkSizeT i; + Tcl_Size i; TkMenuConfigureDrawOptions(menuPtr); for (i = 0; i < menuPtr->numEntries; i++) { @@ -2111,7 +2111,7 @@ GetMenuIndex( * manual entry for valid .*/ int lastOK, /* Non-zero means its OK to return index just * *after* last entry. */ - TkSizeT *indexPtr) /* Where to store converted index. */ + Tcl_Size *indexPtr) /* Where to store converted index. */ { int i; const char *string; @@ -2239,13 +2239,13 @@ MenuCmdDeletedProc( static TkMenuEntry * MenuNewEntry( TkMenu *menuPtr, /* Menu that will hold the new entry. */ - TkSizeT index, /* Where in the menu the new entry is to + Tcl_Size index, /* Where in the menu the new entry is to * go. */ int type) /* The type of the new entry. */ { TkMenuEntry *mePtr; TkMenuEntry **newEntries; - TkSizeT i; + Tcl_Size i; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -2343,7 +2343,7 @@ MenuAddOrInsert( * entry, others are config options. */ { int type; - TkSizeT index; + Tcl_Size index; TkMenuEntry *mePtr; TkMenu *menuListPtr; @@ -2386,7 +2386,7 @@ MenuAddOrInsert( } if (ConfigureMenuEntry(mePtr, objc - 1, objv + 1) != TCL_OK) { TkMenu *errorMenuPtr; - TkSizeT i; + Tcl_Size i; for (errorMenuPtr = menuPtr->mainMenuPtr; errorMenuPtr != NULL; @@ -2590,7 +2590,7 @@ MenuVarProc( int TkActivateMenuEntry( TkMenu *menuPtr, /* Menu in which to activate. */ - TkSizeT index) /* Index of entry to activate, or + Tcl_Size index) /* Index of entry to activate, or * TCL_INDEX_NONE to deactivate all entries. */ { TkMenuEntry *mePtr; @@ -2691,7 +2691,7 @@ CloneMenu( { int returnResult; int menuType; - TkSizeT i; + Tcl_Size i; TkMenuReferences *menuRefPtr; Tcl_Obj *menuDupCommandArray[4]; @@ -2731,7 +2731,7 @@ CloneMenu( && (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) { TkMenu *newMenuPtr = menuRefPtr->menuPtr; Tcl_Obj *newObjv[3]; - TkSizeT numElements; + Tcl_Size numElements; /* * Now put this newly created menu into the parent menu's instance @@ -2866,7 +2866,7 @@ MenuDoXPosition( TkMenu *menuPtr, Tcl_Obj *objPtr) { - TkSizeT index; + Tcl_Size index; TkRecomputeMenu(menuPtr); if (GetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) { @@ -2903,7 +2903,7 @@ MenuDoYPosition( TkMenu *menuPtr, Tcl_Obj *objPtr) { - TkSizeT index; + Tcl_Size index; TkRecomputeMenu(menuPtr); if (GetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) { @@ -2941,12 +2941,12 @@ MenuDoYPosition( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size GetIndexFromCoords( Tcl_Interp *interp, /* Interpreter of menu. */ TkMenu *menuPtr, /* The menu we are searching. */ const char *string, /* The @string we are parsing. */ - TkSizeT *indexPtr) /* The index of the item that matches. */ + Tcl_Size *indexPtr) /* The index of the item that matches. */ { int x, y, i; const char *p; @@ -3024,7 +3024,7 @@ static void RecursivelyDeleteMenu( TkMenu *menuPtr) /* The menubar instance we are deleting. */ { - TkSizeT i; + Tcl_Size i; TkMenuEntry *mePtr; /* diff --git a/generic/tkMenu.h b/generic/tkMenu.h index d53dc5f..f38bd3e 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -64,7 +64,7 @@ typedef struct TkMenuEntry { Tk_OptionTable optionTable; /* Option table for this menu entry. */ Tcl_Obj *labelPtr; /* Main text label displayed in entry (NULL if * no label). */ - TkSizeT labelLength; /* Number of non-NULL characters in label. */ + Tcl_Size labelLength; /* Number of non-NULL characters in label. */ int state; /* State of button for display purposes: * normal, active, or disabled. */ int underline; /* Value of -underline option: specifies index @@ -85,7 +85,7 @@ typedef struct TkMenuEntry { Tcl_Obj *accelPtr; /* Accelerator string displayed at right of * menu entry. NULL means no such accelerator. * Malloc'ed. */ - TkSizeT accelLength; /* Number of non-NULL characters in + Tcl_Size accelLength; /* Number of non-NULL characters in * accelerator. */ int indicatorOn; /* True means draw indicator, false means * don't draw it. This field is ignored unless @@ -263,8 +263,8 @@ typedef struct TkMenu { Tcl_Command widgetCmd; /* Token for menu's widget command. */ TkMenuEntry **entries; /* Array of pointers to all the entries in the * menu. NULL means no entries. */ - TkSizeT numEntries; /* Number of elements in entries. */ - TkSizeT active; /* Index of active entry. TCL_INDEX_NONE means + Tcl_Size numEntries; /* Number of elements in entries. */ + Tcl_Size active; /* Index of active entry. TCL_INDEX_NONE means * nothing active. */ int menuType; /* MAIN_MENU, TEAROFF_MENU, or MENUBAR. See * below for definitions. */ @@ -478,7 +478,7 @@ typedef struct TkMenuReferences { * the outside world: */ -MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, TkSizeT index); +MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, Tcl_Size index); MODULE_SCOPE void TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr); MODULE_SCOPE TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp, const char *name); @@ -494,10 +494,10 @@ MODULE_SCOPE Tcl_HashTable *TkGetMenuHashTable(Tcl_Interp *interp); MODULE_SCOPE void TkMenuInitializeDrawingFields(TkMenu *menuPtr); MODULE_SCOPE void TkMenuInitializeEntryDrawingFields(TkMenuEntry *mePtr); MODULE_SCOPE int TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr, - TkSizeT index); + Tcl_Size index); MODULE_SCOPE void TkMenuConfigureDrawOptions(TkMenu *menuPtr); MODULE_SCOPE int TkMenuConfigureEntryDrawOptions( - TkMenuEntry *mePtr, TkSizeT index); + TkMenuEntry *mePtr, Tcl_Size index); MODULE_SCOPE void TkMenuFreeDrawOptions(TkMenu *menuPtr); MODULE_SCOPE void TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr); MODULE_SCOPE void TkMenuEventProc(ClientData clientData, diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index be82b71..da8ae39 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -298,7 +298,7 @@ TkMenuConfigureDrawOptions( int TkMenuConfigureEntryDrawOptions( TkMenuEntry *mePtr, - TkSizeT index) + Tcl_Size index) { XGCValues gcValues; GC newGC, newActiveGC, newDisabledGC, newIndicatorGC; @@ -487,7 +487,7 @@ TkEventuallyRedrawMenu( TkMenuEntry *mePtr)/* Entry to redraw. NULL means redraw all the * entries in the menu. */ { - TkSizeT i; + Tcl_Size i; if (menuPtr->tkwin == NULL) { return; @@ -624,7 +624,7 @@ DisplayMenu( TkMenu *menuPtr = (TkMenu *)clientData; TkMenuEntry *mePtr; Tk_Window tkwin = menuPtr->tkwin; - TkSizeT index; + Tcl_Size index; int strictMotif; Tk_Font tkfont; Tk_FontMetrics menuMetrics; diff --git a/generic/tkObj.c b/generic/tkObj.c index 1577be9..76719fc 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -223,9 +223,9 @@ GetTypeCache(void) int TkGetIntForIndex( Tcl_Obj *indexObj, - TkSizeT end, + Tcl_Size end, int lastOK, - TkSizeT *indexPtr) + Tcl_Size *indexPtr) { if (indexObj == NULL) { *indexPtr = TCL_INDEX_NONE; @@ -748,7 +748,7 @@ UpdateStringOfMM( { MMRep *mmPtr; char buffer[TCL_DOUBLE_SPACE]; - TkSizeT len; + Tcl_Size len; mmPtr = (MMRep *)objPtr->internalRep.twoPtrValue.ptr1; /* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */ @@ -1116,7 +1116,7 @@ TkParsePadAmount( int *allPtr) /* Write the total padding here */ { int firstInt, secondInt; /* The two components of the padding */ - TkSizeT objc; /* The length of the list (should be 1 or 2) */ + Tcl_Size objc; /* The length of the list (should be 1 or 2) */ Tcl_Obj **objv; /* The objects in the list */ /* diff --git a/generic/tkOption.c b/generic/tkOption.c index 4ba7830..ca940db 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -521,7 +521,7 @@ Tk_GetOption( if (masqName != NULL) { char *masqClass; Tk_Uid nodeId, winClassId, winNameId; - TkSizeT classNameLength; + Tcl_Size classNameLength; Element *nodePtr, *leafPtr; static const int searchOrder[] = { EXACT_NODE_NAME, WILDCARD_NODE_NAME, EXACT_NODE_CLASS, @@ -1085,7 +1085,7 @@ ReadOptionFile( const char *realName; Tcl_Obj *buffer; int result; - TkSizeT bufferSize; + Tcl_Size bufferSize; Tcl_Channel chan; Tcl_DString newName; diff --git a/generic/tkPack.c b/generic/tkPack.c index 8d91f2b..b7ba555 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -1112,7 +1112,7 @@ PackAfter( Tk_Window tkwin, ancestor, parent; Tcl_Obj **options; int c; - TkSizeT index, optionCount; + Tcl_Size index, optionCount; /* * Iterate over all of the window specifiers, each consisting of two @@ -1179,7 +1179,7 @@ PackAfter( packPtr->flags |= OLD_STYLE; for (index = 0 ; index < optionCount; index++) { Tcl_Obj *curOptPtr = options[index]; - TkSizeT length; + Tcl_Size length; const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length); c = curOpt[0]; diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 7147ad2..1622872 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -225,10 +225,10 @@ static void DestroyOptionTables(void *clientData, Tcl_Interp *interp); static int SetSticky(void *clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, - TkSizeT internalOffset, char *oldInternalPtr, + Tcl_Size internalOffset, char *oldInternalPtr, int flags); static Tcl_Obj * GetSticky(void *clientData, Tk_Window tkwin, - char *recordPtr, TkSizeT internalOffset); + char *recordPtr, Tcl_Size internalOffset); static void RestoreSticky(void *clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr); static void AdjustForSticky(int sticky, int cavityWidth, @@ -236,7 +236,7 @@ static void AdjustForSticky(int sticky, int cavityWidth, int *paneWidthPtr, int *paneHeightPtr); static void MoveSash(PanedWindow *pwPtr, int sash, int diff); static int ObjectIsEmpty(Tcl_Obj *objPtr); -static void * ComputeSlotAddress(void *recordPtr, TkSizeT offset); +static void * ComputeSlotAddress(void *recordPtr, Tcl_Size offset); static int PanedWindowIdentifyCoords(PanedWindow *pwPtr, Tcl_Interp *interp, int x, int y); @@ -2400,7 +2400,7 @@ GetSticky( TCL_UNUSED(void *), TCL_UNUSED(Tk_Window), char *recordPtr, /* Pointer to widget record. */ - TkSizeT internalOffset) /* Offset within *recordPtr containing the + Tcl_Size internalOffset) /* Offset within *recordPtr containing the * sticky value. */ { int sticky = *(int *)(recordPtr + internalOffset); @@ -2452,7 +2452,7 @@ SetSticky( * We use a pointer to the pointer because we * may need to return a value (NULL). */ char *recordPtr, /* Pointer to storage for the widget record. */ - TkSizeT internalOffset, /* Offset within *recordPtr at which the + Tcl_Size internalOffset, /* Offset within *recordPtr at which the * internal value is to be stored. */ char *oldInternalPtr, /* Pointer to storage for the old value. */ int flags) /* Flags for the option, set Tk_SetOptions. */ @@ -3026,7 +3026,7 @@ ObjectIsEmpty( static void * ComputeSlotAddress( void *recordPtr, /* Pointer to the start of a record. */ - TkSizeT offset) /* Offset of a slot within that record; may be TCL_INDEX_NONE. */ + Tcl_Size offset) /* Offset of a slot within that record; may be TCL_INDEX_NONE. */ { if (offset != TCL_INDEX_NONE) { return (char *)recordPtr + offset; diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index bf83453..54bd886 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -47,7 +47,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL diff --git a/generic/tkScale.h b/generic/tkScale.h index 6320e3e..d6a84eb 100644 --- a/generic/tkScale.h +++ b/generic/tkScale.h @@ -87,7 +87,7 @@ typedef struct TkScale { int repeatInterval; /* Interval between autorepeats (in ms). */ char *label; /* Label to display above or to right of * scale; NULL means don't display a label. */ - TkSizeT labelLength; /* Number of non-NULL chars. in label. */ + Tcl_Size labelLength; /* Number of non-NULL chars. in label. */ enum state state; /* Values are active, normal, or disabled. * Value of scale cannot be changed when * disabled. */ diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 0b09b84..48e6de1 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -227,7 +227,7 @@ ScrollbarWidgetObjCmd( { TkScrollbar *scrollPtr = (TkScrollbar *)clientData; int result = TCL_OK, cmdIndex, length; - TkSizeT len; + Tcl_Size len; static const char *const commandNames[] = { "activate", "cget", "configure", "delta", "fraction", "get", "identify", "set", NULL diff --git a/generic/tkSelect.c b/generic/tkSelect.c index c37a320..5dd897c 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -59,8 +59,8 @@ static Tcl_ThreadDataKey dataKey; * Forward declarations for functions defined in this file: */ -static TkSizeT HandleTclCommand(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); +static Tcl_Size HandleTclCommand(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); static void LostSelection(ClientData clientData); static int SelGetProc(ClientData clientData, Tcl_Interp *interp, const char *portion); @@ -831,7 +831,7 @@ Tk_SelectionObjCmd( const char *targetName = NULL; const char *formatName = NULL; CommandInfo *cmdInfoPtr; - TkSizeT cmdLength; + Tcl_Size cmdLength; static const char *const handleOptionStrings[] = { "-format", "-selection", "-type", NULL }; @@ -1317,13 +1317,13 @@ SelGetProc( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size HandleTclCommand( ClientData clientData, /* Information about command to execute. */ - TkSizeT offset, /* Return selection bytes starting at this + Tcl_Size offset, /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TkSizeT maxBytes) /* Maximum # of bytes to store at buffer. */ + Tcl_Size maxBytes) /* Maximum # of bytes to store at buffer. */ { CommandInfo *cmdInfoPtr = (CommandInfo *)clientData; int length; diff --git a/generic/tkSelect.h b/generic/tkSelect.h index ceff8cb..763148a 100644 --- a/generic/tkSelect.h +++ b/generic/tkSelect.h @@ -57,7 +57,7 @@ typedef struct TkSelHandler { Tk_SelectionProc *proc; /* Procedure to generate selection in this * format. */ void *clientData; /* Argument to pass to proc. */ - TkSizeT size; /* Size of units returned by proc (8 for + Tcl_Size size; /* Size of units returned by proc (8 for * STRING, 32 for almost anything else). */ struct TkSelHandler *nextPtr; /* Next selection handler associated with same @@ -107,7 +107,7 @@ typedef struct TkSelRetrievalInfo { typedef struct TkClipboardBuffer { char *buffer; /* Null terminated data buffer. */ - TkSizeT length; /* Length of string in buffer. */ + Tcl_Size length; /* Length of string in buffer. */ struct TkClipboardBuffer *nextPtr; /* Next in list of buffers. NULL means end of * list . */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 8a18796..45df161 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -113,12 +113,6 @@ static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) #define TkGenWMConfigureEvent_ TkGenWMConfigureEvent #define TkGenerateActivateEvents_ TkGenerateActivateEvents #define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable -#define Tk_CanvasTagsParseProc \ - (int (*) (void *, Tcl_Interp *,Tk_Window, const char *, char *, \ - int offset))(void *)TkCanvasTagsParseProc -#define Tk_CanvasTagsPrintProc \ - (const char *(*) (void *,Tk_Window, char *, int, \ - Tcl_FreeProc **))(void *)TkCanvasTagsPrintProc #if !defined(MAC_OSX_TK) && defined(MAC_OSX_TCL) # undef TkpWillDrawWidget diff --git a/generic/tkTest.c b/generic/tkTest.c index 3f32105..a165dec 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -2049,7 +2049,7 @@ CustomOptionSet( TCL_UNUSED(Tk_Window), Tcl_Obj **value, char *recordPtr, - TkSizeT internalOffset, + Tcl_Size internalOffset, char *saveInternalPtr, int flags) { @@ -2108,7 +2108,7 @@ CustomOptionGet( TCL_UNUSED(void *), TCL_UNUSED(Tk_Window), char *recordPtr, - TkSizeT internalOffset) + Tcl_Size internalOffset) { return (Tcl_NewStringObj(*(char **)(recordPtr + internalOffset), -1)); } diff --git a/generic/tkText.c b/generic/tkText.c index 267fc0c..b2e7969 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -86,11 +86,11 @@ static const char *const insertUnfocussedStrings[] = { static int SetLineStartEnd(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, - TkSizeT internalOffset, char *oldInternalPtr, + Tcl_Size internalOffset, char *oldInternalPtr, int flags); static Tcl_Obj * GetLineStartEnd(ClientData clientData, Tk_Window tkwin, char *recordPtr, - TkSizeT internalOffset); + Tcl_Size internalOffset); static void RestoreLineStartEnd(ClientData clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr); @@ -269,10 +269,10 @@ typedef ClientData SearchAddLineProc(int lineNum, typedef int SearchMatchProc(int lineNum, struct SearchSpec *searchSpecPtr, ClientData clientData, Tcl_Obj *theLine, - TkSizeT matchOffset, TkSizeT matchLength); + Tcl_Size matchOffset, Tcl_Size matchLength); typedef int SearchLineIndexProc(Tcl_Interp *interp, Tcl_Obj *objPtr, struct SearchSpec *searchSpecPtr, - int *linePosPtr, TkSizeT *offsetPosPtr); + int *linePosPtr, Tcl_Size *offsetPosPtr); typedef struct SearchSpec { int exact; /* Whether search is exact or regexp. */ @@ -288,10 +288,10 @@ typedef struct SearchSpec { int all; /* Whether all or the first match should be * reported. */ int startLine; /* First line to examine. */ - TkSizeT startOffset; /* Index in first line to start at. */ + Tcl_Size startOffset; /* Index in first line to start at. */ int stopLine; /* Last line to examine, or -1 when we search * all available text. */ - TkSizeT stopOffset; /* Index to stop at, provided stopLine is not + Tcl_Size stopOffset; /* Index to stop at, provided stopLine is not * -1. */ int numLines; /* Total lines which are available. */ int backwards; /* Searching forwards or backwards. */ @@ -355,8 +355,8 @@ static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); static void TextEventProc(ClientData clientData, XEvent *eventPtr); -static TkSizeT TextFetchSelection(ClientData clientData, TkSizeT offset, - char *buffer, TkSizeT maxBytes); +static Tcl_Size TextFetchSelection(ClientData clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); static int TextIndexSortProc(const void *first, const void *second); static int TextInsertCmd(TkSharedText *sharedTextPtr, @@ -400,8 +400,8 @@ static void TextPushUndoAction(TkText *textPtr, Tcl_Obj *undoString, int insert, const TkTextIndex *index1Ptr, const TkTextIndex *index2Ptr); -static TkSizeT TextSearchIndexInLine(const SearchSpec *searchSpecPtr, - TkTextLine *linePtr, TkSizeT byteIndex); +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[]); static TkUndoProc TextUndoRedoCallback; @@ -854,7 +854,7 @@ TextWidgetObjCmd( for (i = 2; i < objc-2; i++) { int value; - TkSizeT length; + Tcl_Size length; const char *option = Tcl_GetStringFromObj(objv[i], &length); char c; @@ -1249,7 +1249,7 @@ TextWidgetObjCmd( Tcl_Obj *objPtr = NULL; int i, found = 0, visible = 0; const char *name; - TkSizeT length; + Tcl_Size length; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, @@ -2625,7 +2625,7 @@ InsertChars( int viewUpdate) /* Update the view if set. */ { int lineIndex; - TkSizeT length; + Tcl_Size length; TkText *tPtr; int *lineAndByteIndex; int resetViewCount; @@ -2957,7 +2957,7 @@ TextUndoRedoCallback( { TkSharedText *sharedPtr = (TkSharedText *)clientData; int res; - TkSizeT objc; + Tcl_Size objc; Tcl_Obj **objv; TkText *textPtr; @@ -3122,7 +3122,7 @@ DeleteIndexRange( int pixels[2*PIXEL_CLIENTS]; Tcl_HashSearch search; Tcl_HashEntry *hPtr; - TkSizeT i; + Tcl_Size i; if (sharedTextPtr == NULL) { sharedTextPtr = textPtr->sharedTextPtr; @@ -3168,7 +3168,7 @@ DeleteIndexRange( line2 = TkBTreeLinesTo(textPtr, index2.linePtr); if (line2 == TkBTreeNumLines(sharedTextPtr->tree, textPtr)) { TkTextTag **arrayPtr; - TkSizeT arraySize; + Tcl_Size arraySize; TkTextIndex oldIndex2; oldIndex2 = index2; @@ -3400,20 +3400,20 @@ DeleteIndexRange( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size TextFetchSelection( ClientData clientData, /* Information about text widget. */ - TkSizeT offset, /* Offset within selection of first character + Tcl_Size offset, /* Offset within selection of first character * to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { TkText *textPtr = (TkText *)clientData; TkTextIndex eof; int count, chunkSize; - TkSizeT offsetInSeg; + Tcl_Size offsetInSeg; TkTextSearch search; TkTextSegment *segPtr; @@ -3730,12 +3730,12 @@ TextInsertCmd( if (objc > (j+1)) { Tcl_Obj **tagNamePtrs; TkTextTag **oldTagArrayPtr; - TkSizeT numTags; + Tcl_Size numTags; TkTextIndexForwBytes(textPtr, &index1, length, &index2); oldTagArrayPtr = TkBTreeGetTags(&index1, NULL, &numTags); if (oldTagArrayPtr != NULL) { - TkSizeT i; + Tcl_Size i; for (i = 0; i < numTags; i++) { TkBTreeTag(&index1, &index2, oldTagArrayPtr[i], 0); @@ -3746,7 +3746,7 @@ TextInsertCmd( &tagNamePtrs) != TCL_OK) { return TCL_ERROR; } else { - TkSizeT i; + Tcl_Size i; for (i = 0; i < numTags; i++) { const char *strTag = Tcl_GetString(tagNamePtrs[i]); @@ -4002,7 +4002,7 @@ TextSearchGetLineIndex( Tcl_Obj *objPtr, /* Contains a textual index like "1.2" */ SearchSpec *searchSpecPtr, /* Contains other search parameters. */ int *linePosPtr, /* For returning the line number. */ - TkSizeT *offsetPosPtr) /* For returning the text offset in the + Tcl_Size *offsetPosPtr) /* For returning the text offset in the * line. */ { const TkTextIndex *indexPtr; @@ -4062,16 +4062,16 @@ TextSearchGetLineIndex( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size TextSearchIndexInLine( const SearchSpec *searchSpecPtr, /* Search parameters. */ TkTextLine *linePtr, /* The line we're looking at. */ - TkSizeT byteIndex) /* Index into the line. */ + Tcl_Size byteIndex) /* Index into the line. */ { TkTextSegment *segPtr; TkTextIndex curIndex; - TkSizeT index; + Tcl_Size index; int leftToScan; TkText *textPtr = (TkText *)searchSpecPtr->clientData; @@ -4255,12 +4255,12 @@ TextSearchFoundMatch( Tcl_Obj *theLine, /* Text from current line, only accessed for * exact searches, and is allowed to be NULL * for regexp searches. */ - TkSizeT matchOffset, /* Offset of found item in utf-8 bytes for + Tcl_Size matchOffset, /* Offset of found item in utf-8 bytes for * exact search, Unicode chars for regexp. */ - TkSizeT matchLength) /* Length also in bytes/chars as per search + Tcl_Size matchLength) /* Length also in bytes/chars as per search * type. */ { - TkSizeT numChars; + Tcl_Size numChars; int leftToScan; TkTextIndex curIndex, foundIndex; TkTextSegment *segPtr; @@ -4492,7 +4492,7 @@ TkTextGetTabs( Tcl_Obj *stringPtr) /* Description of the tab stops. See the text * manual entry for details. */ { - TkSizeT objc, i, count; + Tcl_Size objc, i, count; Tcl_Obj **objv; TkTextTabArray *tabArrayPtr; TkTextTab *tabPtr; @@ -4740,7 +4740,7 @@ TextDumpCmd( if (objc == arg) { TkTextIndexForwChars(NULL, &index1, 1, &index2, COUNT_INDICES); } else { - TkSizeT length; + Tcl_Size length; const char *str; if (TkTextGetObjIndex(interp, textPtr, objv[arg], &index2) != TCL_OK) { @@ -5062,7 +5062,7 @@ DumpSegment( Tcl_DecrRefCount(tuple); return 0; } else { - TkSizeT oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree); + Tcl_Size oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree); Tcl_DString buf; int code; @@ -5421,7 +5421,7 @@ TextGetText( if (TkTextIndexCmp(indexPtr1, indexPtr2) < 0) { while (1) { - TkSizeT offset; + Tcl_Size offset; TkTextSegment *segPtr = TkTextIndexToSeg(&tmpIndex, &offset); int last = segPtr->size, last2; @@ -5742,7 +5742,7 @@ SearchCore( */ int firstOffset, lastOffset; - TkSizeT matchOffset, matchLength; + Tcl_Size matchOffset, matchLength; int passes; int lineNum = searchSpecPtr->startLine; int code = TCL_OK; @@ -5763,9 +5763,9 @@ SearchCore( #define LOTS_OF_MATCHES 20 int matchNum = LOTS_OF_MATCHES; - TkSizeT smArray[2 * LOTS_OF_MATCHES]; - TkSizeT *storeMatch = smArray; - TkSizeT *storeLength = smArray + LOTS_OF_MATCHES; + Tcl_Size smArray[2 * LOTS_OF_MATCHES]; + Tcl_Size *storeMatch = smArray; + Tcl_Size *storeLength = smArray + LOTS_OF_MATCHES; int lastBackwardsLineMatch = -1; int lastBackwardsMatchOffset = -1; @@ -5914,7 +5914,7 @@ SearchCore( * Only use the last part of the line. */ - if (searchSpecPtr->startOffset + 1 > (TkSizeT)firstOffset + 1) { + if (searchSpecPtr->startOffset + 1 > (Tcl_Size)firstOffset + 1) { firstOffset = searchSpecPtr->startOffset; } if ((firstOffset >= lastOffset) @@ -5926,7 +5926,7 @@ SearchCore( * Use only the first part of the line. */ - if (searchSpecPtr->startOffset + 1 < (TkSizeT)lastOffset + 1) { + if (searchSpecPtr->startOffset + 1 < (Tcl_Size)lastOffset + 1) { lastOffset = searchSpecPtr->startOffset; } } @@ -5950,11 +5950,11 @@ SearchCore( do { int ch; const char *p; - TkSizeT lastFullLine = lastOffset; + Tcl_Size lastFullLine = lastOffset; if (firstNewLine == -1) { if (searchSpecPtr->strictLimits - && (firstOffset + matchLength + 1 > (TkSizeT)lastOffset + 1)) { + && (firstOffset + matchLength + 1 > (Tcl_Size)lastOffset + 1)) { /* * Not enough characters to match. */ @@ -6072,7 +6072,7 @@ SearchCore( * exact searches. */ - if ((TkSizeT)lastTotal - skipFirst + 1 >= matchLength + 1) { + if ((Tcl_Size)lastTotal - skipFirst + 1 >= matchLength + 1) { /* * We now have enough text to match, so we * make a final test and break whatever the @@ -6154,7 +6154,7 @@ SearchCore( } } else { firstOffset = matchLength ? p - startOfLine + matchLength - : p - startOfLine + (TkSizeT)1; + : p - startOfLine + (Tcl_Size)1; if (firstOffset >= lastOffset) { /* * Now, we have to be careful not to find @@ -6194,7 +6194,7 @@ SearchCore( do { Tcl_RegExpInfo info; int match; - TkSizeT lastFullLine = lastOffset; + Tcl_Size lastFullLine = lastOffset; match = Tcl_RegExpExecObj(interp, regexp, theLine, firstOffset, 1, (firstOffset>0 ? TCL_REG_NOTBOL : 0)); @@ -6212,9 +6212,9 @@ SearchCore( if (!match || ((info.extendStart == info.matches[0].start) - && (info.matches[0].end == (TkSizeT) (lastOffset - firstOffset)))) { + && (info.matches[0].end == (Tcl_Size) (lastOffset - firstOffset)))) { int extraLines = 0; - TkSizeT prevFullLine; + Tcl_Size prevFullLine; /* * If we find a match that overlaps more than one line, we @@ -6327,7 +6327,7 @@ SearchCore( */ if ((match && - firstOffset + info.matches[0].end != (TkSizeT) lastTotal && + firstOffset + info.matches[0].end != (Tcl_Size) lastTotal && firstOffset + info.matches[0].end + 1 < prevFullLine + 1) || info.extendStart == TCL_INDEX_NONE) { break; @@ -6340,7 +6340,7 @@ SearchCore( * that line. */ - if (match && (info.matches[0].start + 1 >= (TkSizeT) lastOffset + 1)) { + if (match && (info.matches[0].start + 1 >= (Tcl_Size) lastOffset + 1)) { break; } if (match && ((firstOffset + info.matches[0].end) @@ -6397,7 +6397,7 @@ SearchCore( * Possible overlap or enclosure. */ - if ((TkSizeT)thisOffset - lastNonOverlap >= + if ((Tcl_Size)thisOffset - lastNonOverlap >= lastBackwardsMatchOffset + matchLength + 1){ /* * Totally encloses previous match, so @@ -6481,7 +6481,7 @@ SearchCore( if (matchOffset == TCL_INDEX_NONE || ((searchSpecPtr->all || searchSpecPtr->backwards) - && (((TkSizeT)firstOffset + 1 < matchOffset + 1) + && (((Tcl_Size)firstOffset + 1 < matchOffset + 1) || ((firstOffset + info.matches[0].end - info.matches[0].start) > matchOffset + matchLength)))) { @@ -6502,11 +6502,11 @@ SearchCore( * matches on the heap. */ - TkSizeT *newArray = (TkSizeT *) - ckalloc(4 * matchNum * sizeof(TkSizeT)); - memcpy(newArray, storeMatch, matchNum*sizeof(TkSizeT)); + Tcl_Size *newArray = (Tcl_Size *) + ckalloc(4 * matchNum * sizeof(Tcl_Size)); + memcpy(newArray, storeMatch, matchNum*sizeof(Tcl_Size)); memcpy(newArray + 2*matchNum, storeLength, - matchNum * sizeof(TkSizeT)); + matchNum * sizeof(Tcl_Size)); if (storeMatch != smArray) { ckfree(storeMatch); } @@ -6766,7 +6766,7 @@ GetLineStartEnd( TCL_UNUSED(void *), TCL_UNUSED(Tk_Window), char *recordPtr, /* Pointer to widget record. */ - TkSizeT internalOffset) /* Offset within *recordPtr containing the + Tcl_Size internalOffset) /* Offset within *recordPtr containing the * line value. */ { TkTextLine *linePtr = *(TkTextLine **)(recordPtr + internalOffset); @@ -6805,7 +6805,7 @@ SetLineStartEnd( * We use a pointer to the pointer because we * may need to return a value (NULL). */ char *recordPtr, /* Pointer to storage for the widget record. */ - TkSizeT internalOffset, /* Offset within *recordPtr at which the + Tcl_Size internalOffset, /* Offset within *recordPtr at which the * internal value is to be stored. */ char *oldInternalPtr, /* Pointer to storage for the old value. */ int flags) /* Flags for the option, set Tk_SetOptions. */ diff --git a/generic/tkText.h b/generic/tkText.h index 3a24ad8..796a4ec 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -165,7 +165,7 @@ typedef struct TkTextSegment { struct TkTextSegment *nextPtr; /* Next in list of segments for this line, or * NULL for end of list. */ - TkSizeT size; /* Size of this segment (# of bytes of index + Tcl_Size size; /* Size of this segment (# of bytes of index * space it occupies). */ union { char chars[TKFLEXARRAY]; /* Characters that make up character info. @@ -534,16 +534,8 @@ typedef enum { * that are peers. */ -#ifndef TkSizeT -# if TCL_MAJOR_VERSION > 8 -# define TkSizeT size_t -# else -# define TkSizeT int -# endif -#endif - typedef struct TkSharedText { - TkSizeT refCount; /* Reference count this shared object. */ + Tcl_Size refCount; /* Reference count this shared object. */ TkTextBTree tree; /* B-tree representation of text and tags for * widget. */ Tcl_HashTable tagTable; /* Hash table that maps from tag names to @@ -572,7 +564,7 @@ typedef struct TkSharedText { * exist, so the table hasn't been created. * Each "object" used for this table is the * name of a tag. */ - TkSizeT stateEpoch; /* This is incremented each time the B-tree's + Tcl_Size stateEpoch; /* This is incremented each time the B-tree's * contents change structurally, or when the * start/end limits change, and means that any * cached TkTextIndex objects are no longer @@ -793,7 +785,7 @@ typedef struct TkText { * definitions. */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ - TkSizeT refCount; /* Number of cached TkTextIndex objects + Tcl_Size refCount; /* Number of cached TkTextIndex objects * refering to us. */ int insertCursorType; /* 0 = standard insertion cursor, 1 = block * cursor. */ @@ -849,7 +841,7 @@ typedef struct TkText { */ typedef TkTextSegment * Tk_SegSplitProc(struct TkTextSegment *segPtr, - TkSizeT index); + Tcl_Size index); typedef int Tk_SegDeleteProc(struct TkTextSegment *segPtr, TkTextLine *linePtr, int treeGone); typedef TkTextSegment * Tk_SegCleanupProc(struct TkTextSegment *segPtr, @@ -858,8 +850,8 @@ typedef void Tk_SegLineChangeProc(struct TkTextSegment *segPtr, TkTextLine *linePtr); typedef int Tk_SegLayoutProc(struct TkText *textPtr, struct TkTextIndex *indexPtr, - TkTextSegment *segPtr, TkSizeT offset, int maxX, - TkSizeT maxChars, int noCharsYet, TkWrapMode wrapMode, + TkTextSegment *segPtr, Tcl_Size offset, int maxX, + Tcl_Size maxChars, int noCharsYet, TkWrapMode wrapMode, struct TkTextDispChunk *chunkPtr); typedef void Tk_SegCheckProc(TkTextSegment *segPtr, TkTextLine *linePtr); @@ -1019,14 +1011,14 @@ MODULE_SCOPE void TkBTreeRemoveClient(TkTextBTree tree, MODULE_SCOPE void TkBTreeDestroy(TkTextBTree tree); MODULE_SCOPE void TkBTreeDeleteIndexRange(TkTextBTree tree, TkTextIndex *index1Ptr, TkTextIndex *index2Ptr); -MODULE_SCOPE TkSizeT TkBTreeEpoch(TkTextBTree tree); +MODULE_SCOPE Tcl_Size TkBTreeEpoch(TkTextBTree tree); MODULE_SCOPE TkTextLine *TkBTreeFindLine(TkTextBTree tree, const TkText *textPtr, int line); MODULE_SCOPE TkTextLine *TkBTreeFindPixelLine(TkTextBTree tree, const TkText *textPtr, int pixels, int *pixelOffset); MODULE_SCOPE TkTextTag **TkBTreeGetTags(const TkTextIndex *indexPtr, - const TkText *textPtr, TkSizeT *numTagsPtr); + const TkText *textPtr, Tcl_Size *numTagsPtr); MODULE_SCOPE void TkBTreeInsertChars(TkTextBTree tree, TkTextIndex *indexPtr, const char *string); MODULE_SCOPE int TkBTreeLinesTo(const TkText *textPtr, @@ -1062,7 +1054,7 @@ MODULE_SCOPE int TkTextIndexBbox(TkText *textPtr, int *widthPtr, int *heightPtr, int *charWidthPtr); MODULE_SCOPE int TkTextCharLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, TkTextSegment *segPtr, - TkSizeT offset, int maxX, TkSizeT maxChars, int noBreakYet, + Tcl_Size offset, int maxX, Tcl_Size maxChars, int noBreakYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); MODULE_SCOPE void TkTextCreateDInfo(TkText *textPtr); MODULE_SCOPE int TkTextDLineInfo(TkText *textPtr, @@ -1108,7 +1100,7 @@ MODULE_SCOPE void TkTextIndexOfX(TkText *textPtr, int x, MODULE_SCOPE int TkTextIndexYPixels(TkText *textPtr, const TkTextIndex *indexPtr); MODULE_SCOPE TkTextSegment *TkTextIndexToSeg(const TkTextIndex *indexPtr, - TkSizeT *offsetPtr); + Tcl_Size *offsetPtr); MODULE_SCOPE void TkTextLostSelection(ClientData clientData); MODULE_SCOPE TkTextIndex *TkTextMakeCharIndex(TkTextBTree tree, TkText *textPtr, int lineIndex, int charIndex, diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 9b38352..0d76b27 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -105,7 +105,7 @@ typedef struct BTree { int clients; /* Number of clients of this B-tree. */ int pixelReferences; /* Number of clients of this B-tree which care * about pixel heights. */ - TkSizeT stateEpoch; /* Updated each time any aspect of the B-tree + Tcl_Size stateEpoch; /* Updated each time any aspect of the B-tree * changes. */ TkSharedText *sharedTextPtr;/* Used to find tagTable in consistency * checking code, and to access list of all @@ -161,7 +161,7 @@ static int CharDeleteProc(TkTextSegment *segPtr, TkTextLine *linePtr, int treeGone); static TkTextSegment * CharCleanupProc(TkTextSegment *segPtr, TkTextLine *linePtr); -static TkTextSegment * CharSplitProc(TkTextSegment *segPtr, TkSizeT index); +static TkTextSegment * CharSplitProc(TkTextSegment *segPtr, Tcl_Size index); static void CheckNodeConsistency(Node *nodePtr, int references); static void CleanupLine(TkTextLine *linePtr); static void DeleteSummaries(Summary *tagPtr); @@ -501,7 +501,7 @@ TkBTreeDestroy( *---------------------------------------------------------------------- */ -TkSizeT +Tcl_Size TkBTreeEpoch( TkTextBTree tree) /* Tree to get epoch for. */ { @@ -1190,7 +1190,7 @@ SplitSeg( { TkTextSegment *prevPtr, *segPtr; TkTextLine *linePtr; - TkSizeT count = indexPtr->byteIndex; + Tcl_Size count = indexPtr->byteIndex; linePtr = indexPtr->linePtr; prevPtr = NULL; @@ -2674,7 +2674,7 @@ TkBTreeStartSearch( /* Where to store information about search's * progress. */ { - TkSizeT offset; + Tcl_Size offset; TkTextIndex index0; /* First index of the tag. */ TkTextSegment *seg0Ptr; /* First segment of the tag. */ @@ -2770,7 +2770,7 @@ TkBTreeStartSearchBack( /* Where to store information about search's * progress. */ { - TkSizeT offset; + Tcl_Size offset; TkTextIndex index0; /* Last index of the tag. */ TkTextIndex backOne; /* One character before starting index. */ TkTextSegment *seg0Ptr; /* Last segment of the tag. */ @@ -3361,7 +3361,7 @@ TkBTreeGetTags( const TkText *textPtr, /* If non-NULL, then only return tags for this * text widget (when there are peer * widgets). */ - TkSizeT *numTagsPtr) /* Store number of tags found at this + Tcl_Size *numTagsPtr) /* Store number of tags found at this * location. */ { Node *nodePtr; @@ -4565,7 +4565,7 @@ TkBTreeNumPixels( static TkTextSegment * CharSplitProc( TkTextSegment *segPtr, /* Pointer to segment to split. */ - TkSizeT index) /* Position within segment at which to + Tcl_Size index) /* Position within segment at which to * split. */ { TkTextSegment *newPtr1, *newPtr2; diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 906190a..b5bea74 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -171,7 +171,7 @@ typedef struct StyleValues { */ typedef struct TextStyle { - TkSizeT refCount; /* Number of times this structure is + Tcl_Size refCount; /* Number of times this structure is * referenced in Chunks. */ GC bgGC; /* Graphics context for background. None means * use widget background. */ @@ -418,7 +418,7 @@ typedef struct TextDInfo { * to so far... */ int metricPixelHeight; /* ...and this is for the height calculation * so far...*/ - TkSizeT metricEpoch; /* ...and this for the epoch of the partial + Tcl_Size metricEpoch; /* ...and this for the epoch of the partial * calculation so it can be cancelled if * things change once more. This field will be * -1 if there is no long-line calculation in @@ -777,7 +777,7 @@ GetStyle( StyleValues styleValues; TextStyle *stylePtr; Tcl_HashEntry *hPtr; - TkSizeT numTags, i; + Tcl_Size numTags, i; int isNew; int isSelected; XGCValues gcValues; @@ -1181,7 +1181,7 @@ LayoutDLine( /* Pointer to last chunk in display lines with * numBytes > 0. Used to drop 0-sized chunks * from the end of the line. */ - TkSizeT byteOffset; + Tcl_Size byteOffset; int ascent, descent, code, elide, elidesize; StyleValues *sValuePtr; TkTextElideInfo info; /* Keep track of elide state. */ @@ -6181,7 +6181,7 @@ TkTextYviewCmd( TextDInfo *dInfoPtr = textPtr->dInfoPtr; int pickPlace, type; int pixels, count; - TkSizeT switchLength; + Tcl_Size switchLength; double fraction; TkTextIndex index; @@ -7624,11 +7624,11 @@ TkTextCharLayoutProc( TCL_UNUSED(TkTextIndex *), /* Index of first character to lay out * (corresponds to segPtr and offset). */ TkTextSegment *segPtr, /* Segment being layed out. */ - TkSizeT byteOffset, /* Byte offset within segment of first + Tcl_Size byteOffset, /* Byte offset within segment of first * character to consider. */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - TkSizeT maxBytes, /* Chunk must not include more than this many + Tcl_Size maxBytes, /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this display line yet. */ @@ -7642,7 +7642,7 @@ TkTextCharLayoutProc( { Tk_Font tkfont; int nextX, count; - TkSizeT bytesThatFit; + Tcl_Size bytesThatFit; CharInfo *ciPtr; char *p; TkTextSegment *nextPtr; diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index fdf1c43..cd65bf9 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -43,7 +43,7 @@ static void EmbImageDisplayProc(TkText *textPtr, Drawable dst, int screenY); static int EmbImageLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, TkTextSegment *segPtr, - TkSizeT offset, int maxX, TkSizeT maxChars, + Tcl_Size offset, int maxX, Tcl_Size maxChars, int noCharsYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); static void EmbImageProc(ClientData clientData, int x, int y, @@ -535,11 +535,11 @@ EmbImageLayoutProc( TkText *textPtr, /* Text widget being layed out. */ TCL_UNUSED(TkTextIndex *), /* Identifies first character in chunk. */ TkTextSegment *eiPtr, /* Segment corresponding to indexPtr. */ - TkSizeT offset, /* Offset within segPtr corresponding to + Tcl_Size offset, /* Offset within segPtr corresponding to * indexPtr (always 0). */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - TCL_UNUSED(TkSizeT), /* Chunk must not include more than this many + TCL_UNUSED(Tcl_Size), /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this line yet. */ diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index c8b0722..d9784cf 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -104,7 +104,7 @@ DupTextIndexInternalRep( Tcl_Obj *srcPtr, /* TextIndex obj with internal rep to copy. */ Tcl_Obj *copyPtr) /* TextIndex obj with internal rep to set. */ { - TkSizeT epoch; + Tcl_Size epoch; TkTextIndex *dupIndexPtr, *indexPtr; dupIndexPtr = (TkTextIndex *)ckalloc(sizeof(TkTextIndex)); @@ -206,7 +206,7 @@ TkTextGetIndexFromObj( int cache; if (objPtr->typePtr == &tkTextIndexType) { - TkSizeT epoch; + Tcl_Size epoch; indexPtr = GET_TEXTINDEX(objPtr); epoch = GET_INDEXEPOCH(objPtr); @@ -565,11 +565,11 @@ TkTextMakeCharIndex( TkTextSegment * TkTextIndexToSeg( const TkTextIndex *indexPtr,/* Text index. */ - TkSizeT *offsetPtr) /* Where to store offset within segment, or + Tcl_Size *offsetPtr) /* Where to store offset within segment, or * NULL if offset isn't wanted. */ { TkTextSegment *segPtr; - TkSizeT offset; + Tcl_Size offset; for (offset = indexPtr->byteIndex, segPtr = indexPtr->linePtr->segPtr; offset >= segPtr->size; @@ -1086,7 +1086,7 @@ TkTextIndexAdjustToStartEnd( *--------------------------------------------------------------------------- */ -TkSizeT +Tcl_Size TkTextPrintIndex( const TkText *textPtr, const TkTextIndex *indexPtr,/* Pointer to index. */ @@ -1550,7 +1550,7 @@ TkTextIndexForwChars( TkTextLine *linePtr; TkTextSegment *segPtr; TkTextElideInfo *infoPtr = NULL; - TkSizeT byteOffset; + Tcl_Size byteOffset; char *start, *end, *p; int ch; int elide = 0; @@ -1738,7 +1738,7 @@ IndexCountBytesOrdered( /* Index describing location of last character * at which to stop the count. */ { - TkSizeT byteCount, offset; + Tcl_Size byteCount, offset; TkTextSegment *segPtr, *segPtr1; TkTextLine *linePtr; @@ -1815,7 +1815,7 @@ TkTextIndexCount( TkTextLine *linePtr1; TkTextSegment *segPtr, *seg2Ptr = NULL; TkTextElideInfo *infoPtr = NULL; - TkSizeT byteOffset, maxBytes, count = 0; + Tcl_Size byteOffset, maxBytes, count = 0; int elide = 0; int checkElided = (type & COUNT_DISPLAY); @@ -1906,10 +1906,10 @@ TkTextIndexCount( } if (segPtr->typePtr == &tkTextCharType) { - TkSizeT byteLen = segPtr->size - byteOffset; + Tcl_Size byteLen = segPtr->size - byteOffset; unsigned char *str = (unsigned char *) segPtr->body.chars + byteOffset; - TkSizeT i; + Tcl_Size i; if (segPtr == seg2Ptr) { if (byteLen + byteOffset > maxBytes) { @@ -1939,7 +1939,7 @@ TkTextIndexCount( } } else { if (type & COUNT_INDICES) { - TkSizeT byteLen = segPtr->size - byteOffset; + Tcl_Size byteLen = segPtr->size - byteOffset; if (segPtr == seg2Ptr) { if (byteLen + byteOffset > maxBytes) { @@ -2364,7 +2364,7 @@ StartEnd( } else if ((*string == 'w') && (strncmp(string, "wordend", length) == 0) && (length >= 5)) { int firstChar = 1; - TkSizeT offset; + Tcl_Size offset; /* * If the current character isn't part of a word then just move @@ -2407,7 +2407,7 @@ StartEnd( } else if ((*string == 'w') && (strncmp(string, "wordstart", length) == 0) && (length >= 5)) { int firstChar = 1; - TkSizeT offset; + Tcl_Size offset; if (modifier == TKINDEX_DISPLAY) { TkTextIndexForwChars(textPtr, indexPtr, 0, indexPtr, diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 9efa222..ec66d6c 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -36,8 +36,8 @@ static TkTextSegment * MarkCleanupProc(TkTextSegment *segPtr, static void MarkCheckProc(TkTextSegment *segPtr, TkTextLine *linePtr); static int MarkLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, - TkTextSegment *segPtr, TkSizeT offset, int maxX, - TkSizeT maxChars, int noCharsYet, TkWrapMode wrapMode, + TkTextSegment *segPtr, Tcl_Size offset, int maxX, + Tcl_Size maxChars, int noCharsYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); static int MarkFindNext(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *markName); @@ -126,7 +126,7 @@ TkTextMarkCmd( switch ((enum markOptions) optionIndex) { case MARK_GRAVITY: { char c; - TkSizeT length; + Tcl_Size length; const char *str; if (objc < 4 || objc > 5) { @@ -547,11 +547,11 @@ MarkLayoutProc( TkText *textPtr, /* Text widget being layed out. */ TCL_UNUSED(TkTextIndex *), /* Identifies first character in chunk. */ TkTextSegment *segPtr, /* Segment corresponding to indexPtr. */ - TCL_UNUSED(TkSizeT), /* Offset within segPtr corresponding to + TCL_UNUSED(Tcl_Size), /* Offset within segPtr corresponding to * indexPtr (always 0). */ TCL_UNUSED(int), /* Chunk must not occupy pixels at this * position or higher. */ - TCL_UNUSED(TkSizeT), /* Chunk must not include more than this many + TCL_UNUSED(Tcl_Size), /* Chunk must not include more than this many * characters. */ TCL_UNUSED(int), /* Non-zero means no characters have been * assigned to this line yet. */ diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index e519ade..f38365f 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -132,7 +132,7 @@ TkTextTagCmd( TAG_REMOVE }; int optionIndex; - TkSizeT i; + Tcl_Size i; TkTextTag *tagPtr; TkTextIndex index1, index2; @@ -170,12 +170,12 @@ TkTextTagCmd( */ textPtr->sharedTextPtr->stateEpoch++; } - for (i = 4; i < (TkSizeT)objc; i += 2) { + for (i = 4; i < (Tcl_Size)objc; i += 2) { if (TkTextGetObjIndex(interp, textPtr, objv[i], &index1) != TCL_OK) { return TCL_ERROR; } - if ((TkSizeT)objc > (i+1)) { + if ((Tcl_Size)objc > (i+1)) { if (TkTextGetObjIndex(interp, textPtr, objv[i+1], &index2) != TCL_OK) { return TCL_ERROR; @@ -537,7 +537,7 @@ TkTextTagCmd( Tcl_WrongNumArgs(interp, 3, objv, "tagName ?tagName ...?"); return TCL_ERROR; } - for (i = 3; i < (TkSizeT)objc; i++) { + for (i = 3; i < (Tcl_Size)objc; i++) { hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable, Tcl_GetString(objv[i])); if (hPtr == NULL) { @@ -599,7 +599,7 @@ TkTextTagCmd( } case TAG_NAMES: { TkTextTag **arrayPtr; - TkSizeT arraySize; + Tcl_Size arraySize; Tcl_Obj *listObj; if ((objc != 3) && (objc != 4)) { @@ -1073,7 +1073,7 @@ FindTag( Tcl_Obj *tagName) /* Name of desired tag. */ { Tcl_HashEntry *hPtr; - TkSizeT len; + Tcl_Size len; const char *str; str = Tcl_GetStringFromObj(tagName, &len); @@ -1464,7 +1464,7 @@ TkTextBindProc( TkTextIndex index; TkTextTag** tagArrayPtr; - TkSizeT numTags; + Tcl_Size numTags; TkTextMarkNameToIndex(textPtr, "insert", &index); tagArrayPtr = TkBTreeGetTags(&index, textPtr, &numTags); @@ -1526,7 +1526,7 @@ TkTextPickCurrent( /* Initialization needed to prevent compiler * warning. */ int numOldTags, i, nearby; - TkSizeT numNewTags, j; + Tcl_Size numNewTags, j; size_t size; XEvent event; diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 6e3191c..be0a46f 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -57,7 +57,7 @@ static int EmbWinDeleteProc(TkTextSegment *segPtr, TkTextLine *linePtr, int treeGone); static int EmbWinLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, TkTextSegment *segPtr, - TkSizeT offset, int maxX, TkSizeT maxChars,int noCharsYet, + Tcl_Size offset, int maxX, Tcl_Size maxChars,int noCharsYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); static void EmbWinStructureProc(ClientData clientData, XEvent *eventPtr); @@ -819,11 +819,11 @@ EmbWinLayoutProc( TkText *textPtr, /* Text widget being layed out. */ TCL_UNUSED(TkTextIndex *), /* Identifies first character in chunk. */ TkTextSegment *ewPtr, /* Segment corresponding to indexPtr. */ - TkSizeT offset, /* Offset within segPtr corresponding to + Tcl_Size offset, /* Offset within segPtr corresponding to * indexPtr (always 0). */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - TCL_UNUSED(TkSizeT), /* Chunk must not include more than this many + TCL_UNUSED(Tcl_Size), /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this line yet. */ diff --git a/generic/tkUtil.c b/generic/tkUtil.c index d8331c3..ac5c325 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -51,7 +51,7 @@ TkStateParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { int c; int flags = PTR2INT(clientData); @@ -128,7 +128,7 @@ TkStatePrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -174,7 +174,7 @@ TkOrientParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { int c; size_t length; @@ -230,7 +230,7 @@ TkOrientPrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -262,7 +262,7 @@ TkOffsetParseProc( Tk_Window tkwin, /* Window on same display as tile */ const char *value, /* Name of image */ char *widgRec, /* Widget structure record */ - TkSizeT offset) /* Offset of tile in record */ + Tcl_Size offset) /* Offset of tile in record */ { Tk_TSOffset *offsetPtr = (Tk_TSOffset *) (widgRec + offset); Tk_TSOffset tsoffset; @@ -412,7 +412,7 @@ TkOffsetPrintProc( TCL_UNUSED(void *), /* not used */ TCL_UNUSED(Tk_Window), /* not used */ char *widgRec, /* Widget structure record */ - TkSizeT offset, /* Offset of tile in record */ + Tcl_Size offset, /* Offset of tile in record */ Tcl_FreeProc **freeProcPtr) /* not used */ { Tk_TSOffset *offsetPtr = (Tk_TSOffset *) (widgRec + offset); @@ -479,7 +479,7 @@ TkPixelParseProc( Tk_Window tkwin, /* Window on same display as tile */ const char *value, /* Name of image */ char *widgRec, /* Widget structure record */ - TkSizeT offset) /* Offset of tile in record */ + Tcl_Size offset) /* Offset of tile in record */ { double *doublePtr = (double *) (widgRec + offset); int result; @@ -513,7 +513,7 @@ TkPixelPrintProc( TCL_UNUSED(void *), /* not used */ TCL_UNUSED(Tk_Window), /* not used */ char *widgRec, /* Widget structure record */ - TkSizeT offset, /* Offset of tile in record */ + Tcl_Size offset, /* Offset of tile in record */ Tcl_FreeProc **freeProcPtr) /* not used */ { double *doublePtr = (double *) (widgRec + offset); @@ -730,7 +730,7 @@ Tk_GetScrollInfoObj( int *intPtr) /* Filled in with number of pages or lines to * scroll, if any. */ { - TkSizeT length; + Tcl_Size length; const char *arg = Tcl_GetStringFromObj(objv[2], &length); #define ArgPfxEq(str) \ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index e8a2a19..ced4b3d 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3248,7 +3248,7 @@ Initialize( } if (value) { - TkSizeT objc; + Tcl_Size objc; Tcl_Obj **objv, **rest; Tcl_Obj *parseList = Tcl_NewListObj(1, NULL); @@ -3298,7 +3298,7 @@ Initialize( */ { - TkSizeT numBytes; + Tcl_Size numBytes; const char *bytes = Tcl_GetStringFromObj(nameObj, &numBytes); classObj = Tcl_NewStringObj(bytes, numBytes); diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 0e7cded..eaa583f 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -84,12 +84,12 @@ typedef struct { * Internal state: */ char *string; /* Storage for string (malloced) */ - TkSizeT numBytes; /* Length of string in bytes. */ - TkSizeT numChars; /* Length of string in characters. */ + Tcl_Size numBytes; /* Length of string in bytes. */ + Tcl_Size numChars; /* Length of string in characters. */ - TkSizeT insertPos; /* Insert index */ - TkSizeT selectFirst; /* Index of start of selection, or TCL_INDEX_NONE */ - TkSizeT selectLast; /* Index of end of selection, or TCL_INDEX_NONE */ + Tcl_Size insertPos; /* Insert index */ + Tcl_Size selectFirst; /* Index of start of selection, or TCL_INDEX_NONE */ + Tcl_Size selectLast; /* Index of end of selection, or TCL_INDEX_NONE */ Scrollable xscroll; /* Current scroll position */ ScrollHandle xscrollHandle; @@ -315,7 +315,7 @@ static char *EntryDisplayString(const char *showChar, int numChars) */ static void EntryUpdateTextLayout(Entry *entryPtr) { - TkSizeT length; + Tcl_Size length; char *text; Tk_FreeTextLayout(entryPtr->entry.textLayout); if ((entryPtr->entry.numChars != 0) || (entryPtr->entry.placeholderObj == NULL)) { @@ -350,12 +350,12 @@ EntryEditable(Entry *entryPtr) /* EntryFetchSelection -- * Selection handler for entry widgets. */ -static TkSizeT +static Tcl_Size EntryFetchSelection( - ClientData clientData, TkSizeT offset, char *buffer, TkSizeT maxBytes) + ClientData clientData, Tcl_Size offset, char *buffer, Tcl_Size maxBytes) { Entry *entryPtr = (Entry *)clientData; - TkSizeT byteCount; + Tcl_Size byteCount; const char *string; const char *selStart, *selEnd; @@ -421,7 +421,7 @@ ExpandPercents( Entry *entryPtr, /* Entry that needs validation. */ const char *templ, /* Script template */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete */ + Tcl_Size index, /* index of insert/delete */ int count, /* #changed characters */ VREASON reason, /* Reason for change */ Tcl_DString *dsPtr) /* Result of %-substitutions */ @@ -531,8 +531,8 @@ static int RunValidationScript( const char *templ, /* Script template */ const char *optionName, /* "-validatecommand", "-invalidcommand" */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete */ - TkSizeT count, /* #changed characters */ + Tcl_Size index, /* index of insert/delete */ + Tcl_Size count, /* #changed characters */ VREASON reason) /* Reason for change */ { Tcl_DString script; @@ -592,8 +592,8 @@ static int EntryValidateChange( Entry *entryPtr, /* Entry that needs validation. */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete, TCL_INDEX_NONE otherwise */ - TkSizeT count, /* #changed characters */ + Tcl_Size index, /* index of insert/delete, TCL_INDEX_NONE otherwise */ + Tcl_Size count, /* #changed characters */ VREASON reason) /* Reason for change */ { Tcl_Interp *interp = entryPtr->core.interp; @@ -734,7 +734,7 @@ static void EntryStoreValue(Entry *entryPtr, const char *value) { size_t numBytes = strlen(value); - TkSizeT numChars = Tcl_NumUtfChars(value, numBytes); + Tcl_Size numChars = Tcl_NumUtfChars(value, numBytes); if (entryPtr->core.flags & VALIDATING) entryPtr->core.flags |= VALIDATION_SET_VALUE; @@ -835,7 +835,7 @@ static void EntryTextVariableTrace(void *recordPtr, const char *value) static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ - TkSizeT index, /* Insert before this index */ + Tcl_Size index, /* Insert before this index */ const char *value) /* New characters to add */ { char *string = entryPtr->entry.string; @@ -875,8 +875,8 @@ InsertChars( static int DeleteChars( Entry *entryPtr, /* Entry widget to modify. */ - TkSizeT index, /* Index of first character to delete. */ - TkSizeT count) /* How many characters to delete. */ + Tcl_Size index, /* Index of first character to delete. */ + Tcl_Size count) /* How many characters to delete. */ { char *string = entryPtr->entry.string; size_t byteIndex, byteCount, newByteCount; @@ -1088,7 +1088,7 @@ static int EntryPostConfigure(Tcl_Interp *dummy, void *recordPtr, int mask) * Precondition: textLayout and layoutX up-to-date. */ static int -EntryCharPosition(Entry *entryPtr, TkSizeT index) +EntryCharPosition(Entry *entryPtr, Tcl_Size index) { int xPos; Tk_CharBbox(entryPtr->entry.textLayout, index, &xPos, NULL, NULL, NULL); @@ -1197,7 +1197,7 @@ static void EntryDisplay(void *clientData, Drawable d) { Entry *entryPtr = (Entry *)clientData; Tk_Window tkwin = entryPtr->core.tkwin; - TkSizeT leftIndex = entryPtr->entry.xscroll.first, + Tcl_Size leftIndex = entryPtr->entry.xscroll.first, rightIndex = entryPtr->entry.xscroll.last + 1, selFirst = entryPtr->entry.selectFirst, selLast = entryPtr->entry.selectLast; @@ -1386,10 +1386,10 @@ EntryIndex( Tcl_Interp *interp, /* For error messages. */ Entry *entryPtr, /* Entry widget to query */ Tcl_Obj *indexObj, /* Symbolic index name */ - TkSizeT *indexPtr) /* Return value */ + Tcl_Size *indexPtr) /* Return value */ { # define EntryWidth(e) (Tk_Width(entryPtr->core.tkwin)) /* Not Right */ - TkSizeT length, idx; + Tcl_Size length, idx; const char *string; if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->entry.numChars - 1, 1, &idx)) { @@ -1441,7 +1441,7 @@ EntryIndex( x - entryPtr->entry.layoutX, 0); TtkUpdateScrollInfo(entryPtr->entry.xscrollHandle); - if (*indexPtr + 1 < (TkSizeT)entryPtr->entry.xscroll.first + 1) { + if (*indexPtr + 1 < (Tcl_Size)entryPtr->entry.xscroll.first + 1) { *indexPtr = entryPtr->entry.xscroll.first; } @@ -1452,7 +1452,7 @@ EntryIndex( * last character to be selected, for example. */ - if (roundUp && ((TkSizeT)*indexPtr + 1 < entryPtr->entry.numChars + 1 )) { + if (roundUp && ((Tcl_Size)*indexPtr + 1 < entryPtr->entry.numChars + 1 )) { *indexPtr += 1; } } else { @@ -1476,7 +1476,7 @@ EntryBBoxCommand( { Entry *entryPtr = (Entry *)recordPtr; Ttk_Box b; - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -1505,7 +1505,7 @@ EntryDeleteCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Entry *entryPtr = (Entry *)recordPtr; - TkSizeT first, last; + Tcl_Size first, last; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?"); @@ -1570,7 +1570,7 @@ EntryIndexCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Entry *entryPtr = (Entry *)recordPtr; - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -1592,7 +1592,7 @@ EntryInsertCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Entry *entryPtr = (Entry *)recordPtr; - TkSizeT index; + Tcl_Size index; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "index text"); @@ -1647,7 +1647,7 @@ static int EntrySelectionRangeCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Entry *entryPtr = (Entry *)recordPtr; - TkSizeT start, end; + Tcl_Size start, end; if (objc != 5) { Tcl_WrongNumArgs(interp, 3, objv, "start end"); return TCL_ERROR; @@ -1724,7 +1724,7 @@ static int EntryXViewCommand( { Entry *entryPtr = (Entry *)recordPtr; if (objc == 3) { - TkSizeT newFirst; + Tcl_Size newFirst; if (EntryIndex(interp, entryPtr, objv[2], &newFirst) != TCL_OK) { return TCL_ERROR; } @@ -1780,7 +1780,7 @@ typedef struct { Tcl_Obj *postCommandObj; Tcl_Obj *valuesObj; Tcl_Obj *heightObj; - TkSizeT currentIndex; + Tcl_Size currentIndex; } ComboboxPart; typedef struct { @@ -1842,7 +1842,7 @@ static int ComboboxCurrentCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Combobox *cbPtr = (Combobox *)recordPtr; - TkSizeT currentIndex = cbPtr->combobox.currentIndex; + Tcl_Size currentIndex = cbPtr->combobox.currentIndex; const char *currentValue = cbPtr->entry.string; int nValues; Tcl_Obj **values; @@ -1853,18 +1853,18 @@ static int ComboboxCurrentCommand( /* Check if currentIndex still valid: */ if (currentIndex == TCL_INDEX_NONE - || currentIndex >= (TkSizeT)nValues + || currentIndex >= (Tcl_Size)nValues || strcmp(currentValue,Tcl_GetString(values[currentIndex])) ) { /* Not valid. Check current value against each element in -values: */ - for (currentIndex = 0; currentIndex < (TkSizeT)nValues; ++currentIndex) { + for (currentIndex = 0; currentIndex < (Tcl_Size)nValues; ++currentIndex) { if (!strcmp(currentValue,Tcl_GetString(values[currentIndex]))) { break; } } - if (currentIndex >= (TkSizeT)nValues) { + if (currentIndex >= (Tcl_Size)nValues) { /* Not found */ currentIndex = TCL_INDEX_NONE; } @@ -1873,10 +1873,10 @@ static int ComboboxCurrentCommand( Tcl_SetObjResult(interp, TkNewIndexObj(currentIndex)); return TCL_OK; } else if (objc == 3) { - TkSizeT idx; + Tcl_Size idx; if (TCL_OK == TkGetIntForIndex(objv[2], nValues - 1, 0, &idx)) { - if (idx == TCL_INDEX_NONE || idx >= (TkSizeT)nValues) { + if (idx == TCL_INDEX_NONE || idx >= (Tcl_Size)nValues) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "index \"%s\" out of range", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TTK", "COMBOBOX", "IDX_RANGE", NULL); diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index bdee695..8863924 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -495,7 +495,7 @@ static void LabelframePlaceContent(void *recordPtr) static int LabelRequest( TCL_UNUSED(void *), - TCL_UNUSED(TkSizeT), + TCL_UNUSED(Tcl_Size), TCL_UNUSED(int), TCL_UNUSED(int)) { @@ -511,7 +511,7 @@ static int LabelRequest( */ static void LabelRemoved( void *managerData, - TCL_UNUSED(TkSizeT)) + TCL_UNUSED(Tcl_Size)) { Labelframe *lframe = (Labelframe *)managerData; diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 523fa08..882f5de 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -130,7 +130,7 @@ static void TextCleanup(TextElement *text) static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, text->foregroundObj); - TkSizeT underline = TCL_INDEX_NONE; + Tcl_Size underline = TCL_INDEX_NONE; XGCValues gcValues; GC gc1, gc2; Tk_Anchor anchor = TK_ANCHOR_CENTER; diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 22c5ddb..de07d86 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -61,7 +61,7 @@ struct TtkManager_ void *managerData; Tk_Window window; unsigned flags; - TkSizeT nContent; + Tcl_Size nContent; Ttk_Content **content; }; @@ -142,7 +142,7 @@ static const int ManagerEventMask = StructureNotifyMask; static void ManagerEventHandler(ClientData clientData, XEvent *eventPtr) { Ttk_Manager *mgr = (Ttk_Manager *)clientData; - TkSizeT i; + Tcl_Size i; switch (eventPtr->type) { @@ -247,9 +247,9 @@ void Ttk_DeleteManager(Ttk_Manager *mgr) /* ++ InsertContent -- * Adds content to the list of managed windows. */ -static void InsertContent(Ttk_Manager *mgr, Ttk_Content *content, TkSizeT index) +static void InsertContent(Ttk_Manager *mgr, Ttk_Content *content, Tcl_Size index) { - TkSizeT endIndex = mgr->nContent++; + Tcl_Size endIndex = mgr->nContent++; mgr->content = (Ttk_Content **)ckrealloc(mgr->content, mgr->nContent * sizeof(Ttk_Content *)); while (endIndex > index) { @@ -276,10 +276,10 @@ static void InsertContent(Ttk_Manager *mgr, Ttk_Content *content, TkSizeT index) * [1] It's safe to call Tk_UnmapWindow / Tk_UnmaintainGeometry even if this * routine is called from the content window's DestroyNotify event handler. */ -static void RemoveContent(Ttk_Manager *mgr, TkSizeT index) +static void RemoveContent(Ttk_Manager *mgr, Tcl_Size index) { Ttk_Content *content = mgr->content[index]; - TkSizeT i; + Tcl_Size i; /* Notify manager: */ @@ -313,7 +313,7 @@ static void RemoveContent(Ttk_Manager *mgr, TkSizeT index) void Ttk_GeometryRequestProc(ClientData clientData, Tk_Window window) { Ttk_Manager *mgr = (Ttk_Manager *)clientData; - TkSizeT index = Ttk_ContentIndex(mgr, window); + Tcl_Size index = Ttk_ContentIndex(mgr, window); if (index != TCL_INDEX_NONE) { int reqWidth = Tk_ReqWidth(window); @@ -328,7 +328,7 @@ void Ttk_GeometryRequestProc(ClientData clientData, Tk_Window window) void Ttk_LostContentProc(ClientData clientData, Tk_Window window) { Ttk_Manager *mgr = (Ttk_Manager *)clientData; - TkSizeT index = Ttk_ContentIndex(mgr, window); + Tcl_Size index = Ttk_ContentIndex(mgr, window); /* ASSERT: index != TCL_INDEX_NONE */ RemoveContent(mgr, index); @@ -342,7 +342,7 @@ void Ttk_LostContentProc(ClientData clientData, Tk_Window window) * Add a new content window at the specified index. */ void Ttk_InsertContent( - Ttk_Manager *mgr, TkSizeT index, Tk_Window tkwin, void *data) + Ttk_Manager *mgr, Tcl_Size index, Tk_Window tkwin, void *data) { Ttk_Content *content = NewContent(mgr, tkwin, data); InsertContent(mgr, content, index); @@ -351,7 +351,7 @@ void Ttk_InsertContent( /* ++ Ttk_ForgetContent -- * Unmanage the specified content window. */ -void Ttk_ForgetContent(Ttk_Manager *mgr, TkSizeT index) +void Ttk_ForgetContent(Ttk_Manager *mgr, Tcl_Size index) { Tk_Window window = mgr->content[index]->window; RemoveContent(mgr, index); @@ -366,7 +366,7 @@ void Ttk_ForgetContent(Ttk_Manager *mgr, TkSizeT index) * map the content window. */ void Ttk_PlaceContent( - Ttk_Manager *mgr, TkSizeT index, int x, int y, int width, int height) + Ttk_Manager *mgr, Tcl_Size index, int x, int y, int width, int height) { Ttk_Content *content = mgr->content[index]; Tk_MaintainGeometry(content->window,mgr->window,x,y,width,height); @@ -379,7 +379,7 @@ void Ttk_PlaceContent( /* ++ Ttk_UnmapContent -- * Unmap the specified content window, but leave it managed. */ -void Ttk_UnmapContent(Ttk_Manager *mgr, TkSizeT index) +void Ttk_UnmapContent(Ttk_Manager *mgr, Tcl_Size index) { Ttk_Content *content = mgr->content[index]; Tk_UnmaintainGeometry(content->window, mgr->window); @@ -405,15 +405,15 @@ void Ttk_ManagerSizeChanged(Ttk_Manager *mgr) /* +++ Accessors. */ -TkSizeT Ttk_NumberContent(Ttk_Manager *mgr) +Tcl_Size Ttk_NumberContent(Ttk_Manager *mgr) { return mgr->nContent; } -void *Ttk_ContentData(Ttk_Manager *mgr, TkSizeT index) +void *Ttk_ContentData(Ttk_Manager *mgr, Tcl_Size index) { return mgr->content[index]->data; } -Tk_Window Ttk_ContentWindow(Ttk_Manager *mgr, TkSizeT index) +Tk_Window Ttk_ContentWindow(Ttk_Manager *mgr, Tcl_Size index) { return mgr->content[index]->window; } @@ -425,9 +425,9 @@ Tk_Window Ttk_ContentWindow(Ttk_Manager *mgr, TkSizeT index) /* ++ Ttk_ContentIndex -- * Returns the index of specified content window, TCL_INDEX_NONE if not found. */ -TkSizeT Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) +Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) { - TkSizeT index; + Tcl_Size index; for (index = 0; index < mgr->nContent; ++index) if (mgr->content[index]->window == window) return index; @@ -444,10 +444,10 @@ TkSizeT Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) */ int Ttk_GetContentIndexFromObj( - Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, TkSizeT *indexPtr) + Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, Tcl_Size *indexPtr) { const char *string = Tcl_GetString(objPtr); - TkSizeT index = 0; + Tcl_Size index = 0; Tk_Window tkwin; /* Try interpreting as an integer first: @@ -488,7 +488,7 @@ int Ttk_GetContentIndexFromObj( /* ++ Ttk_ReorderContent(mgr, fromIndex, toIndex) -- * Change content window order. */ -void Ttk_ReorderContent(Ttk_Manager *mgr, TkSizeT fromIndex, TkSizeT toIndex) +void Ttk_ReorderContent(Ttk_Manager *mgr, Tcl_Size fromIndex, Tcl_Size toIndex) { Ttk_Content *moved = mgr->content[fromIndex]; diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index cf07dfc..ae65941 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -31,8 +31,8 @@ typedef struct { /* Manager hooks */ int (*RequestedSize)(void *managerData, int *widthPtr, int *heightPtr); void (*PlaceContent)(void *managerData); - int (*ContentRequest)(void *managerData, TkSizeT index, int w, int h); - void (*ContentRemoved)(void *managerData, TkSizeT index); + int (*ContentRequest)(void *managerData, Tcl_Size index, int w, int h); + void (*ContentRemoved)(void *managerData, Tcl_Size index); } Ttk_ManagerSpec; /* @@ -51,22 +51,22 @@ MODULE_SCOPE void Ttk_DeleteManager(Ttk_Manager *); #define Ttk_InsertSlave Ttk_InsertContent MODULE_SCOPE void Ttk_InsertContent( - Ttk_Manager *, TkSizeT position, Tk_Window, void *clientData); + Ttk_Manager *, Tcl_Size position, Tk_Window, void *clientData); #define Ttk_ForgetSlave Ttk_ForgetContent -MODULE_SCOPE void Ttk_ForgetContent(Ttk_Manager *, TkSizeT index); +MODULE_SCOPE void Ttk_ForgetContent(Ttk_Manager *, Tcl_Size index); #define Ttk_ReorderSlave Ttk_ReorderContent -MODULE_SCOPE void Ttk_ReorderContent(Ttk_Manager *, TkSizeT fromIndex, TkSizeT toIndex); +MODULE_SCOPE void Ttk_ReorderContent(Ttk_Manager *, Tcl_Size fromIndex, Tcl_Size toIndex); /* Rearrange content window positions */ #define Ttk_PlaceSlave Ttk_PlaceContent MODULE_SCOPE void Ttk_PlaceContent( - Ttk_Manager *, TkSizeT index, int x, int y, int width, int height); + Ttk_Manager *, Tcl_Size index, int x, int y, int width, int height); /* Position and map the content window */ #define Ttk_UnmapSlave Ttk_UnmapContent -MODULE_SCOPE void Ttk_UnmapContent(Ttk_Manager *, TkSizeT index); +MODULE_SCOPE void Ttk_UnmapContent(Ttk_Manager *, Tcl_Size index); /* Unmap the content window */ MODULE_SCOPE void Ttk_ManagerSizeChanged(Ttk_Manager *); @@ -76,25 +76,25 @@ MODULE_SCOPE void Ttk_ManagerLayoutChanged(Ttk_Manager *); /* Utilities: */ #define Ttk_SlaveIndex Ttk_ContentIndex -MODULE_SCOPE TkSizeT Ttk_ContentIndex(Ttk_Manager *, Tk_Window); +MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); /* Returns: index in content array of specified window, TCL_INDEX_NONE if not found */ #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( - Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, TkSizeT *indexPtr); + Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, Tcl_Size *indexPtr); /* Accessor functions: */ #define Ttk_NumberSlaves Ttk_NumberContent -MODULE_SCOPE TkSizeT Ttk_NumberContent(Ttk_Manager *); +MODULE_SCOPE Tcl_Size Ttk_NumberContent(Ttk_Manager *); /* Returns: number of managed content windows */ #define Ttk_SlaveData Ttk_ContentData -MODULE_SCOPE void *Ttk_ContentData(Ttk_Manager *, TkSizeT index); +MODULE_SCOPE void *Ttk_ContentData(Ttk_Manager *, Tcl_Size index); /* Returns: client data associated with content window */ #define Ttk_SlaveWindow Ttk_ContentWindow -MODULE_SCOPE Tk_Window Ttk_ContentWindow(Ttk_Manager *, TkSizeT index); +MODULE_SCOPE Tk_Window Ttk_ContentWindow(Ttk_Manager *, Tcl_Size index); /* Returns: content window */ MODULE_SCOPE int Ttk_Maintainable(Tcl_Interp *, Tk_Window content, Tk_Window container); diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 318c4e0..d97c479 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -94,8 +94,8 @@ typedef struct Ttk_Manager *mgr; /* Geometry manager */ Tk_OptionTable tabOptionTable; /* Tab options */ Tk_OptionTable paneOptionTable; /* Tab+pane options */ - TkSizeT currentIndex; /* index of currently selected tab */ - TkSizeT activeIndex; /* index of currently active tab */ + Tcl_Size currentIndex; /* index of currently selected tab */ + Tcl_Size activeIndex; /* index of currently active tab */ Ttk_Layout tabLayout; /* Sublayout for tabs */ Ttk_Box clientArea; /* Where to pack content windows */ @@ -254,9 +254,9 @@ error: * Return the index of the tab at point x,y, * or -1 if no tab at that point. */ -static TkSizeT IdentifyTab(Notebook *nb, int x, int y) +static Tcl_Size IdentifyTab(Notebook *nb, int x, int y) { - TkSizeT index; + Tcl_Size index; for (index = 0; index < Ttk_NumberContent(nb->notebook.mgr); ++index) { Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr,index); if ( tab->state != TAB_STATE_HIDDEN @@ -272,7 +272,7 @@ static TkSizeT IdentifyTab(Notebook *nb, int x, int y) * ActivateTab -- * Set the active tab index, redisplay if necessary. */ -static void ActivateTab(Notebook *nb, TkSizeT index) +static void ActivateTab(Notebook *nb, Tcl_Size index) { if (index != nb->notebook.activeIndex) { nb->notebook.activeIndex = index; @@ -287,11 +287,11 @@ static void ActivateTab(Notebook *nb, TkSizeT index) * The USER1 bit is set for the leftmost visible tab, and USER2 * is set for the rightmost visible tab. */ -static Ttk_State TabState(Notebook *nb, TkSizeT index) +static Ttk_State TabState(Notebook *nb, Tcl_Size index) { Ttk_State state = nb->core.state; Tab *itab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); - TkSizeT i = 0; + Tcl_Size i = 0; if (index == nb->notebook.currentIndex) { state |= TTK_STATE_SELECTED; @@ -351,7 +351,7 @@ static void TabrowSize( { Ttk_Layout tabLayout = nb->notebook.tabLayout; int tabrowWidth = 0, tabrowHeight = 0; - TkSizeT i; + Tcl_Size i; for (i = 0; i < Ttk_NumberContent(nb->notebook.mgr); ++i) { Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, i); @@ -391,7 +391,7 @@ static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) int clientWidth = 0, clientHeight = 0, reqWidth = 0, reqHeight = 0, tabrowWidth = 0, tabrowHeight = 0; - TkSizeT i; + Tcl_Size i; NotebookStyleOptions(nb, &nbstyle); @@ -571,7 +571,7 @@ static void NotebookDoLayout(void *recordPtr) * Set the position and size of a child widget * based on the current client area and content window options: */ -static void NotebookPlaceContent(Notebook *nb, TkSizeT index) +static void NotebookPlaceContent(Notebook *nb, Tcl_Size index) { Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); Tk_Window window = Ttk_ContentWindow(nb->notebook.mgr, index); @@ -589,7 +589,7 @@ static void NotebookPlaceContent(Notebook *nb, TkSizeT index) static void NotebookPlaceContents(void *recordPtr) { Notebook *nb = (Notebook *)recordPtr; - TkSizeT currentIndex = nb->notebook.currentIndex; + Tcl_Size currentIndex = nb->notebook.currentIndex; if (currentIndex != TCL_INDEX_NONE) { NotebookDoLayout(nb); NotebookPlaceContent(nb, currentIndex); @@ -600,10 +600,10 @@ static void NotebookPlaceContents(void *recordPtr) * SelectTab(nb, index) -- * Change the currently-selected tab. */ -static void SelectTab(Notebook *nb, TkSizeT index) +static void SelectTab(Notebook *nb, Tcl_Size index) { Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); - TkSizeT currentIndex = nb->notebook.currentIndex; + Tcl_Size currentIndex = nb->notebook.currentIndex; if (index == currentIndex) { return; @@ -641,8 +641,8 @@ static void SelectTab(Notebook *nb, TkSizeT index) */ static int NextTab(Notebook *nb, int index) { - TkSizeT nTabs = Ttk_NumberContent(nb->notebook.mgr); - TkSizeT nextIndex; + Tcl_Size nTabs = Ttk_NumberContent(nb->notebook.mgr); + Tcl_Size nextIndex; /* Scan forward for following usable tab: */ @@ -676,8 +676,8 @@ static int NextTab(Notebook *nb, int index) */ static void SelectNearestTab(Notebook *nb) { - TkSizeT currentIndex = nb->notebook.currentIndex; - TkSizeT nextIndex = NextTab(nb, currentIndex); + Tcl_Size currentIndex = nb->notebook.currentIndex; + Tcl_Size nextIndex = NextTab(nb, currentIndex); if (currentIndex != TCL_INDEX_NONE) { Ttk_UnmapContent(nb->notebook.mgr, currentIndex); @@ -695,7 +695,7 @@ static void SelectNearestTab(Notebook *nb) * Select the next tab if the current one is being removed. * Adjust currentIndex to account for removed content window. */ -static void TabRemoved(void *managerData, TkSizeT index) +static void TabRemoved(void *managerData, Tcl_Size index) { Notebook *nb = (Notebook *)managerData; Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); @@ -715,7 +715,7 @@ static void TabRemoved(void *managerData, TkSizeT index) static int TabRequest( TCL_UNUSED(void *), - TCL_UNUSED(TkSizeT), + TCL_UNUSED(Tcl_Size), TCL_UNUSED(int), TCL_UNUSED(int)) { @@ -727,7 +727,7 @@ static int TabRequest( */ static int AddTab( Tcl_Interp *interp, Notebook *nb, - TkSizeT destIndex, Tk_Window window, + Tcl_Size destIndex, Tk_Window window, int objc, Tcl_Obj *const objv[]) { Tab *tab; @@ -795,7 +795,7 @@ static void NotebookEventHandler(ClientData clientData, XEvent *eventPtr) Tk_DeleteEventHandler(nb->core.tkwin, NotebookEventMask, NotebookEventHandler, clientData); } else if (eventPtr->type == MotionNotify) { - TkSizeT index = IdentifyTab(nb, eventPtr->xmotion.x, eventPtr->xmotion.y); + Tcl_Size index = IdentifyTab(nb, eventPtr->xmotion.x, eventPtr->xmotion.y); ActivateTab(nb, index); } else if (eventPtr->type == LeaveNotify) { ActivateTab(nb, -1); @@ -823,7 +823,7 @@ static void NotebookEventHandler(ClientData clientData, XEvent *eventPtr) * See also: GetTabIndex. */ static int FindTabIndex( - Tcl_Interp *interp, Notebook *nb, Tcl_Obj *objPtr, TkSizeT *index_rtn) + Tcl_Interp *interp, Notebook *nb, Tcl_Obj *objPtr, Tcl_Size *index_rtn) { const char *string = Tcl_GetString(objPtr); int x, y; @@ -869,7 +869,7 @@ static int FindTabIndex( * Returns TCL_ERROR if the tab does not exist. */ static int GetTabIndex( - Tcl_Interp *interp, Notebook *nb, Tcl_Obj *objPtr, TkSizeT *index_rtn) + Tcl_Interp *interp, Notebook *nb, Tcl_Obj *objPtr, Tcl_Size *index_rtn) { int status = FindTabIndex(interp, nb, objPtr, index_rtn); if (status == TCL_OK && *index_rtn + 1 >= Ttk_NumberContent(nb->notebook.mgr) + 1) { @@ -899,7 +899,7 @@ static int NotebookAddCommand( { Notebook *nb = (Notebook *)recordPtr; Tk_Window window; - TkSizeT index; + Tcl_Size index; Tab *tab; if (objc <= 2 || objc % 2 != 1) { @@ -937,9 +937,9 @@ static int NotebookInsertCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Notebook *nb = (Notebook *)recordPtr; - TkSizeT current = nb->notebook.currentIndex; - TkSizeT nContent = Ttk_NumberContent(nb->notebook.mgr); - TkSizeT srcIndex, destIndex; + Tcl_Size current = nb->notebook.currentIndex; + Tcl_Size nContent = Ttk_NumberContent(nb->notebook.mgr); + Tcl_Size srcIndex, destIndex; if (objc < 4) { Tcl_WrongNumArgs(interp, 2,objv, "index window ?-option value ...?"); @@ -1011,7 +1011,7 @@ static int NotebookForgetCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Notebook *nb = (Notebook *)recordPtr; - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "tab"); @@ -1035,7 +1035,7 @@ static int NotebookHideCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Notebook *nb = (Notebook *)recordPtr; - TkSizeT index; + Tcl_Size index; Tab *tab; if (objc != 3) { @@ -1070,7 +1070,7 @@ static int NotebookIdentifyCommand( Notebook *nb = (Notebook *)recordPtr; Ttk_Element element = NULL; int x, y; - TkSizeT tabIndex; + Tcl_Size tabIndex; if (objc < 4 || objc > 5) { Tcl_WrongNumArgs(interp, 2,objv, "?what? x y"); @@ -1124,7 +1124,7 @@ static int NotebookIndexCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Notebook *nb = (Notebook *)recordPtr; - TkSizeT index; + Tcl_Size index; int status; if (objc != 3) { @@ -1160,7 +1160,7 @@ static int NotebookSelectCommand( } return TCL_OK; } else if (objc == 3) { - TkSizeT index; + Tcl_Size index; int status = GetTabIndex(interp, nb, objv[2], &index); if (status == TCL_OK) { SelectTab(nb, index); @@ -1180,7 +1180,7 @@ static int NotebookTabsCommand( Notebook *nb = (Notebook *)recordPtr; Ttk_Manager *mgr = nb->notebook.mgr; Tcl_Obj *result; - TkSizeT i; + Tcl_Size i; if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, ""); @@ -1204,7 +1204,7 @@ static int NotebookTabCommand( { Notebook *nb = (Notebook *)recordPtr; Ttk_Manager *mgr = nb->notebook.mgr; - TkSizeT index; + Tcl_Size index; Tk_Window window; Tab *tab; @@ -1362,8 +1362,8 @@ static void DisplayTab(Notebook *nb, int index, Drawable d) static void NotebookDisplay(void *clientData, Drawable d) { Notebook *nb = (Notebook *)clientData; - TkSizeT nContent = Ttk_NumberContent(nb->notebook.mgr); - TkSizeT index; + Tcl_Size nContent = Ttk_NumberContent(nb->notebook.mgr); + Tcl_Size index; /* Draw notebook background (base layout): */ diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 2a18682..0955210 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -206,7 +206,7 @@ static int ShoveUp(Paned *pw, int i, int pos) * Same as ShoveUp, but going in the opposite direction * and stopping at the sentinel sash. */ -static int ShoveDown(Paned *pw, TkSizeT i, int pos) +static int ShoveDown(Paned *pw, Tcl_Size i, int pos) { Pane *pane = (Pane *)Ttk_ContentData(pw->paned.mgr,i); int sashThickness = pw->paned.sashThickness; @@ -275,7 +275,7 @@ static void AdjustPanes(Paned *pw) { int sashThickness = pw->paned.sashThickness; int pos = 0; - TkSizeT index; + Tcl_Size index; for (index = 0; index < Ttk_NumberContent(pw->paned.mgr); ++index) { Pane *pane = (Pane *)Ttk_ContentData(pw->paned.mgr, index); @@ -372,7 +372,7 @@ static void PlacePanes(Paned *pw) int width = Tk_Width(pw->core.tkwin), height = Tk_Height(pw->core.tkwin); int sashThickness = pw->paned.sashThickness; int pos = 0; - TkSizeT index; + Tcl_Size index; for (index = 0; index < Ttk_NumberContent(pw->paned.mgr); ++index) { Pane *pane = (Pane *)Ttk_ContentData(pw->paned.mgr, index); @@ -403,7 +403,7 @@ static void PanedPlaceContent(void *managerData) PlacePanes(pw); } -static void PaneRemoved(void *managerData, TkSizeT index) +static void PaneRemoved(void *managerData, Tcl_Size index) { Paned *pw = (Paned *)managerData; Pane *pane = (Pane *)Ttk_ContentData(pw->paned.mgr, index); @@ -445,7 +445,7 @@ static int AddPane( * in order to avoid unexpected pane resizes (esp. while the * user is dragging a sash [#1325286]). */ -static int PaneRequest(void *managerData, TkSizeT index, int width, int height) +static int PaneRequest(void *managerData, Tcl_Size index, int width, int height) { Paned *pw = (Paned *)managerData; Pane *pane = (Pane *)Ttk_ContentData(pw->paned.mgr, index); @@ -606,7 +606,7 @@ static void DrawSash(Paned *pw, int index, Drawable d) static void PanedDisplay(void *recordPtr, Drawable d) { Paned *pw = (Paned *)recordPtr; - TkSizeT i, nContent = Ttk_NumberContent(pw->paned.mgr); + Tcl_Size i, nContent = Ttk_NumberContent(pw->paned.mgr); TtkWidgetDisplay(recordPtr, d); for (i = 1; i < nContent; ++i) { @@ -649,8 +649,8 @@ static int PanedInsertCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Paned *pw = (Paned *)recordPtr; - TkSizeT nContent = Ttk_NumberContent(pw->paned.mgr); - TkSizeT srcIndex, destIndex; + Tcl_Size nContent = Ttk_NumberContent(pw->paned.mgr); + Tcl_Size srcIndex, destIndex; Tk_Window window; if (objc < 4) { @@ -692,7 +692,7 @@ static int PanedForgetCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Paned *pw = (Paned *)recordPtr; - TkSizeT paneIndex; + Tcl_Size paneIndex; if (objc != 3) { Tcl_WrongNumArgs(interp, 2,objv, "pane"); @@ -772,7 +772,7 @@ static int PanedPaneCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Paned *pw = (Paned *)recordPtr; - TkSizeT paneIndex; + Tcl_Size paneIndex; Tk_Window window; Pane *pane; @@ -813,7 +813,7 @@ static int PanedPanesCommand( Paned *pw = (Paned *)recordPtr; Ttk_Manager *mgr = pw->paned.mgr; Tcl_Obj *panes; - TkSizeT i; + Tcl_Size i; if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, ""); @@ -848,7 +848,7 @@ static int PanedSashposCommand( if (Tcl_GetIntFromObj(interp, objv[2], &sashIndex) != TCL_OK) { return TCL_ERROR; } - if (sashIndex < 0 || (TkSizeT)sashIndex + 1 >= Ttk_NumberContent(pw->paned.mgr)) { + if (sashIndex < 0 || (Tcl_Size)sashIndex + 1 >= Ttk_NumberContent(pw->paned.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "sash index %d out of range", sashIndex)); Tcl_SetErrorCode(interp, "TTK", "PANE", "SASH_INDEX", NULL); diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c index 9e50ccb..57666cf 100644 --- a/generic/ttk/ttkTagSet.c +++ b/generic/ttk/ttkTagSet.c @@ -321,7 +321,7 @@ void Ttk_TagSetValues(Ttk_TagTable tagTable, Ttk_TagSet tagSet, void *record) for (i = 0; tagTable->optionSpecs[i].type != TK_OPTION_END; ++i) { const Tk_OptionSpec *optionSpec = tagTable->optionSpecs + i; - TkSizeT offset = optionSpec->objOffset; + Tcl_Size offset = optionSpec->objOffset; int prio = LOWEST_PRIORITY; for (j = 0; j < tagSet->nTags; ++j) { @@ -340,7 +340,7 @@ void Ttk_TagSetApplyStyle( const Tk_OptionSpec *optionSpec = tagTable->optionSpecs; while (optionSpec->type != TK_OPTION_END) { - TkSizeT offset = optionSpec->objOffset; + Tcl_Size offset = optionSpec->objOffset; const char *optionName = optionSpec->optionName; Tcl_Obj *val = Ttk_StyleMap(style, optionName, state); if (val) { diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index 3364971..e4b8f92 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -203,19 +203,11 @@ typedef void (Ttk_ElementSizeProc)(void *clientData, void *elementRecord, typedef void (Ttk_ElementDrawProc)(void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state); -#ifndef TkSizeT -# if TCL_MAJOR_VERSION > 8 -# define TkSizeT size_t -# else -# define TkSizeT int -# endif -#endif - typedef struct Ttk_ElementOptionSpec { const char *optionName; /* Command-line name of the widget option */ Tk_OptionType type; /* Accepted option types */ - TkSizeT offset; /* Offset of Tcl_Obj* field in element record */ + Tcl_Size offset; /* Offset of Tcl_Obj* field in element record */ const char *defaultValue; /* Default value to used if resource missing */ } Ttk_ElementOptionSpec; diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index e70bf04..ac638c6 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -59,7 +59,7 @@ struct TreeItemRec { int height; /* Height is in number of row heights */ Ttk_TagSet *cellTagSets; - TkSizeT nTagSets; + Tcl_Size nTagSets; /* * Derived resources: @@ -141,7 +141,7 @@ static TreeItem *NewItem(void) */ static void FreeItem(TreeItem *item) { - TkSizeT i; + Tcl_Size i; if (item->textObj) { Tcl_DecrRefCount(item->textObj); } if (item->imageObj) { Tcl_DecrRefCount(item->imageObj); } if (item->valuesObj) { Tcl_DecrRefCount(item->valuesObj); } @@ -483,8 +483,8 @@ typedef struct { /* Derived resources: */ Tcl_HashTable columnNames; /* Map: column name -> column table entry */ - TkSizeT nColumns; /* #columns */ - TkSizeT nDisplayColumns; /* #display columns */ + Tcl_Size nColumns; /* #columns */ + Tcl_Size nDisplayColumns; /* #display columns */ TreeColumn **displayColumns; /* List of columns for display (incl tree) */ int titleWidth; /* Width of non-scrolled columns */ int titleRows; /* Height of non-scrolled items, in rows */ @@ -646,7 +646,7 @@ static TreeColumn *GetColumn( Tcl_Interp *interp, Treeview *tv, Tcl_Obj *columnIDObj) { Tcl_HashEntry *entryPtr; - TkSizeT columnIndex; + Tcl_Size columnIndex; /* Check for named column: */ @@ -681,11 +681,11 @@ static TreeColumn *GetColumn( static TreeColumn *FindColumn( Tcl_Interp *interp, Treeview *tv, Tcl_Obj *columnIDObj) { - TkSizeT colno; + Tcl_Size colno; if (sscanf(Tcl_GetString(columnIDObj), "#%" TKSIZET_MODIFIER "d", &colno) == 1) { /* Display column specification, #n */ - if (colno != TCL_INDEX_NONE && (TkSizeT)colno < tv->tree.nDisplayColumns) { + if (colno != TCL_INDEX_NONE && (Tcl_Size)colno < tv->tree.nDisplayColumns) { return tv->tree.displayColumns[colno]; } /* else */ @@ -729,7 +729,7 @@ static TreeItem **GetItemListFromObj( { TreeItem **items; Tcl_Obj **elements; - TkSizeT i, nElements; + Tcl_Size i, nElements; if (Tcl_ListObjGetElements(interp,objPtr,&nElements,&elements) != TCL_OK) { return NULL; @@ -773,7 +773,7 @@ static Tcl_Obj *ItemID(Treeview *tv, TreeItem *item) */ static void TreeviewFreeColumns(Treeview *tv) { - TkSizeT i; + Tcl_Size i; Tcl_DeleteHashTable(&tv->tree.columnNames); Tcl_InitHashTable(&tv->tree.columnNames, TCL_STRING_KEYS); @@ -891,17 +891,17 @@ static int TreeviewInitDisplayColumns(Tcl_Interp *interp, Treeview *tv) */ static int TreeWidth(Treeview *tv) { - TkSizeT i = FirstColumn(tv); + Tcl_Size i = FirstColumn(tv); int width = 0; tv->tree.titleWidth = 0; while (i < tv->tree.nDisplayColumns) { - if (i == (TkSizeT)tv->tree.nTitleColumns) { + if (i == (Tcl_Size)tv->tree.nTitleColumns) { tv->tree.titleWidth = width; } width += tv->tree.displayColumns[i++]->width; } - if ((TkSizeT)tv->tree.nTitleColumns >= tv->tree.nDisplayColumns) { + if ((Tcl_Size)tv->tree.nTitleColumns >= tv->tree.nDisplayColumns) { tv->tree.titleWidth = width; } return width; @@ -978,7 +978,7 @@ static int ShoveLeft(Treeview *tv, int i, int n) */ static int ShoveRight(Treeview *tv, int i, int n) { - while (n != 0 && (TkSizeT)i < tv->tree.nDisplayColumns) { + while (n != 0 && (Tcl_Size)i < tv->tree.nDisplayColumns) { TreeColumn *c = tv->tree.displayColumns[i]; if (c->stretch) { n -= Stretch(c, n); @@ -999,7 +999,7 @@ static int DistributeWidth(Treeview *tv, int n) { int w = TreeWidth(tv); int m = 0; - TkSizeT i; + Tcl_Size i; int d, r; for (i = FirstColumn(tv); i < tv->tree.nDisplayColumns; ++i) { @@ -1092,7 +1092,7 @@ static int GetCellFromObj( /* colObj is short lived and do not keep a reference counted */ cell->colObj = elements[1]; if (displayColumnOnly) { - TkSizeT i = FirstColumn(tv); + Tcl_Size i = FirstColumn(tv); while (i < tv->tree.nDisplayColumns) { if (tv->tree.displayColumns[i] == cell->column) { break; @@ -1120,13 +1120,13 @@ static int GetCellFromObj( */ static TreeCell *GetCellListFromObj( - Tcl_Interp *interp, Treeview *tv, Tcl_Obj *objPtr, TkSizeT *nCells) + Tcl_Interp *interp, Treeview *tv, Tcl_Obj *objPtr, Tcl_Size *nCells) { TreeCell *cells; TreeCell cell; Tcl_Obj **elements; Tcl_Obj *oneCell; - TkSizeT i; + Tcl_Size i; int n; if (Tcl_ListObjGetElements(interp, objPtr, &n, &elements) != TCL_OK) { @@ -1146,7 +1146,7 @@ static TreeCell *GetCellListFromObj( } cells = (TreeCell *) ckalloc(n * sizeof(TreeCell)); - for (i = 0; i < (TkSizeT)n; ++i) { + for (i = 0; i < (Tcl_Size)n; ++i) { if (GetCellFromObj(interp, tv, elements[i], 0, NULL, &cells[i]) != TCL_OK) { ckfree(cells); return NULL; @@ -1164,7 +1164,7 @@ static TreeCell *GetCellListFromObj( */ static TreeItem *IdentifyItem(Treeview *tv, int y); /*forward*/ -static TkSizeT IdentifyDisplayColumn(Treeview *tv, int x, int *x1); /*forward*/ +static Tcl_Size IdentifyDisplayColumn(Treeview *tv, int x, int *x1); /*forward*/ static const unsigned long TreeviewBindEventMask = KeyPressMask|KeyReleaseMask @@ -1179,7 +1179,7 @@ static void TreeviewBindEventProc(void *clientData, XEvent *event) TreeItem *item = NULL; Ttk_TagSet tagset; int unused; - TkSizeT colno = TCL_INDEX_NONE; + Tcl_Size colno = TCL_INDEX_NONE; TreeColumn *column = NULL; /* @@ -1677,12 +1677,12 @@ static TreeItem *IdentifyItem(Treeview *tv, int y) * Returns the display column number at the specified x position, * or -1 if x is outside any columns. */ -static TkSizeT IdentifyDisplayColumn(Treeview *tv, int x, int *x1) +static Tcl_Size IdentifyDisplayColumn(Treeview *tv, int x, int *x1) { - TkSizeT colno = FirstColumn(tv); + Tcl_Size colno = FirstColumn(tv); int xpos = tv->tree.treeArea.x; - if ((TkSizeT)tv->tree.nTitleColumns <= colno) { + if ((Tcl_Size)tv->tree.nTitleColumns <= colno) { xpos -= tv->tree.xscroll.first; } @@ -1695,7 +1695,7 @@ static TkSizeT IdentifyDisplayColumn(Treeview *tv, int x, int *x1) } ++colno; xpos = next_xpos; - if ((TkSizeT)tv->tree.nTitleColumns == colno) { + if ((Tcl_Size)tv->tree.nTitleColumns == colno) { xpos -= tv->tree.xscroll.first; } } @@ -1767,7 +1767,7 @@ static int BoundingBox( if (column) { int xpos = 0; - TkSizeT i = FirstColumn(tv); + Tcl_Size i = FirstColumn(tv); while (i < tv->tree.nDisplayColumns) { if (tv->tree.displayColumns[i] == column) { break; @@ -1781,7 +1781,7 @@ static int BoundingBox( bbox.x += xpos; bbox.width = column->width; - if (i < (TkSizeT)tv->tree.nTitleColumns) { + if (i < (Tcl_Size)tv->tree.nTitleColumns) { /* Unscrollable column, remove scroll shift */ bbox.x += tv->tree.xscroll.first; } @@ -1816,7 +1816,7 @@ static const char *const regionStrings[] = { static TreeRegion IdentifyRegion(Treeview *tv, int x, int y) { int x1 = 0; - TkSizeT colno = IdentifyDisplayColumn(tv, x, &x1); + Tcl_Size colno = IdentifyDisplayColumn(tv, x, &x1); if (Ttk_BoxContains(tv->tree.headingArea, x, y)) { if (colno == TCL_INDEX_NONE) { @@ -2015,10 +2015,10 @@ static void DrawHeadings(Treeview *tv, Drawable d) int x0 = tv->tree.headingArea.x - tv->tree.xscroll.first; const int y0 = tv->tree.headingArea.y; const int h0 = tv->tree.headingArea.height; - TkSizeT i = FirstColumn(tv); + Tcl_Size i = FirstColumn(tv); int x = 0; - if ((TkSizeT)tv->tree.nTitleColumns > i) { + if ((Tcl_Size)tv->tree.nTitleColumns > i) { x = tv->tree.titleWidth; i = tv->tree.nTitleColumns; } @@ -2037,7 +2037,7 @@ static void DrawHeadings(Treeview *tv, Drawable d) x0 = tv->tree.headingArea.x; i = FirstColumn(tv); x = 0; - while ((i < (TkSizeT)tv->tree.nTitleColumns) && (i < tv->tree.nDisplayColumns)) { + while ((i < (Tcl_Size)tv->tree.nTitleColumns) && (i < tv->tree.nDisplayColumns)) { TreeColumn *column = tv->tree.displayColumns[i]; Ttk_Box parcel = Ttk_MakeBox(x0+x, y0, column->width, h0); DisplayLayout(tv->tree.headingLayout, @@ -2057,7 +2057,7 @@ static void DrawSeparators(Treeview *tv, Drawable d) DisplayItem displayItem; Ttk_Style style = Ttk_LayoutStyle(tv->tree.separatorLayout); int x = tv->tree.treeArea.x; - TkSizeT i; + Tcl_Size i; Ttk_TagSetDefaults(tv->tree.tagTable, style, &displayItem); @@ -2069,7 +2069,7 @@ static void DrawSeparators(Treeview *tv, Drawable d) if (!column->separator) continue; - if (i >= (TkSizeT)tv->tree.nTitleColumns) { + if (i >= (Tcl_Size)tv->tree.nTitleColumns) { xDraw -= tv->tree.xscroll.first; if (xDraw < tv->tree.titleWidth) continue; } @@ -2115,7 +2115,7 @@ static void PrepareItem( static void PrepareCells( Treeview *tv, TreeItem *item) { - TkSizeT i; + Tcl_Size i; int nValues = 0; Tcl_Obj **values = NULL; TreeColumn *column; @@ -2124,7 +2124,7 @@ static void PrepareCells( Tcl_ListObjGetElements(NULL, item->valuesObj, &nValues, &values); } for (i = 0; i < tv->tree.nColumns; ++i) { - tv->tree.columns[i].data = (i < (TkSizeT)nValues) ? values[i] : 0; + tv->tree.columns[i].data = (i < (Tcl_Size)nValues) ? values[i] : 0; tv->tree.columns[i].selected = 0; tv->tree.columns[i].tagset = NULL; } @@ -2134,7 +2134,7 @@ static void PrepareCells( if (item->selObj != NULL) { Tcl_ListObjGetElements(NULL, item->selObj, &nValues, &values); - for (i = 0; i < (TkSizeT)nValues; ++i) { + for (i = 0; i < (Tcl_Size)nValues; ++i) { column = FindColumn(NULL, tv, values[i]); /* Just in case. It should not be possible for column to be NULL */ if (column != NULL) { @@ -2166,7 +2166,7 @@ static void DrawCells( DisplayItem displayItemCell, displayItemCellSel; int rowHeight = tv->tree.rowHeight * item->height; int xPad = 0; - TkSizeT i; + Tcl_Size i; /* Adjust if the tree column has a separator */ if (tv->tree.showFlags & SHOW_TREE && tv->tree.column0.separator) { @@ -2194,8 +2194,8 @@ static void DrawCells( xPad = column->separator ? tv->tree.colSeparatorWidth/2 : 0; x += column->width; - if (title && i >= (TkSizeT)tv->tree.nTitleColumns) break; - if (!title && i < (TkSizeT)tv->tree.nTitleColumns) continue; + if (title && i >= (Tcl_Size)tv->tree.nTitleColumns) break; + if (!title && i < (Tcl_Size)tv->tree.nTitleColumns) continue; if (!title && x < tv->tree.titleWidth) continue; if (column->selected) { @@ -2273,7 +2273,7 @@ static void DrawItem( /* Draw row background for non-scrolled area: */ - if ((TkSizeT)tv->tree.nTitleColumns >= 1) { + if ((Tcl_Size)tv->tree.nTitleColumns >= 1) { Ttk_Box rowBox = Ttk_MakeBox(tv->tree.treeArea.x, y, tv->tree.titleWidth, rowHeight); DisplayLayout(tv->tree.rowLayout, &displayItem, state, rowBox, d); @@ -2337,7 +2337,7 @@ static void DrawItem( /* Draw non-scrolled data cells: */ - if ((TkSizeT)tv->tree.nTitleColumns > 1) { + if ((Tcl_Size)tv->tree.nTitleColumns > 1) { DrawCells(tv, item, &displayItem, &displayItemSel, d, xTitle, y, 1); } } @@ -2655,7 +2655,7 @@ static int TreeviewIndexCommand( { Treeview *tv = (Treeview *)recordPtr; TreeItem *item; - TkSizeT index = 0; + Tcl_Size index = 0; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "item"); @@ -2740,7 +2740,7 @@ static int TreeviewHorribleIdentify( const char *what = "nothing", *detail = NULL; TreeItem *item = 0; Tcl_Obj *result; - TkSizeT dColumnNumber; + Tcl_Size dColumnNumber; char dcolbuf[32]; int x, y, x1; (void)objc; @@ -2825,7 +2825,7 @@ static int TreeviewIdentifyCommand( Ttk_Box bbox; TreeItem *item; TreeColumn *column = 0; - TkSizeT colno; + Tcl_Size colno; int x1; if (objc == 4) { /* Old form */ @@ -3022,7 +3022,7 @@ static int TreeviewSetCommand( Treeview *tv = (Treeview *)recordPtr; TreeItem *item; TreeColumn *column; - TkSizeT columnNumber; + Tcl_Size columnNumber; if (objc < 3 || objc > 5) { Tcl_WrongNumArgs(interp, 2, objv, "item ?column ?value??"); @@ -3089,7 +3089,7 @@ static int TreeviewSetCommand( /* Make sure -values is fully populated: */ Tcl_ListObjLength(interp, item->valuesObj, &length); - while ((TkSizeT)length < tv->tree.nColumns) { + while ((Tcl_Size)length < tv->tree.nColumns) { Tcl_Obj *empty = Tcl_NewStringObj("",0); Tcl_ListObjAppendElement(interp, item->valuesObj, empty); ++length; @@ -3449,7 +3449,7 @@ static int TreeviewDragCommand( { Treeview *tv = (Treeview *)recordPtr; int left = tv->tree.treeArea.x - tv->tree.xscroll.first; - TkSizeT i = FirstColumn(tv); + Tcl_Size i = FirstColumn(tv); TreeColumn *column; int newx; @@ -3467,7 +3467,7 @@ static int TreeviewDragCommand( TreeColumn *c = tv->tree.displayColumns[i]; int right = left + c->width; if (c == column) { - if (i < (TkSizeT)tv->tree.nTitleColumns) { + if (i < (Tcl_Size)tv->tree.nTitleColumns) { /* Unscrollable column, remove scroll shift */ right += tv->tree.xscroll.first; } @@ -3751,7 +3751,7 @@ static int TreeviewCellSelectionCommand( Treeview *tv = (Treeview *)recordPtr; int selop, anyChange = 0; - TkSizeT i, nCells; + Tcl_Size i, nCells; TreeCell *cells; TreeItem *item; @@ -3760,7 +3760,7 @@ static int TreeviewCellSelectionCommand( for (item = tv->tree.root->children; item; item = NextPreorder(item)) { if (item->selObj != NULL) { int n; - TkSizeT elemc; + Tcl_Size elemc; Tcl_Obj **elemv; Tcl_ListObjGetElements(interp, item->selObj, &n, &elemv); @@ -4019,7 +4019,7 @@ static int TreeviewCtagHasCommand( { Treeview *tv = (Treeview *)recordPtr; TreeCell cell; - TkSizeT i, columnNumber; + Tcl_Size i, columnNumber; if (objc == 5) { /* Return list of all cells with tag */ Ttk_Tag tag = Ttk_GetTagFromObj(tv->tree.tagTable, objv[4]); @@ -4131,9 +4131,9 @@ static int TreeviewTagAddCommand( } /* Make sure tagset at column is allocated and initialised */ -static void AllocCellTagSets(Treeview *tv, TreeItem *item, TkSizeT columnNumber) +static void AllocCellTagSets(Treeview *tv, TreeItem *item, Tcl_Size columnNumber) { - TkSizeT i, newSize = MAX(columnNumber + 1, tv->tree.nColumns + 1); + Tcl_Size i, newSize = MAX(columnNumber + 1, tv->tree.nColumns + 1); if (item->nTagSets < newSize) { if (item->cellTagSets == NULL) { item->cellTagSets = (Ttk_TagSet *) @@ -4163,7 +4163,7 @@ static int TreeviewCtagAddCommand( Ttk_Tag tag; TreeCell *cells; TreeItem *item; - TkSizeT i, nCells, columnNumber; + Tcl_Size i, nCells, columnNumber; if (objc != 6) { Tcl_WrongNumArgs(interp, 4, objv, "tagName cells"); @@ -4209,7 +4209,7 @@ static void RemoveTag(TreeItem *item, Ttk_Tag tag) */ static void RemoveTagFromCellsAtItem(TreeItem *item, Ttk_Tag tag) { - TkSizeT i; + Tcl_Size i; for (i = 0; i < item->nTagSets; i++) { if (item->cellTagSets[i] != NULL) { @@ -4264,7 +4264,7 @@ static int TreeviewCtagRemoveCommand( Ttk_Tag tag; TreeCell *cells; TreeItem *item; - TkSizeT i, nCells, columnNumber; + Tcl_Size i, nCells, columnNumber; if (objc < 5 || objc > 6) { Tcl_WrongNumArgs(interp, 4, objv, "tagName ?cells?"); diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 38ead27..3155f36 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -372,7 +372,7 @@ TkGetCursorByName( { TkMacOSXCursor *macCursorPtr = NULL; const char **argv = NULL; - TkSizeT argc; + Tcl_Size argc; /* * All cursor names are valid lists of one element (for diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 496dc35..a25e451 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -823,7 +823,7 @@ Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ - int numBytes, /* Maximum number of bytes to consider from + Tcl_Size numBytes, /* Maximum number of bytes to consider from * source string. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length; don't consider any @@ -873,10 +873,10 @@ TkpMeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char * source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ - int numBytes, /* Maximum number of bytes to consider from + Tcl_Size numBytes, /* Maximum number of bytes to consider from * source string in all. */ - int rangeStart, /* Index of first byte to measure. */ - int rangeLength, /* Length of range to measure in bytes. */ + Tcl_Size rangeStart, /* Index of first byte to measure. */ + Tcl_Size rangeLength, /* Length of range to measure in bytes. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length; don't consider any * character that would cross this x-position. @@ -1081,7 +1081,7 @@ Tk_DrawChars( * passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ + Tcl_Size numBytes, /* Number of bytes in string. */ int x, int y) /* Coordinates at which to place origin of the * string when drawing. */ { @@ -1172,9 +1172,9 @@ TkpDrawAngledCharsInContext( * passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ - int rangeStart, /* Index of first byte to draw. */ - int rangeLength, /* Length of range to draw in bytes. */ + Tcl_Size numBytes, /* Number of bytes in string. */ + Tcl_Size rangeStart, /* Index of first byte to draw. */ + Tcl_Size rangeLength, /* Length of range to draw in bytes. */ double x, double y, /* Coordinates at which to place origin of the * whole (not just the range) string when * drawing. */ @@ -1195,7 +1195,7 @@ TkpDrawAngledCharsInContext( CGAffineTransform t; CGFloat width, height, textX = (CGFloat) x, textY = (CGFloat) y; - if (rangeStart < 0 || rangeLength <= 0 || + if (rangeStart == TCL_INDEX_NONE || rangeLength + 1 <= 1 || rangeStart + rangeLength > numBytes || !TkMacOSXSetupDrawingContext(drawable, gc, &drawingContext)) { return; diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index f42b91c..17a6a34 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -829,7 +829,7 @@ TkpConfigureMenuEntry( * have been added by the system. See [7185d26cf4]. */ - for (TkSizeT i = 0; i < menuRefPtr->menuPtr->numEntries; i++) { + for (Tcl_Size i = 0; i < menuRefPtr->menuPtr->numEntries; i++) { TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i]; NSMenuItem *item = (NSMenuItem *) submePtr->platformEntryData; [item setEnabled:(submePtr->state != ENTRY_DISABLED)]; @@ -1028,7 +1028,7 @@ TkpPostTearoffMenu( * at the given coordinates. */ - if (index < 0 || (TkSizeT)index >= menuPtr->numEntries) { + if (index < 0 || (Tcl_Size)index >= menuPtr->numEntries) { index = menuPtr->numEntries - 1; } if (index >= 0) { diff --git a/unix/configure b/unix/configure index 6b96ef4..0edc7ac 100755 --- a/unix/configure +++ b/unix/configure @@ -8900,14 +8900,18 @@ fi #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} -eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" -eval "TK_STUB_LIB_DIR=${libdir}" - +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}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" diff --git a/unix/configure.ac b/unix/configure.ac index cce5c29..19f91af 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -711,14 +711,18 @@ AC_SUBST(INSTALL_MSGS) #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} -eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" -eval "TK_STUB_LIB_DIR=${libdir}" - +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}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c index 46da1d1..a3c1d0b 100644 --- a/unix/tkUnixCursor.c +++ b/unix/tkUnixCursor.c @@ -180,7 +180,7 @@ static const struct TkCursorName { #endif static Cursor CreateCursorFromTableOrFile(Tcl_Interp *interp, - Tk_Window tkwin, TkSizeT argc, const char **argv, + Tk_Window tkwin, Tcl_Size argc, const char **argv, const struct TkCursorName *tkCursorPtr); /* @@ -210,7 +210,7 @@ TkGetCursorByName( { TkUnixCursor *cursorPtr = NULL; Cursor cursor = None; - TkSizeT argc; + Tcl_Size argc; const char **argv = NULL; Display *display = Tk_Display(tkwin); int inTkTable = 0; @@ -381,7 +381,7 @@ static Cursor CreateCursorFromTableOrFile( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which cursor will be used. */ - TkSizeT argc, + Tcl_Size argc, const char **argv, /* Cursor spec parsed into elements. */ const struct TkCursorName *tkCursorPtr) /* Non-NULL when cursor is defined in Tk diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index d706887..da10e31 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -1007,7 +1007,7 @@ Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ - int numBytes, /* Maximum number of bytes to consider from + Tcl_Size numBytes, /* Maximum number of bytes to consider from * source string. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length in pixels; don't @@ -1219,10 +1219,10 @@ TkpMeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ - TCL_UNUSED(int), /* Maximum number of bytes to consider from + TCL_UNUSED(Tcl_Size), /* Maximum number of bytes to consider from * source string in all. */ - int rangeStart, /* Index of first byte to measure. */ - int rangeLength, /* Length of range to measure in bytes. */ + Tcl_Size rangeStart, /* Index of first byte to measure. */ + Tcl_Size rangeLength, /* Length of range to measure in bytes. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length; don't consider any * character that would cross this x-position. @@ -1276,7 +1276,7 @@ Tk_DrawChars( * is passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ + Tcl_Size numBytes, /* Number of bytes in string. */ int x, int y) /* Coordinates at which to place origin of * string when drawing. */ { @@ -1443,9 +1443,9 @@ TkpDrawAngledCharsInContext( * passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ - int rangeStart, /* Index of first byte to draw. */ - int rangeLength, /* Length of range to draw in bytes. */ + Tcl_Size numBytes, /* Number of bytes in string. */ + Tcl_Size rangeStart, /* Index of first byte to draw. */ + Tcl_Size rangeLength, /* Length of range to draw in bytes. */ double x, double y, /* Coordinates at which to place origin of the * whole (not just the range) string when * drawing. */ diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 16adcf3..109fa4f 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -100,7 +100,7 @@ TkpGetString( XEvent *eventPtr, /* X keyboard event. */ Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */ { - TkSizeT len; + Tcl_Size len; Tcl_DString buf; TkKeyEvent *kePtr = (TkKeyEvent *) eventPtr; diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index c1cd2b5..136506d 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -706,7 +706,7 @@ Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ - int numBytes, /* Maximum number of bytes to consider from + Tcl_Size numBytes, /* Maximum number of bytes to consider from * source string. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length in pixels; don't @@ -822,9 +822,9 @@ int TkpMeasureCharsInContext( Tk_Font tkfont, const char *source, - int numBytes, - int rangeStart, - int rangeLength, + Tcl_Size numBytes, + Tcl_Size rangeStart, + Tcl_Size rangeLength, int maxLength, int flags, int *lengthPtr) @@ -934,7 +934,7 @@ Tk_DrawChars( * is passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ + Tcl_Size numBytes, /* Number of bytes in string. */ int x, int y) /* Coordinates at which to place origin of * string when drawing. */ { @@ -1406,9 +1406,9 @@ TkpDrawAngledCharsInContext( * passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ - int rangeStart, /* Index of first byte to draw. */ - int rangeLength, /* Length of range to draw in bytes. */ + Tcl_Size numBytes, /* Number of bytes in string. */ + Tcl_Size rangeStart, /* Index of first byte to draw. */ + Tcl_Size rangeLength, /* Length of range to draw in bytes. */ double x, double y, /* Coordinates at which to place origin of the * whole (not just the range) string when * drawing. */ diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index a49fdc3..d6f48a8 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -3056,7 +3056,7 @@ WmProtocolCmd( ProtocolHandler *protPtr, *prevPtr; Atom protocol; const char *cmd; - TkSizeT cmdLength; + Tcl_Size cmdLength; if ((objc < 3) || (objc > 5)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?"); @@ -5508,7 +5508,7 @@ SetNetWmType( for (n = 0; n < objc; ++n) { Tcl_DString ds, dsName; - TkSizeT len; + Tcl_Size len; char *name = Tcl_GetStringFromObj(objv[n], &len); Tcl_UtfToUpper(name); diff --git a/win/configure b/win/configure index 1cdc6f4..bb26d7a 100755 --- a/win/configure +++ b/win/configure @@ -5871,7 +5871,11 @@ else fi fi -eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" +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 # 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 @@ -5883,7 +5887,11 @@ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}${VER}${LIBFLAGSUFFIX}\"" TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" eval "TK_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_LIB_FLAG}\"" -eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" +if test "${TCL_MAJOR_VERSION}" -gt 8 ; then + eval "TK_STUB_LIB_FLAG=\"-ltkstub${LIBFLAGSUFFIX}\"" +else + eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" +fi eval "TK_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_STUB_LIB_FLAG}\"" TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" diff --git a/win/configure.ac b/win/configure.ac index c843ebc..ae5a1e3 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -259,7 +259,11 @@ else fi fi -eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" +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 # 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 @@ -271,7 +275,11 @@ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}${VER}${LIBFLAGSUFFIX}\"" TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" eval "TK_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_LIB_FLAG}\"" -eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" +if test "${TCL_MAJOR_VERSION}" -gt 8 ; then + eval "TK_STUB_LIB_FLAG=\"-ltkstub${LIBFLAGSUFFIX}\"" +else + eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" +fi eval "TK_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_STUB_LIB_FLAG}\"" TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" diff --git a/win/rules.vc b/win/rules.vc index 47c0742..4280b9b 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -693,7 +693,7 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg !if [echo REM = This file is generated from rules.vc > versions.vc] !endif !if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] + && [nmakehlp -V "$(_TCL_H)" "define TCL_MAJOR_VERSION" >> versions.vc] !endif !if [echo TCL_MINOR_VERSION = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] @@ -1146,7 +1146,11 @@ TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) TCLSCRIPTZIP = $(OUT_DIR)\$(TCLSCRIPTZIPNAME) +!if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib +!else +TCLSTUBLIBNAME = $(STUBPREFIX).lib +!endif TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" @@ -1162,7 +1166,11 @@ TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe !endif +!if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib +!else +TCLSTUBLIB = $(_TCLDIR)\lib\tclstub.lib +!endif TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. @@ -1182,7 +1190,11 @@ TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe !if !exist($(TCLSH)) TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe !endif +!if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib +!else +TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub.lib +!endif TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. @@ -1282,7 +1294,11 @@ PRJLIBNAME = $(PRJLIBNAME9) !endif PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) +!if $(TCL_MAJOR_VERSION) == 8 PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib +!else +PRJSTUBLIBNAME = $(STUBPREFIX).lib +!endif PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) # If extension parent makefile has not defined a resource definition file, @@ -1418,7 +1434,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1 !endif -!if "$(TCL_MAJOR_VERSION)" == "8" +!if $(TCL_MAJOR_VERSION) == 8 !if "$(_USE_64BIT_TIME_T)" == "1" OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1 !endif diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index d79ab5f..cd4d46d 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -98,7 +98,7 @@ TkGetCursorByName( { const struct CursorName *namePtr; TkWinCursor *cursorPtr; - TkSizeT argc; + Tcl_Size argc; const char **argv = NULL; (void)tkwin; diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 0bfc7f1..2e1b9d3 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -2056,7 +2056,7 @@ MakeFilter( *p = '\0'; } else { - TkSizeT len; + Tcl_Size len; if (valuePtr == NULL) { len = 0; diff --git a/win/tkWinFont.c b/win/tkWinFont.c index ddee969..3812c3a 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -790,7 +790,7 @@ Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ - int numBytes, /* Maximum number of bytes to consider from + Tcl_Size numBytes, /* Maximum number of bytes to consider from * source string. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length in pixels; don't @@ -1018,8 +1018,8 @@ TkpMeasureCharsInContext( * '\0' terminated. */ TCL_UNUSED(int), /* Maximum number of bytes to consider from * source string in all. */ - int rangeStart, /* Index of first byte to measure. */ - int rangeLength, /* Length of range to measure in bytes. */ + Tcl_Size rangeStart, /* Index of first byte to measure. */ + Tcl_Size rangeLength, /* Length of range to measure in bytes. */ int maxLength, /* If >= 0, maxLength specifies the longest * permissible line length; don't consider any * character that would cross this x-position. @@ -1072,7 +1072,7 @@ Tk_DrawChars( * is passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ + Tcl_Size numBytes, /* Number of bytes in string. */ int x, int y) /* Coordinates at which to place origin of * string when drawing. */ { @@ -1416,9 +1416,9 @@ TkpDrawAngledCharsInContext( * passed to this function. If they are not * stripped out, they will be displayed as * regular printing characters. */ - int numBytes, /* Number of bytes in string. */ - int rangeStart, /* Index of first byte to draw. */ - int rangeLength, /* Length of range to draw in bytes. */ + Tcl_Size numBytes, /* Number of bytes in string. */ + Tcl_Size rangeStart, /* Index of first byte to draw. */ + Tcl_Size rangeLength, /* Length of range to draw in bytes. */ double x, double y, /* Coordinates at which to place origin of the * whole (not just the range) string when * drawing. */ diff --git a/win/tkWinInit.c b/win/tkWinInit.c index f171fa2..cb77c62 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -70,7 +70,7 @@ TkpGetAppName( Tcl_Interp *interp, Tcl_DString *namePtr) /* A previously initialized Tcl_DString. */ { - TkSizeT argc, namelength; + Tcl_Size argc, namelength; const char **argv = NULL, *name, *p; name = Tcl_GetVar2(interp, "argv0", NULL, TCL_GLOBAL_ONLY); diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 5c31ca0..bee43b7 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -1258,7 +1258,7 @@ TkWinHandleMenuEvent( hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable, *plParam); if (hashEntryPtr != NULL) { - TkSizeT i, len; + Tcl_Size i, len; int underline; Tcl_Obj *labelPtr; WCHAR *wlabel; @@ -1286,7 +1286,7 @@ TkWinHandleMenuEvent( Tcl_DStringFree(&ds); Tcl_DStringInit(&ds); wlabel = Tcl_UtfToWCharDString(src, len, &ds); - if (((TkSizeT)underline + 1 < len + 1) && (menuChar == + if (((Tcl_Size)underline + 1 < len + 1) && (menuChar == Tcl_UniCharToUpper(wlabel[underline]))) { *plResult = (2 << 16) | i; returnResult = 1; @@ -1474,7 +1474,7 @@ void RecursivelyClearActiveMenu( TkMenu *menuPtr) /* The menu to reset. */ { - TkSizeT i; + Tcl_Size i; TkMenuEntry *mePtr; TkActivateMenuEntry(menuPtr, -1); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index e568f0c..d647688 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2685,7 +2685,7 @@ Tk_WmObjCmd( WMOPT_WITHDRAW }; int index; - TkSizeT length; + Tcl_Size length; const char *argv1; TkWindow *winPtr, **winPtrPtr = &winPtr; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; @@ -2915,7 +2915,7 @@ WmAttributesCmd( LONG style, exStyle, styleBit, *stylePtr = NULL; const char *string; int i, boolean; - TkSizeT length; + Tcl_Size length; int config_fullscreen = 0, updatewrapper = 0; int fullscreen_attr_changed = 0, fullscreen_attr = 0; @@ -3212,7 +3212,7 @@ WmClientCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; - TkSizeT length; + Tcl_Size length; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?name?"); @@ -3813,7 +3813,7 @@ WmGroupCmd( WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; const char *argv3; - TkSizeT length; + Tcl_Size length; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?"); @@ -4246,7 +4246,7 @@ WmIconnameCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; - TkSizeT length; + Tcl_Size length; if (objc > 4) { Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?"); @@ -4874,7 +4874,7 @@ WmProtocolCmd( ProtocolHandler *protPtr, *prevPtr; Atom protocol; const char *cmd; - TkSizeT cmdLength; + Tcl_Size cmdLength; Tcl_Obj *resultObj; if ((objc < 3) || (objc > 5)) { @@ -5367,7 +5367,7 @@ WmTitleCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; - TkSizeT length; + Tcl_Size length; HWND wrapper; if (objc > 4) { diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 6917192..5d3e1ce 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -832,7 +832,7 @@ static void TextElementSize( RECT rc = {0, 0}; HRESULT hr = S_OK; const char *src; - TkSizeT len; + Tcl_Size len; Tcl_DString ds; if (!InitElementData(elementData, tkwin, 0)) @@ -871,7 +871,7 @@ static void TextElementDraw( RECT rc = BoxToRect(b); HRESULT hr = S_OK; const char *src; - TkSizeT len; + Tcl_Size len; Tcl_DString ds; if (!InitElementData(elementData, tkwin, d)) @@ -1120,7 +1120,7 @@ Ttk_CreateVsapiElement( Ttk_StateTable *stateTable; Ttk_Padding pad = {0, 0, 0, 0}; int flags = 0; - TkSizeT length = 0; + Tcl_Size length = 0; char *name; LPWSTR wname; const Ttk_ElementSpec *elementSpec = &GenericElementSpec; -- cgit v0.12 From 12ddb522354b462f3c3b204714a31af0eaf71859 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 27 Jun 2022 11:20:50 +0000 Subject: Update rules.vc (add OPTS=tcl8) --- win/rules.vc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/win/rules.vc b/win/rules.vc index 4280b9b..6e06943 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -877,6 +877,11 @@ TCL_THREADS = 0 USE_THREAD_ALLOC= 0 !endif +!if [nmakehlp -f $(OPTS) "tcl8"] +!message *** Build for Tcl8 +TCL_MAJOR_VERSION = 8 +!endif + !if $(TCL_MAJOR_VERSION) == 8 !if [nmakehlp -f $(OPTS) "time64bit"] !message *** Force 64-bit time_t @@ -1445,6 +1450,9 @@ COMPILERFLAGS = /D_ATL_XP_TARGETING !if "$(TCL_UTF_MAX)" == "3" OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=3 !endif +!if $(TCL_MAJOR_VERSION) == 8 +OPTDEFINES = $(OPTDEFINES) /DTCL_MAJOR_VERSION=8 +!endif # Like the TEA system only set this non empty for non-Tk extensions # Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME -- cgit v0.12