summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/CrtImgType.344
-rw-r--r--doc/ImgChanged.38
-rw-r--r--doc/NameOfImg.36
-rw-r--r--generic/tk.decls8
-rw-r--r--generic/tk.h15
-rw-r--r--generic/tkDecls.h25
-rw-r--r--generic/tkGrid.c9
-rw-r--r--generic/tkImage.c228
-rw-r--r--generic/tkImgPhInstance.c154
-rw-r--r--generic/tkImgPhoto.h11
-rw-r--r--generic/tkInt.h2
-rw-r--r--generic/tkOldTest.c52
-rw-r--r--generic/tkPack.c5
-rw-r--r--generic/tkPlace.c5
-rw-r--r--generic/tkStubInit.c2
-rw-r--r--generic/tkTest.c54
-rw-r--r--tests/grid.test2
-rw-r--r--tests/oldpack.test4
-rw-r--r--tests/pack.test2
-rw-r--r--tests/place.test2
20 files changed, 321 insertions, 317 deletions
diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3
index 4949c50..b0a14fc 100644
--- a/doc/CrtImgType.3
+++ b/doc/CrtImgType.3
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
-Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
+Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -17,7 +17,7 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind o
\fBTk_CreateImageType\fR(\fItypePtr\fR)
.sp
ClientData
-\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
+\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR)
.sp
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
.SH ARGUMENTS
@@ -71,7 +71,7 @@ The fields of this structure will be described in later subsections
of this entry.
.PP
The second major data structure manipulated by an image manager
-is called an \fIimage master\fR; it contains overall information
+is called an \fIimage model\fR; it contains overall information
about a particular image, such as the values of the configuration
options specified in an \fBimage create\fR command.
There will usually be one of these structures for each
@@ -113,8 +113,8 @@ typedef int \fBTk_ImageCreateProc\fR(
int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[],
const Tk_ImageType *\fItypePtr\fR,
- Tk_ImageMaster \fImaster\fR,
- ClientData *\fImasterDataPtr\fR);
+ Tk_ImageModel \fImodel\fR,
+ ClientData *\fImodelDataPtr\fR);
.CE
The \fIinterp\fR argument is the interpreter in which the \fBimage\fR
command was invoked, and \fIname\fR is the name for the new image,
@@ -123,15 +123,15 @@ or generated automatically by the \fBimage\fR command.
The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration
options for the new image (everything after the name argument to
\fBimage\fR).
-The \fImaster\fR argument is a token that refers to Tk's information
+The \fImodel\fR argument is a token that refers to Tk's information
about this image; the image manager must return this token to
Tk when invoking the \fBTk_ImageChanged\fR procedure.
Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR
-and create an image master data structure for the new image.
+and create an image model data structure for the new image.
\fIcreateProc\fR may store an arbitrary one-word value at
-*\fImasterDataPtr\fR, which will be passed back to the
+*\fImodelDataPtr\fR, which will be passed back to the
image manager when other callbacks are invoked.
-Typically the value is a pointer to the master data
+Typically the value is a pointer to the model data
structure for the image.
.PP
If \fIcreateProc\fR encounters an error, it should leave an error
@@ -148,11 +148,11 @@ This procedure must match the following prototype:
.CS
typedef ClientData \fBTk_ImageGetProc\fR(
Tk_Window \fItkwin\fR,
- ClientData \fImasterData\fR);
+ ClientData \fImodelData\fR);
.CE
The \fItkwin\fR argument identifies the window in which the
-image will be used and \fImasterData\fR is the value
-returned by \fIcreateProc\fR when the image master was created.
+image will be used and \fImodelData\fR is the value
+returned by \fIcreateProc\fR when the image model was created.
\fIgetProc\fR will usually create a data structure for the new
instance, including such things as the resources needed to
display the image in the given window.
@@ -221,25 +221,25 @@ each of the image's instances.
\fIdeleteProc\fR must match the following prototype:
.CS
typedef void \fBTk_ImageDeleteProc\fR(
- ClientData \fImasterData\fR);
+ ClientData \fImodelData\fR);
.CE
-The \fImasterData\fR argument will be the same as the value
-stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the
+The \fImodelData\fR argument will be the same as the value
+stored in \fI*modelDataPtr\fR by \fIcreateProc\fR when the
image was created.
\fIdeleteProc\fR should release any resources associated with
the image.
-.SH TK_GETIMAGEMASTERDATA
+.SH TK_GETIMAGEMODELDATA
.PP
-The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
+The procedure \fBTk_GetImageModelData\fR may be invoked to retrieve
information about an image. For example, an image manager can use this
-procedure to locate its image master data for an image.
+procedure to locate its image model data for an image.
If there exists an image named \fIname\fR
in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is
filled in with type information for the image (the \fItypePtr\fR value
passed to \fBTk_CreateImageType\fR when the image type was registered)
and the return value is the ClientData value returned by the
\fIcreateProc\fR when the image was created (this is typically a
-pointer to the image master data structure). If no such image exists
+pointer to the image model data structure). If no such image exists
then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
.SH "LEGACY INTERFACE SUPPORT"
.PP
@@ -252,8 +252,8 @@ typedef int \fBTk_ImageCreateProc\fR(
int \fIargc\fR,
char **\fIargv\fR,
Tk_ImageType *\fItypePtr\fR,
- Tk_ImageMaster \fImaster\fR,
- ClientData *\fImasterDataPtr\fR);
+ Tk_ImageModel \fImodel\fR,
+ ClientData *\fImodelDataPtr\fR);
.CE
Legacy programs and libraries dating from those days may still
contain code that defines extended Tk image types using the old
@@ -280,4 +280,4 @@ interfaces. Expect their support to go away in Tk 9.
.SH "SEE ALSO"
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
.SH KEYWORDS
-image manager, image type, instance, master
+image manager, image type, instance, model
diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3
index ccf0c11..d801dce 100644
--- a/doc/ImgChanged.3
+++ b/doc/ImgChanged.3
@@ -14,10 +14,10 @@ Tk_ImageChanged \- notify widgets that image needs to be redrawn
.nf
\fB#include <tk.h>\fR
.sp
-\fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR)
+\fBTk_ImageChanged\fR(\fIimageModel, x, y, width, height, imageWidth, imageHeight\fR)
.SH ARGUMENTS
-.AS Tk_ImageMaster imageHeight
-.AP Tk_ImageMaster imageMaster in
+.AS Tk_ImageModel imageHeight
+.AP Tk_ImageModel imageModel in
Token for image, which was passed to image's \fIcreateProc\fR when
the image was created.
.AP int x in
@@ -42,7 +42,7 @@ whenever anything happens that requires the image to be redrawn.
As a result of calling \fBTk_ImageChanged\fR, any widgets using
the image are notified so that they can redisplay themselves
appropriately.
-The \fIimageMaster\fR argument identifies the image, and
+The \fIimageModel\fR argument identifies the image, and
\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR
specify a rectangular region within the image that needs to
be redrawn.
diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3
index 8c191ce..781650f 100644
--- a/doc/NameOfImg.3
+++ b/doc/NameOfImg.3
@@ -14,10 +14,10 @@ Tk_NameOfImage \- Return name of image.
\fB#include <tk.h>\fR
.sp
const char *
-\fBTk_NameOfImage\fR(\fIimageMaster\fR)
+\fBTk_NameOfImage\fR(\fIimageModel\fR)
.SH ARGUMENTS
-.AS Tk_ImageMaster imageMaster
-.AP Tk_ImageMaster imageMaster in
+.AS Tk_ImageModel imageModel
+.AP Tk_ImageModel imageModel in
Token for image, which was passed to image manager's \fIcreateProc\fR when
the image was created.
.BE
diff --git a/generic/tk.decls b/generic/tk.decls
index 31e107d..df51b31 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -403,7 +403,7 @@ declare 97 {
Tk_ImageChangedProc *changeProc, ClientData clientData)
}
declare 98 {
- ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
+ ClientData Tk_GetImageModelData(Tcl_Interp *interp,
const char *name, const Tk_ImageType **typePtrPtr)
}
declare 99 {
@@ -472,7 +472,7 @@ declare 116 {
Tk_Window Tk_IdToWindow(Display *display, Window window)
}
declare 117 {
- void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
+ void Tk_ImageChanged(Tk_ImageModel model, int x, int y,
int width, int height, int imageWidth, int imageHeight)
}
declare 118 {
@@ -487,7 +487,7 @@ declare 120 {
}
declare 121 {
void Tk_MaintainGeometry(Tk_Window slave,
- Tk_Window master, int x, int y, int width, int height)
+ Tk_Window model, int x, int y, int width, int height)
}
declare 122 {
Tk_Window Tk_MainWindow(Tcl_Interp *interp)
@@ -539,7 +539,7 @@ declare 136 {
const char *Tk_NameOfFont(Tk_Font font)
}
declare 137 {
- const char *Tk_NameOfImage(Tk_ImageMaster imageMaster)
+ const char *Tk_NameOfImage(Tk_ImageModel imageModel)
}
declare 138 {
const char *Tk_NameOfJoinStyle(int join)
diff --git a/generic/tk.h b/generic/tk.h
index cec87b3..2c8b9d0 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -122,13 +122,14 @@ extern "C" {
* Dummy types that are used by clients:
*/
+#define Tk_ImageModel Tk_ImageMaster
typedef struct Tk_BindingTable_ *Tk_BindingTable;
typedef struct Tk_Canvas_ *Tk_Canvas;
typedef struct Tk_Cursor_ *Tk_Cursor;
typedef struct Tk_ErrorHandler_ *Tk_ErrorHandler;
typedef struct Tk_Font_ *Tk_Font;
typedef struct Tk_Image__ *Tk_Image;
-typedef struct Tk_ImageMaster_ *Tk_ImageMaster;
+typedef struct Tk_ImageMaster_ *Tk_ImageModel;
typedef struct Tk_OptionTable_ *Tk_OptionTable;
typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo;
typedef struct Tk_TextLayout_ *Tk_TextLayout;
@@ -1303,19 +1304,19 @@ typedef struct Tk_Outline {
typedef struct Tk_ImageType Tk_ImageType;
#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE)
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
- char **argv, Tk_ImageType *typePtr, Tk_ImageMaster master,
- ClientData *masterDataPtr);
+ char **argv, Tk_ImageType *typePtr, Tk_ImageModel model,
+ ClientData *modelDataPtr);
#else
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, int objc,
- Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageMaster master,
- ClientData *masterDataPtr);
+ Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model,
+ ClientData *modelDataPtr);
#endif /* USE_OLD_IMAGE */
-typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData masterData);
+typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData modelData);
typedef void (Tk_ImageDisplayProc) (ClientData instanceData, Display *display,
Drawable drawable, int imageX, int imageY, int width, int height,
int drawableX, int drawableY);
typedef void (Tk_ImageFreeProc) (ClientData instanceData, Display *display);
-typedef void (Tk_ImageDeleteProc) (ClientData masterData);
+typedef void (Tk_ImageDeleteProc) (ClientData modelData);
typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y,
int width, int height, int imageWidth, int imageHeight);
typedef int (Tk_ImagePostscriptProc) (ClientData clientData,
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index bb2fdd4..5d5fcd2 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -355,7 +355,7 @@ EXTERN Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin,
Tk_ImageChangedProc *changeProc,
ClientData clientData);
/* 98 */
-EXTERN ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
+EXTERN ClientData Tk_GetImageModelData(Tcl_Interp *interp,
const char *name,
const Tk_ImageType **typePtrPtr);
/* 99 */
@@ -411,7 +411,7 @@ EXTERN void Tk_HandleEvent(XEvent *eventPtr);
/* 116 */
EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window);
/* 117 */
-EXTERN void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
+EXTERN void Tk_ImageChanged(Tk_ImageModel model, int x, int y,
int width, int height, int imageWidth,
int imageHeight);
/* 118 */
@@ -422,9 +422,8 @@ EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name);
EXTERN int Tk_IntersectTextLayout(Tk_TextLayout layout, int x,
int y, int width, int height);
/* 121 */
-EXTERN void Tk_MaintainGeometry(Tk_Window slave,
- Tk_Window master, int x, int y, int width,
- int height);
+EXTERN void Tk_MaintainGeometry(Tk_Window slave, Tk_Window model,
+ int x, int y, int width, int height);
/* 122 */
EXTERN Tk_Window Tk_MainWindow(Tcl_Interp *interp);
/* 123 */
@@ -461,7 +460,7 @@ EXTERN const char * Tk_NameOfCursor(Display *display, Tk_Cursor cursor);
/* 136 */
EXTERN const char * Tk_NameOfFont(Tk_Font font);
/* 137 */
-EXTERN const char * Tk_NameOfImage(Tk_ImageMaster imageMaster);
+EXTERN const char * Tk_NameOfImage(Tk_ImageModel imageModel);
/* 138 */
EXTERN const char * Tk_NameOfJoinStyle(int join);
/* 139 */
@@ -1003,7 +1002,7 @@ typedef struct TkStubs {
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_GetImageMasterData) (Tcl_Interp *interp, const char *name, const Tk_ImageType **typePtrPtr); /* 98 */
+ ClientData (*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 */
@@ -1022,11 +1021,11 @@ typedef struct TkStubs {
int (*tk_Grab) (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal); /* 114 */
void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */
Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */
- void (*tk_ImageChanged) (Tk_ImageMaster master, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */
+ void (*tk_ImageChanged) (Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */
int (*tk_Init) (Tcl_Interp *interp); /* 118 */
Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */
int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */
- void (*tk_MaintainGeometry) (Tk_Window slave, Tk_Window master, int x, int y, int width, int height); /* 121 */
+ void (*tk_MaintainGeometry) (Tk_Window slave, Tk_Window model, 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 */
@@ -1042,7 +1041,7 @@ typedef struct TkStubs {
const char * (*tk_NameOfColor) (XColor *colorPtr); /* 134 */
const char * (*tk_NameOfCursor) (Display *display, Tk_Cursor cursor); /* 135 */
const char * (*tk_NameOfFont) (Tk_Font font); /* 136 */
- const char * (*tk_NameOfImage) (Tk_ImageMaster imageMaster); /* 137 */
+ const char * (*tk_NameOfImage) (Tk_ImageModel imageModel); /* 137 */
const char * (*tk_NameOfJoinStyle) (int join); /* 138 */
const char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */
const char * (*tk_NameOfRelief) (int relief); /* 140 */
@@ -1395,8 +1394,8 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_GetGC) /* 96 */
#define Tk_GetImage \
(tkStubsPtr->tk_GetImage) /* 97 */
-#define Tk_GetImageMasterData \
- (tkStubsPtr->tk_GetImageMasterData) /* 98 */
+#define Tk_GetImageModelData \
+ (tkStubsPtr->tk_GetImageModelData) /* 98 */
#define Tk_GetItemTypes \
(tkStubsPtr->tk_GetItemTypes) /* 99 */
#define Tk_GetJoinStyle \
@@ -1774,7 +1773,7 @@ extern const TkStubs *tkStubsPtr;
#undef Tk_FreeStyleFromObj
#define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj)
#define Tk_FreeStyleFromObj(obj) /* no-op */
-
+#define Tk_GetImageMasterData Tk_GetImageModelData
#if defined(_WIN32) && defined(UNICODE)
# define Tk_MainEx Tk_MainExW
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 6ad77dc..eac98cb 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -338,13 +338,13 @@ Tk_GridObjCmd(
Tk_Window tkwin = (Tk_Window)clientData;
static const char *const optionStrings[] = {
"anchor", "bbox", "columnconfigure", "configure",
- "forget", "info", "location", "propagate", "remove",
- "rowconfigure", "size", "slaves", NULL
+ "content", "forget", "info", "location", "propagate",
+ "remove", "rowconfigure", "size", "slaves", NULL
};
enum options {
GRID_ANCHOR, GRID_BBOX, GRID_COLUMNCONFIGURE, GRID_CONFIGURE,
- GRID_FORGET, GRID_INFO, GRID_LOCATION, GRID_PROPAGATE, GRID_REMOVE,
- GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES
+ GRID_CONTENT, GRID_FORGET, GRID_INFO, GRID_LOCATION, GRID_PROPAGATE,
+ GRID_REMOVE, GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES
};
int index;
@@ -384,6 +384,7 @@ Tk_GridObjCmd(
return GridPropagateCommand(tkwin, interp, objc, objv);
case GRID_SIZE:
return GridSizeCommand(tkwin, interp, objc, objv);
+ case GRID_CONTENT:
case GRID_SLAVES:
return GridSlavesCommand(tkwin, interp, objc, objv);
diff --git a/generic/tkImage.c b/generic/tkImage.c
index 1874d38..8c58c78 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -26,7 +26,7 @@ typedef struct Image {
Display *display; /* Display for tkwin. Needed because when the
* image is eventually freed tkwin may not
* exist anymore. */
- struct ImageMaster *masterPtr;
+ struct ImageModel *modelPtr;
/* Master for this image (identifiers image
* manager, for example). */
ClientData instanceData; /* One word argument to pass to image manager
@@ -45,11 +45,11 @@ typedef struct Image {
* from it. Entries in mainPtr->imageTable point to these structures.
*/
-typedef struct ImageMaster {
+typedef struct ImageModel {
Tk_ImageType *typePtr; /* Information about image type. NULL means
* that no image manager owns this image: the
* image was deleted. */
- ClientData masterData; /* One-word argument to pass to image mgr when
+ ClientData modelData; /* One-word argument to pass to image mgr when
* dealing with the master, as opposed to
* instances. */
int width, height; /* Last known dimensions for image. */
@@ -64,7 +64,7 @@ typedef struct ImageMaster {
int deleted; /* Flag set when image is being deleted. */
TkWindow *winPtr; /* Main window of interpreter (used to detect
* when the world is falling apart.) */
-} ImageMaster;
+} ImageModel;
typedef struct {
Tk_ImageType *imageTypeList;/* First in a list of all known image
@@ -82,8 +82,8 @@ static Tcl_ThreadDataKey dataKey;
*/
static void ImageTypeThreadExitProc(ClientData clientData);
-static void DeleteImage(ImageMaster *masterPtr);
-static void EventuallyDeleteImage(ImageMaster *masterPtr,
+static void DeleteImage(ImageModel *modelPtr);
+static void EventuallyDeleteImage(ImageModel *modelPtr,
int forgetImageHashNow);
/*
@@ -219,7 +219,7 @@ Tk_ImageObjCmd(
TkWindow *winPtr = (TkWindow *)clientData;
int i, isNew, firstOption, index;
Tk_ImageType *typePtr;
- ImageMaster *masterPtr;
+ ImageModel *modelPtr;
Image *imagePtr;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
@@ -319,37 +319,37 @@ Tk_ImageObjCmd(
hPtr = Tcl_CreateHashEntry(&winPtr->mainPtr->imageTable, name, &isNew);
if (isNew) {
- masterPtr = (ImageMaster *)ckalloc(sizeof(ImageMaster));
- masterPtr->typePtr = NULL;
- masterPtr->masterData = NULL;
- masterPtr->width = masterPtr->height = 1;
- masterPtr->tablePtr = &winPtr->mainPtr->imageTable;
- masterPtr->hPtr = hPtr;
- masterPtr->instancePtr = NULL;
- masterPtr->deleted = 0;
- masterPtr->winPtr = winPtr->mainPtr->winPtr;
- Tcl_Preserve(masterPtr->winPtr);
- Tcl_SetHashValue(hPtr, masterPtr);
+ modelPtr = (ImageModel *)ckalloc(sizeof(ImageModel));
+ modelPtr->typePtr = NULL;
+ modelPtr->modelData = NULL;
+ modelPtr->width = modelPtr->height = 1;
+ modelPtr->tablePtr = &winPtr->mainPtr->imageTable;
+ modelPtr->hPtr = hPtr;
+ modelPtr->instancePtr = NULL;
+ modelPtr->deleted = 0;
+ modelPtr->winPtr = winPtr->mainPtr->winPtr;
+ Tcl_Preserve(modelPtr->winPtr);
+ Tcl_SetHashValue(hPtr, modelPtr);
} else {
/*
* An image already exists by this name. Disconnect the instances
* from the master.
*/
- masterPtr = (ImageMaster *)Tcl_GetHashValue(hPtr);
- if (masterPtr->typePtr != NULL) {
- for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
+ modelPtr = (ImageModel *)Tcl_GetHashValue(hPtr);
+ if (modelPtr->typePtr != NULL) {
+ for (imagePtr = modelPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
- masterPtr->typePtr->freeProc(imagePtr->instanceData,
+ modelPtr->typePtr->freeProc(imagePtr->instanceData,
imagePtr->display);
imagePtr->changeProc(imagePtr->widgetClientData, 0, 0,
- masterPtr->width, masterPtr->height,
- masterPtr->width, masterPtr->height);
+ modelPtr->width, modelPtr->height,
+ modelPtr->width, modelPtr->height);
}
- masterPtr->typePtr->deleteProc(masterPtr->masterData);
- masterPtr->typePtr = NULL;
+ modelPtr->typePtr->deleteProc(modelPtr->modelData);
+ modelPtr->typePtr = NULL;
}
- masterPtr->deleted = 0;
+ modelPtr->deleted = 0;
}
/*
@@ -370,25 +370,25 @@ Tk_ImageObjCmd(
}
args[objc] = NULL;
}
- Tcl_Preserve(masterPtr);
+ Tcl_Preserve(modelPtr);
if (typePtr->createProc(interp, name, objc, args, typePtr,
- (Tk_ImageMaster)masterPtr, &masterPtr->masterData) != TCL_OK){
- EventuallyDeleteImage(masterPtr, 0);
- Tcl_Release(masterPtr);
+ (Tk_ImageModel)modelPtr, &modelPtr->modelData) != TCL_OK){
+ EventuallyDeleteImage(modelPtr, 0);
+ Tcl_Release(modelPtr);
if (oldimage) {
ckfree(args);
}
return TCL_ERROR;
}
- Tcl_Release(masterPtr);
+ Tcl_Release(modelPtr);
if (oldimage) {
ckfree(args);
}
- masterPtr->typePtr = typePtr;
- for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
+ modelPtr->typePtr = typePtr;
+ for (imagePtr = modelPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
imagePtr->instanceData = typePtr->getProc(imagePtr->tkwin,
- masterPtr->masterData);
+ modelPtr->modelData);
}
Tcl_SetObjResult(interp, Tcl_NewStringObj(
(const char *)Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr), -1));
@@ -401,11 +401,11 @@ Tk_ImageObjCmd(
if (hPtr == NULL) {
goto alreadyDeleted;
}
- masterPtr = (ImageMaster *)Tcl_GetHashValue(hPtr);
- if (masterPtr->deleted) {
+ modelPtr = (ImageModel *)Tcl_GetHashValue(hPtr);
+ if (modelPtr->deleted) {
goto alreadyDeleted;
}
- DeleteImage(masterPtr);
+ DeleteImage(modelPtr);
}
break;
case IMAGE_NAMES:
@@ -416,8 +416,8 @@ Tk_ImageObjCmd(
hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search);
resultObj = Tcl_NewObj();
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- masterPtr = (ImageMaster *)Tcl_GetHashValue(hPtr);
- if (masterPtr->deleted) {
+ modelPtr = (ImageModel *)Tcl_GetHashValue(hPtr);
+ if (modelPtr->deleted) {
continue;
}
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
@@ -464,8 +464,8 @@ Tk_ImageObjCmd(
if (hPtr == NULL) {
goto alreadyDeleted;
}
- masterPtr = (ImageMaster *)Tcl_GetHashValue(hPtr);
- if (masterPtr->deleted) {
+ modelPtr = (ImageModel *)Tcl_GetHashValue(hPtr);
+ if (modelPtr->deleted) {
goto alreadyDeleted;
}
@@ -475,20 +475,20 @@ Tk_ImageObjCmd(
switch ((enum options) index) {
case IMAGE_HEIGHT:
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(masterPtr->height));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(modelPtr->height));
break;
case IMAGE_INUSE:
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- masterPtr->typePtr && masterPtr->instancePtr));
+ modelPtr->typePtr && modelPtr->instancePtr));
break;
case IMAGE_TYPE:
- if (masterPtr->typePtr != NULL) {
+ if (modelPtr->typePtr != NULL) {
Tcl_SetObjResult(interp,
- Tcl_NewStringObj(masterPtr->typePtr->name, -1));
+ Tcl_NewStringObj(modelPtr->typePtr->name, -1));
}
break;
case IMAGE_WIDTH:
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(masterPtr->width));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(modelPtr->width));
break;
default:
Tcl_Panic("can't happen");
@@ -524,7 +524,7 @@ Tk_ImageObjCmd(
void
Tk_ImageChanged(
- Tk_ImageMaster imageMaster, /* Image that needs redisplay. */
+ Tk_ImageModel imageModel, /* Image that needs redisplay. */
int x, int y, /* Coordinates of upper-left pixel of region
* of image that needs to be redrawn. */
int width, int height, /* Dimensions (in pixels) of region of image
@@ -535,12 +535,12 @@ Tk_ImageChanged(
int imageWidth, int imageHeight)
/* New dimensions of image. */
{
- ImageMaster *masterPtr = (ImageMaster *) imageMaster;
+ ImageModel *modelPtr = (ImageModel *) imageModel;
Image *imagePtr;
- masterPtr->width = imageWidth;
- masterPtr->height = imageHeight;
- for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
+ modelPtr->width = imageWidth;
+ modelPtr->height = imageHeight;
+ for (imagePtr = modelPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
imagePtr->changeProc(imagePtr->widgetClientData, x, y, width, height,
imageWidth, imageHeight);
@@ -556,7 +556,7 @@ Tk_ImageChanged(
* the image.
*
* Results:
- * The return value is the string name for imageMaster.
+ * The return value is the string name for imageModel.
*
* Side effects:
* None.
@@ -566,14 +566,14 @@ Tk_ImageChanged(
const char *
Tk_NameOfImage(
- Tk_ImageMaster imageMaster) /* Token for image. */
+ Tk_ImageModel imageModel) /* Token for image. */
{
- ImageMaster *masterPtr = (ImageMaster *) imageMaster;
+ ImageModel *modelPtr = (ImageModel *) imageModel;
- if (masterPtr->hPtr == NULL) {
+ if (modelPtr->hPtr == NULL) {
return NULL;
}
- return (const char *)Tcl_GetHashKey(masterPtr->tablePtr, masterPtr->hPtr);
+ return (const char *)Tcl_GetHashKey(modelPtr->tablePtr, modelPtr->hPtr);
}
/*
@@ -611,30 +611,30 @@ Tk_GetImage(
ClientData clientData) /* One-word argument to pass to damageProc. */
{
Tcl_HashEntry *hPtr;
- ImageMaster *masterPtr;
+ ImageModel *modelPtr;
Image *imagePtr;
hPtr = Tcl_FindHashEntry(&((TkWindow *) tkwin)->mainPtr->imageTable, name);
if (hPtr == NULL) {
goto noSuchImage;
}
- masterPtr = (ImageMaster *)Tcl_GetHashValue(hPtr);
- if (masterPtr->typePtr == NULL) {
+ modelPtr = (ImageModel *)Tcl_GetHashValue(hPtr);
+ if (modelPtr->typePtr == NULL) {
goto noSuchImage;
}
- if (masterPtr->deleted) {
+ if (modelPtr->deleted) {
goto noSuchImage;
}
imagePtr = (Image *)ckalloc(sizeof(Image));
imagePtr->tkwin = tkwin;
imagePtr->display = Tk_Display(tkwin);
- imagePtr->masterPtr = masterPtr;
+ imagePtr->modelPtr = modelPtr;
imagePtr->instanceData =
- masterPtr->typePtr->getProc(tkwin, masterPtr->masterData);
+ modelPtr->typePtr->getProc(tkwin, modelPtr->modelData);
imagePtr->changeProc = changeProc;
imagePtr->widgetClientData = clientData;
- imagePtr->nextPtr = masterPtr->instancePtr;
- masterPtr->instancePtr = imagePtr;
+ imagePtr->nextPtr = modelPtr->instancePtr;
+ modelPtr->instancePtr = imagePtr;
return (Tk_Image) imagePtr;
noSuchImage:
@@ -670,20 +670,20 @@ Tk_FreeImage(
* a widget. */
{
Image *imagePtr = (Image *) image;
- ImageMaster *masterPtr = imagePtr->masterPtr;
+ ImageModel *modelPtr = imagePtr->modelPtr;
Image *prevPtr;
/*
* Clean up the particular instance.
*/
- if (masterPtr->typePtr != NULL) {
- masterPtr->typePtr->freeProc(imagePtr->instanceData,
+ if (modelPtr->typePtr != NULL) {
+ modelPtr->typePtr->freeProc(imagePtr->instanceData,
imagePtr->display);
}
- prevPtr = masterPtr->instancePtr;
+ prevPtr = modelPtr->instancePtr;
if (prevPtr == imagePtr) {
- masterPtr->instancePtr = imagePtr->nextPtr;
+ modelPtr->instancePtr = imagePtr->nextPtr;
} else {
while (prevPtr->nextPtr != imagePtr) {
prevPtr = prevPtr->nextPtr;
@@ -697,12 +697,12 @@ Tk_FreeImage(
* image has been deleted, then delete the master too.
*/
- if ((masterPtr->typePtr == NULL) && (masterPtr->instancePtr == NULL)) {
- if (masterPtr->hPtr != NULL) {
- Tcl_DeleteHashEntry(masterPtr->hPtr);
+ if ((modelPtr->typePtr == NULL) && (modelPtr->instancePtr == NULL)) {
+ if (modelPtr->hPtr != NULL) {
+ Tcl_DeleteHashEntry(modelPtr->hPtr);
}
- Tcl_Release(masterPtr->winPtr);
- ckfree(masterPtr);
+ Tcl_Release(modelPtr->winPtr);
+ ckfree(modelPtr);
}
}
@@ -742,7 +742,7 @@ Tk_PostscriptImage(
GC newGC;
XGCValues gcValues;
- if (imagePtr->masterPtr->typePtr == NULL) {
+ if (imagePtr->modelPtr->typePtr == NULL) {
/*
* No master for image, so nothing to display on postscript.
*/
@@ -755,9 +755,9 @@ Tk_PostscriptImage(
* otherwise go on with generic code.
*/
- if (imagePtr->masterPtr->typePtr->postscriptProc != NULL) {
- return imagePtr->masterPtr->typePtr->postscriptProc(
- imagePtr->masterPtr->masterData, interp, tkwin, psinfo,
+ if (imagePtr->modelPtr->typePtr->postscriptProc != NULL) {
+ return imagePtr->modelPtr->typePtr->postscriptProc(
+ imagePtr->modelPtr->modelData, interp, tkwin, psinfo,
x, y, width, height, prepass);
}
@@ -838,7 +838,7 @@ Tk_RedrawImage(
{
Image *imagePtr = (Image *) image;
- if (imagePtr->masterPtr->typePtr == NULL) {
+ if (imagePtr->modelPtr->typePtr == NULL) {
/*
* No master for image, so nothing to display.
*/
@@ -860,13 +860,13 @@ Tk_RedrawImage(
drawableY -= imageY;
imageY = 0;
}
- if ((imageX + width) > imagePtr->masterPtr->width) {
- width = imagePtr->masterPtr->width - imageX;
+ if ((imageX + width) > imagePtr->modelPtr->width) {
+ width = imagePtr->modelPtr->width - imageX;
}
- if ((imageY + height) > imagePtr->masterPtr->height) {
- height = imagePtr->masterPtr->height - imageY;
+ if ((imageY + height) > imagePtr->modelPtr->height) {
+ height = imagePtr->modelPtr->height - imageY;
}
- imagePtr->masterPtr->typePtr->displayProc(imagePtr->instanceData,
+ imagePtr->modelPtr->typePtr->displayProc(imagePtr->instanceData,
imagePtr->display, drawable, imageX, imageY, width, height,
drawableX, drawableY);
}
@@ -896,8 +896,8 @@ Tk_SizeOfImage(
{
Image *imagePtr = (Image *) image;
- *widthPtr = imagePtr->masterPtr->width;
- *heightPtr = imagePtr->masterPtr->height;
+ *widthPtr = imagePtr->modelPtr->width;
+ *heightPtr = imagePtr->modelPtr->height;
}
/*
@@ -934,7 +934,7 @@ Tk_DeleteImage(
if (hPtr == NULL) {
return;
}
- DeleteImage((ImageMaster *)Tcl_GetHashValue(hPtr));
+ DeleteImage((ImageModel *)Tcl_GetHashValue(hPtr));
}
/*
@@ -957,31 +957,31 @@ Tk_DeleteImage(
static void
DeleteImage(
- ImageMaster *masterPtr) /* Pointer to main data structure for image. */
+ ImageModel *modelPtr) /* Pointer to main data structure for image. */
{
Image *imagePtr;
Tk_ImageType *typePtr;
- typePtr = masterPtr->typePtr;
- masterPtr->typePtr = NULL;
+ typePtr = modelPtr->typePtr;
+ modelPtr->typePtr = NULL;
if (typePtr != NULL) {
- for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
+ for (imagePtr = modelPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
typePtr->freeProc(imagePtr->instanceData, imagePtr->display);
imagePtr->changeProc(imagePtr->widgetClientData, 0, 0,
- masterPtr->width, masterPtr->height, masterPtr->width,
- masterPtr->height);
+ modelPtr->width, modelPtr->height, modelPtr->width,
+ modelPtr->height);
}
- typePtr->deleteProc(masterPtr->masterData);
+ typePtr->deleteProc(modelPtr->modelData);
}
- if (masterPtr->instancePtr == NULL) {
- if (masterPtr->hPtr != NULL) {
- Tcl_DeleteHashEntry(masterPtr->hPtr);
+ if (modelPtr->instancePtr == NULL) {
+ if (modelPtr->hPtr != NULL) {
+ Tcl_DeleteHashEntry(modelPtr->hPtr);
}
- Tcl_Release(masterPtr->winPtr);
- ckfree(masterPtr);
+ Tcl_Release(modelPtr->winPtr);
+ ckfree(modelPtr);
} else {
- masterPtr->deleted = 1;
+ modelPtr->deleted = 1;
}
}
@@ -1005,16 +1005,16 @@ DeleteImage(
static void
EventuallyDeleteImage(
- ImageMaster *masterPtr, /* Pointer to main data structure for image. */
+ ImageModel *modelPtr, /* Pointer to main data structure for image. */
int forgetImageHashNow) /* Flag to say whether the hash table is about
* to vanish. */
{
if (forgetImageHashNow) {
- masterPtr->hPtr = NULL;
+ modelPtr->hPtr = NULL;
}
- if (!masterPtr->deleted) {
- masterPtr->deleted = 1;
- Tcl_EventuallyFree(masterPtr, (Tcl_FreeProc *) DeleteImage);
+ if (!modelPtr->deleted) {
+ modelPtr->deleted = 1;
+ Tcl_EventuallyFree(modelPtr, (Tcl_FreeProc *) DeleteImage);
}
}
@@ -1046,7 +1046,7 @@ TkDeleteAllImages(
for (hPtr = Tcl_FirstHashEntry(&mainPtr->imageTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- EventuallyDeleteImage((ImageMaster *)Tcl_GetHashValue(hPtr), 1);
+ EventuallyDeleteImage((ImageModel *)Tcl_GetHashValue(hPtr), 1);
}
Tcl_DeleteHashTable(&mainPtr->imageTable);
}
@@ -1054,7 +1054,7 @@ TkDeleteAllImages(
/*
*----------------------------------------------------------------------
*
- * Tk_GetImageMasterData --
+ * Tk_GetImageModelData --
*
* Given the name of an image, this function returns the type of the
* image and the clientData associated with its master.
@@ -1072,7 +1072,7 @@ TkDeleteAllImages(
*/
ClientData
-Tk_GetImageMasterData(
+Tk_GetImageModelData(
Tcl_Interp *interp, /* Interpreter in which the image was
* created. */
const char *name, /* Name of image. */
@@ -1082,20 +1082,20 @@ Tk_GetImageMasterData(
{
TkWindow *winPtr = (TkWindow *) Tk_MainWindow(interp);
Tcl_HashEntry *hPtr;
- ImageMaster *masterPtr;
+ ImageModel *modelPtr;
hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, name);
if (hPtr == NULL) {
*typePtrPtr = NULL;
return NULL;
}
- masterPtr = (ImageMaster *)Tcl_GetHashValue(hPtr);
- if (masterPtr->deleted) {
+ modelPtr = (ImageModel *)Tcl_GetHashValue(hPtr);
+ if (modelPtr->deleted) {
*typePtrPtr = NULL;
return NULL;
}
- *typePtrPtr = masterPtr->typePtr;
- return masterPtr->masterData;
+ *typePtrPtr = modelPtr->typePtr;
+ return modelPtr->modelData;
}
/*
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c
index b774b40..b47f21c 100644
--- a/generic/tkImgPhInstance.c
+++ b/generic/tkImgPhInstance.c
@@ -84,7 +84,7 @@ void
TkImgPhotoConfigureInstance(
PhotoInstance *instancePtr) /* Instance to reconfigure. */
{
- PhotoMaster *masterPtr = instancePtr->masterPtr;
+ PhotoModel *modelPtr = instancePtr->modelPtr;
XImage *imagePtr;
int bitsPerPixel;
ColorTable *colorTablePtr;
@@ -96,13 +96,13 @@ TkImgPhotoConfigureInstance(
* for our windows. Use the gamma value specified the master.
*/
- if ((masterPtr->palette && masterPtr->palette[0])
- && IsValidPalette(instancePtr, masterPtr->palette)) {
- instancePtr->palette = masterPtr->palette;
+ if ((modelPtr->palette && modelPtr->palette[0])
+ && IsValidPalette(instancePtr, modelPtr->palette)) {
+ instancePtr->palette = modelPtr->palette;
} else {
instancePtr->palette = instancePtr->defaultPalette;
}
- instancePtr->gamma = masterPtr->gamma;
+ instancePtr->gamma = modelPtr->gamma;
/*
* If we don't currently have a color table, or if the one we have no
@@ -173,8 +173,8 @@ TkImgPhotoConfigureInstance(
*/
if ((instancePtr->pixels == None) || (instancePtr->error == NULL)
- || (instancePtr->width != masterPtr->width)
- || (instancePtr->height != masterPtr->height)) {
+ || (instancePtr->width != modelPtr->width)
+ || (instancePtr->height != modelPtr->height)) {
TkImgPhotoInstanceSetSize(instancePtr);
}
@@ -182,9 +182,9 @@ TkImgPhotoConfigureInstance(
* Redither this instance if necessary.
*/
- if ((masterPtr->flags & IMAGE_CHANGED)
+ if ((modelPtr->flags & IMAGE_CHANGED)
|| (instancePtr->colorTablePtr != colorTablePtr)) {
- TkClipBox(masterPtr->validRegion, &validBox);
+ TkClipBox(modelPtr->validRegion, &validBox);
if ((validBox.width > 0) && (validBox.height > 0)) {
TkImgDitherInstance(instancePtr, validBox.x, validBox.y,
validBox.width, validBox.height);
@@ -214,10 +214,10 @@ ClientData
TkImgPhotoGet(
Tk_Window tkwin, /* Window in which the instance will be
* used. */
- ClientData masterData) /* Pointer to our master structure for the
+ ClientData modelData) /* Pointer to our master structure for the
* image. */
{
- PhotoMaster *masterPtr = (PhotoMaster *)masterData;
+ PhotoModel *modelPtr = (PhotoModel *)modelData;
PhotoInstance *instancePtr;
Colormap colormap;
int mono, nRed, nGreen, nBlue, numVisuals;
@@ -254,7 +254,7 @@ TkImgPhotoGet(
*/
colormap = Tk_Colormap(tkwin);
- for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
+ for (instancePtr = modelPtr->instancePtr; instancePtr != NULL;
instancePtr = instancePtr->nextPtr) {
if ((colormap == instancePtr->colormap)
&& (Tk_Display(tkwin) == instancePtr->display)) {
@@ -284,7 +284,7 @@ TkImgPhotoGet(
*/
instancePtr = (PhotoInstance *)ckalloc(sizeof(PhotoInstance));
- instancePtr->masterPtr = masterPtr;
+ instancePtr->modelPtr = modelPtr;
instancePtr->display = Tk_Display(tkwin);
instancePtr->colormap = Tk_Colormap(tkwin);
Tk_PreserveColormap(instancePtr->display, instancePtr->colormap);
@@ -295,8 +295,8 @@ TkImgPhotoGet(
instancePtr->width = 0;
instancePtr->height = 0;
instancePtr->imagePtr = 0;
- instancePtr->nextPtr = masterPtr->instancePtr;
- masterPtr->instancePtr = instancePtr;
+ instancePtr->nextPtr = modelPtr->instancePtr;
+ modelPtr->instancePtr = instancePtr;
/*
* Obtain information about the visual and decide on the default palette.
@@ -356,8 +356,8 @@ TkImgPhotoGet(
* Make a GC with background = black and foreground = white.
*/
- white = Tk_GetColor(masterPtr->interp, tkwin, "white");
- black = Tk_GetColor(masterPtr->interp, tkwin, "black");
+ white = Tk_GetColor(modelPtr->interp, tkwin, "white");
+ black = Tk_GetColor(modelPtr->interp, tkwin, "black");
gcValues.foreground = (white != NULL)? white->pixel:
WhitePixelOfScreen(Tk_Screen(tkwin));
gcValues.background = (black != NULL)? black->pixel:
@@ -380,8 +380,8 @@ TkImgPhotoGet(
*/
if (instancePtr->nextPtr == NULL) {
- Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0,
- masterPtr->width, masterPtr->height);
+ Tk_ImageChanged(modelPtr->tkMaster, 0, 0, 0, 0,
+ modelPtr->width, modelPtr->height);
}
return instancePtr;
@@ -441,8 +441,8 @@ BlendComplexAlpha(
{
int x, y, line;
unsigned long pixel;
- unsigned char r, g, b, alpha, unalpha, *masterPtr;
- unsigned char *alphaAr = iPtr->masterPtr->pix32;
+ unsigned char r, g, b, alpha, unalpha, *modelPtr;
+ unsigned char *alphaAr = iPtr->modelPtr->pix32;
/*
* This blending is an integer version of the Source-Over compositing rule
@@ -499,10 +499,10 @@ BlendComplexAlpha(
green_mlen = 8 - CountBits(green_mask >> green_shift);
blue_mlen = 8 - CountBits(blue_mask >> blue_shift);
for (y = 0; y < height; y++) {
- line = (y + yOffset) * iPtr->masterPtr->width;
+ line = (y + yOffset) * iPtr->modelPtr->width;
for (x = 0; x < width; x++) {
- masterPtr = alphaAr + ((line + x + xOffset) * 4);
- alpha = masterPtr[3];
+ modelPtr = alphaAr + ((line + x + xOffset) * 4);
+ alpha = modelPtr[3];
/*
* Ignore pixels that are fully transparent
@@ -514,9 +514,9 @@ BlendComplexAlpha(
* 24 and 32 bit displays, but this seems "fast enough".
*/
- r = masterPtr[0];
- g = masterPtr[1];
- b = masterPtr[2];
+ r = modelPtr[0];
+ g = modelPtr[1];
+ b = modelPtr[2];
if (alpha != 255) {
/*
* Only blend pixels that have some transparency
@@ -542,10 +542,10 @@ BlendComplexAlpha(
#endif /* !_WIN32 */
for (y = 0; y < height; y++) {
- line = (y + yOffset) * iPtr->masterPtr->width;
+ line = (y + yOffset) * iPtr->modelPtr->width;
for (x = 0; x < width; x++) {
- masterPtr = alphaAr + ((line + x + xOffset) * 4);
- alpha = masterPtr[3];
+ modelPtr = alphaAr + ((line + x + xOffset) * 4);
+ alpha = modelPtr[3];
/*
* Ignore pixels that are fully transparent
@@ -557,9 +557,9 @@ BlendComplexAlpha(
* and 32 bit displays, but this seems "fast enough".
*/
- r = masterPtr[0];
- g = masterPtr[1];
- b = masterPtr[2];
+ r = modelPtr[0];
+ g = modelPtr[1];
+ b = modelPtr[2];
if (alpha != 255) {
/*
* Only blend pixels that have some transparency
@@ -633,7 +633,7 @@ TkImgPhotoDisplay(
* no need to call XGetImage or to do the Porter-Duff compositing by hand.
*/
- unsigned char *rgbaPixels = instancePtr->masterPtr->pix32;
+ unsigned char *rgbaPixels = instancePtr->modelPtr->pix32;
XImage *photo = XCreateImage(display, NULL, 32, ZPixmap, 0, (char*)rgbaPixels,
(unsigned int)instancePtr->width,
(unsigned int)instancePtr->height,
@@ -645,7 +645,7 @@ TkImgPhotoDisplay(
XDestroyImage(photo);
#else
- if ((instancePtr->masterPtr->flags & COMPLEX_ALPHA)
+ if ((instancePtr->modelPtr->flags & COMPLEX_ALPHA)
&& visInfo.depth >= 15
&& (visInfo.c_class == DirectColor || visInfo.c_class == TrueColor)) {
Tk_ErrorHandler handler;
@@ -686,14 +686,14 @@ TkImgPhotoDisplay(
Tk_DeleteErrorHandler(handler);
} else {
/*
- * masterPtr->region describes which parts of the image contain valid
+ * modelPtr->region describes which parts of the image contain valid
* data. We set this region as the clip mask for the gc, setting its
* origin appropriately, and use it when drawing the image.
*/
fallBack:
TkSetRegion(display, instancePtr->gc,
- instancePtr->masterPtr->validRegion);
+ instancePtr->modelPtr->validRegion);
XSetClipOrigin(display, instancePtr->gc, drawableX - imageX,
drawableY - imageY);
XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc,
@@ -776,23 +776,23 @@ void
TkImgPhotoInstanceSetSize(
PhotoInstance *instancePtr) /* Instance whose size is to be changed. */
{
- PhotoMaster *masterPtr;
+ PhotoModel *modelPtr;
schar *newError, *errSrcPtr, *errDestPtr;
int h, offset;
XRectangle validBox;
Pixmap newPixmap;
- masterPtr = instancePtr->masterPtr;
- TkClipBox(masterPtr->validRegion, &validBox);
+ modelPtr = instancePtr->modelPtr;
+ TkClipBox(modelPtr->validRegion, &validBox);
- if ((instancePtr->width != masterPtr->width)
- || (instancePtr->height != masterPtr->height)
+ if ((instancePtr->width != modelPtr->width)
+ || (instancePtr->height != modelPtr->height)
|| (instancePtr->pixels == None)) {
newPixmap = Tk_GetPixmap(instancePtr->display,
RootWindow(instancePtr->display,
instancePtr->visualInfo.screen),
- (masterPtr->width > 0) ? masterPtr->width: 1,
- (masterPtr->height > 0) ? masterPtr->height: 1,
+ (modelPtr->width > 0) ? modelPtr->width: 1,
+ (modelPtr->height > 0) ? modelPtr->height: 1,
instancePtr->visualInfo.depth);
if (!newPixmap) {
Tcl_Panic("Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize");
@@ -822,17 +822,17 @@ TkImgPhotoInstanceSetSize(
instancePtr->pixels = newPixmap;
}
- if ((instancePtr->width != masterPtr->width)
- || (instancePtr->height != masterPtr->height)
+ if ((instancePtr->width != modelPtr->width)
+ || (instancePtr->height != modelPtr->height)
|| (instancePtr->error == NULL)) {
- if (masterPtr->height > 0 && masterPtr->width > 0) {
+ if (modelPtr->height > 0 && modelPtr->width > 0) {
/*
* TODO: use attemptckalloc() here once there is a strategy that
* will allow us to recover from failure. Right now, there's no
* such possibility.
*/
- newError = (schar *)ckalloc(masterPtr->height * masterPtr->width
+ newError = (schar *)ckalloc(modelPtr->height * modelPtr->width
* 3 * sizeof(schar));
/*
@@ -841,21 +841,21 @@ TkImgPhotoInstanceSetSize(
*/
if ((instancePtr->error != NULL)
- && ((instancePtr->width == masterPtr->width)
- || (validBox.width == masterPtr->width))) {
+ && ((instancePtr->width == modelPtr->width)
+ || (validBox.width == modelPtr->width))) {
if (validBox.y > 0) {
memset(newError, 0, (size_t)
- validBox.y * masterPtr->width * 3 * sizeof(schar));
+ validBox.y * modelPtr->width * 3 * sizeof(schar));
}
h = validBox.y + validBox.height;
- if (h < masterPtr->height) {
- memset(newError + h*masterPtr->width*3, 0,
- (size_t) (masterPtr->height - h)
- * masterPtr->width * 3 * sizeof(schar));
+ if (h < modelPtr->height) {
+ memset(newError + h*modelPtr->width*3, 0,
+ (size_t) (modelPtr->height - h)
+ * modelPtr->width * 3 * sizeof(schar));
}
} else {
memset(newError, 0, (size_t)
- masterPtr->height * masterPtr->width *3*sizeof(schar));
+ modelPtr->height * modelPtr->width *3*sizeof(schar));
}
} else {
newError = NULL;
@@ -867,22 +867,22 @@ TkImgPhotoInstanceSetSize(
* array.
*/
- if (masterPtr->width == instancePtr->width) {
- offset = validBox.y * masterPtr->width * 3;
+ if (modelPtr->width == instancePtr->width) {
+ offset = validBox.y * modelPtr->width * 3;
memcpy(newError + offset, instancePtr->error + offset,
(size_t) validBox.height
- * masterPtr->width * 3 * sizeof(schar));
+ * modelPtr->width * 3 * sizeof(schar));
} else if (validBox.width > 0 && validBox.height > 0) {
errDestPtr = newError +
- (validBox.y * masterPtr->width + validBox.x) * 3;
+ (validBox.y * modelPtr->width + validBox.x) * 3;
errSrcPtr = instancePtr->error +
(validBox.y * instancePtr->width + validBox.x) * 3;
for (h = validBox.height; h > 0; --h) {
memcpy(errDestPtr, errSrcPtr,
validBox.width * 3 * sizeof(schar));
- errDestPtr += masterPtr->width * 3;
+ errDestPtr += modelPtr->width * 3;
errSrcPtr += instancePtr->width * 3;
}
}
@@ -892,8 +892,8 @@ TkImgPhotoInstanceSetSize(
instancePtr->error = newError;
}
- instancePtr->width = masterPtr->width;
- instancePtr->height = masterPtr->height;
+ instancePtr->width = modelPtr->width;
+ instancePtr->height = modelPtr->height;
}
/*
@@ -1605,10 +1605,10 @@ TkImgDisposeInstance(
FreeColorTable(instancePtr->colorTablePtr, 1);
}
- if (instancePtr->masterPtr->instancePtr == instancePtr) {
- instancePtr->masterPtr->instancePtr = instancePtr->nextPtr;
+ if (instancePtr->modelPtr->instancePtr == instancePtr) {
+ instancePtr->modelPtr->instancePtr = instancePtr->nextPtr;
} else {
- for (prevPtr = instancePtr->masterPtr->instancePtr;
+ for (prevPtr = instancePtr->modelPtr->instancePtr;
prevPtr->nextPtr != instancePtr; prevPtr = prevPtr->nextPtr) {
/* Empty loop body. */
}
@@ -1642,7 +1642,7 @@ TkImgDitherInstance(
* block to be dithered. */
int width, int height) /* Dimensions of the block to be dithered. */
{
- PhotoMaster *masterPtr = instancePtr->masterPtr;
+ PhotoModel *modelPtr = instancePtr->modelPtr;
ColorTable *colorPtr = instancePtr->colorTablePtr;
XImage *imagePtr;
int nLines, bigEndian, i, c, x, y, xEnd, doDithering = 1;
@@ -1700,8 +1700,8 @@ TkImgDitherInstance(
bigEndian = imagePtr->bitmap_bit_order == MSBFirst;
firstBit = bigEndian? (1 << (imagePtr->bitmap_unit - 1)): 1;
- lineLength = masterPtr->width * 3;
- srcLinePtr = masterPtr->pix32 + (yStart * masterPtr->width + xStart) * 4;
+ lineLength = modelPtr->width * 3;
+ srcLinePtr = modelPtr->pix32 + (yStart * modelPtr->width + xStart) * 4;
errLinePtr = instancePtr->error + yStart * lineLength + xStart * 3;
xEnd = xStart + width;
@@ -1756,7 +1756,7 @@ TkImgDitherInstance(
c += errPtr[-lineLength-3];
}
c += errPtr[-lineLength] * 5;
- if ((x + 1) < masterPtr->width) {
+ if ((x + 1) < modelPtr->width) {
c += errPtr[-lineLength+3] * 3;
}
}
@@ -1839,13 +1839,13 @@ TkImgDitherInstance(
c += errPtr[-lineLength-1];
}
c += errPtr[-lineLength] * 5;
- if (x + 1 < masterPtr->width) {
+ if (x + 1 < modelPtr->width) {
c += errPtr[-lineLength+1] * 3;
}
}
c = ((c + 2056) >> 4) - 128;
- if (masterPtr->flags & COLOR_IMAGE) {
+ if (modelPtr->flags & COLOR_IMAGE) {
c += (unsigned) (srcPtr[0] * 11 + srcPtr[1] * 16
+ srcPtr[2] * 5 + 16) >> 5;
} else {
@@ -1912,13 +1912,13 @@ TkImgDitherInstance(
c += errPtr[-lineLength-1];
}
c += errPtr[-lineLength] * 5;
- if (x + 1 < masterPtr->width) {
+ if (x + 1 < modelPtr->width) {
c += errPtr[-lineLength+1] * 3;
}
}
c = ((c + 2056) >> 4) - 128;
- if (masterPtr->flags & COLOR_IMAGE) {
+ if (modelPtr->flags & COLOR_IMAGE) {
c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16
+ srcPtr[2] * 5 + 16) >> 5;
} else {
@@ -1941,7 +1941,7 @@ TkImgDitherInstance(
}
*destLongPtr = word;
}
- srcLinePtr += masterPtr->width * 4;
+ srcLinePtr += modelPtr->width * 4;
errLinePtr += lineLength;
dstLinePtr += bytesPerLine;
}
@@ -1985,8 +1985,8 @@ TkImgResetDither(
{
if (instancePtr->error) {
memset(instancePtr->error, 0,
- (size_t) instancePtr->masterPtr->width
- * instancePtr->masterPtr->height * 3 * sizeof(schar));
+ (size_t) instancePtr->modelPtr->width
+ * instancePtr->modelPtr->height * 3 * sizeof(schar));
}
}
diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h
index a84ebb3..c6e32e3 100644
--- a/generic/tkImgPhoto.h
+++ b/generic/tkImgPhoto.h
@@ -27,10 +27,11 @@
* Forward declarations of the structures we define.
*/
+#define PhotoMaster PhotoModel
typedef struct ColorTableId ColorTableId;
typedef struct ColorTable ColorTable;
typedef struct PhotoInstance PhotoInstance;
-typedef struct PhotoMaster PhotoMaster;
+typedef struct PhotoModel PhotoModel;
/*
* A signed 8-bit integral type. If chars are unsigned and the compiler isn't
@@ -147,8 +148,8 @@ struct ColorTable {
* Definition of the data associated with each photo image master.
*/
-struct PhotoMaster {
- Tk_ImageMaster tkMaster; /* Tk's token for image master. NULL means the
+struct PhotoModel {
+ Tk_ImageModel tkMaster; /* Tk's token for image model. NULL means the
* image is being deleted. */
Tcl_Interp *interp; /* Interpreter associated with the application
* using this image. */
@@ -175,7 +176,7 @@ struct PhotoMaster {
};
/*
- * Bit definitions for the flags field of a PhotoMaster.
+ * Bit definitions for the flags field of a PhotoModel.
* COLOR_IMAGE: 1 means that the image has different color
* components.
* IMAGE_CHANGED: 1 means that the instances of this image need
@@ -202,7 +203,7 @@ struct PhotoMaster {
*/
struct PhotoInstance {
- PhotoMaster *masterPtr; /* Pointer to master for image. */
+ PhotoModel *modelPtr; /* Pointer to model for image. */
Display *display; /* Display for windows using this instance. */
Colormap colormap; /* The image may only be used in windows with
* this particular colormap. */
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 4785266..9fca326 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -681,7 +681,7 @@ typedef struct TkMainInfo {
/* Top level of option hierarchy for this main
* window. NULL means uninitialized. Managed
* by tkOption.c. */
- Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageMaster
+ Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageModel
* structures. Managed by tkImage.c. */
int strictMotif; /* This is linked to the tk_strictMotif global
* variable. */
diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c
index 0702347..22522d8 100644
--- a/generic/tkOldTest.c
+++ b/generic/tkOldTest.c
@@ -26,17 +26,17 @@
#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
/*
- * The following data structure represents the master for a test image:
+ * The following data structure represents the model for a test image:
*/
-typedef struct TImageMaster {
- Tk_ImageMaster master; /* Tk's token for image master. */
+typedef struct TImageModel {
+ Tk_ImageModel model; /* Tk's token for image model. */
Tcl_Interp *interp; /* Interpreter for application. */
int width, height; /* Dimensions of image. */
char *imageName; /* Name of image (malloc-ed). */
char *varName; /* Name of variable in which to log events for
* image (malloc-ed). */
-} TImageMaster;
+} TImageModel;
/*
* The following data structure represents a particular use of a particular
@@ -44,7 +44,7 @@ typedef struct TImageMaster {
*/
typedef struct TImageInstance {
- TImageMaster *masterPtr; /* Pointer to master for image. */
+ TImageModel *modelPtr; /* Pointer to model for image. */
XColor *fg; /* Foreground color for drawing in image. */
GC gc; /* Graphics context for drawing in image. */
} TImageInstance;
@@ -55,7 +55,7 @@ typedef struct TImageInstance {
static int ImageCreate(Tcl_Interp *interp,
char *name, int argc, char **argv,
- Tk_ImageType *typePtr, Tk_ImageMaster master,
+ Tk_ImageType *typePtr, Tk_ImageModel model,
ClientData *clientDataPtr);
static ClientData ImageGet(Tk_Window tkwin, ClientData clientData);
static void ImageDisplay(ClientData clientData,
@@ -146,12 +146,12 @@ ImageCreate(
char **argv, /* Argument strings for options (doesn't
* include image name or type). */
Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
- Tk_ImageMaster master, /* Token for image, to be used by us in later
+ Tk_ImageModel model, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
* will be returned in later callbacks. */
{
- TImageMaster *timPtr;
+ TImageModel *timPtr;
const char *varName;
int i;
(void)typePtr;
@@ -171,8 +171,8 @@ ImageCreate(
varName = argv[i+1];
}
- timPtr = (TImageMaster *)ckalloc(sizeof(TImageMaster));
- timPtr->master = master;
+ timPtr = (TImageModel *)ckalloc(sizeof(TImageModel));
+ timPtr->model = model;
timPtr->interp = interp;
timPtr->width = 30;
timPtr->height = 15;
@@ -182,7 +182,7 @@ ImageCreate(
strcpy(timPtr->varName, varName);
Tcl_CreateObjCommand(interp, name, ImageObjCmd, timPtr, NULL);
*clientDataPtr = timPtr;
- Tk_ImageChanged(master, 0, 0, 30, 15, 30, 15);
+ Tk_ImageChanged(model, 0, 0, 30, 15, 30, 15);
return TCL_OK;
}
@@ -210,7 +210,7 @@ ImageObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
{
- TImageMaster *timPtr = (TImageMaster *)clientData;
+ TImageModel *timPtr = (TImageModel *)clientData;
int x, y, width, height;
if (objc < 2) {
@@ -231,7 +231,7 @@ ImageObjCmd(
|| (Tcl_GetIntFromObj(interp, objv[7], &timPtr->height) != TCL_OK)) {
return TCL_ERROR;
}
- Tk_ImageChanged(timPtr->master, x, y, width, height, timPtr->width,
+ Tk_ImageChanged(timPtr->model, x, y, width, height, timPtr->width,
timPtr->height);
} else {
Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
@@ -263,9 +263,9 @@ static ClientData
ImageGet(
Tk_Window tkwin, /* Token for window in which image will be
* used. */
- ClientData clientData) /* Pointer to TImageMaster for image. */
+ ClientData clientData) /* Pointer to TImageModel for image. */
{
- TImageMaster *timPtr = (TImageMaster *)clientData;
+ TImageModel *timPtr = (TImageModel *)clientData;
TImageInstance *instPtr;
char buffer[100];
XGCValues gcValues;
@@ -275,7 +275,7 @@ ImageGet(
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
instPtr = (TImageInstance *)ckalloc(sizeof(TImageInstance));
- instPtr->masterPtr = timPtr;
+ instPtr->modelPtr = timPtr;
instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000");
gcValues.foreground = instPtr->fg->pixel;
instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues);
@@ -316,15 +316,15 @@ ImageDisplay(
char buffer[200 + TCL_INTEGER_SPACE * 6];
sprintf(buffer, "%s display %d %d %d %d %d %d",
- instPtr->masterPtr->imageName, imageX, imageY, width, height,
+ instPtr->modelPtr->imageName, imageX, imageY, width, height,
drawableX, drawableY);
- Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL,
+ Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL,
buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
- if (width > (instPtr->masterPtr->width - imageX)) {
- width = instPtr->masterPtr->width - imageX;
+ if (width > (instPtr->modelPtr->width - imageX)) {
+ width = instPtr->modelPtr->width - imageX;
}
- if (height > (instPtr->masterPtr->height - imageY)) {
- height = instPtr->masterPtr->height - imageY;
+ if (height > (instPtr->modelPtr->height - imageY)) {
+ height = instPtr->modelPtr->height - imageY;
}
XDrawRectangle(display, drawable, instPtr->gc, drawableX, drawableY,
(unsigned) (width-1), (unsigned) (height-1));
@@ -360,8 +360,8 @@ ImageFree(
TImageInstance *instPtr = (TImageInstance *)clientData;
char buffer[200];
- sprintf(buffer, "%s free", instPtr->masterPtr->imageName);
- Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL,
+ sprintf(buffer, "%s free", instPtr->modelPtr->imageName);
+ Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL,
buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
Tk_FreeColor(instPtr->fg);
Tk_FreeGC(display, instPtr->gc);
@@ -387,11 +387,11 @@ ImageFree(
static void
ImageDelete(
- ClientData clientData) /* Pointer to TImageMaster for image. When
+ ClientData clientData) /* Pointer to TImageModel for image. When
* this function is called, no more instances
* exist. */
{
- TImageMaster *timPtr = (TImageMaster *)clientData;
+ TImageModel *timPtr = (TImageModel *)clientData;
char buffer[100];
sprintf(buffer, "%s delete", timPtr->imageName);
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 2fb3a25..49ac1e6 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -202,12 +202,12 @@ Tk_PackObjCmd(
#ifndef TK_NO_DEPRECATED
"after", "append", "before", "unpack",
#endif /* !TK_NO_DEPRECATED */
- "configure", "forget", "info", "propagate", "slaves", NULL };
+ "configure", "content", "forget", "info", "propagate", "slaves", NULL };
enum options {
#ifndef TK_NO_DEPRECATED
PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK,
#endif /* !TK_NO_DEPRECATED */
- PACK_CONFIGURE, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES };
+ PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES };
int index;
if (objc >= 2) {
@@ -445,6 +445,7 @@ Tk_PackObjCmd(
}
break;
}
+ case PACK_CONTENT:
case PACK_SLAVES: {
Tk_Window master;
Packer *masterPtr, *slavePtr;
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index 66c31d9..2c0a0a3 100644
--- a/generic/tkPlace.c
+++ b/generic/tkPlace.c
@@ -214,9 +214,9 @@ Tk_PlaceObjCmd(
TkDisplay *dispPtr;
Tk_OptionTable optionTable;
static const char *const optionStrings[] = {
- "configure", "forget", "info", "slaves", NULL
+ "configure", "content", "forget", "info", "slaves", NULL
};
- enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES };
+ enum options { PLACE_CONFIGURE, PLACE_CONTENT, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES };
int index;
if (objc < 3) {
@@ -330,6 +330,7 @@ Tk_PlaceObjCmd(
}
return PlaceInfoCommand(interp, tkwin);
+ case PLACE_CONTENT:
case PLACE_SLAVES: {
Master *masterPtr;
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index a5d98ef..9c8a1d8 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -1143,7 +1143,7 @@ const TkStubs tkStubs = {
Tk_GetFontMetrics, /* 95 */
Tk_GetGC, /* 96 */
Tk_GetImage, /* 97 */
- Tk_GetImageMasterData, /* 98 */
+ Tk_GetImageModelData, /* 98 */
Tk_GetItemTypes, /* 99 */
Tk_GetJoinStyle, /* 100 */
Tk_GetJustify, /* 101 */
diff --git a/generic/tkTest.c b/generic/tkTest.c
index c222ad2..e4ef0b1 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -57,17 +57,17 @@ EXTERN int Tktest_Init(Tcl_Interp *interp);
#endif
/*
- * The following data structure represents the master for a test image:
+ * The following data structure represents the model for a test image:
*/
-typedef struct TImageMaster {
- Tk_ImageMaster master; /* Tk's token for image master. */
+typedef struct TImageModel {
+ Tk_ImageModel model; /* Tk's token for image model. */
Tcl_Interp *interp; /* Interpreter for application. */
int width, height; /* Dimensions of image. */
char *imageName; /* Name of image (malloc-ed). */
char *varName; /* Name of variable in which to log events for
* image (malloc-ed). */
-} TImageMaster;
+} TImageModel;
/*
* The following data structure represents a particular use of a particular
@@ -75,7 +75,7 @@ typedef struct TImageMaster {
*/
typedef struct TImageInstance {
- TImageMaster *masterPtr; /* Pointer to master for image. */
+ TImageModel *modelPtr; /* Pointer to model for image. */
XColor *fg; /* Foreground color for drawing in image. */
GC gc; /* Graphics context for drawing in image. */
Bool displayFailed; /* macOS display attempted out of drawRect. */
@@ -88,7 +88,7 @@ typedef struct TImageInstance {
static int ImageCreate(Tcl_Interp *interp,
const char *name, int argc, Tcl_Obj *const objv[],
- const Tk_ImageType *typePtr, Tk_ImageMaster master,
+ const Tk_ImageType *typePtr, Tk_ImageModel model,
ClientData *clientDataPtr);
static ClientData ImageGet(Tk_Window tkwin, ClientData clientData);
static void ImageDisplay(ClientData clientData,
@@ -1395,12 +1395,12 @@ ImageCreate(
Tcl_Obj *const objv[], /* Argument strings for options (doesn't
* include image name or type). */
const Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
- Tk_ImageMaster master, /* Token for image, to be used by us in later
+ Tk_ImageModel model, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
* will be returned in later callbacks. */
{
- TImageMaster *timPtr;
+ TImageModel *timPtr;
const char *varName;
int i;
(void)typePtr;
@@ -1420,8 +1420,8 @@ ImageCreate(
varName = Tcl_GetString(objv[i+1]);
}
- timPtr = (TImageMaster *)ckalloc(sizeof(TImageMaster));
- timPtr->master = master;
+ timPtr = (TImageModel *)ckalloc(sizeof(TImageModel));
+ timPtr->model = model;
timPtr->interp = interp;
timPtr->width = 30;
timPtr->height = 15;
@@ -1431,7 +1431,7 @@ ImageCreate(
strcpy(timPtr->varName, varName);
Tcl_CreateObjCommand(interp, name, ImageObjCmd, timPtr, NULL);
*clientDataPtr = timPtr;
- Tk_ImageChanged(master, 0, 0, 30, 15, 30, 15);
+ Tk_ImageChanged(model, 0, 0, 30, 15, 30, 15);
return TCL_OK;
}
@@ -1459,7 +1459,7 @@ ImageObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
{
- TImageMaster *timPtr = (TImageMaster *)clientData;
+ TImageModel *timPtr = (TImageModel *)clientData;
int x, y, width, height;
if (objc < 2) {
@@ -1480,7 +1480,7 @@ ImageObjCmd(
|| (Tcl_GetIntFromObj(interp, objv[7], &timPtr->height) != TCL_OK)) {
return TCL_ERROR;
}
- Tk_ImageChanged(timPtr->master, x, y, width, height, timPtr->width,
+ Tk_ImageChanged(timPtr->model, x, y, width, height, timPtr->width,
timPtr->height);
} else {
Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
@@ -1512,9 +1512,9 @@ static ClientData
ImageGet(
Tk_Window tkwin, /* Token for window in which image will be
* used. */
- ClientData clientData) /* Pointer to TImageMaster for image. */
+ ClientData clientData) /* Pointer to TImageModel for image. */
{
- TImageMaster *timPtr = (TImageMaster *)clientData;
+ TImageModel *timPtr = (TImageModel *)clientData;
TImageInstance *instPtr;
char buffer[100];
XGCValues gcValues;
@@ -1524,7 +1524,7 @@ ImageGet(
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
instPtr = (TImageInstance *)ckalloc(sizeof(TImageInstance));
- instPtr->masterPtr = timPtr;
+ instPtr->modelPtr = timPtr;
instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000");
gcValues.foreground = instPtr->fg->pixel;
instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues);
@@ -1589,9 +1589,9 @@ ImageDisplay(
*/
sprintf(instPtr->buffer, "%s display %d %d %d %d",
- instPtr->masterPtr->imageName, imageX, imageY, width, height);
+ instPtr->modelPtr->imageName, imageX, imageY, width, height);
}
- Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName,
+ Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName,
NULL, instPtr->buffer,
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
instPtr->displayFailed = False;
@@ -1604,15 +1604,15 @@ ImageDisplay(
if (instPtr->displayFailed == False) {
sprintf(instPtr->buffer, "%s display %d %d %d %d",
- instPtr->masterPtr->imageName, imageX, imageY, width, height);
+ instPtr->modelPtr->imageName, imageX, imageY, width, height);
}
instPtr->displayFailed = True;
}
- if (width > (instPtr->masterPtr->width - imageX)) {
- width = instPtr->masterPtr->width - imageX;
+ if (width > (instPtr->modelPtr->width - imageX)) {
+ width = instPtr->modelPtr->width - imageX;
}
- if (height > (instPtr->masterPtr->height - imageY)) {
- height = instPtr->masterPtr->height - imageY;
+ if (height > (instPtr->modelPtr->height - imageY)) {
+ height = instPtr->modelPtr->height - imageY;
}
XDrawRectangle(display, drawable, instPtr->gc, drawableX, drawableY,
@@ -1649,8 +1649,8 @@ ImageFree(
TImageInstance *instPtr = (TImageInstance *)clientData;
char buffer[200];
- sprintf(buffer, "%s free", instPtr->masterPtr->imageName);
- Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL,
+ sprintf(buffer, "%s free", instPtr->modelPtr->imageName);
+ Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL,
buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
Tk_FreeColor(instPtr->fg);
Tk_FreeGC(display, instPtr->gc);
@@ -1676,11 +1676,11 @@ ImageFree(
static void
ImageDelete(
- ClientData clientData) /* Pointer to TImageMaster for image. When
+ ClientData clientData) /* Pointer to TImageModel for image. When
* this function is called, no more instances
* exist. */
{
- TImageMaster *timPtr = (TImageMaster *)clientData;
+ TImageModel *timPtr = (TImageModel *)clientData;
char buffer[100];
sprintf(buffer, "%s delete", timPtr->imageName);
diff --git a/tests/grid.test b/tests/grid.test
index 3e67b6e..a0f281a 100644
--- a/tests/grid.test
+++ b/tests/grid.test
@@ -45,7 +45,7 @@ test grid-1.1 {basic argument checking} -body {
} -returnCodes error -result {wrong # args: should be "grid option arg ?arg ...?"}
test grid-1.2 {basic argument checking} -body {
grid foo bar
-} -returnCodes error -result {bad option "foo": must be anchor, bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves}
+} -returnCodes error -result {bad option "foo": must be anchor, bbox, columnconfigure, configure, content, forget, info, location, propagate, remove, rowconfigure, size, or slaves}
test grid-1.3 {basic argument checking} -body {
button .b
grid .b -row 0 -column
diff --git a/tests/oldpack.test b/tests/oldpack.test
index 72ec065..92c411d 100644
--- a/tests/oldpack.test
+++ b/tests/oldpack.test
@@ -452,10 +452,10 @@ test oldpack-8.2 {syntax errors} -body {
} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"}
test oldpack-8.3 {syntax errors} -body {
pack gorp foo
-} -returnCodes error -result {bad option "gorp": must be configure, forget, info, propagate, or slaves}
+} -returnCodes error -result {bad option "gorp": must be configure, content, forget, info, propagate, or slaves}
test oldpack-8.4 {syntax errors} -body {
pack a .pack
-} -returnCodes error -result {bad option "a": must be configure, forget, info, propagate, or slaves}
+} -returnCodes error -result {bad option "a": must be configure, content, forget, info, propagate, or slaves}
test oldpack-8.5 {syntax errors} -body {
pack after foobar
} -returnCodes error -result {bad window path name "foobar"}
diff --git a/tests/pack.test b/tests/pack.test
index 3ca2253..be607d2 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1360,7 +1360,7 @@ test pack-12.46 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
} -body {
pack lousy .pack
-} -returnCodes error -result {bad option "lousy": must be configure, forget, info, propagate, or slaves}
+} -returnCodes error -result {bad option "lousy": must be configure, content, forget, info, propagate, or slaves}
test pack-13.1 {window deletion} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom
diff --git a/tests/place.test b/tests/place.test
index 041daa6..4a53bf4 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -329,7 +329,7 @@ test place-9.5 {PlaceObjCmd} -setup {
place badopt .foo
} -cleanup {
destroy .foo
-} -returnCodes error -result {bad option "badopt": must be configure, forget, info, or slaves}
+} -returnCodes error -result {bad option "badopt": must be configure, content, forget, info, or slaves}
test place-9.6 {PlaceObjCmd, configure errors} -setup {
destroy .foo
} -body {