diff options
Diffstat (limited to 'generic/tkImage.c')
-rw-r--r-- | generic/tkImage.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/generic/tkImage.c b/generic/tkImage.c index 50c3c66..701c765 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -4,8 +4,8 @@ * This module implements the image protocol, which allows lots of * different kinds of images to be used in lots of different widgets. * - * Copyright (c) 1994 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright © 1994 The Regents of the University of California. + * Copyright © 1994-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -33,12 +33,12 @@ typedef struct Image { struct ImageModel *modelPtr; /* Model for this image (identifiers image * manager, for example). */ - ClientData instanceData; /* One word argument to pass to image manager + void *instanceData; /* One word argument to pass to image manager * when dealing with this image instance. */ Tk_ImageChangedProc *changeProc; /* Code in widget to call when image changes * in a way that affects redisplay. */ - ClientData widgetClientData;/* Argument to pass to changeProc. */ + void *widgetClientData;/* Argument to pass to changeProc. */ struct Image *nextPtr; /* Next in list of all image instances * associated with the same name. */ struct Image *prevPtr; /* Previous in list of all image instances @@ -55,7 +55,7 @@ typedef struct ImageModel { Tk_ImageType *typePtr; /* Information about image type. NULL means * that no image manager owns this image: the * image was deleted. */ - ClientData modelData; /* One-word argument to pass to image mgr when + void *modelData; /* One-word argument to pass to image mgr when * dealing with the model, as opposed to * instances. */ int width, height; /* Last known dimensions for image. */ @@ -87,7 +87,7 @@ static Tcl_ThreadDataKey dataKey; * Prototypes for local functions: */ -static void ImageTypeThreadExitProc(ClientData clientData); +static void ImageTypeThreadExitProc(void *clientData); static Tcl_FreeProc DeleteImage; static void EventuallyDeleteImage(ImageModel *modelPtr, int forgetImageHashNow); @@ -208,7 +208,7 @@ Tk_CreateImageType( int Tk_ImageObjCmd( - ClientData clientData, /* Main window associated with interpreter. */ + void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ @@ -233,7 +233,7 @@ Tk_ImageObjCmd( const char *arg, *name; Tcl_Obj *resultObj; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?args?"); @@ -280,7 +280,7 @@ Tk_ImageObjCmd( if (typePtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image type \"%s\" doesn't exist", arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE_TYPE", arg, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE_TYPE", arg, (char *)NULL); return TCL_ERROR; } @@ -313,7 +313,7 @@ Tk_ImageObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "images may not be named the same as the main window", -1)); - Tcl_SetErrorCode(interp, "TK", "IMAGE", "SMASH_MAIN", NULL); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "SMASH_MAIN", (char *)NULL); return TCL_ERROR; } } @@ -375,8 +375,8 @@ Tk_ImageObjCmd( } Tcl_Preserve(modelPtr); if (oldimage) { - typedef int (OldCreateProc)(Tcl_Interp*, char*, int, char**, - Tk_ImageType*, Tk_ImageModel, ClientData*); + typedef int (OldCreateProc)(Tcl_Interp*, char*, Tcl_Size, char**, + Tk_ImageType*, Tk_ImageModel, void **); i = ((OldCreateProc*)typePtr->createProc)(interp, (char*)name, objc, (char**)args, typePtr, (Tk_ImageModel)modelPtr, &modelPtr->modelData); @@ -403,7 +403,7 @@ Tk_ImageObjCmd( modelPtr->modelData); } Tcl_SetObjResult(interp, Tcl_NewStringObj( - (const char *)Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr), -1)); + (const char *)Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr), TCL_INDEX_NONE)); break; } case IMAGE_DELETE: @@ -433,7 +433,7 @@ Tk_ImageObjCmd( continue; } Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( - (const char *)Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr), -1)); + (const char *)Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr), TCL_INDEX_NONE)); } Tcl_SetObjResult(interp, resultObj); break; @@ -446,12 +446,12 @@ Tk_ImageObjCmd( for (typePtr = tsdPtr->imageTypeList; typePtr != NULL; typePtr = typePtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( - typePtr->name, -1)); + typePtr->name, TCL_INDEX_NONE)); } for (typePtr = tsdPtr->oldImageTypeList; typePtr != NULL; typePtr = typePtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( - typePtr->name, -1)); + typePtr->name, TCL_INDEX_NONE)); } Tcl_SetObjResult(interp, resultObj); break; @@ -487,7 +487,7 @@ Tk_ImageObjCmd( switch ((enum options) index) { case IMAGE_HEIGHT: - Tcl_SetObjResult(interp, Tcl_NewIntObj(modelPtr->height)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(modelPtr->height)); break; case IMAGE_INUSE: Tcl_SetObjResult(interp, Tcl_NewBooleanObj( @@ -496,11 +496,11 @@ Tk_ImageObjCmd( case IMAGE_TYPE: if (modelPtr->typePtr != NULL) { Tcl_SetObjResult(interp, - Tcl_NewStringObj(modelPtr->typePtr->name, -1)); + Tcl_NewStringObj(modelPtr->typePtr->name, TCL_INDEX_NONE)); } break; case IMAGE_WIDTH: - Tcl_SetObjResult(interp, Tcl_NewIntObj(modelPtr->width)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(modelPtr->width)); break; default: Tcl_Panic("can't happen"); @@ -511,7 +511,7 @@ Tk_ImageObjCmd( alreadyDeleted: Tcl_SetObjResult(interp, Tcl_ObjPrintf("image \"%s\" doesn't exist",arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", arg, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", arg, (char *)NULL); return TCL_ERROR; } @@ -620,7 +620,7 @@ Tk_GetImage( Tk_ImageChangedProc *changeProc, /* Function to invoke when redisplay is needed * because image's pixels or size changed. */ - ClientData clientData) /* One-word argument to pass to damageProc. */ + void *clientData) /* One-word argument to pass to damageProc. */ { Tcl_HashEntry *hPtr; ImageModel *modelPtr; @@ -657,7 +657,7 @@ Tk_GetImage( if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image \"%s\" doesn't exist", name)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", name, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", name, (char *)NULL); } return NULL; } @@ -974,7 +974,11 @@ Tk_DeleteImage( static void DeleteImage( - char *blockPtr) /* Pointer to main data structure for image. */ +#if TCL_MAJOR_VERSION > 8 + void *blockPtr) /* Pointer to main data structure for image. */ +#else + char *blockPtr) +#endif { Image *imagePtr; Tk_ImageType *typePtr; @@ -1089,7 +1093,7 @@ TkDeleteAllImages( *---------------------------------------------------------------------- */ -ClientData +void * Tk_GetImageModelData( Tcl_Interp *interp, /* Interpreter in which the image was * created. */ |