diff options
Diffstat (limited to 'generic/tkImgBmap.c')
-rw-r--r-- | generic/tkImgBmap.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index f02b560..49de20a 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -3,9 +3,9 @@ * * This procedure implements images of type "bitmap" for Tk. * - * Copyright (c) 1994 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1999 Scriptics Corporation. + * Copyright © 1994 The Regents of the University of California. + * Copyright © 1994-1997 Sun Microsystems, Inc. + * Copyright © 1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -18,7 +18,7 @@ * image: */ -typedef struct BitmapModel { +typedef struct { Tk_ImageModel tkModel; /* Tk's token for image model. NULL means the * image is being deleted. */ Tcl_Interp *interp; /* Interpreter for application that is using @@ -49,7 +49,7 @@ typedef struct BitmapModel { */ typedef struct BitmapInstance { - int refCount; /* Number of instances that share this data + size_t refCount; /* Number of instances that share this data * structure. */ BitmapModel *modelPtr; /* Pointer to model for image. */ Tk_Window tkwin; /* Window in which the instances will be @@ -75,7 +75,7 @@ typedef struct BitmapInstance { static int GetByte(Tcl_Channel chan); static int ImgBmapCreate(Tcl_Interp *interp, - const char *name, int objc, Tcl_Obj *const objv[], + const char *name, Tcl_Size objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); static void *ImgBmapGet(Tk_Window tkwin, void *clientData); @@ -108,17 +108,17 @@ Tk_ImageType tkBitmapImageType = { static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_UID, "-background", NULL, NULL, - "", Tk_Offset(BitmapModel, bgUid), 0, NULL}, + "", offsetof(BitmapModel, bgUid), 0, NULL}, {TK_CONFIG_STRING, "-data", NULL, NULL, - NULL, Tk_Offset(BitmapModel, dataString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapModel, dataString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_STRING, "-file", NULL, NULL, - NULL, Tk_Offset(BitmapModel, fileString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapModel, fileString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_UID, "-foreground", NULL, NULL, - "#000000", Tk_Offset(BitmapModel, fgUid), 0, NULL}, + "#000000", offsetof(BitmapModel, fgUid), 0, NULL}, {TK_CONFIG_STRING, "-maskdata", NULL, NULL, - NULL, Tk_Offset(BitmapModel, maskDataString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapModel, maskDataString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_STRING, "-maskfile", NULL, NULL, - NULL, Tk_Offset(BitmapModel, maskFileString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapModel, maskFileString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; @@ -150,7 +150,7 @@ static int ImgBmapCmd(void *clientData, Tcl_Interp *interp, static void ImgBmapCmdDeletedProc(void *clientData); static void ImgBmapConfigureInstance(BitmapInstance *instancePtr); static int ImgBmapConfigureModel(BitmapModel *modelPtr, - int objc, Tcl_Obj *const objv[], int flags); + Tcl_Size objc, Tcl_Obj *const objv[], int flags); static int NextBitmapWord(ParseInfo *parseInfoPtr); /* @@ -174,7 +174,7 @@ ImgBmapCreate( Tcl_Interp *interp, /* Interpreter for application containing * image. */ const char *name, /* Name to use for image. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects for options (doesn't * include image name or type). */ TCL_UNUSED(const Tk_ImageType *),/* Pointer to our type record (not used). */ @@ -231,7 +231,7 @@ static int ImgBmapConfigureModel( BitmapModel *modelPtr, /* Pointer to data structure describing * overall bitmap image to (reconfigure). */ - int objc, /* Number of entries in objv. */ + Tcl_Size objc, /* Number of entries in objv. */ Tcl_Obj *const objv[], /* Pairs of configuration options for image. */ int flags) /* Flags to pass to Tk_ConfigureWidget, such * as TK_CONFIG_ARGV_ONLY. */ @@ -269,7 +269,7 @@ ImgBmapConfigureModel( || (modelPtr->maskDataString != NULL)) { if (modelPtr->data == NULL) { Tcl_SetObjResult(modelPtr->interp, Tcl_NewStringObj( - "can't have mask without bitmap", -1)); + "can't have mask without bitmap", TCL_INDEX_NONE)); Tcl_SetErrorCode(modelPtr->interp, "TK", "IMAGE", "BITMAP", "NO_BITMAP", NULL); return TCL_ERROR; @@ -285,7 +285,7 @@ ImgBmapConfigureModel( ckfree(modelPtr->maskData); modelPtr->maskData = NULL; Tcl_SetObjResult(modelPtr->interp, Tcl_NewStringObj( - "bitmap and mask have different sizes", -1)); + "bitmap and mask have different sizes", TCL_INDEX_NONE)); Tcl_SetErrorCode(modelPtr->interp, "TK", "IMAGE", "BITMAP", "MASK_SIZE", NULL); return TCL_ERROR; @@ -591,7 +591,7 @@ TkGetBitmapData( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "format error in bitmap data; looks like it's an" - " obsolete X10 bitmap file", -1)); + " obsolete X10 bitmap file", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "BITMAP", "OBSOLETE", NULL); } @@ -636,7 +636,7 @@ TkGetBitmapData( error: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "format error in bitmap data", -1)); + "format error in bitmap data", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "BITMAP", "FORMAT", NULL); } @@ -764,14 +764,14 @@ ImgBmapCmd( return TCL_ERROR; } return Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs, - (char *)modelPtr, Tcl_GetString(objv[2]), 0); + modelPtr, Tcl_GetString(objv[2]), 0); case 1: /* configure */ if (objc == 2) { return Tk_ConfigureInfo(interp, Tk_MainWindow(interp), - configSpecs, (char *)modelPtr, NULL, 0); + configSpecs, modelPtr, NULL, 0); } else if (objc == 3) { return Tk_ConfigureInfo(interp, Tk_MainWindow(interp), - configSpecs, (char *)modelPtr, + configSpecs, modelPtr, Tcl_GetString(objv[2]), 0); } else { return ImgBmapConfigureModel(modelPtr, objc-2, objv+2, @@ -1013,7 +1013,7 @@ ImgBmapDelete( if (modelPtr->maskData != NULL) { ckfree(modelPtr->maskData); } - Tk_FreeOptions(configSpecs, (char *)modelPtr, NULL, 0); + Tk_FreeOptions(configSpecs, modelPtr, NULL, 0); ckfree(modelPtr); } @@ -1151,10 +1151,10 @@ ImgBmapPsImagemask( Tcl_AppendPrintfToObj(psObj, " %02x", bit_reverse[0xff & data[i*nBytePerRow + j]]); } - Tcl_AppendToObj(psObj, "\n", -1); + Tcl_AppendToObj(psObj, "\n", TCL_INDEX_NONE); } - Tcl_AppendToObj(psObj, ">} imagemask \n", -1); + Tcl_AppendToObj(psObj, ">} imagemask \n", TCL_INDEX_NONE); } /* @@ -1209,7 +1209,7 @@ ImgBmapPostscript( if (modelPtr->width*modelPtr->height > 60000) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "unable to generate postscript for bitmaps larger than 60000" - " pixels", -1)); + " pixels", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", NULL); return TCL_ERROR; } @@ -1259,7 +1259,7 @@ ImgBmapPostscript( if (modelPtr->maskData == NULL) { Tcl_AppendToObj(psObj, "0 0 moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto " - "closepath fill\n", -1); + "closepath fill\n", TCL_INDEX_NONE); } else { ImgBmapPsImagemask(psObj, modelPtr->width, modelPtr->height, modelPtr->maskData); |