diff options
106 files changed, 1156 insertions, 1215 deletions
diff --git a/doc/BindTable.3 b/doc/BindTable.3 index 772f39f..af2c8c5 100644 --- a/doc/BindTable.3 +++ b/doc/BindTable.3 @@ -41,7 +41,7 @@ used for returning results and errors from binding procedures. .AP Tk_BindingTable bindingTable in Token for binding table; must have been returned by some previous call to \fBTk_CreateBindingTable\fR. -.AP ClientData object in +.AP "void *" object in Identifies object with which binding is associated. .AP "const char" *eventString in String describing event sequence. @@ -55,9 +55,9 @@ X event to match against bindings in \fIbindingTable\fR. .AP Tk_Window tkwin in Identifier for any window on the display where the event occurred. Used to find display-related information such as key maps. -.AP int numObjects in +.AP Tcl_Size numObjects in Number of object identifiers pointed to by \fIobjectPtr\fR. -.AP ClientData *objectPtr in +.AP "void **" objectPtr in Points to an array of object identifiers: bindings will be considered for each of these objects in order from first to last. .BE diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3 index f789d3c..3678085 100644 --- a/doc/CanvPsY.3 +++ b/doc/CanvPsY.3 @@ -30,7 +30,7 @@ int int \fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) .SH ARGUMENTS -.AS "unsigned int" "numPoints" +.AS Tcl_Size "numPoints" .AP Tk_Canvas canvas in A token that identifies a canvas widget for which Postscript is being generated. @@ -58,7 +58,7 @@ Pointer to an array of coordinates for one or more points specified in canvas coordinates. The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, and so on. -.AP int numPoints in +.AP Tcl_Size numPoints in Number of points at \fIcoordPtr\fR. .BE .SH DESCRIPTION diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index 927925c..e29daa8 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -536,22 +536,22 @@ of the a type and creating a structure pointing to those procedures: typedef struct Tk_CustomOption { Tk_OptionParseProc *\fIparseProc\fR; Tk_OptionPrintProc *\fIprintProc\fR; - ClientData \fIclientData\fR; + void *\fIclientData\fR; } \fBTk_CustomOption\fR; typedef int \fBTk_OptionParseProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, char *\fIvalue\fR, char *\fIwidgRec\fR, - int \fIoffset\fR); + Tcl_Size \fIoffset\fR); typedef const char *\fBTk_OptionPrintProc\fR( - ClientData \fIclientData\fR, + void *\fIclientData\fR, Tk_Window \fItkwin\fR, char *\fIwidgRec\fR, - int \fIoffset\fR, + Tcl_Size \fIoffset\fR, Tcl_FreeProc **\fIfreeProcPtr\fR); .CE The Tk_CustomOption structure contains three fields, which are pointers diff --git a/generic/tk.decls b/generic/tk.decls index 2e89147..2382a76 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -54,8 +54,8 @@ declare 5 { } declare 6 { void Tk_BindEvent(Tk_BindingTable bindingTable, - XEvent *eventPtr, Tk_Window tkwin, int numObjects, - ClientData *objectPtr) + XEvent *eventPtr, Tk_Window tkwin, Tcl_Size numObjects, + void **objectPtr) } declare 7 { void Tk_CanvasDrawableCoords(Tk_Canvas canvas, @@ -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, @@ -101,12 +101,12 @@ declare 17 { void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc) } declare 18 { - int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + int Tk_CanvasTagsParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *Tk_CanvasTagsPrintProc(void *clientData, Tk_Window tkwin, + 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) } @@ -164,7 +164,7 @@ declare 32 { } declare 33 { unsigned long Tk_CreateBinding(Tcl_Interp *interp, - Tk_BindingTable bindingTable, ClientData object, + Tk_BindingTable bindingTable, void *object, const char *eventStr, const char *script, int append) } declare 34 { @@ -173,15 +173,15 @@ declare 34 { declare 35 { Tk_ErrorHandler Tk_CreateErrorHandler(Display *display, int errNum, int request, int minorCode, - Tk_ErrorProc *errorProc, ClientData clientData) + Tk_ErrorProc *errorProc, void *clientData) } declare 36 { void Tk_CreateEventHandler(Tk_Window token, unsigned long mask, Tk_EventProc *proc, - ClientData clientData) + void *clientData) } declare 37 { - void Tk_CreateGenericHandler(Tk_GenericProc *proc, ClientData clientData) + void Tk_CreateGenericHandler(Tk_GenericProc *proc, void *clientData) } declare 38 { void Tk_CreateImageType(const Tk_ImageType *typePtr) @@ -195,7 +195,7 @@ declare 40 { declare 41 { void Tk_CreateSelHandler(Tk_Window tkwin, Atom selection, Atom target, - Tk_SelectionProc *proc, ClientData clientData, + Tk_SelectionProc *proc, void *clientData, Atom format) } declare 42 { @@ -214,11 +214,11 @@ declare 45 { void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor) } declare 46 { - void Tk_DeleteAllBindings(Tk_BindingTable bindingTable, ClientData object) + void Tk_DeleteAllBindings(Tk_BindingTable bindingTable, void *object) } declare 47 { int Tk_DeleteBinding(Tcl_Interp *interp, - Tk_BindingTable bindingTable, ClientData object, + Tk_BindingTable bindingTable, void *object, const char *eventStr) } declare 48 { @@ -230,10 +230,10 @@ declare 49 { declare 50 { void Tk_DeleteEventHandler(Tk_Window token, unsigned long mask, Tk_EventProc *proc, - ClientData clientData) + void *clientData) } declare 51 { - void Tk_DeleteGenericHandler(Tk_GenericProc *proc, ClientData clientData) + void Tk_DeleteGenericHandler(Tk_GenericProc *proc, void *clientData) } declare 52 { void Tk_DeleteImage(Tcl_Interp *interp, const char *name) @@ -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 { @@ -341,7 +341,7 @@ declare 80 { } declare 81 { void Tk_GetAllBindings(Tcl_Interp *interp, - Tk_BindingTable bindingTable, ClientData object) + Tk_BindingTable bindingTable, void *object) } declare 82 { int Tk_GetAnchor(Tcl_Interp *interp, @@ -352,7 +352,7 @@ declare 83 { } declare 84 { const char *Tk_GetBinding(Tcl_Interp *interp, - Tk_BindingTable bindingTable, ClientData object, + Tk_BindingTable bindingTable, void *object, const char *eventStr) } declare 85 { @@ -400,10 +400,10 @@ declare 96 { } declare 97 { Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin, const char *name, - Tk_ImageChangedProc *changeProc, ClientData clientData) + Tk_ImageChangedProc *changeProc, void *clientData) } declare 98 { - ClientData Tk_GetImageModelData(Tcl_Interp *interp, + void *Tk_GetImageModelData(Tcl_Interp *interp, const char *name, const Tk_ImageType **typePtrPtr) } declare 99 { @@ -448,7 +448,7 @@ declare 109 { declare 110 { int Tk_GetSelection(Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, - Tk_GetSelProc *proc, ClientData clientData) + Tk_GetSelProc *proc, void *clientData) } declare 111 { Tk_Uid Tk_GetUid(const char *str) @@ -497,14 +497,14 @@ declare 123 { } declare 124 { void Tk_ManageGeometry(Tk_Window tkwin, - const Tk_GeomMgr *mgrPtr, ClientData clientData) + const Tk_GeomMgr *mgrPtr, void *clientData) } declare 125 { void Tk_MapWindow(Tk_Window tkwin) } 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 { @@ -557,7 +557,7 @@ declare 141 { declare 142 { void Tk_OwnSelection(Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, - ClientData clientData) + void *clientData) } declare 143 { int Tk_ParseArgv(Tcl_Interp *interp, @@ -615,7 +615,7 @@ declare 157 { } declare 158 { Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc, - ClientData arg, ClientData *prevArgPtr) + void *arg, void **prevArgPtr) } declare 159 { int Tk_SafeInit(Tcl_Interp *interp) @@ -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, @@ -924,7 +924,7 @@ declare 241 { } declare 242 { void Tk_SetClassProcs(Tk_Window tkwin, - const Tk_ClassProcs *procs, ClientData instanceData) + const Tk_ClassProcs *procs, void *instanceData) } # New in 8.4a4 @@ -975,7 +975,7 @@ declare 252 { } declare 253 { Tk_Style Tk_CreateStyle(const char *name, Tk_StyleEngine engine, - ClientData clientData) + void *clientData) } declare 254 { Tk_Style Tk_GetStyle(Tcl_Interp *interp, const char *name) @@ -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 9697a9c..581aad5 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -65,7 +65,12 @@ extern "C" { * the version of Tcl that this release of Tk is compiled against. */ -#define TK_MAJOR_VERSION 8 +#ifndef TK_MAJOR_VERSION +# define TK_MAJOR_VERSION 8 +#endif +#if TK_MAJOR_VERSION != 8 +# error "This header-file is for Tk 8 only" +#endif #define TK_MINOR_VERSION 7 #define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE #define TK_RELEASE_SERIAL 6 @@ -141,6 +146,10 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; */ typedef const char *Tk_Uid; + +#ifndef Tcl_Size +# define Tcl_Size int +#endif /* *---------------------------------------------------------------------- @@ -190,14 +199,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 +213,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 @@ -239,22 +243,14 @@ 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); -typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData, - Tk_Window tkwin, char *widgRec, size_t offset); -#else -typedef int (Tk_CustomOptionSetProc) (ClientData clientData, +typedef int (Tk_CustomOptionSetProc) (void *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 -typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData, + Tcl_Size offset, char *saveInternalPtr, int flags); +typedef Tcl_Obj *(Tk_CustomOptionGetProc) (void *clientData, + Tk_Window tkwin, char *widgRec, Tcl_Size offset); +typedef void (Tk_CustomOptionRestoreProc) (void *clientData, Tk_Window tkwin, char *internalPtr, char *saveInternalPtr); -typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin, +typedef void (Tk_CustomOptionFreeProc) (void *clientData, Tk_Window tkwin, char *internalPtr); typedef struct Tk_ObjCustomOption { @@ -272,7 +268,7 @@ typedef struct Tk_ObjCustomOption { Tk_CustomOptionFreeProc *freeProc; /* Function to use to free the internal * representation of an option. */ - ClientData clientData; /* Arbitrary one-word value passed to the + void *clientData; /* Arbitrary one-word value passed to the * handling procs. */ } Tk_ObjCustomOption; @@ -327,11 +323,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; @@ -355,17 +347,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); -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 +typedef int (Tk_OptionParseProc) (void *clientData, Tcl_Interp *interp, + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); +typedef const char *(Tk_OptionPrintProc) (void *clientData, + Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); typedef struct Tk_CustomOption { Tk_OptionParseProc *parseProc; @@ -374,7 +359,7 @@ typedef struct Tk_CustomOption { Tk_OptionPrintProc *printProc; /* Procedure to return a printable string * describing an existing option. */ - ClientData clientData; /* Arbitrary one-word value used by option + void *clientData; /* Arbitrary one-word value used by option * parser: passed to parseProc and * printProc. */ } Tk_CustomOption; @@ -396,13 +381,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. */ @@ -606,16 +587,12 @@ typedef struct Tk_FontMetrics { */ typedef Window (Tk_ClassCreateProc) (Tk_Window tkwin, Window parent, - ClientData instanceData); -typedef void (Tk_ClassWorldChangedProc) (ClientData instanceData); + void *instanceData); +typedef void (Tk_ClassWorldChangedProc) (void *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 @@ -640,12 +617,12 @@ typedef struct Tk_ClassProcs { * * #define Tk_GetField(name, who, which) \ * (((who) == NULL) ? NULL : - * (((who)->size <= offsetof(name, which)) ? NULL :(name)->which)) + * (((size_t)(who)->size <= offsetof(name, which)) ? NULL :(name)->which)) */ #define Tk_GetClassProc(procs, which) \ (((procs) == NULL) ? NULL : \ - (((procs)->size <= offsetof(Tk_ClassProcs, which)) ? NULL:(procs)->which)) + (((size_t)(procs)->size <= offsetof(Tk_ClassProcs, which)) ? NULL:(procs)->which)) /* * Each geometry manager (the packer, the placer, etc.) is represented by a @@ -654,8 +631,8 @@ typedef struct Tk_ClassProcs { */ #define Tk_GeomLostSlaveProc Tk_GeomLostContentProc -typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin); -typedef void (Tk_GeomLostContentProc) (ClientData clientData, Tk_Window tkwin); +typedef void (Tk_GeomRequestProc) (void *clientData, Tk_Window tkwin); +typedef void (Tk_GeomLostContentProc) (void *clientData, Tk_Window tkwin); typedef struct Tk_GeomMgr { const char *name; /* Name of the geometry manager (command used @@ -838,22 +815,17 @@ typedef struct Tk_FakeWin { #if defined(TK_USE_INPUT_METHODS) || (TCL_MAJOR_VERSION > 8) 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 + void **dummy10; /* tagPtr */ + Tcl_Size dummy11; /* numTags */ + Tcl_Size dummy12; /* optionLevel */ char *dummy13; /* selHandlerList */ char *dummy14; /* geomMgrPtr */ - ClientData dummy15; /* geomData */ + void *dummy15; /* geomData */ int reqWidth, reqHeight; int internalBorderLeft; char *dummy16; /* wmInfoPtr */ char *dummy17; /* classProcPtr */ - ClientData dummy18; /* instanceData */ + void *dummy18; /* instanceData */ char *dummy19; /* privatePtr */ int internalBorderRight; int internalBorderTop; @@ -992,12 +964,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. */ @@ -1006,14 +974,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 @@ -1075,17 +1039,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); -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); + Tcl_Size 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); @@ -1105,33 +1062,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); -typedef size_t (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t offset, char *buffer, size_t 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); + Tcl_Size index); +typedef Tcl_Size (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, + Tcl_Size offset, char *buffer, Tcl_Size 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. */ @@ -1213,25 +1157,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 @@ -1313,21 +1249,21 @@ typedef struct Tk_ImageType Tk_ImageType; #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE) typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc, char **argv, Tk_ImageType *typePtr, Tk_ImageModel model, - ClientData *clientDataPtr); + void **clientDataPtr); #else typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, int objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, - ClientData *clientDataPtr); + void **clientDataPtr); #endif /* USE_OLD_IMAGE */ -typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData clientData); -typedef void (Tk_ImageDisplayProc) (ClientData clientData, Display *display, +typedef void *(Tk_ImageGetProc) (Tk_Window tkwin, void *clientData); +typedef void (Tk_ImageDisplayProc) (void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); -typedef void (Tk_ImageFreeProc) (ClientData clientData, Display *display); -typedef void (Tk_ImageDeleteProc) (ClientData clientData); -typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y, +typedef void (Tk_ImageFreeProc) (void *clientData, Display *display); +typedef void (Tk_ImageDeleteProc) (void *clientData); +typedef void (Tk_ImageChangedProc) (void *clientData, int x, int y, int width, int height, int imageWidth, int imageHeight); -typedef int (Tk_ImagePostscriptProc) (ClientData clientData, +typedef int (Tk_ImagePostscriptProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass); @@ -1560,16 +1496,16 @@ struct Tk_PhotoImageFormatVersion3 { * declare widget elements. */ -typedef void (Tk_GetElementSizeProc) (ClientData clientData, char *recordPtr, +typedef void (Tk_GetElementSizeProc) (void *clientData, char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); -typedef void (Tk_GetElementBoxProc) (ClientData clientData, char *recordPtr, +typedef void (Tk_GetElementBoxProc) (void *clientData, char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); -typedef int (Tk_GetElementBorderWidthProc) (ClientData clientData, +typedef int (Tk_GetElementBorderWidthProc) (void *clientData, char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin); -typedef void (Tk_DrawElementProc) (ClientData clientData, char *recordPtr, +typedef void (Tk_DrawElementProc) (void *clientData, char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state); @@ -1682,22 +1618,17 @@ EXTERN const char * Tk_PkgInitStubsCheck(Tcl_Interp *interp, *---------------------------------------------------------------------- */ -typedef int (Tk_ErrorProc) (ClientData clientData, XErrorEvent *errEventPtr); -typedef void (Tk_EventProc) (ClientData clientData, XEvent *eventPtr); -typedef int (Tk_GenericProc) (ClientData clientData, XEvent *eventPtr); +typedef int (Tk_ErrorProc) (void *clientData, XErrorEvent *errEventPtr); +typedef void (Tk_EventProc) (void *clientData, XEvent *eventPtr); +typedef int (Tk_GenericProc) (void *clientData, XEvent *eventPtr); typedef int (Tk_ClientMessageProc) (Tk_Window tkwin, XEvent *eventPtr); -typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp, +typedef int (Tk_GetSelProc) (void *clientData, Tcl_Interp *interp, const char *portion); -typedef void (Tk_LostSelProc) (ClientData clientData); -typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData, +typedef void (Tk_LostSelProc) (void *clientData); +typedef Tk_RestrictAction (Tk_RestrictProc) (void *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 Tcl_Size (Tk_SelectionProc) (void *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 ceaa468..4971aad 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2177,7 +2177,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; @@ -2202,6 +2202,7 @@ Tk_BindEvent( unsigned arraySize; unsigned newArraySize; unsigned i, k; + int numObjects = numObjects1; assert(bindPtr); assert(eventPtr); diff --git a/generic/tkButton.h b/generic/tkButton.h index 59d15a2..52e861a 100644 --- a/generic/tkButton.h +++ b/generic/tkButton.h @@ -308,14 +308,14 @@ MODULE_SCOPE char tkDefLabelPady[TCL_INTEGER_SPACE]; #ifndef TkpButtonSetDefaults MODULE_SCOPE void TkpButtonSetDefaults(void); #endif -MODULE_SCOPE void TkButtonWorldChanged(ClientData instanceData); +MODULE_SCOPE void TkButtonWorldChanged(void *instanceData); MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr); MODULE_SCOPE TkButton *TkpCreateButton(Tk_Window tkwin); #ifndef TkpDestroyButton MODULE_SCOPE void TkpDestroyButton(TkButton *butPtr); #endif #ifndef TkpDisplayButton -MODULE_SCOPE void TkpDisplayButton(ClientData clientData); +MODULE_SCOPE void TkpDisplayButton(void *clientData); #endif MODULE_SCOPE int TkInvokeButton(TkButton *butPtr); 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 db19aef..f6bb678 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. */ @@ -152,7 +152,7 @@ UnderlinePrintProc( (void)tkwin; if (underline == INT_MIN) { -#if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9 +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 p = (char *)"-1"; #else p = (char *)""; @@ -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 c008913..4cd734f 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -675,7 +675,7 @@ DoObjConfig( break; } case TK_OPTION_INDEX: { - TkSizeT newIndex; + Tcl_Size newIndex; if (TkGetIntForIndex(valuePtr, TCL_INDEX_END, 0, &newIndex) != TCL_OK) { if (interp) { @@ -685,7 +685,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++; } @@ -728,7 +728,7 @@ DoObjConfig( case TK_OPTION_STRING: { char *newStr; const char *value; - TkSizeT length; + Tcl_Size length; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; @@ -1316,7 +1316,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 @@ -1335,6 +1335,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 b4c17e4..f4bb4bf 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, void **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); @@ -99,13 +99,14 @@ EXTERN double Tk_CanvasPsY(Tk_Canvas canvas, double y); /* 17 */ EXTERN void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc); /* 18 */ -EXTERN int Tk_CanvasTagsParseProc(ClientData clientData, +EXTERN int Tk_CanvasTagsParseProc(void *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); +EXTERN const char * Tk_CanvasTagsPrintProc(void *clientData, + 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 */ @@ -157,23 +158,22 @@ EXTERN Tk_Window Tk_CoordsToWindow(int rootX, int rootY, Tk_Window tkwin); /* 33 */ EXTERN unsigned long Tk_CreateBinding(Tcl_Interp *interp, - Tk_BindingTable bindingTable, - ClientData object, const char *eventStr, - const char *script, int append); + Tk_BindingTable bindingTable, void *object, + const char *eventStr, const char *script, + int append); /* 34 */ EXTERN Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp); /* 35 */ EXTERN Tk_ErrorHandler Tk_CreateErrorHandler(Display *display, int errNum, int request, int minorCode, - Tk_ErrorProc *errorProc, - ClientData clientData); + Tk_ErrorProc *errorProc, void *clientData); /* 36 */ EXTERN void Tk_CreateEventHandler(Tk_Window token, unsigned long mask, Tk_EventProc *proc, - ClientData clientData); + void *clientData); /* 37 */ EXTERN void Tk_CreateGenericHandler(Tk_GenericProc *proc, - ClientData clientData); + void *clientData); /* 38 */ EXTERN void Tk_CreateImageType(const Tk_ImageType *typePtr); /* 39 */ @@ -184,7 +184,7 @@ EXTERN void Tk_CreatePhotoImageFormat( /* 41 */ EXTERN void Tk_CreateSelHandler(Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, - ClientData clientData, Atom format); + void *clientData, Atom format); /* 42 */ EXTERN Tk_Window Tk_CreateWindow(Tcl_Interp *interp, Tk_Window parent, const char *name, const char *screenName); @@ -199,11 +199,11 @@ EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, EXTERN void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor); /* 46 */ EXTERN void Tk_DeleteAllBindings(Tk_BindingTable bindingTable, - ClientData object); + void *object); /* 47 */ EXTERN int Tk_DeleteBinding(Tcl_Interp *interp, - Tk_BindingTable bindingTable, - ClientData object, const char *eventStr); + Tk_BindingTable bindingTable, void *object, + const char *eventStr); /* 48 */ EXTERN void Tk_DeleteBindingTable(Tk_BindingTable bindingTable); /* 49 */ @@ -211,10 +211,10 @@ EXTERN void Tk_DeleteErrorHandler(Tk_ErrorHandler handler); /* 50 */ EXTERN void Tk_DeleteEventHandler(Tk_Window token, unsigned long mask, Tk_EventProc *proc, - ClientData clientData); + void *clientData); /* 51 */ EXTERN void Tk_DeleteGenericHandler(Tk_GenericProc *proc, - ClientData clientData); + void *clientData); /* 52 */ EXTERN void Tk_DeleteImage(Tcl_Interp *interp, const char *name); /* 53 */ @@ -230,7 +230,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 +240,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 +252,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, @@ -301,8 +301,7 @@ EXTERN Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 81 */ EXTERN void Tk_GetAllBindings(Tcl_Interp *interp, - Tk_BindingTable bindingTable, - ClientData object); + Tk_BindingTable bindingTable, void *object); /* 82 */ EXTERN int Tk_GetAnchor(Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); @@ -310,8 +309,8 @@ EXTERN int Tk_GetAnchor(Tcl_Interp *interp, const char *str, EXTERN const char * Tk_GetAtomName(Tk_Window tkwin, Atom atom); /* 84 */ EXTERN const char * Tk_GetBinding(Tcl_Interp *interp, - Tk_BindingTable bindingTable, - ClientData object, const char *eventStr); + Tk_BindingTable bindingTable, void *object, + const char *eventStr); /* 85 */ EXTERN Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, const char *str); @@ -353,9 +352,9 @@ EXTERN GC Tk_GetGC(Tk_Window tkwin, unsigned long valueMask, EXTERN Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin, const char *name, Tk_ImageChangedProc *changeProc, - ClientData clientData); + void *clientData); /* 98 */ -EXTERN ClientData Tk_GetImageModelData(Tcl_Interp *interp, +EXTERN void * Tk_GetImageModelData(Tcl_Interp *interp, const char *name, const Tk_ImageType **typePtrPtr); /* 99 */ @@ -393,7 +392,7 @@ EXTERN int Tk_GetScreenMM(Tcl_Interp *interp, Tk_Window tkwin, /* 110 */ EXTERN int Tk_GetSelection(Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, - Tk_GetSelProc *proc, ClientData clientData); + Tk_GetSelProc *proc, void *clientData); /* 111 */ EXTERN Tk_Uid Tk_GetUid(const char *str); /* 112 */ @@ -431,13 +430,12 @@ EXTERN Tk_Window Tk_MainWindow(Tcl_Interp *interp); EXTERN void Tk_MakeWindowExist(Tk_Window tkwin); /* 124 */ EXTERN void Tk_ManageGeometry(Tk_Window tkwin, - const Tk_GeomMgr *mgrPtr, - ClientData clientData); + const Tk_GeomMgr *mgrPtr, void *clientData); /* 125 */ 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, @@ -473,7 +471,7 @@ EXTERN Tk_Window Tk_NameToWindow(Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 142 */ EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection, - Tk_LostSelProc *proc, ClientData clientData); + Tk_LostSelProc *proc, void *clientData); /* 143 */ EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, @@ -529,8 +527,8 @@ EXTERN void Tk_ResizeWindow(Tk_Window tkwin, int width, EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 158 */ -EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, - ClientData arg, ClientData *prevArgPtr); +EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, + void **prevArgPtr); /* 159 */ EXTERN int Tk_SafeInit(Tcl_Interp *interp); /* 160 */ @@ -578,14 +576,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 +680,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 +751,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, @@ -777,7 +775,7 @@ EXTERN Tk_Window Tk_CreateAnonymousWindow(Tcl_Interp *interp, /* 242 */ EXTERN void Tk_SetClassProcs(Tk_Window tkwin, const Tk_ClassProcs *procs, - ClientData instanceData); + void *instanceData); /* 243 */ EXTERN void Tk_SetInternalBorderEx(Tk_Window tkwin, int left, int right, int top, int bottom); @@ -813,7 +811,7 @@ EXTERN int Tk_RegisterStyledElement(Tk_StyleEngine engine, EXTERN int Tk_GetElementId(const char *name); /* 253 */ EXTERN Tk_Style Tk_CreateStyle(const char *name, - Tk_StyleEngine engine, ClientData clientData); + Tk_StyleEngine engine, void *clientData); /* 254 */ EXTERN Tk_Style Tk_GetStyle(Tcl_Interp *interp, const char *name); /* 255 */ @@ -944,7 +942,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, void **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 +950,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) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 18 */ + const char * (*tk_CanvasTagsPrintProc) (void *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,38 +967,38 @@ 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 */ + unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object, const char *eventStr, const char *script, int append); /* 33 */ Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */ - Tk_ErrorHandler (*tk_CreateErrorHandler) (Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, ClientData clientData); /* 35 */ - void (*tk_CreateEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 36 */ - void (*tk_CreateGenericHandler) (Tk_GenericProc *proc, ClientData clientData); /* 37 */ + Tk_ErrorHandler (*tk_CreateErrorHandler) (Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, void *clientData); /* 35 */ + void (*tk_CreateEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, void *clientData); /* 36 */ + void (*tk_CreateGenericHandler) (Tk_GenericProc *proc, void *clientData); /* 37 */ void (*tk_CreateImageType) (const Tk_ImageType *typePtr); /* 38 */ void (*tk_CreateItemType) (Tk_ItemType *typePtr); /* 39 */ void (*tk_CreatePhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 40 */ - void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, ClientData clientData, Atom format); /* 41 */ + void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, void *clientData, Atom format); /* 41 */ Tk_Window (*tk_CreateWindow) (Tcl_Interp *interp, Tk_Window parent, const char *name, const char *screenName); /* 42 */ Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp *interp, Tk_Window tkwin, const char *pathName, const char *screenName); /* 43 */ int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 44 */ void (*tk_DefineCursor) (Tk_Window window, Tk_Cursor cursor); /* 45 */ - void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, ClientData object); /* 46 */ - int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 47 */ + void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, void *object); /* 46 */ + int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object, const char *eventStr); /* 47 */ void (*tk_DeleteBindingTable) (Tk_BindingTable bindingTable); /* 48 */ void (*tk_DeleteErrorHandler) (Tk_ErrorHandler handler); /* 49 */ - void (*tk_DeleteEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 50 */ - void (*tk_DeleteGenericHandler) (Tk_GenericProc *proc, ClientData clientData); /* 51 */ + void (*tk_DeleteEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, void *clientData); /* 50 */ + void (*tk_DeleteGenericHandler) (Tk_GenericProc *proc, void *clientData); /* 51 */ void (*tk_DeleteImage) (Tcl_Interp *interp, const char *name); /* 52 */ void (*tk_DeleteSelHandler) (Tk_Window tkwin, Atom selection, Atom target); /* 53 */ 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 */ @@ -1019,10 +1017,10 @@ typedef struct TkStubs { GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */ void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */ Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */ - void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object); /* 81 */ + void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object); /* 81 */ int (*tk_GetAnchor) (Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); /* 82 */ const char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */ - const char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 84 */ + const char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object, const char *eventStr); /* 84 */ Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 85 */ Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 86 */ int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */ @@ -1035,8 +1033,8 @@ typedef struct TkStubs { Tk_Font (*tk_GetFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 94 */ void (*tk_GetFontMetrics) (Tk_Font font, Tk_FontMetrics *fmPtr); /* 95 */ GC (*tk_GetGC) (Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr); /* 96 */ - Tk_Image (*tk_GetImage) (Tcl_Interp *interp, Tk_Window tkwin, const char *name, Tk_ImageChangedProc *changeProc, ClientData clientData); /* 97 */ - ClientData (*tk_GetImageModelData) (Tcl_Interp *interp, const char *name, const Tk_ImageType **typePtrPtr); /* 98 */ + Tk_Image (*tk_GetImage) (Tcl_Interp *interp, Tk_Window tkwin, const char *name, Tk_ImageChangedProc *changeProc, void *clientData); /* 97 */ + void * (*tk_GetImageModelData) (Tcl_Interp *interp, const char *name, const Tk_ImageType **typePtrPtr); /* 98 */ Tk_ItemType * (*tk_GetItemTypes) (void); /* 99 */ int (*tk_GetJoinStyle) (Tcl_Interp *interp, const char *str, int *joinPtr); /* 100 */ int (*tk_GetJustify) (Tcl_Interp *interp, const char *str, Tk_Justify *justifyPtr); /* 101 */ @@ -1048,7 +1046,7 @@ typedef struct TkStubs { void (*tk_GetRootCoords) (Tk_Window tkwin, int *xPtr, int *yPtr); /* 107 */ int (*tk_GetScrollInfo) (Tcl_Interp *interp, int argc, const char **argv, double *dblPtr, int *intPtr); /* 108 */ int (*tk_GetScreenMM) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, double *doublePtr); /* 109 */ - int (*tk_GetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData); /* 110 */ + int (*tk_GetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, void *clientData); /* 110 */ Tk_Uid (*tk_GetUid) (const char *str); /* 111 */ Visual * (*tk_GetVisual) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *depthPtr, Colormap *colormapPtr); /* 112 */ void (*tk_GetVRootGeometry) (Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 113 */ @@ -1062,9 +1060,9 @@ typedef struct TkStubs { void (*tk_MaintainGeometry) (Tk_Window window, Tk_Window container, int x, int y, int width, int height); /* 121 */ Tk_Window (*tk_MainWindow) (Tcl_Interp *interp); /* 122 */ void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */ - void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, ClientData clientData); /* 124 */ + void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, void *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 */ @@ -1080,7 +1078,7 @@ typedef struct TkStubs { const char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */ const char * (*tk_NameOfRelief) (int relief); /* 140 */ Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */ - void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, ClientData clientData); /* 142 */ + void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 142 */ int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 145 */ @@ -1096,7 +1094,7 @@ typedef struct TkStubs { void (*tk_RedrawImage) (Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY); /* 155 */ void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */ int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */ - Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, ClientData arg, ClientData *prevArgPtr); /* 158 */ + Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, void *arg, void **prevArgPtr); /* 158 */ int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */ const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */ void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */ @@ -1114,9 +1112,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 +1148,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,14 +1171,14 @@ 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 */ void (*tk_CreateClientMessageHandler) (Tk_ClientMessageProc *proc); /* 239 */ void (*tk_DeleteClientMessageHandler) (Tk_ClientMessageProc *proc); /* 240 */ Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, const char *screenName); /* 241 */ - void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, ClientData instanceData); /* 242 */ + void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, void *instanceData); /* 242 */ void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */ void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */ void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */ @@ -1191,7 +1189,7 @@ typedef struct TkStubs { Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */ int (*tk_RegisterStyledElement) (Tk_StyleEngine engine, Tk_ElementSpec *templatePtr); /* 251 */ int (*tk_GetElementId) (const char *name); /* 252 */ - Tk_Style (*tk_CreateStyle) (const char *name, Tk_StyleEngine engine, ClientData clientData); /* 253 */ + Tk_Style (*tk_CreateStyle) (const char *name, Tk_StyleEngine engine, void *clientData); /* 253 */ Tk_Style (*tk_GetStyle) (Tcl_Interp *interp, const char *name); /* 254 */ void (*tk_FreeStyle) (Tk_Style style); /* 255 */ const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */ @@ -1848,7 +1846,7 @@ extern const TkStubs *tkStubsPtr; #if defined(_WIN32) && defined(UNICODE) # define Tk_MainEx Tk_MainExW - EXTERN void Tk_MainExW(int argc, wchar_t **argv, + EXTERN void Tk_MainExW(Tcl_Size argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif 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<ostypeCount; i++) { - TkSizeT len; + Tcl_Size len; const char *strType = Tcl_GetStringFromObj(ostypeList[i], &len); /* @@ -322,7 +322,7 @@ AddClause( if (globCount > 0 && globList != NULL) { for (i=0; i<globCount; i++) { GlobPattern *globPtr = (GlobPattern *)ckalloc(sizeof(GlobPattern)); - TkSizeT len; + Tcl_Size len; const char *str = Tcl_GetStringFromObj(globList[i], &len); len = (len + 1) * sizeof(char); @@ -375,7 +375,7 @@ AddClause( } for (i=0; i<ostypeCount; i++) { Tcl_DString osTypeDS; - TkSizeT len; + Tcl_Size len; MacFileType *mfPtr = (MacFileType *)ckalloc(sizeof(MacFileType)); const char *strType = Tcl_GetStringFromObj(ostypeList[i], &len); char *string; diff --git a/generic/tkFont.c b/generic/tkFont.c index 0b1aeeb..3af6c98 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -715,7 +715,7 @@ Tk_FontObjCmd( case FONT_MEASURE: { const char *string; Tk_Font tkfont; - TkSizeT length = 0; + Tcl_Size length = 0; int skip = 0; if (objc > 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 ecf14cf..fad0635 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 b6ffbf3..ab58d1d 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/tkIcu.c b/generic/tkIcu.c index d27ea36..e7817e5 100644 --- a/generic/tkIcu.c +++ b/generic/tkIcu.c @@ -76,11 +76,11 @@ startEndOfCmd( Tcl_Obj *const objv[]) { Tcl_DString ds; - TkSizeT len; + Tcl_Size len; const char *str; UErrorCodex errorCode = U_ZERO_ERRORZ; void *it; - TkSizeT idx; + Tcl_Size idx; int flags = PTR2INT(clientData); const uint16_t *ustr; const char *locale = NULL; diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 4595e20..f9f2ea6 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -954,7 +954,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); @@ -1025,7 +1025,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 b8f7796..5bb10f8 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/tkImgPhoto.h b/generic/tkImgPhoto.h index 7ac738f..a65b971 100644 --- a/generic/tkImgPhoto.h +++ b/generic/tkImgPhoto.h @@ -247,16 +247,16 @@ struct PhotoInstance { MODULE_SCOPE void TkImgPhotoConfigureInstance( PhotoInstance *instancePtr); -MODULE_SCOPE void TkImgDisposeInstance(ClientData clientData); +MODULE_SCOPE void TkImgDisposeInstance(void *clientData); MODULE_SCOPE void TkImgPhotoInstanceSetSize(PhotoInstance *instancePtr); -MODULE_SCOPE ClientData TkImgPhotoGet(Tk_Window tkwin, ClientData clientData); +MODULE_SCOPE void *TkImgPhotoGet(Tk_Window tkwin, void *clientData); MODULE_SCOPE void TkImgDitherInstance(PhotoInstance *instancePtr, int x, int y, int width, int height); -MODULE_SCOPE void TkImgPhotoDisplay(ClientData clientData, +MODULE_SCOPE void TkImgPhotoDisplay(void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); -MODULE_SCOPE void TkImgPhotoFree(ClientData clientData, +MODULE_SCOPE void TkImgPhotoFree(void *clientData, Display *display); MODULE_SCOPE void TkImgResetDither(PhotoInstance *instancePtr); 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 7d80fd6..4926f15 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -67,7 +67,7 @@ declare 12 { int xHot, int yHot, XColor fg, XColor bg) } declare 13 { - int TkCreateFrame(ClientData clientData, Tcl_Interp *interp, + int TkCreateFrame(void *clientData, Tcl_Interp *interp, int argc, const char *const *argv, int toplevel, const char *appName) } declare 14 { @@ -306,7 +306,7 @@ declare 83 { # Exported publically as Tk_SetClassProcs in 8.4a2 #declare 84 { # void TkSetClassProcs(Tk_Window tkwin, -# TkClassProcs *procs, ClientData instanceData) +# TkClassProcs *procs, void *instanceData) #} declare 85 {deprecated {renamed to Tk_SetWindowMenubar}} { void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, @@ -498,25 +498,25 @@ declare 152 { int highlightWidth, int borderWidth, int relief) } declare 153 { - void TkCreateThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) + void TkCreateThreadExitHandler(Tcl_ExitProc *proc, void *clientData) } declare 154 { - void TkDeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) + void TkDeleteThreadExitHandler(Tcl_ExitProc *proc, void *clientData) } # entries needed only by tktest: declare 156 { - int TkpTestembedCmd(ClientData clientData, Tcl_Interp *interp, int objc, + int TkpTestembedCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) } declare 157 { - int TkpTesttextCmd(ClientData dummy, Tcl_Interp *interp, int objc, + int TkpTesttextCmd(void *dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) } declare 158 { int TkSelGetSelection(Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, - ClientData clientData) + void *clientData) } declare 159 { int TkTextGetIndex(Tcl_Interp *interp, struct TkText *textPtr, @@ -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 { @@ -566,52 +566,52 @@ 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) + int TkStateParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *TkStatePrintProc(void *clientData, Tk_Window tkwin, + 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) + int TkCanvasDashParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *TkCanvasDashPrintProc(void *clientData, Tk_Window tkwin, + 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) + int TkOffsetParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *TkOffsetPrintProc(void *clientData, Tk_Window tkwin, + 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) + int TkPixelParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *TkPixelPrintProc(void *clientData, Tk_Window tkwin, + 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) + int TkOrientParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *TkOrientPrintProc(void *clientData, Tk_Window tkwin, + 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) + int TkSmoothParseProc(void *clientData, Tcl_Interp *interp, + 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) + const char *TkSmoothPrintProc(void *clientData, Tk_Window tkwin, + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } # Angled text API, exposed for Emiliano Gavilán's RBC work. @@ -695,7 +695,7 @@ declare 12 x11 { } # only needed by tktest: declare 13 x11 { - int TkpTestsendCmd(ClientData clientData, Tcl_Interp *interp, int objc, + int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) } declare 38 x11 { @@ -721,7 +721,7 @@ declare 44 x11 { } # only needed by tktest: declare 45 x11 { - int TkpTestsendCmd_(ClientData clientData, Tcl_Interp *interp, int objc, + int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) } @@ -813,7 +813,7 @@ declare 27 win { void TkWinWmCleanup(HINSTANCE hInstance) } declare 28 win { - void TkWinXCleanup(ClientData clientData) + void TkWinXCleanup(void *clientData) } declare 29 win { void TkWinXInit(HINSTANCE hInstance) @@ -878,7 +878,7 @@ declare 44 win { } # only needed by tktest: declare 45 win { - int TkpTestsendCmd(ClientData clientData, Tcl_Interp *interp, int objc, + int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) } declare 47 win { diff --git a/generic/tkInt.h b/generic/tkInt.h index fcd1f4f..f67a70f 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -73,14 +73,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) @@ -183,7 +175,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 @@ -192,7 +184,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. */ @@ -344,7 +336,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. */ @@ -566,7 +558,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. */ @@ -648,7 +640,7 @@ typedef struct TkErrorHandler { * codes). */ Tk_ErrorProc *errorProc; /* Function to invoke when a matching error * occurs. NULL means just ignore errors. */ - ClientData clientData; /* Arbitrary value to pass to errorProc. */ + void *clientData; /* Arbitrary value to pass to errorProc. */ struct TkErrorHandler *nextPtr; /* Pointer to next older handler for this * display, or NULL for end of list. */ @@ -663,7 +655,7 @@ typedef struct TkEventHandler { unsigned long mask; /* Events for which to invoke proc. */ Tk_EventProc *proc; /* Function to invoke when an event in mask * occurs. */ - ClientData clientData; /* Argument to pass to proc. */ + void *clientData; /* Argument to pass to proc. */ struct TkEventHandler *nextPtr; /* Next in list of handlers associated with * window (NULL means end of list). */ @@ -676,7 +668,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 @@ -848,16 +840,16 @@ typedef struct TkWindow { * in tkCmds.c): */ - ClientData *tagPtr; /* Points to array of tags used for bindings + void **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. */ @@ -876,7 +868,7 @@ typedef struct TkWindow { const Tk_GeomMgr *geomMgrPtr; /* Information about geometry manager for this * window. */ - ClientData geomData; /* Argument for geometry manager functions. */ + void *geomData; /* Argument for geometry manager functions. */ int reqWidth, reqHeight; /* Arguments from last call to * Tk_GeometryRequest, or 0's if * Tk_GeometryRequest hasn't been called. */ @@ -901,7 +893,7 @@ typedef struct TkWindow { */ const Tk_ClassProcs *classProcsPtr; - ClientData instanceData; + void *instanceData; /* * Platform specific information private to each port. @@ -964,7 +956,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 */ @@ -988,7 +980,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 /* @@ -1196,142 +1188,142 @@ MODULE_SCOPE int Ttk_Init(Tcl_Interp *interp); * world: */ -MODULE_SCOPE int Tk_BellObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_BellObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_BindObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_BindObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_BindtagsObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_BindtagsObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_BusyObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_BusyObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ButtonObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ButtonObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_CanvasObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_CanvasObjCmd(void *clientData, Tcl_Interp *interp, int argc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_CheckbuttonObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_CheckbuttonObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ClipboardObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ClipboardObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ChooseColorObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ChooseColorObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ChooseDirectoryObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ChooseDirectoryObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_DestroyObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_DestroyObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_EntryObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_EntryObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_EventObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_EventObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_FrameObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_FrameObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_FocusObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_FocusObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_FontObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_FontObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_GetOpenFileObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_GetOpenFileObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_GetSaveFileObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_GetSaveFileObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_GrabObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_GrabObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_GridObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_GridObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ImageObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ImageObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_LabelObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_LabelObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_LabelframeObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_LabelframeObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ListboxObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ListboxObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_LowerObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_LowerObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_MenuObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_MenuObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_MenubuttonObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_MenubuttonObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_MessageBoxObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_MessageBoxObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_MessageObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_MessageObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_PanedWindowObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_PanedWindowObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_OptionObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_OptionObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_PackObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_PackObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_PlaceObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_PlaceObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_RadiobuttonObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_RadiobuttonObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_RaiseObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_RaiseObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ScaleObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ScaleObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ScrollbarObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ScrollbarObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_SelectionObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_SelectionObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_SendObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_SendObjCmd(void *clientData, Tcl_Interp *interp,int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_SpinboxObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_SpinboxObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_TextObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_TextObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_TkwaitObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_TkwaitObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_ToplevelObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_ToplevelObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_UpdateObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_UpdateObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_WinfoObjCmd(ClientData clientData, +MODULE_SCOPE int Tk_WinfoObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_WmObjCmd(ClientData clientData, Tcl_Interp *interp, +MODULE_SCOPE int Tk_WmObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int TkSetGeometryContainer(Tcl_Interp *interp, @@ -1341,7 +1333,7 @@ MODULE_SCOPE void TkFreeGeometryContainer(Tk_Window tkwin, MODULE_SCOPE void TkEventInit(void); MODULE_SCOPE void TkRegisterObjTypes(void); -MODULE_SCOPE int TkDeadAppObjCmd(ClientData clientData, +MODULE_SCOPE int TkDeadAppObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int TkCanvasGetCoordObj(Tcl_Interp *interp, Tk_Canvas canvas, Tcl_Obj *obj, @@ -1351,21 +1343,12 @@ 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, void *clientData); MODULE_SCOPE void TkDeleteExitHandler(Tcl_ExitProc *proc, - ClientData clientData); + void *clientData); MODULE_SCOPE Tcl_ExitProc TkFinalize; MODULE_SCOPE Tcl_ExitProc TkFinalizeThread; MODULE_SCOPE void TkpBuildRegionFromAlphaData(Region region, @@ -1385,16 +1368,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, @@ -1411,28 +1394,28 @@ MODULE_SCOPE int TkBackgroundEvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, int flags); MODULE_SCOPE Tcl_Command TkMakeEnsemble(Tcl_Interp *interp, const char *nsname, const char *name, - ClientData clientData, const TkEnsemble *map); + void *clientData, const TkEnsemble *map); MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp, - ClientData clientData); + void *clientData); MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp, - ClientData clientData); + void *clientData); MODULE_SCOPE void TkInitEmbeddedConfigurationInformation( Tcl_Interp *interp); MODULE_SCOPE void TkDoWarpWrtWin(TkDisplay *dispPtr); MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr); -MODULE_SCOPE int TkListCreateFrame(ClientData clientData, +MODULE_SCOPE int TkListCreateFrame(void *clientData, Tcl_Interp *interp, Tcl_Obj *listObj, int toplevel, Tcl_Obj *nameObj); 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 @@ -1493,14 +1476,14 @@ MODULE_SCOPE void Icu_Init(Tcl_Interp* interp); * Unsupported commands. */ -MODULE_SCOPE int TkUnsupported1ObjCmd(ClientData clientData, +MODULE_SCOPE int TkUnsupported1ObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* * For Tktest. */ -MODULE_SCOPE int SquareObjCmd(ClientData clientData, +MODULE_SCOPE int SquareObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]); MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp); diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 4f18ee9..e5dcd9b 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -79,10 +79,9 @@ EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 13 */ -EXTERN int TkCreateFrame(ClientData clientData, - Tcl_Interp *interp, int argc, - const char *const *argv, int toplevel, - const char *appName); +EXTERN int TkCreateFrame(void *clientData, Tcl_Interp *interp, + int argc, const char *const *argv, + int toplevel, const char *appName); /* 14 */ EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp, const char *screenName, const char *baseName); @@ -436,22 +435,21 @@ EXTERN void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border, int relief); /* 153 */ EXTERN void TkCreateThreadExitHandler(Tcl_ExitProc *proc, - ClientData clientData); + void *clientData); /* 154 */ EXTERN void TkDeleteThreadExitHandler(Tcl_ExitProc *proc, - ClientData clientData); + void *clientData); /* Slot 155 is reserved */ /* 156 */ -EXTERN int TkpTestembedCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +EXTERN int TkpTestembedCmd(void *clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *const objv[]); /* 157 */ -EXTERN int TkpTesttextCmd(ClientData dummy, Tcl_Interp *interp, +EXTERN int TkpTesttextCmd(void *dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 158 */ EXTERN int TkSelGetSelection(Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, - Tk_GetSelProc *proc, ClientData clientData); + Tk_GetSelProc *proc, void *clientData); /* 159 */ EXTERN int TkTextGetIndex(Tcl_Interp *interp, struct TkText *textPtr, const char *string, @@ -469,7 +467,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 */ @@ -494,59 +492,59 @@ EXTERN void TkTextInsertDisplayProc(struct TkText *textPtr, int y, int height, int baseline, Display *display, Drawable dst, int screenY); /* 169 */ -EXTERN int TkStateParseProc(ClientData clientData, +EXTERN int TkStateParseProc(void *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); +EXTERN const char * TkStatePrintProc(void *clientData, Tk_Window tkwin, + char *widgRec, Tcl_Size offset, + Tcl_FreeProc **freeProcPtr); /* 171 */ -EXTERN int TkCanvasDashParseProc(ClientData clientData, +EXTERN int TkCanvasDashParseProc(void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 172 */ -EXTERN const char * TkCanvasDashPrintProc(ClientData clientData, +EXTERN const char * TkCanvasDashPrintProc(void *clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 173 */ -EXTERN int TkOffsetParseProc(ClientData clientData, +EXTERN int TkOffsetParseProc(void *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); +EXTERN const char * TkOffsetPrintProc(void *clientData, Tk_Window tkwin, + char *widgRec, Tcl_Size offset, + Tcl_FreeProc **freeProcPtr); /* 175 */ -EXTERN int TkPixelParseProc(ClientData clientData, +EXTERN int TkPixelParseProc(void *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); +EXTERN const char * TkPixelPrintProc(void *clientData, Tk_Window tkwin, + char *widgRec, Tcl_Size offset, + Tcl_FreeProc **freeProcPtr); /* 177 */ -EXTERN int TkOrientParseProc(ClientData clientData, +EXTERN int TkOrientParseProc(void *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); +EXTERN const char * TkOrientPrintProc(void *clientData, Tk_Window tkwin, + char *widgRec, Tcl_Size offset, + Tcl_FreeProc **freeProcPtr); /* 179 */ -EXTERN int TkSmoothParseProc(ClientData clientData, +EXTERN int TkSmoothParseProc(void *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); +EXTERN const char * TkSmoothPrintProc(void *clientData, Tk_Window tkwin, + char *widgRec, Tcl_Size offset, + Tcl_FreeProc **freeProcPtr); /* 181 */ EXTERN void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc, @@ -592,7 +590,7 @@ typedef struct TkIntStubs { void (*reserved10)(void); void (*reserved11)(void); TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */ - int (*tkCreateFrame) (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv, int toplevel, const char *appName); /* 13 */ + int (*tkCreateFrame) (void *clientData, Tcl_Interp *interp, int argc, const char *const *argv, int toplevel, const char *appName); /* 13 */ Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, const char *screenName, const char *baseName); /* 14 */ Time (*tkCurrentTime) (TkDisplay *dispPtr); /* 15 */ void (*tkDeleteAllImages) (TkMainInfo *mainPtr); /* 16 */ @@ -759,34 +757,34 @@ typedef struct TkIntStubs { int (*tkMakeRawCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 150 */ void (*tkMakeRawCurvePostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 151 */ void (*tkpDrawFrame) (Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); /* 152 */ - void (*tkCreateThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 153 */ - void (*tkDeleteThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 154 */ + void (*tkCreateThreadExitHandler) (Tcl_ExitProc *proc, void *clientData); /* 153 */ + void (*tkDeleteThreadExitHandler) (Tcl_ExitProc *proc, void *clientData); /* 154 */ void (*reserved155)(void); - int (*tkpTestembedCmd) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 156 */ - int (*tkpTesttextCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 157 */ - int (*tkSelGetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData); /* 158 */ + int (*tkpTestembedCmd) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 156 */ + int (*tkpTesttextCmd) (void *dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 157 */ + int (*tkSelGetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, void *clientData); /* 158 */ int (*tkTextGetIndex) (Tcl_Interp *interp, struct TkText *textPtr, const char *string, struct TkTextIndex *indexPtr); /* 159 */ 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) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 169 */ + const char * (*tkStatePrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 170 */ + int (*tkCanvasDashParseProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 171 */ + const char * (*tkCanvasDashPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 172 */ + int (*tkOffsetParseProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 173 */ + const char * (*tkOffsetPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 174 */ + int (*tkPixelParseProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 175 */ + const char * (*tkPixelPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 176 */ + int (*tkOrientParseProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 177 */ + const char * (*tkOrientPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 178 */ + int (*tkSmoothParseProc) (void *clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 179 */ + const char * (*tkSmoothPrintProc) (void *clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 180 */ void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */ void (*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/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 0b770a1..3560c5e 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -103,7 +103,7 @@ EXTERN void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd, /* 27 */ EXTERN void TkWinWmCleanup(HINSTANCE hInstance); /* 28 */ -EXTERN void TkWinXCleanup(ClientData clientData); +EXTERN void TkWinXCleanup(void *clientData); /* 29 */ EXTERN void TkWinXInit(HINSTANCE hInstance); /* 30 */ @@ -139,9 +139,8 @@ EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* 44 */ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 45 */ -EXTERN int TkpTestsendCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *const objv[]); /* Slot 46 is reserved */ /* 47 */ EXTERN Tk_Window TkpGetCapture(void); @@ -288,9 +287,8 @@ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* 12 */ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 13 */ -EXTERN int TkpTestsendCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *const objv[]); /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ @@ -330,9 +328,8 @@ EXTERN void TkWmCleanup_(TkDisplay *dispPtr); /* 44 */ EXTERN void TkSendCleanup_(TkDisplay *dispPtr); /* 45 */ -EXTERN int TkpTestsendCmd_(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *const objv[]); #endif /* X11 */ typedef struct TkIntPlatStubs { @@ -368,7 +365,7 @@ typedef struct TkIntPlatStubs { void (*tkWinSetMenu) (Tk_Window tkwin, HMENU hMenu); /* 25 */ void (*tkWinSetWindowPos) (HWND hwnd, HWND siblingHwnd, int pos); /* 26 */ void (*tkWinWmCleanup) (HINSTANCE hInstance); /* 27 */ - void (*tkWinXCleanup) (ClientData clientData); /* 28 */ + void (*tkWinXCleanup) (void *clientData); /* 28 */ void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */ void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ void (*tkWinDialogDebug) (int debug); /* 31 */ @@ -385,7 +382,7 @@ typedef struct TkIntPlatStubs { void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ - int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 45 */ + int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 45 */ void (*reserved46)(void); Tk_Window (*tkpGetCapture) (void); /* 47 */ #endif /* WIN */ @@ -461,7 +458,7 @@ typedef struct TkIntPlatStubs { void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */ void (*reserved11)(void); int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ - int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 13 */ + int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 13 */ void (*reserved14)(void); void (*reserved15)(void); void (*reserved16)(void); @@ -493,7 +490,7 @@ typedef struct TkIntPlatStubs { void (*tkUnixSetMenubar_) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ void (*tkWmCleanup_) (TkDisplay *dispPtr); /* 43 */ void (*tkSendCleanup_) (TkDisplay *dispPtr); /* 44 */ - int (*tkpTestsendCmd_) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 45 */ + int (*tkpTestsendCmd_) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 45 */ #endif /* X11 */ } TkIntPlatStubs; 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..75b3f7c 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 @@ -206,7 +206,7 @@ Tk_MainEx( return; } } else { - int j; + Tcl_Size j; for (j = 1; j < argc; ++j) { if (!strcmp(argv[j], "-display")) { diff --git a/generic/tkMenu.c b/generic/tkMenu.c index a4671cc..d94ba5b 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; @@ -1485,7 +1485,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++) { @@ -2112,7 +2112,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; @@ -2240,13 +2240,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)); @@ -2344,7 +2344,7 @@ MenuAddOrInsert( * entry, others are config options. */ { int type; - TkSizeT index; + Tcl_Size index; TkMenuEntry *mePtr; TkMenu *menuListPtr; @@ -2387,7 +2387,7 @@ MenuAddOrInsert( } if (ConfigureMenuEntry(mePtr, objc - 1, objv + 1) != TCL_OK) { TkMenu *errorMenuPtr; - TkSizeT i; + Tcl_Size i; for (errorMenuPtr = menuPtr->mainMenuPtr; errorMenuPtr != NULL; @@ -2591,7 +2591,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; @@ -2692,7 +2692,7 @@ CloneMenu( { int returnResult; int menuType; - TkSizeT i; + Tcl_Size i; TkMenuReferences *menuRefPtr; Tcl_Obj *menuDupCommandArray[4]; @@ -2732,7 +2732,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 @@ -2867,7 +2867,7 @@ MenuDoXPosition( TkMenu *menuPtr, Tcl_Obj *objPtr) { - TkSizeT index; + Tcl_Size index; TkRecomputeMenu(menuPtr); if (GetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) { @@ -2904,7 +2904,7 @@ MenuDoYPosition( TkMenu *menuPtr, Tcl_Obj *objPtr) { - TkSizeT index; + Tcl_Size index; TkRecomputeMenu(menuPtr); if (GetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) { @@ -2942,12 +2942,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; @@ -3025,7 +3025,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..21ca097 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,19 +494,19 @@ 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, +MODULE_SCOPE void TkMenuEventProc(void *clientData, XEvent *eventPtr); -MODULE_SCOPE void TkMenuImageProc(ClientData clientData, int x, int y, +MODULE_SCOPE void TkMenuImageProc(void *clientData, int x, int y, int width, int height, int imgWidth, int imgHeight); MODULE_SCOPE void TkMenuInit(void); -MODULE_SCOPE void TkMenuSelectImageProc(ClientData clientData, int x, +MODULE_SCOPE void TkMenuSelectImageProc(void *clientData, int x, int y, int width, int height, int imgWidth, int imgHeight); MODULE_SCOPE Tcl_Obj * TkNewMenuName(Tcl_Interp *interp, 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/tkMenubutton.h b/generic/tkMenubutton.h index 7055abc..146bfe7 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -209,8 +209,8 @@ typedef struct { MODULE_SCOPE void TkpComputeMenuButtonGeometry(TkMenuButton *mbPtr); MODULE_SCOPE TkMenuButton *TkpCreateMenuButton(Tk_Window tkwin); -MODULE_SCOPE void TkpDisplayMenuButton(ClientData clientData); +MODULE_SCOPE void TkpDisplayMenuButton(void *clientData); MODULE_SCOPE void TkpDestroyMenuButton(TkMenuButton *mbPtr); -MODULE_SCOPE void TkMenuButtonWorldChanged(ClientData instanceData); +MODULE_SCOPE void TkMenuButtonWorldChanged(void *instanceData); #endif /* _TKMENUBUTTON */ diff --git a/generic/tkObj.c b/generic/tkObj.c index bc9b58d..0b97aaa 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 f422260..7698e82 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..4765007 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. */ @@ -233,7 +233,7 @@ MODULE_SCOPE double TkRoundValueToResolution(TkScale *scalePtr, double value); MODULE_SCOPE double TkRoundIntervalToResolution(TkScale *scalePtr, double value); MODULE_SCOPE TkScale * TkpCreateScale(Tk_Window tkwin); MODULE_SCOPE void TkpDestroyScale(TkScale *scalePtr); -MODULE_SCOPE void TkpDisplayScale(ClientData clientData); +MODULE_SCOPE void TkpDisplayScale(void *clientData); MODULE_SCOPE int TkpScaleElement(TkScale *scalePtr, int x, int y); MODULE_SCOPE void TkScaleSetValue(TkScale *scalePtr, double value, int setVar, int invokeCommand); 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/tkScrollbar.h b/generic/tkScrollbar.h index 2108a00..6912e71 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -175,13 +175,13 @@ MODULE_SCOPE char tkDefScrollbarWidth[TCL_INTEGER_SPACE]; * widget. */ -MODULE_SCOPE void TkScrollbarEventProc(ClientData clientData, +MODULE_SCOPE void TkScrollbarEventProc(void *clientData, XEvent *eventPtr); MODULE_SCOPE void TkScrollbarEventuallyRedraw(TkScrollbar *scrollPtr); MODULE_SCOPE void TkpComputeScrollbarGeometry(TkScrollbar *scrollPtr); MODULE_SCOPE TkScrollbar *TkpCreateScrollbar(Tk_Window tkwin); MODULE_SCOPE void TkpDestroyScrollbar(TkScrollbar *scrollPtr); -MODULE_SCOPE void TkpDisplayScrollbar(ClientData clientData); +MODULE_SCOPE void TkpDisplayScrollbar(void *clientData); MODULE_SCOPE void TkpConfigureScrollbar(TkScrollbar *scrollPtr); MODULE_SCOPE int TkpScrollbarPosition(TkScrollbar *scrollPtr, int x, int y); 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..66233c3 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 @@ -81,7 +81,7 @@ typedef struct TkSelRetrievalInfo { Atom target; /* Desired form for selection. */ Tk_GetSelProc *proc; /* Procedure to call to handle pieces of * selection. */ - ClientData clientData; /* Argument for proc. */ + void *clientData; /* Argument for proc. */ int result; /* Initially -1. Set to a Tcl return value * once the selection has been retrieved. */ Tcl_TimerToken timeout; /* Token for current timeout procedure. */ @@ -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 5877afe..8970646 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) # 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..9b4bdba 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. @@ -271,7 +271,7 @@ struct TkTextDispChunk { * position for a line (break just before this * byte index). <= 0 means don't break during * or immediately after this chunk. */ - ClientData clientData; /* Additional information for use of + void *clientData; /* Additional information for use of * displayProc and undisplayProc. */ }; @@ -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, @@ -1054,7 +1046,7 @@ MODULE_SCOPE int TkBTreeTag(TkTextIndex *index1Ptr, int add); MODULE_SCOPE void TkBTreeUnlinkSegment(TkTextSegment *segPtr, TkTextLine *linePtr); -MODULE_SCOPE void TkTextBindProc(ClientData clientData, +MODULE_SCOPE void TkTextBindProc(void *clientData, XEvent *eventPtr); MODULE_SCOPE void TkTextSelectionEvent(TkText *textPtr); MODULE_SCOPE int TkTextIndexBbox(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,8 +1100,8 @@ 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); -MODULE_SCOPE void TkTextLostSelection(ClientData clientData); + Tcl_Size *offsetPtr); +MODULE_SCOPE void TkTextLostSelection(void *clientData); MODULE_SCOPE TkTextIndex *TkTextMakeCharIndex(TkTextBTree tree, TkText *textPtr, int lineIndex, int charIndex, TkTextIndex *indexPtr); @@ -1171,7 +1163,7 @@ MODULE_SCOPE int TkTextYviewCmd(TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE void TkTextWinFreeClient(Tcl_HashEntry *hPtr, TkTextEmbWindowClient *client); -MODULE_SCOPE void TkTextRunAfterSyncCmd(ClientData clientData); +MODULE_SCOPE void TkTextRunAfterSyncCmd(void *clientData); MODULE_SCOPE int TkTextIndexAdjustToStartEnd(TkText *textPtr, TkTextIndex *indexPtr, int err); #endif /* _TKTEXT */ diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 78680f9..4f7c823 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 651cb96..5bdbe3e 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -168,7 +168,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. */ @@ -415,7 +415,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 @@ -774,7 +774,7 @@ GetStyle( StyleValues styleValues; TextStyle *stylePtr; Tcl_HashEntry *hPtr; - TkSizeT numTags, i; + Tcl_Size numTags, i; int isNew; int isSelected; XGCValues gcValues; @@ -1178,7 +1178,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. */ @@ -6178,7 +6178,7 @@ TkTextYviewCmd( TextDInfo *dInfoPtr = textPtr->dInfoPtr; int pickPlace, type; int pixels, count; - TkSizeT switchLength; + Tcl_Size switchLength; double fraction; TkTextIndex index; @@ -7621,11 +7621,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. */ @@ -7639,7 +7639,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 79199d8..83db999 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -112,7 +112,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)); @@ -214,7 +214,7 @@ TkTextGetIndexFromObj( int cache; if (objPtr->typePtr == &tkTextIndexType) { - TkSizeT epoch; + Tcl_Size epoch; indexPtr = GET_TEXTINDEX(objPtr); epoch = GET_INDEXEPOCH(objPtr); @@ -573,11 +573,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; @@ -1094,7 +1094,7 @@ TkTextIndexAdjustToStartEnd( *--------------------------------------------------------------------------- */ -TkSizeT +Tcl_Size TkTextPrintIndex( const TkText *textPtr, const TkTextIndex *indexPtr,/* Pointer to index. */ @@ -1558,7 +1558,7 @@ TkTextIndexForwChars( TkTextLine *linePtr; TkTextSegment *segPtr; TkTextElideInfo *infoPtr = NULL; - TkSizeT byteOffset; + Tcl_Size byteOffset; char *start, *end, *p; int ch; int elide = 0; @@ -1746,7 +1746,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; @@ -1823,7 +1823,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); @@ -1914,10 +1914,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) { @@ -1947,7 +1947,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) { @@ -2372,7 +2372,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 @@ -2415,7 +2415,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/tkUndo.h b/generic/tkUndo.h index c5cc37e..c568483 100644 --- a/generic/tkUndo.h +++ b/generic/tkUndo.h @@ -30,7 +30,7 @@ typedef enum { * can also be defined by Tcl scripts). */ -typedef int (TkUndoProc)(Tcl_Interp *interp, ClientData clientData, +typedef int (TkUndoProc)(Tcl_Interp *interp, void *clientData, Tcl_Obj *objPtr); /* @@ -47,7 +47,7 @@ typedef struct TkUndoSubAtom { * contain everything. */ TkUndoProc *funcPtr; /* Function pointer for callback to perform * undo/redo actions. */ - ClientData clientData; /* Data for 'funcPtr'. */ + void *clientData; /* Data for 'funcPtr'. */ Tcl_Obj *action; /* Command to apply the action that was * taken. */ struct TkUndoSubAtom *next; /* Pointer to the next element in the linked @@ -105,7 +105,7 @@ MODULE_SCOPE void TkUndoInsertUndoSeparator(TkUndoRedoStack *stack); MODULE_SCOPE TkUndoSubAtom *TkUndoMakeCmdSubAtom(Tcl_Command command, Tcl_Obj *actionScript, TkUndoSubAtom *subAtomList); MODULE_SCOPE TkUndoSubAtom *TkUndoMakeSubAtom(TkUndoProc *funcPtr, - ClientData clientData, Tcl_Obj *actionScript, + void *clientData, Tcl_Obj *actionScript, TkUndoSubAtom *subAtomList); MODULE_SCOPE void TkUndoPushAction(TkUndoRedoStack *stack, TkUndoSubAtom *apply, TkUndoSubAtom *revert); 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 8a9063b..2f63436 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3276,7 +3276,7 @@ Initialize( } if (value) { - TkSizeT objc; + Tcl_Size objc; Tcl_Obj **objv, **rest; Tcl_Obj *parseList = Tcl_NewListObj(1, NULL); @@ -3326,7 +3326,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..65cf724 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -31,16 +31,16 @@ 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; /* * Default implementations for Tk_GeomMgr hooks: */ #define Ttk_LostSlaveProc Ttk_LostContentProc -MODULE_SCOPE void Ttk_GeometryRequestProc(ClientData, Tk_Window window); -MODULE_SCOPE void Ttk_LostContentProc(ClientData, Tk_Window window); +MODULE_SCOPE void Ttk_GeometryRequestProc(void *, Tk_Window window); +MODULE_SCOPE void Ttk_LostContentProc(void *, Tk_Window window); /* * Public API: @@ -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 8f4df13..b38aa4a 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..581158c 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; @@ -341,7 +333,7 @@ MODULE_SCOPE void Ttk_RegisterNamedColor(Ttk_ResourceCache, const char *, XColor typedef struct TtkImageSpec Ttk_ImageSpec; TTKAPI Ttk_ImageSpec *TtkGetImageSpec(Tcl_Interp *, Tk_Window, Tcl_Obj *); TTKAPI Ttk_ImageSpec *TtkGetImageSpecEx(Tcl_Interp *, Tk_Window, Tcl_Obj *, - Tk_ImageChangedProc *, ClientData); + Tk_ImageChangedProc *, void *); TTKAPI void TtkFreeImageSpec(Ttk_ImageSpec *); TTKAPI Tk_Image TtkSelectImage(Ttk_ImageSpec *, Ttk_State); diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 24a3236..f709d48 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); } @@ -487,8 +487,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 */ @@ -650,7 +650,7 @@ static TreeColumn *GetColumn( Tcl_Interp *interp, Treeview *tv, Tcl_Obj *columnIDObj) { Tcl_HashEntry *entryPtr; - TkSizeT columnIndex; + Tcl_Size columnIndex; /* Check for named column: */ @@ -685,11 +685,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 */ @@ -733,7 +733,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; @@ -777,7 +777,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); @@ -895,17 +895,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; @@ -982,7 +982,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); @@ -1003,7 +1003,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) { @@ -1096,7 +1096,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; @@ -1124,13 +1124,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) { @@ -1150,7 +1150,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; @@ -1168,7 +1168,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 @@ -1183,7 +1183,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; /* @@ -1681,12 +1681,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; } @@ -1699,7 +1699,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; } } @@ -1771,7 +1771,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; @@ -1785,7 +1785,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; } @@ -1820,7 +1820,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) { @@ -2019,10 +2019,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; } @@ -2041,7 +2041,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, @@ -2061,7 +2061,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); @@ -2073,7 +2073,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; } @@ -2119,7 +2119,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; @@ -2128,7 +2128,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; } @@ -2138,7 +2138,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) { @@ -2170,7 +2170,7 @@ static void DrawCells( DisplayItem displayItemCell, displayItemCellSel; int rowHeight = tv->tree.rowHeight * item->height; int xPad = 0, defaultPadding = 1; - TkSizeT i; + Tcl_Size i; /* Adjust if the tree column has a separator */ if (tv->tree.showFlags & SHOW_TREE && tv->tree.column0.separator) { @@ -2204,8 +2204,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) { @@ -2287,7 +2287,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); @@ -2351,7 +2351,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); } } @@ -2669,7 +2669,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"); @@ -2754,7 +2754,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; @@ -2839,7 +2839,7 @@ static int TreeviewIdentifyCommand( Ttk_Box bbox; TreeItem *item; TreeColumn *column = 0; - TkSizeT colno; + Tcl_Size colno; int x1; if (objc == 4) { /* Old form */ @@ -3036,7 +3036,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??"); @@ -3103,7 +3103,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; @@ -3463,7 +3463,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; @@ -3481,7 +3481,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; } @@ -3765,7 +3765,7 @@ static int TreeviewCellSelectionCommand( Treeview *tv = (Treeview *)recordPtr; int selop, anyChange = 0; - TkSizeT i, nCells; + Tcl_Size i, nCells; TreeCell *cells; TreeItem *item; @@ -3774,7 +3774,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); @@ -4033,7 +4033,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]); @@ -4145,9 +4145,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 *) @@ -4177,7 +4177,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"); @@ -4223,7 +4223,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) { @@ -4278,7 +4278,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/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index dbe073e..c1d576a 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -105,7 +105,7 @@ MODULE_SCOPE int TtkWidgetStyleCommand( /* Widget constructor: */ MODULE_SCOPE int TtkWidgetConstructorObjCmd( - ClientData, Tcl_Interp*, int, Tcl_Obj*const[]); + void *, Tcl_Interp*, int, Tcl_Obj*const[]); #define RegisterWidget(interp, name, specPtr) \ Tcl_CreateObjCommand(interp, name, \ 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 7d5e078..f384d9c 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -451,7 +451,7 @@ startOfClusterObjCmd( TKNSString *S; const char *stringArg; int numBytes; - TkSizeT index; + Tcl_Size index; if ((unsigned)(objc - 3) > 1) { Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?"); return TCL_ERROR; @@ -470,7 +470,7 @@ startOfClusterObjCmd( } if (index != TCL_INDEX_NONE) { if ((size_t)index >= [S length]) { - index = (TkSizeT)[S length]; + index = (Tcl_Size)[S length]; } else { NSRange range = [S rangeOfComposedCharacterSequenceAtIndex:index]; index = range.location; @@ -490,7 +490,7 @@ endOfClusterObjCmd( TKNSString *S; char *stringArg; int numBytes; - TkSizeT index; + Tcl_Size index; if ((unsigned)(objc - 3) > 1) { Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?"); @@ -924,7 +924,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 @@ -974,10 +974,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. @@ -1182,7 +1182,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. */ { @@ -1272,9 +1272,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. */ @@ -1295,7 +1295,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 f75db3e..cd93592 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -849,7 +849,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)]; @@ -1048,7 +1048,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 7eeeaa7..876d417 100755 --- a/unix/configure +++ b/unix/configure @@ -8903,14 +8903,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 93b3226..f803a35 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -714,14 +714,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 fdc68e0..89a72ce 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -24,7 +24,7 @@ _RULES_VC = 1 # For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 10
+RULES_VERSION_MINOR = 11
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -877,6 +877,11 @@ TCL_THREADS = 0 USE_THREAD_ALLOC= 0
!endif
+!if [nmakehlp -f $(OPTS) "tcl8"]
+!message *** Build for Tcl8
+TCL_BUILD_FOR = 8
+!endif
+
!if $(TCL_MAJOR_VERSION) == 8
!if [nmakehlp -f $(OPTS) "time64bit"]
!message *** Force 64-bit time_t
@@ -1146,7 +1151,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 +1171,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 +1195,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.
@@ -1198,7 +1215,11 @@ TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" !endif # TCLINSTALL
+!if !$(STATIC_BUILD) && "$(TCL_BUILD_FOR)" == "8"
+tcllibs = "$(TCLSTUBLIB)"
+!else
tcllibs = "$(TCLSTUBLIB)" "$(TCLIMPLIB)"
+!endif
!endif # $(DOING_TCL)
@@ -1218,7 +1239,7 @@ WISHNAMEPREFIX = wish WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe
TKLIBNAME8 = tk$(TK_VERSION)$(SUFX).$(EXT)
TKLIBNAME9 = tcl9tk$(TK_VERSION)$(SUFX).$(EXT)
-!if $(TCL_MAJOR_VERSION) == 8
+!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8"
TKLIBNAME = tk$(TK_VERSION)$(SUFX).$(EXT)
TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX).lib
!else
@@ -1275,14 +1296,18 @@ tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
PRJLIBNAME8 = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
PRJLIBNAME9 = tcl9$(PROJECT)$(VERSION)$(SUFX).$(EXT)
-!if $(TCL_MAJOR_VERSION) == 8
+!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8"
PRJLIBNAME = $(PRJLIBNAME8)
!else
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,
@@ -1429,6 +1454,9 @@ COMPILERFLAGS = /D_ATL_XP_TARGETING !if "$(TCL_UTF_MAX)" == "3"
OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=3
!endif
+!if "$(TCL_BUILD_FOR)" == "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
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 ac2bf20..e1a3831 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..d7de783 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 @@ -1016,10 +1016,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. @@ -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 bde0f99..5e72480 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -71,7 +71,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 3c9946e..992aa08 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; |