summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-04 12:38:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-04 12:38:37 (GMT)
commit7fbdc22e15b48b888546a5df320f8d7ffedb78b1 (patch)
tree838814268df1612366f505acc1876e1ca9e22bf5 /generic
parent83284028be79738bc82ba21dd3f02fe2effb46ee (diff)
downloadtk-7fbdc22e15b48b888546a5df320f8d7ffedb78b1.zip
tk-7fbdc22e15b48b888546a5df320f8d7ffedb78b1.tar.gz
tk-7fbdc22e15b48b888546a5df320f8d7ffedb78b1.tar.bz2
TIP #581: grid/pack/place implementation (internal) and documentation
Diffstat (limited to 'generic')
-rw-r--r--generic/tk.decls4
-rw-r--r--generic/tk.h24
-rw-r--r--generic/tkConfig.c6
-rw-r--r--generic/tkDecls.h8
-rw-r--r--generic/tkGrid.c734
-rw-r--r--generic/tkImgPhoto.h12
-rw-r--r--generic/tkOldConfig.c2
-rw-r--r--generic/tkPack.c539
-rw-r--r--generic/tkPlace.c542
-rw-r--r--generic/tkTest.c14
10 files changed, 941 insertions, 944 deletions
diff --git a/generic/tk.decls b/generic/tk.decls
index 59977ef..3e64878 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -472,7 +472,7 @@ declare 116 {
Tk_Window Tk_IdToWindow(Display *display, Window window)
}
declare 117 {
- void Tk_ImageChanged(Tk_ImageModel master, int x, int y,
+ void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
int width, int height, int imageWidth, int imageHeight)
}
declare 118 {
@@ -539,7 +539,7 @@ declare 136 {
CONST84_RETURN char *Tk_NameOfFont(Tk_Font font)
}
declare 137 {
- CONST84_RETURN char *Tk_NameOfImage(Tk_ImageModel imageMaster)
+ CONST84_RETURN char *Tk_NameOfImage(Tk_ImageMaster imageMaster)
}
declare 138 {
CONST84_RETURN char *Tk_NameOfJoinStyle(int join)
diff --git a/generic/tk.h b/generic/tk.h
index ede97ac..50195b9 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -129,7 +129,7 @@ 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_ImageModel;
+typedef struct Tk_ImageMaster_ *Tk_ImageMaster;
typedef struct Tk_OptionTable_ *Tk_OptionTable;
typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo;
typedef struct Tk_TextLayout_ *Tk_TextLayout;
@@ -624,13 +624,13 @@ typedef struct Tk_GeomMgr {
* to invoke it, or name of widget class that
* allows embedded widgets). */
Tk_GeomRequestProc *requestProc;
- /* Procedure to invoke when a slave's
+ /* Procedure to invoke when a content's
* requested geometry changes. */
Tk_GeomLostContentProc *lostSlaveProc;
- /* Procedure to invoke when a slave is taken
+ /* Procedure to invoke when content is taken
* away from one geometry manager by another.
* NULL means geometry manager doesn't care
- * when slaves are lost. */
+ * when content lost. */
} Tk_GeomMgr;
/*
@@ -1230,19 +1230,19 @@ typedef struct Tk_Outline {
typedef struct Tk_ImageType Tk_ImageType;
#ifdef USE_OLD_IMAGE
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
- char **argv, Tk_ImageType *typePtr, Tk_ImageModel model,
- ClientData *masterDataPtr);
+ char **argv, Tk_ImageType *typePtr, Tk_ImageMaster model,
+ ClientData *clientDataPtr);
#else
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc,
- Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageModel model,
- ClientData *modelDataPtr);
+ Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster model,
+ ClientData *clientDataPtr);
#endif /* USE_OLD_IMAGE */
-typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData masterData);
-typedef void (Tk_ImageDisplayProc) (ClientData instanceData, Display *display,
+typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData clientData);
+typedef void (Tk_ImageDisplayProc) (ClientData clientData, 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_ImageFreeProc) (ClientData clientData, Display *display);
+typedef void (Tk_ImageDeleteProc) (ClientData clientData);
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/tkConfig.c b/generic/tkConfig.c
index 44af1ea..a752674 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -67,7 +67,7 @@ typedef struct TkOption {
* monochrome displays. */
struct TkOption *synonymPtr;
/* For synonym options, this points to the
- * master entry. */
+ * original entry. */
const struct Tk_ObjCustomOption *custom;
/* For TK_OPTION_CUSTOM. */
} extra;
@@ -237,8 +237,8 @@ Tk_CreateOptionTable(
if (specPtr->type == TK_OPTION_SYNONYM) {
/*
- * This is a synonym option; find the master option that it refers
- * to and create a pointer from the synonym to the master.
+ * This is a synonym option; find the original option that it refers
+ * to and create a pointer from the synonym to the origin.
*/
for (specPtr2 = templatePtr, i = 0; ; specPtr2++, i++) {
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index c96039d..b02f286 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -402,7 +402,7 @@ EXTERN void Tk_HandleEvent(XEvent *eventPtr);
/* 116 */
EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window);
/* 117 */
-EXTERN void Tk_ImageChanged(Tk_ImageModel master, int x, int y,
+EXTERN void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
int width, int height, int imageWidth,
int imageHeight);
/* 118 */
@@ -453,7 +453,7 @@ EXTERN CONST84_RETURN char * Tk_NameOfCursor(Display *display,
/* 136 */
EXTERN CONST84_RETURN char * Tk_NameOfFont(Tk_Font font);
/* 137 */
-EXTERN CONST84_RETURN char * Tk_NameOfImage(Tk_ImageModel imageMaster);
+EXTERN CONST84_RETURN char * Tk_NameOfImage(Tk_ImageMaster imageMaster);
/* 138 */
EXTERN CONST84_RETURN char * Tk_NameOfJoinStyle(int join);
/* 139 */
@@ -993,7 +993,7 @@ 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_ImageModel master, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */
+ void (*tk_ImageChanged) (Tk_ImageMaster master, 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 */
@@ -1013,7 +1013,7 @@ typedef struct TkStubs {
CONST84_RETURN char * (*tk_NameOfColor) (XColor *colorPtr); /* 134 */
CONST84_RETURN char * (*tk_NameOfCursor) (Display *display, Tk_Cursor cursor); /* 135 */
CONST84_RETURN char * (*tk_NameOfFont) (Tk_Font font); /* 136 */
- CONST84_RETURN char * (*tk_NameOfImage) (Tk_ImageModel imageMaster); /* 137 */
+ CONST84_RETURN char * (*tk_NameOfImage) (Tk_ImageMaster imageMaster); /* 137 */
CONST84_RETURN char * (*tk_NameOfJoinStyle) (int join); /* 138 */
CONST84_RETURN char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */
CONST84_RETURN char * (*tk_NameOfRelief) (int relief); /* 140 */
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 9f08b02..75ce1a9 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -80,7 +80,7 @@ typedef struct SlotInfo {
* inproportion to their weights. */
int pad; /* Extra padding, in pixels, required for this
* slot. This amount is "added" to the largest
- * slave in the slot. */
+ * content in the slot. */
Tk_Uid uniform; /* Value of -uniform option. It is used to
* group slots that should have the same
* size. */
@@ -99,13 +99,13 @@ typedef struct SlotInfo {
*/
typedef struct GridLayout {
- struct Gridder *binNextPtr; /* The next slave window in this bin. Each bin
- * contains a list of all slaves whose spans
+ struct Gridder *binNextPtr; /* The next content window in this bin. Each bin
+ * contains a list of all content whose spans
* are >1 and whose right edges fall in this
* slot. */
int minSize; /* Minimum size needed for this slot, in
* pixels. This is the space required to hold
- * any slaves contained entirely in this slot,
+ * any content contained entirely in this slot,
* adjusted for any slot constrants, such as
* size or padding. */
int pad; /* Padding needed for this slot */
@@ -130,11 +130,11 @@ typedef struct GridLayout {
typedef struct {
SlotInfo *columnPtr; /* Pointer to array of column constraints. */
SlotInfo *rowPtr; /* Pointer to array of row constraints. */
- int columnEnd; /* The last column occupied by any slave. */
+ int columnEnd; /* The last column occupied by any content. */
int columnMax; /* The number of columns with constraints. */
int columnSpace; /* The number of slots currently allocated for
* column constraints. */
- int rowEnd; /* The last row occupied by any slave. */
+ int rowEnd; /* The last row occupied by any content. */
int rowMax; /* The number of rows with constraints. */
int rowSpace; /* The number of slots currently allocated for
* row constraints. */
@@ -144,11 +144,11 @@ typedef struct {
* container. */
Tk_Anchor anchor; /* Value of anchor option: specifies where a
* grid without weight should be placed. */
-} GridMaster;
+} GridContainer;
/*
* For each window that the grid cares about (either because the window is
- * managed by the grid or because the window has slaves that are managed by
+ * managed by the grid or because the window has content that are managed by
* the grid), there is a structure of the following type:
*/
@@ -157,18 +157,18 @@ typedef struct Gridder {
* window has been deleted, but the gridder
* hasn't had a chance to clean up yet because
* the structure is still in use. */
- struct Gridder *containerPtr; /* Master window within which this window is
+ struct Gridder *containerPtr; /* Container window within which this window is
* managed (NULL means this window isn't
* managed by the gridder). */
struct Gridder *nextPtr; /* Next window managed within same container.
* List order doesn't matter. */
- struct Gridder *slavePtr; /* First in list of slaves managed inside this
- * window (NULL means no grid slaves). */
- GridMaster *containerDataPtr; /* Additional data for geometry container. */
+ struct Gridder *contentPtr; /* First in list of content managed inside this
+ * window (NULL means no grid content). */
+ GridContainer *containerDataPtr; /* Additional data for geometry container. */
Tcl_Obj *in; /* Store container name when removed. */
int column, row; /* Location in the grid (starting from
* zero). */
- int numCols, numRows; /* Number of columns or rows this slave spans.
+ int numCols, numRows; /* Number of columns or rows this content spans.
* Should be at least 1. */
int padX, padY; /* Total additional pixels to leave around the
* window. Some is of this space is on each
@@ -190,7 +190,7 @@ typedef struct Gridder {
* nested call to ArrangeGrid already working
* on this window. *abortPtr may be set to 1
* to abort that nested call. This happens,
- * for example, if tkwin or any of its slaves
+ * for example, if tkwin or any of its content
* is deleted. */
int flags; /* Miscellaneous flags; see below for
* definitions. */
@@ -199,9 +199,9 @@ typedef struct Gridder {
* These fields are used temporarily for layout calculations only.
*/
- struct Gridder *binNextPtr; /* Link to next span>1 slave in this bin. */
+ struct Gridder *binNextPtr; /* Link to next span>1 content in this bin. */
int size; /* Nominal size (width or height) in pixels of
- * the slave. This includes the padding. */
+ * the content. This includes the padding. */
} Gridder;
/*
@@ -235,12 +235,12 @@ typedef struct UniformGroup {
* Flag values for Grid structures:
*
* REQUESTED_RELAYOUT 1 means a Tcl_DoWhenIdle request has already
- * been made to re-arrange all the slaves of this
+ * been made to re-arrange all the content of this
* window.
* DONT_PROPAGATE 1 means don't set this window's requested
* size. 0 means if this window is a container then
* Tk will set its requested size to fit the
- * needs of its slaves.
+ * needs of its content.
* ALLOCED_CONTAINER 1 means that Grid has allocated itself as
* geometry container for this window.
*/
@@ -253,7 +253,7 @@ typedef struct UniformGroup {
* Prototypes for procedures used only in this file:
*/
-static void AdjustForSticky(Gridder *slavePtr, int *xPtr,
+static void AdjustForSticky(Gridder *contentPtr, int *xPtr,
int *yPtr, int *widthPtr, int *heightPtr);
static int AdjustOffsets(int width, int elements,
SlotInfo *slotPtr);
@@ -284,22 +284,22 @@ static int GridRowColumnConfigureCommand(Tk_Window tkwin,
Tcl_Obj *const objv[]);
static int GridSizeCommand(Tk_Window tkwin, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int GridSlavesCommand(Tk_Window tkwin, Tcl_Interp *interp,
+static int GridContentCommand(Tk_Window tkwin, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static void GridStructureProc(ClientData clientData,
XEvent *eventPtr);
-static void GridLostSlaveProc(ClientData clientData,
+static void GridLostContentProc(ClientData clientData,
Tk_Window tkwin);
static void GridReqProc(ClientData clientData, Tk_Window tkwin);
-static void InitMasterData(Gridder *containerPtr);
+static void InitContainerData(Gridder *containerPtr);
static Tcl_Obj * NewPairObj(int, int);
static Tcl_Obj * NewQuadObj(int, int, int, int);
static int ResolveConstraints(Gridder *gridPtr, int rowOrColumn,
int maxOffset);
static void SetGridSize(Gridder *gridPtr);
-static int SetSlaveColumn(Tcl_Interp *interp, Gridder *slavePtr,
+static int SetContentColumn(Tcl_Interp *interp, Gridder *contentPtr,
int column, int numCols);
-static int SetSlaveRow(Tcl_Interp *interp, Gridder *slavePtr,
+static int SetContentRow(Tcl_Interp *interp, Gridder *contentPtr,
int row, int numRows);
static Tcl_Obj * StickyToObj(int flags);
static int StringToSticky(const char *string);
@@ -308,7 +308,7 @@ static void Unlink(Gridder *gridPtr);
static const Tk_GeomMgr gridMgrType = {
"grid", /* name */
GridReqProc, /* requestProc */
- GridLostSlaveProc, /* lostSlaveProc */
+ GridLostContentProc, /* lostSlaveProc */
};
/*
@@ -335,7 +335,7 @@ Tk_GridObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
static const char *const optionStrings[] = {
"anchor", "bbox", "columnconfigure", "configure",
"content", "forget", "info", "location", "propagate",
@@ -386,7 +386,7 @@ Tk_GridObjCmd(
return GridSizeCommand(tkwin, interp, objc, objv);
case GRID_CONTENT:
case GRID_SLAVES:
- return GridSlavesCommand(tkwin, interp, objc, objv);
+ return GridContentCommand(tkwin, interp, objc, objv);
/*
* Sample argument combinations:
@@ -434,7 +434,7 @@ GridAnchorCommand(
{
Tk_Window container;
Gridder *containerPtr;
- GridMaster *gridPtr;
+ GridContainer *gridPtr;
Tk_Anchor old;
if (objc > 4) {
@@ -455,7 +455,7 @@ GridAnchorCommand(
return TCL_OK;
}
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
gridPtr = containerPtr->containerDataPtr;
old = gridPtr->anchor;
if (Tk_GetAnchorFromObj(interp, objv[3], &gridPtr->anchor) != TCL_OK) {
@@ -503,7 +503,7 @@ GridBboxCommand(
{
Tk_Window container;
Gridder *containerPtr; /* container grid record */
- GridMaster *gridPtr; /* pointer to grid data */
+ GridContainer *gridPtr; /* pointer to grid data */
int row, column; /* origin for bounding box */
int row2, column2; /* end of bounding box */
int endX, endY; /* last column/row in the layout */
@@ -631,67 +631,67 @@ GridForgetRemoveCommand(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window slave;
- Gridder *slavePtr;
+ Tk_Window content;
+ Gridder *contentPtr;
int i;
const char *string = Tcl_GetString(objv[1]);
char c = string[0];
for (i = 2; i < objc; i++) {
- if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i], &content) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr = GetGrid(slave);
- if (slavePtr->containerPtr != NULL) {
+ contentPtr = GetGrid(content);
+ if (contentPtr->containerPtr != NULL) {
/*
* For "forget", reset all the settings to their defaults
*/
if (c == 'f') {
- slavePtr->column = -1;
- slavePtr->row = -1;
- slavePtr->numCols = 1;
- slavePtr->numRows = 1;
- slavePtr->padX = 0;
- slavePtr->padY = 0;
- slavePtr->padLeft = 0;
- slavePtr->padTop = 0;
- slavePtr->iPadX = 0;
- slavePtr->iPadY = 0;
- if (slavePtr->in != NULL) {
- Tcl_DecrRefCount(slavePtr->in);
- slavePtr->in = NULL;
+ contentPtr->column = -1;
+ contentPtr->row = -1;
+ contentPtr->numCols = 1;
+ contentPtr->numRows = 1;
+ contentPtr->padX = 0;
+ contentPtr->padY = 0;
+ contentPtr->padLeft = 0;
+ contentPtr->padTop = 0;
+ contentPtr->iPadX = 0;
+ contentPtr->iPadY = 0;
+ if (contentPtr->in != NULL) {
+ Tcl_DecrRefCount(contentPtr->in);
+ contentPtr->in = NULL;
}
- slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
- if (slavePtr->flags & REQUESTED_RELAYOUT) {
- Tcl_CancelIdleCall(ArrangeGrid, slavePtr);
+ contentPtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
+ if (contentPtr->flags & REQUESTED_RELAYOUT) {
+ Tcl_CancelIdleCall(ArrangeGrid, contentPtr);
}
- slavePtr->flags = 0;
- slavePtr->sticky = 0;
+ contentPtr->flags = 0;
+ contentPtr->sticky = 0;
} else {
/*
* When removing, store name of container to be able to
* restore it later, even if the container is recreated.
*/
- if (slavePtr->in != NULL) {
- Tcl_DecrRefCount(slavePtr->in);
- slavePtr->in = NULL;
+ if (contentPtr->in != NULL) {
+ Tcl_DecrRefCount(contentPtr->in);
+ contentPtr->in = NULL;
}
- if (slavePtr->containerPtr != NULL) {
- slavePtr->in = Tcl_NewStringObj(
- Tk_PathName(slavePtr->containerPtr->tkwin), -1);
- Tcl_IncrRefCount(slavePtr->in);
+ if (contentPtr->containerPtr != NULL) {
+ contentPtr->in = Tcl_NewStringObj(
+ Tk_PathName(contentPtr->containerPtr->tkwin), -1);
+ Tcl_IncrRefCount(contentPtr->in);
}
}
- Tk_ManageGeometry(slave, NULL, NULL);
- if (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin,
- slavePtr->containerPtr->tkwin);
+ Tk_ManageGeometry(content, NULL, NULL);
+ if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin,
+ contentPtr->containerPtr->tkwin);
}
- Unlink(slavePtr);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Unlink(contentPtr);
+ Tk_UnmapWindow(contentPtr->tkwin);
}
}
return TCL_OK;
@@ -721,40 +721,40 @@ GridInfoCommand(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Gridder *slavePtr;
- Tk_Window slave;
+ Gridder *contentPtr;
+ Tk_Window content;
Tcl_Obj *infoObj;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &content) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr = GetGrid(slave);
- if (slavePtr->containerPtr == NULL) {
+ contentPtr = GetGrid(content);
+ if (contentPtr->containerPtr == NULL) {
Tcl_ResetResult(interp);
return TCL_OK;
}
infoObj = Tcl_NewObj();
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-in", -1),
- TkNewWindowObj(slavePtr->containerPtr->tkwin));
+ TkNewWindowObj(contentPtr->containerPtr->tkwin));
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-column", -1),
- Tcl_NewIntObj(slavePtr->column));
+ Tcl_NewIntObj(contentPtr->column));
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-row", -1),
- Tcl_NewIntObj(slavePtr->row));
+ Tcl_NewIntObj(contentPtr->row));
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-columnspan", -1),
- Tcl_NewIntObj(slavePtr->numCols));
+ Tcl_NewIntObj(contentPtr->numCols));
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-rowspan", -1),
- Tcl_NewIntObj(slavePtr->numRows));
- TkAppendPadAmount(infoObj, "-ipadx", slavePtr->iPadX/2, slavePtr->iPadX);
- TkAppendPadAmount(infoObj, "-ipady", slavePtr->iPadY/2, slavePtr->iPadY);
- TkAppendPadAmount(infoObj, "-padx", slavePtr->padLeft, slavePtr->padX);
- TkAppendPadAmount(infoObj, "-pady", slavePtr->padTop, slavePtr->padY);
+ Tcl_NewIntObj(contentPtr->numRows));
+ TkAppendPadAmount(infoObj, "-ipadx", contentPtr->iPadX/2, contentPtr->iPadX);
+ TkAppendPadAmount(infoObj, "-ipady", contentPtr->iPadY/2, contentPtr->iPadY);
+ TkAppendPadAmount(infoObj, "-padx", contentPtr->padLeft, contentPtr->padX);
+ TkAppendPadAmount(infoObj, "-pady", contentPtr->padTop, contentPtr->padY);
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-sticky", -1),
- StickyToObj(slavePtr->sticky));
+ StickyToObj(contentPtr->sticky));
Tcl_SetObjResult(interp, infoObj);
return TCL_OK;
}
@@ -784,8 +784,8 @@ GridLocationCommand(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window container;
- Gridder *containerPtr; /* Master grid record. */
- GridMaster *gridPtr; /* Pointer to grid data. */
+ Gridder *containerPtr; /* Container grid record. */
+ GridContainer *gridPtr; /* Pointer to grid data. */
SlotInfo *slotPtr;
int x, y; /* Offset in pixels, from edge of container. */
int i, j; /* Corresponding column and row indeces. */
@@ -906,10 +906,10 @@ GridPropagateCommand(
if (propagate != old) {
if (propagate) {
/*
- * If we have slaves, we need to register as geometry container.
+ * If we have content, we need to register as geometry container.
*/
- if (containerPtr->slavePtr != NULL) {
+ if (containerPtr->contentPtr != NULL) {
if (TkSetGeometryContainer(interp, container, "grid") != TCL_OK) {
return TCL_ERROR;
}
@@ -964,8 +964,8 @@ GridRowColumnConfigureCommand(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window container, slave;
- Gridder *containerPtr, *slavePtr;
+ Tk_Window container, content;
+ Gridder *containerPtr, *contentPtr;
SlotInfo *slotPtr = NULL;
int slot; /* the column or row number */
int slotType; /* COLUMN or ROW */
@@ -1011,8 +1011,8 @@ GridRowColumnConfigureCommand(
}
containerPtr = GetGrid(container);
- first = 0; /* lint */
- last = 0; /* lint */
+ first = 0;
+ last = 0;
if ((objc == 4) || (objc == 5)) {
if (lObjc != 1) {
@@ -1102,32 +1102,32 @@ GridRowColumnConfigureCommand(
}
for (j = 0; j < lObjc; j++) {
- int allSlaves = 0;
+ int allContent = 0;
if (Tcl_GetIntFromObj(NULL, lObjv[j], &slot) == TCL_OK) {
first = slot;
last = slot;
- slavePtr = NULL;
+ contentPtr = NULL;
} else if (strcmp(Tcl_GetString(lObjv[j]), "all") == 0) {
/*
* Make sure container is initialised.
*/
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
- slavePtr = containerPtr->slavePtr;
- if (slavePtr == NULL) {
+ contentPtr = containerPtr->contentPtr;
+ if (contentPtr == NULL) {
continue;
}
- allSlaves = 1;
- } else if (TkGetWindowFromObj(NULL, tkwin, lObjv[j], &slave)
+ allContent = 1;
+ } else if (TkGetWindowFromObj(NULL, tkwin, lObjv[j], &content)
== TCL_OK) {
/*
* Is it gridded in this container?
*/
- slavePtr = GetGrid(slave);
- if (slavePtr->containerPtr != containerPtr) {
+ contentPtr = GetGrid(content);
+ if (contentPtr->containerPtr != containerPtr) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"the window \"%s\" is not managed by \"%s\"",
Tcl_GetString(lObjv[j]), Tcl_GetString(objv[2])));
@@ -1148,11 +1148,11 @@ GridRowColumnConfigureCommand(
*/
do {
- if (slavePtr != NULL) {
+ if (contentPtr != NULL) {
first = (slotType == COLUMN) ?
- slavePtr->column : slavePtr->row;
+ contentPtr->column : contentPtr->row;
last = first - 1 + ((slotType == COLUMN) ?
- slavePtr->numCols : slavePtr->numRows);
+ contentPtr->numCols : contentPtr->numRows);
}
for (slot = first; slot <= last; slot++) {
@@ -1222,10 +1222,10 @@ GridRowColumnConfigureCommand(
}
}
}
- if (slavePtr != NULL) {
- slavePtr = slavePtr->nextPtr;
+ if (contentPtr != NULL) {
+ contentPtr = contentPtr->nextPtr;
}
- } while ((allSlaves == 1) && (slavePtr != NULL));
+ } while ((allContent == 1) && (contentPtr != NULL));
}
Tcl_DecrRefCount(listCopy);
@@ -1299,7 +1299,7 @@ GridSizeCommand(
{
Tk_Window container;
Gridder *containerPtr;
- GridMaster *gridPtr; /* pointer to grid data */
+ GridContainer *gridPtr; /* pointer to grid data */
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -1326,23 +1326,23 @@ GridSizeCommand(
/*
*----------------------------------------------------------------------
*
- * GridSlavesCommand --
+ * GridContentCommand --
*
- * Implementation of the [grid slaves] subcommand. See the user
+ * Implementation of the [grid content] subcommand. See the user
* documentation for details on what it does.
*
* Results:
* Standard Tcl result.
*
* Side effects:
- * Places a list of slaves of the specified window in the interpreter's
- * result field.
+ * Places a list of content windows of the specified window in the
+ * interpreter's result field.
*
*----------------------------------------------------------------------
*/
static int
-GridSlavesCommand(
+GridContentCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -1350,13 +1350,13 @@ GridSlavesCommand(
{
Tk_Window container;
Gridder *containerPtr; /* container grid record */
- Gridder *slavePtr;
+ Gridder *contentPtr;
int i, value, index;
int row = -1, column = -1;
static const char *const optionStrings[] = {
"-column", "-row", NULL
};
- enum options { SLAVES_COLUMN, SLAVES_ROW };
+ enum options { CONTENT_COLUMN, CONTENT_ROW };
Tcl_Obj *res;
if ((objc < 3) || ((objc % 2) == 0)) {
@@ -1378,7 +1378,7 @@ GridSlavesCommand(
Tcl_SetErrorCode(interp, "TK", "GRID", "NEG_INDEX", NULL);
return TCL_ERROR;
}
- if (index == SLAVES_COLUMN) {
+ if (index == CONTENT_COLUMN) {
column = value;
} else {
row = value;
@@ -1391,17 +1391,17 @@ GridSlavesCommand(
containerPtr = GetGrid(container);
res = Tcl_NewListObj(0, NULL);
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- if ((column >= 0) && (slavePtr->column > column
- || slavePtr->column+slavePtr->numCols-1 < column)) {
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ if ((column >= 0) && (contentPtr->column > column
+ || contentPtr->column+contentPtr->numCols-1 < column)) {
continue;
}
- if ((row >= 0) && (slavePtr->row > row ||
- slavePtr->row+slavePtr->numRows-1 < row)) {
+ if ((row >= 0) && (contentPtr->row > row ||
+ contentPtr->row+contentPtr->numRows-1 < row)) {
continue;
}
- Tcl_ListObjAppendElement(interp,res, TkNewWindowObj(slavePtr->tkwin));
+ Tcl_ListObjAppendElement(interp,res, TkNewWindowObj(contentPtr->tkwin));
}
Tcl_SetObjResult(interp, res);
return TCL_OK;
@@ -1429,10 +1429,10 @@ static void
GridReqProc(
ClientData clientData, /* Grid's information about window that got
* new preferred geometry. */
- Tk_Window tkwin) /* Other Tk-related information about the
+ TCL_UNUSED(Tk_Window)) /* Other Tk-related information about the
* window. */
{
- Gridder *gridPtr = clientData;
+ Gridder *gridPtr = (Gridder *)clientData;
gridPtr = gridPtr->containerPtr;
if (gridPtr && !(gridPtr->flags & REQUESTED_RELAYOUT)) {
@@ -1444,33 +1444,33 @@ GridReqProc(
/*
*----------------------------------------------------------------------
*
- * GridLostSlaveProc --
+ * GridLostContentProc --
*
* This procedure is invoked by Tk whenever some other geometry claims
- * control over a slave that used to be managed by us.
+ * control over a content that used to be managed by us.
*
* Results:
* None.
*
* Side effects:
- * Forgets all grid-related information about the slave.
+ * Forgets all grid-related information about the content.
*
*----------------------------------------------------------------------
*/
static void
-GridLostSlaveProc(
- ClientData clientData, /* Grid structure for slave window that was
+GridLostContentProc(
+ ClientData clientData, /* Grid structure for content window that was
* stolen away. */
- Tk_Window tkwin) /* Tk's handle for the slave window. */
+ TCL_UNUSED(Tk_Window)) /* Tk's handle for the content window. */
{
- Gridder *slavePtr = clientData;
+ Gridder *contentPtr = (Gridder *)clientData;
- if (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->containerPtr->tkwin);
+ if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin);
}
- Unlink(slavePtr);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Unlink(contentPtr);
+ Tk_UnmapWindow(contentPtr->tkwin);
}
/*
@@ -1644,12 +1644,12 @@ AdjustOffsets(
*
* AdjustForSticky --
*
- * This procedure adjusts the size of a slave in its cavity based on its
+ * This procedure adjusts the size of a content in its cavity based on its
* "sticky" flags.
*
* Results:
* The input x, y, width, and height are changed to represent the desired
- * coordinates of the slave.
+ * coordinates of the content.
*
* Side effects:
* None.
@@ -1659,29 +1659,29 @@ AdjustOffsets(
static void
AdjustForSticky(
- Gridder *slavePtr, /* Slave window to arrange in its cavity. */
+ Gridder *contentPtr, /* Content window to arrange in its cavity. */
int *xPtr, /* Pixel location of the left edge of the cavity. */
int *yPtr, /* Pixel location of the top edge of the cavity. */
int *widthPtr, /* Width of the cavity (in pixels). */
int *heightPtr) /* Height of the cavity (in pixels). */
{
- int diffx = 0; /* Cavity width - slave width. */
- int diffy = 0; /* Cavity hight - slave height. */
- int sticky = slavePtr->sticky;
+ int diffx = 0; /* Cavity width - content width. */
+ int diffy = 0; /* Cavity hight - content height. */
+ int sticky = contentPtr->sticky;
- *xPtr += slavePtr->padLeft;
- *widthPtr -= slavePtr->padX;
- *yPtr += slavePtr->padTop;
- *heightPtr -= slavePtr->padY;
+ *xPtr += contentPtr->padLeft;
+ *widthPtr -= contentPtr->padX;
+ *yPtr += contentPtr->padTop;
+ *heightPtr -= contentPtr->padY;
- if (*widthPtr > (Tk_ReqWidth(slavePtr->tkwin) + slavePtr->iPadX)) {
- diffx = *widthPtr - (Tk_ReqWidth(slavePtr->tkwin) + slavePtr->iPadX);
- *widthPtr = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->iPadX;
+ if (*widthPtr > (Tk_ReqWidth(contentPtr->tkwin) + contentPtr->iPadX)) {
+ diffx = *widthPtr - (Tk_ReqWidth(contentPtr->tkwin) + contentPtr->iPadX);
+ *widthPtr = Tk_ReqWidth(contentPtr->tkwin) + contentPtr->iPadX;
}
- if (*heightPtr > (Tk_ReqHeight(slavePtr->tkwin) + slavePtr->iPadY)) {
- diffy = *heightPtr - (Tk_ReqHeight(slavePtr->tkwin) + slavePtr->iPadY);
- *heightPtr = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->iPadY;
+ if (*heightPtr > (Tk_ReqHeight(contentPtr->tkwin) + contentPtr->iPadY)) {
+ diffy = *heightPtr - (Tk_ReqHeight(contentPtr->tkwin) + contentPtr->iPadY);
+ *heightPtr = Tk_ReqHeight(contentPtr->tkwin) + contentPtr->iPadY;
}
if (sticky&STICK_EAST && sticky&STICK_WEST) {
@@ -1712,19 +1712,19 @@ AdjustForSticky(
* None.
*
* Side effects:
- * The slaves of containerPtr may get resized or moved.
+ * The content of containerPtr may get resized or moved.
*
*----------------------------------------------------------------------
*/
static void
ArrangeGrid(
- ClientData clientData) /* Structure describing container whose slaves
+ ClientData clientData) /* Structure describing container whose content
* are to be re-layed out. */
{
- Gridder *containerPtr = clientData;
- Gridder *slavePtr;
- GridMaster *slotPtr = containerPtr->containerDataPtr;
+ Gridder *containerPtr = (Gridder *)clientData;
+ Gridder *contentPtr;
+ GridContainer *slotPtr = containerPtr->containerDataPtr;
int abort;
int width, height; /* Requested size of layout, in pixels. */
int realWidth, realHeight; /* Actual size layout should take-up. */
@@ -1733,13 +1733,13 @@ ArrangeGrid(
containerPtr->flags &= ~REQUESTED_RELAYOUT;
/*
- * If the container has no slaves anymore, then don't do anything at all:
+ * If the container has no content anymore, then don't do anything at all:
* just leave the container's size as-is. Otherwise there is no way to
* "relinquish" control over the container so another geometry manager can
* take over.
*/
- if (containerPtr->slavePtr == NULL) {
+ if (containerPtr->contentPtr == NULL) {
return;
}
@@ -1813,62 +1813,62 @@ ArrangeGrid(
0, 0, usedX, usedY, &slotPtr->startX, &slotPtr->startY);
/*
- * Now adjust the actual size of the slave to its cavity by computing the
+ * Now adjust the actual size of the content to its cavity by computing the
* cavity size, and adjusting the widget according to its stickyness.
*/
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL && !abort;
- slavePtr = slavePtr->nextPtr) {
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL && !abort;
+ contentPtr = contentPtr->nextPtr) {
int x, y; /* Top left coordinate */
- int width, height; /* Slot or slave size */
- int col = slavePtr->column;
- int row = slavePtr->row;
+ int width, height; /* Slot or content size */
+ int col = contentPtr->column;
+ int row = contentPtr->row;
x = (col>0) ? slotPtr->columnPtr[col-1].offset : 0;
y = (row>0) ? slotPtr->rowPtr[row-1].offset : 0;
- width = slotPtr->columnPtr[slavePtr->numCols+col-1].offset - x;
- height = slotPtr->rowPtr[slavePtr->numRows+row-1].offset - y;
+ width = slotPtr->columnPtr[contentPtr->numCols+col-1].offset - x;
+ height = slotPtr->rowPtr[contentPtr->numRows+row-1].offset - y;
x += slotPtr->startX;
y += slotPtr->startY;
- AdjustForSticky(slavePtr, &x, &y, &width, &height);
+ AdjustForSticky(contentPtr, &x, &y, &width, &height);
/*
* Now put the window in the proper spot. (This was taken directly
- * from tkPack.c.) If the slave is a child of the container, then do this
+ * from tkPack.c.) If the content is a child of the container, then do this
* here. Otherwise let Tk_MaintainGeometry do the work.
*/
- if (containerPtr->tkwin == Tk_Parent(slavePtr->tkwin)) {
+ if (containerPtr->tkwin == Tk_Parent(contentPtr->tkwin)) {
if ((width <= 0) || (height <= 0)) {
- Tk_UnmapWindow(slavePtr->tkwin);
+ Tk_UnmapWindow(contentPtr->tkwin);
} else {
- if ((x != Tk_X(slavePtr->tkwin))
- || (y != Tk_Y(slavePtr->tkwin))
- || (width != Tk_Width(slavePtr->tkwin))
- || (height != Tk_Height(slavePtr->tkwin))) {
- Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
+ if ((x != Tk_X(contentPtr->tkwin))
+ || (y != Tk_Y(contentPtr->tkwin))
+ || (width != Tk_Width(contentPtr->tkwin))
+ || (height != Tk_Height(contentPtr->tkwin))) {
+ Tk_MoveResizeWindow(contentPtr->tkwin, x, y, width, height);
}
if (abort) {
break;
}
/*
- * Don't map the slave if the container isn't mapped: wait until
+ * Don't map the content if the container isn't mapped: wait until
* the container gets mapped later.
*/
if (Tk_IsMapped(containerPtr->tkwin)) {
- Tk_MapWindow(slavePtr->tkwin);
+ Tk_MapWindow(contentPtr->tkwin);
}
}
} else if ((width <= 0) || (height <= 0)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, containerPtr->tkwin);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Tk_UnmaintainGeometry(contentPtr->tkwin, containerPtr->tkwin);
+ Tk_UnmapWindow(contentPtr->tkwin);
} else {
- Tk_MaintainGeometry(slavePtr->tkwin, containerPtr->tkwin, x, y,
+ Tk_MaintainGeometry(contentPtr->tkwin, containerPtr->tkwin, x, y,
width, height);
}
}
@@ -1905,7 +1905,7 @@ ResolveConstraints(
* pixels, or 0 (not currently used). */
{
SlotInfo *slotPtr; /* Pointer to row/col constraints. */
- Gridder *slavePtr; /* List of slave windows in this grid. */
+ Gridder *contentPtr; /* List of content windows in this grid. */
int constraintCount; /* Count of rows or columns that have
* constraints. */
int slotCount; /* Last occupied row or column. */
@@ -1914,7 +1914,7 @@ ResolveConstraints(
GridLayout *layoutPtr; /* Temporary layout structure. */
int requiredSize; /* The natural size of the grid (pixels).
* This is the minimum size needed to
- * accommodate all of the slaves at their
+ * accommodate all of the content at their
* requested sizes. */
int offset; /* The pixel offset of the right edge of the
* current slot from the beginning of the
@@ -1957,7 +1957,7 @@ ResolveConstraints(
gridCount = MAX(constraintCount, slotCount);
if (gridCount >= TYPICAL_SIZE) {
- layoutPtr = ckalloc(sizeof(GridLayout) * (1+gridCount));
+ layoutPtr = (GridLayout *)ckalloc(sizeof(GridLayout) * (1+gridCount));
} else {
layoutPtr = layoutData;
}
@@ -1998,29 +1998,29 @@ ResolveConstraints(
/*
* Step 2.
- * Slaves with a span of 1 are used to determine the minimum size of each
- * slot. Slaves whose span is two or more slots don't contribute to the
+ * Content with a span of 1 are used to determine the minimum size of each
+ * slot. Content whose span is two or more slots don't contribute to the
* minimum size of each slot directly, but can cause slots to grow if
* their size exceeds the the sizes of the slots they span.
*
- * Bin all slaves whose spans are > 1 by their right edges. This allows
+ * Bin all content whose spans are > 1 by their right edges. This allows
* the computation on minimum and maximum possible layout sizes at each
- * slot boundary, without the need to re-sort the slaves.
+ * slot boundary, without the need to re-sort the content.
*/
switch (slotType) {
case COLUMN:
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- int rightEdge = slavePtr->column + slavePtr->numCols - 1;
-
- slavePtr->size = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->padX
- + slavePtr->iPadX + slavePtr->doubleBw;
- if (slavePtr->numCols > 1) {
- slavePtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
- layoutPtr[rightEdge].binNextPtr = slavePtr;
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ int rightEdge = contentPtr->column + contentPtr->numCols - 1;
+
+ contentPtr->size = Tk_ReqWidth(contentPtr->tkwin) + contentPtr->padX
+ + contentPtr->iPadX + contentPtr->doubleBw;
+ if (contentPtr->numCols > 1) {
+ contentPtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
+ layoutPtr[rightEdge].binNextPtr = contentPtr;
} else if (rightEdge >= 0) {
- int size = slavePtr->size + layoutPtr[rightEdge].pad;
+ int size = contentPtr->size + layoutPtr[rightEdge].pad;
if (size > layoutPtr[rightEdge].minSize) {
layoutPtr[rightEdge].minSize = size;
@@ -2029,17 +2029,17 @@ ResolveConstraints(
}
break;
case ROW:
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- int rightEdge = slavePtr->row + slavePtr->numRows - 1;
-
- slavePtr->size = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->padY
- + slavePtr->iPadY + slavePtr->doubleBw;
- if (slavePtr->numRows > 1) {
- slavePtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
- layoutPtr[rightEdge].binNextPtr = slavePtr;
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ int rightEdge = contentPtr->row + contentPtr->numRows - 1;
+
+ contentPtr->size = Tk_ReqHeight(contentPtr->tkwin) + contentPtr->padY
+ + contentPtr->iPadY + contentPtr->doubleBw;
+ if (contentPtr->numRows > 1) {
+ contentPtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
+ layoutPtr[rightEdge].binNextPtr = contentPtr;
} else if (rightEdge >= 0) {
- int size = slavePtr->size + layoutPtr[rightEdge].pad;
+ int size = contentPtr->size + layoutPtr[rightEdge].pad;
if (size > layoutPtr[rightEdge].minSize) {
layoutPtr[rightEdge].minSize = size;
@@ -2079,7 +2079,7 @@ ResolveConstraints(
* sizeof(UniformGroup);
size_t newSize = (uniformGroupsAlloced + UNIFORM_PREALLOC)
* sizeof(UniformGroup);
- UniformGroup *newUG = ckalloc(newSize);
+ UniformGroup *newUG = (UniformGroup *)ckalloc(newSize);
UniformGroup *oldUG = uniformGroupPtr;
memcpy(newUG, oldUG, oldSize);
@@ -2130,16 +2130,16 @@ ResolveConstraints(
/*
* Step 3.
* Determine the minimum slot offsets going from left to right that would
- * fit all of the slaves. This determines the minimum
+ * fit all of the content. This determines the minimum
*/
for (offset=0,slot=0; slot < gridCount; slot++) {
layoutPtr[slot].minOffset = layoutPtr[slot].minSize + offset;
- for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
- slavePtr = slavePtr->binNextPtr) {
+ for (contentPtr = layoutPtr[slot].binNextPtr; contentPtr != NULL;
+ contentPtr = contentPtr->binNextPtr) {
int span = (slotType == COLUMN) ?
- slavePtr->numCols : slavePtr->numRows;
- int required = slavePtr->size + layoutPtr[slot - span].minOffset;
+ contentPtr->numCols : contentPtr->numRows;
+ int required = contentPtr->size + layoutPtr[slot - span].minOffset;
if (required > layoutPtr[slot].minOffset) {
layoutPtr[slot].minOffset = required;
@@ -2171,11 +2171,11 @@ ResolveConstraints(
layoutPtr[slot].maxOffset = offset;
}
for (slot=gridCount-1; slot > 0;) {
- for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
- slavePtr = slavePtr->binNextPtr) {
+ for (contentPtr = layoutPtr[slot].binNextPtr; contentPtr != NULL;
+ contentPtr = contentPtr->binNextPtr) {
int span = (slotType == COLUMN) ?
- slavePtr->numCols : slavePtr->numRows;
- int require = offset - slavePtr->size;
+ contentPtr->numCols : contentPtr->numRows;
+ int require = offset - contentPtr->size;
int startSlot = slot - span;
if (startSlot >=0 && require < layoutPtr[startSlot].maxOffset) {
@@ -2440,14 +2440,14 @@ GetGrid(
hPtr = Tcl_CreateHashEntry(&dispPtr->gridHashTable, (char*) tkwin, &isNew);
if (!isNew) {
- return Tcl_GetHashValue(hPtr);
+ return (Gridder *)Tcl_GetHashValue(hPtr);
}
- gridPtr = ckalloc(sizeof(Gridder));
+ gridPtr = (Gridder *)ckalloc(sizeof(Gridder));
gridPtr->tkwin = tkwin;
gridPtr->containerPtr = NULL;
gridPtr->containerDataPtr = NULL;
gridPtr->nextPtr = NULL;
- gridPtr->slavePtr = NULL;
+ gridPtr->contentPtr = NULL;
gridPtr->binNextPtr = NULL;
gridPtr->column = -1;
@@ -2479,7 +2479,7 @@ GetGrid(
*
* SetGridSize --
*
- * This internal procedure sets the size of the grid occupied by slaves.
+ * This internal procedure sets the size of the grid occupied by content.
*
* Results:
* None
@@ -2496,13 +2496,13 @@ static void
SetGridSize(
Gridder *containerPtr) /* The geometry container for this grid. */
{
- Gridder *slavePtr; /* Current slave window. */
+ Gridder *contentPtr; /* Current content window. */
int maxX = 0, maxY = 0;
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- maxX = MAX(maxX, slavePtr->numCols + slavePtr->column);
- maxY = MAX(maxY, slavePtr->numRows + slavePtr->row);
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ maxX = MAX(maxX, contentPtr->numCols + contentPtr->column);
+ maxY = MAX(maxY, contentPtr->numRows + contentPtr->row);
}
containerPtr->containerDataPtr->columnEnd = maxX;
containerPtr->containerDataPtr->rowEnd = maxY;
@@ -2513,31 +2513,31 @@ SetGridSize(
/*
*----------------------------------------------------------------------
*
- * SetSlaveColumn --
+ * SetContentColumn --
*
- * Update column data for a slave, checking that MAX_ELEMENT bound
+ * Update column data for a content, checking that MAX_ELEMENT bound
* is not passed.
*
* Results:
* TCL_ERROR if out of bounds, TCL_OK otherwise
*
* Side effects:
- * Slave fields are updated.
+ * Content fields are updated.
*
*----------------------------------------------------------------------
*/
static int
-SetSlaveColumn(
+SetContentColumn(
Tcl_Interp *interp, /* Interp for error message. */
- Gridder *slavePtr, /* Slave to be updated. */
+ Gridder *contentPtr, /* Content to be updated. */
int column, /* New column or -1 to be unchanged. */
int numCols) /* New columnspan or -1 to be unchanged. */
{
int newColumn, newNumCols, lastCol;
- newColumn = (column >= 0) ? column : slavePtr->column;
- newNumCols = (numCols >= 1) ? numCols : slavePtr->numCols;
+ newColumn = (column >= 0) ? column : contentPtr->column;
+ newNumCols = (numCols >= 1) ? numCols : contentPtr->numCols;
lastCol = ((newColumn >= 0) ? newColumn : 0) + newNumCols;
if (lastCol >= MAX_ELEMENT) {
@@ -2546,39 +2546,39 @@ SetSlaveColumn(
return TCL_ERROR;
}
- slavePtr->column = newColumn;
- slavePtr->numCols = newNumCols;
+ contentPtr->column = newColumn;
+ contentPtr->numCols = newNumCols;
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * SetSlaveRow --
+ * SetContentRow --
*
- * Update row data for a slave, checking that MAX_ELEMENT bound
+ * Update row data for a content, checking that MAX_ELEMENT bound
* is not passed.
*
* Results:
* TCL_ERROR if out of bounds, TCL_OK otherwise
*
* Side effects:
- * Slave fields are updated.
+ * Content fields are updated.
*
*----------------------------------------------------------------------
*/
static int
-SetSlaveRow(
+SetContentRow(
Tcl_Interp *interp, /* Interp for error message. */
- Gridder *slavePtr, /* Slave to be updated. */
+ Gridder *contentPtr, /* Content to be updated. */
int row, /* New row or -1 to be unchanged. */
int numRows) /* New rowspan or -1 to be unchanged. */
{
int newRow, newNumRows, lastRow;
- newRow = (row >= 0) ? row : slavePtr->row;
- newNumRows = (numRows >= 1) ? numRows : slavePtr->numRows;
+ newRow = (row >= 0) ? row : contentPtr->row;
+ newNumRows = (numRows >= 1) ? numRows : contentPtr->numRows;
lastRow = ((newRow >= 0) ? newRow : 0) + newNumRows;
if (lastRow >= MAX_ELEMENT) {
@@ -2587,8 +2587,8 @@ SetSlaveRow(
return TCL_ERROR;
}
- slavePtr->row = newRow;
- slavePtr->numRows = newNumRows;
+ contentPtr->row = newRow;
+ contentPtr->numRows = newNumRows;
return TCL_OK;
}
@@ -2640,7 +2640,7 @@ CheckSlotData(
* of the offsets as well.
*/
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
end = (slotType == ROW) ? containerPtr->containerDataPtr->rowMax :
containerPtr->containerDataPtr->columnMax;
if (checkOnly == CHECK_ONLY) {
@@ -2652,7 +2652,7 @@ CheckSlotData(
int newNumSlot = slot + PREALLOC;
size_t oldSize = numSlot * sizeof(SlotInfo);
size_t newSize = newNumSlot * sizeof(SlotInfo);
- SlotInfo *newSI = ckalloc(newSize);
+ SlotInfo *newSI = (SlotInfo *)ckalloc(newSize);
SlotInfo *oldSI = (slotType == ROW)
? containerPtr->containerDataPtr->rowPtr
: containerPtr->containerDataPtr->columnPtr;
@@ -2682,7 +2682,7 @@ CheckSlotData(
/*
*----------------------------------------------------------------------
*
- * InitMasterData --
+ * InitContainerData --
*
* This internal procedure is used to allocate and initialize the data
* for a geometry container, if the data doesn't exist already.
@@ -2698,21 +2698,21 @@ CheckSlotData(
*/
static void
-InitMasterData(
+InitContainerData(
Gridder *containerPtr)
{
if (containerPtr->containerDataPtr == NULL) {
- GridMaster *gridPtr = containerPtr->containerDataPtr =
- ckalloc(sizeof(GridMaster));
+ GridContainer *gridPtr = containerPtr->containerDataPtr =
+ ckalloc(sizeof(GridContainer));
size_t size = sizeof(SlotInfo) * TYPICAL_SIZE;
gridPtr->columnEnd = 0;
gridPtr->columnMax = 0;
- gridPtr->columnPtr = ckalloc(size);
+ gridPtr->columnPtr = (SlotInfo *)ckalloc(size);
gridPtr->columnSpace = TYPICAL_SIZE;
gridPtr->rowEnd = 0;
gridPtr->rowMax = 0;
- gridPtr->rowPtr = ckalloc(size);
+ gridPtr->rowPtr = (SlotInfo *)ckalloc(size);
gridPtr->rowSpace = TYPICAL_SIZE;
gridPtr->startX = 0;
gridPtr->startY = 0;
@@ -2728,7 +2728,7 @@ InitMasterData(
*
* Unlink --
*
- * Remove a grid from its container's list of slaves.
+ * Remove a grid from its container's list of content.
*
* Results:
* None.
@@ -2742,24 +2742,24 @@ InitMasterData(
static void
Unlink(
- Gridder *slavePtr) /* Window to unlink. */
+ Gridder *contentPtr) /* Window to unlink. */
{
- Gridder *containerPtr, *slavePtr2;
+ Gridder *containerPtr, *contentPtr2;
- containerPtr = slavePtr->containerPtr;
+ containerPtr = contentPtr->containerPtr;
if (containerPtr == NULL) {
return;
}
- if (containerPtr->slavePtr == slavePtr) {
- containerPtr->slavePtr = slavePtr->nextPtr;
+ if (containerPtr->contentPtr == contentPtr) {
+ containerPtr->contentPtr = contentPtr->nextPtr;
} else {
- for (slavePtr2=containerPtr->slavePtr ; ; slavePtr2=slavePtr2->nextPtr) {
- if (slavePtr2 == NULL) {
+ for (contentPtr2=containerPtr->contentPtr ; ; contentPtr2=contentPtr2->nextPtr) {
+ if (contentPtr2 == NULL) {
Tcl_Panic("Unlink couldn't find previous window");
}
- if (slavePtr2->nextPtr == slavePtr) {
- slavePtr2->nextPtr = slavePtr->nextPtr;
+ if (contentPtr2->nextPtr == contentPtr) {
+ contentPtr2->nextPtr = contentPtr->nextPtr;
break;
}
}
@@ -2772,15 +2772,15 @@ Unlink(
*containerPtr->abortPtr = 1;
}
- SetGridSize(slavePtr->containerPtr);
- slavePtr->containerPtr = NULL;
+ SetGridSize(contentPtr->containerPtr);
+ contentPtr->containerPtr = NULL;
/*
- * If we have emptied this container from slaves it means we are no longer
+ * If we have emptied this container from content it means we are no longer
* handling it and should mark it as free.
*/
- if ((containerPtr->slavePtr == NULL) && (containerPtr->flags & ALLOCED_CONTAINER)) {
+ if ((containerPtr->contentPtr == NULL) && (containerPtr->flags & ALLOCED_CONTAINER)) {
TkFreeGeometryContainer(containerPtr->tkwin, "grid");
containerPtr->flags &= ~ALLOCED_CONTAINER;
}
@@ -2810,7 +2810,7 @@ static void
DestroyGrid(
void *memPtr) /* Info about window that is now dead. */
{
- Gridder *gridPtr = memPtr;
+ Gridder *gridPtr = (Gridder *)memPtr;
if (gridPtr->containerDataPtr != NULL) {
if (gridPtr->containerDataPtr->rowPtr != NULL) {
@@ -2840,7 +2840,7 @@ DestroyGrid(
*
* Side effects:
* If a window was just deleted, clean up all its grid-related
- * information. If it was just resized, re-configure its slaves, if any.
+ * information. If it was just resized, re-configure its content, if any.
*
*----------------------------------------------------------------------
*/
@@ -2851,11 +2851,11 @@ GridStructureProc(
* eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- Gridder *gridPtr = clientData;
+ Gridder *gridPtr = (Gridder *)clientData;
TkDisplay *dispPtr = ((TkWindow *) gridPtr->tkwin)->dispPtr;
if (eventPtr->type == ConfigureNotify) {
- if ((gridPtr->slavePtr != NULL)
+ if ((gridPtr->contentPtr != NULL)
&& !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
Tcl_DoWhenIdle(ArrangeGrid, gridPtr);
@@ -2869,38 +2869,38 @@ GridStructureProc(
}
}
} else if (eventPtr->type == DestroyNotify) {
- Gridder *slavePtr, *nextPtr;
+ Gridder *contentPtr, *nextPtr;
if (gridPtr->containerPtr != NULL) {
Unlink(gridPtr);
}
- for (slavePtr = gridPtr->slavePtr; slavePtr != NULL;
- slavePtr = nextPtr) {
- Tk_ManageGeometry(slavePtr->tkwin, NULL, NULL);
- Tk_UnmapWindow(slavePtr->tkwin);
- slavePtr->containerPtr = NULL;
- nextPtr = slavePtr->nextPtr;
- slavePtr->nextPtr = NULL;
+ for (contentPtr = gridPtr->contentPtr; contentPtr != NULL;
+ contentPtr = nextPtr) {
+ Tk_ManageGeometry(contentPtr->tkwin, NULL, NULL);
+ Tk_UnmapWindow(contentPtr->tkwin);
+ contentPtr->containerPtr = NULL;
+ nextPtr = contentPtr->nextPtr;
+ contentPtr->nextPtr = NULL;
}
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->gridHashTable,
- (char *) gridPtr->tkwin));
+ (char *)gridPtr->tkwin));
if (gridPtr->flags & REQUESTED_RELAYOUT) {
Tcl_CancelIdleCall(ArrangeGrid, gridPtr);
}
gridPtr->tkwin = NULL;
Tcl_EventuallyFree(gridPtr, (Tcl_FreeProc *)DestroyGrid);
} else if (eventPtr->type == MapNotify) {
- if ((gridPtr->slavePtr != NULL)
+ if ((gridPtr->contentPtr != NULL)
&& !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
Tcl_DoWhenIdle(ArrangeGrid, gridPtr);
}
} else if (eventPtr->type == UnmapNotify) {
- Gridder *slavePtr;
+ Gridder *contentPtr;
- for (slavePtr = gridPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- Tk_UnmapWindow(slavePtr->tkwin);
+ for (contentPtr = gridPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ Tk_UnmapWindow(contentPtr->tkwin);
}
}
}
@@ -2911,8 +2911,8 @@ GridStructureProc(
* ConfigureContent --
*
* This implements the guts of the "grid configure" command. Given a list
- * of slaves and configuration options, it arranges for the grid to
- * manage the slaves and sets the specified options. Arguments consist
+ * of content and configuration options, it arranges for the grid to
+ * manage the content and sets the specified options. Arguments consist
* of windows or window shortcuts followed by "-option value" pairs.
*
* Results:
@@ -2920,7 +2920,7 @@ GridStructureProc(
* and the interp's result is set to contain an error message.
*
* Side effects:
- * Slave windows get taken over by the grid.
+ * Content windows get taken over by the grid.
*
*----------------------------------------------------------------------
*/
@@ -2929,7 +2929,7 @@ static int
ConfigureContent(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Any window in application containing
- * slaves. Used to look up slave names. */
+ * content. Used to look up content names. */
int objc, /* Number of elements in argv. */
Tcl_Obj *const objv[]) /* Argument objects: contains one or more
* window names followed by any number of
@@ -2937,8 +2937,8 @@ ConfigureContent(
* that there is at least one window name. */
{
Gridder *containerPtr = NULL;
- Gridder *slavePtr;
- Tk_Window other, slave, parent, ancestor;
+ Gridder *contentPtr;
+ Tk_Window other, content, parent, ancestor;
TkWindow *container;
int i, j, tmp;
int numWindows;
@@ -2975,34 +2975,34 @@ ConfigureContent(
if (firstChar == '.') {
/*
- * Check that windows are valid, and locate the first slave's
+ * Check that windows are valid, and locate the first content's
* parent window (default for -in).
*/
- if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i], &content) != TCL_OK) {
return TCL_ERROR;
}
if (containerPtr == NULL) {
/*
- * Is there any saved -in from a removed slave?
+ * Is there any saved -in from a removed content?
* If there is, it becomes default for -in.
* If the stored container does not exist, just ignore it.
*/
- struct Gridder *slavePtr = GetGrid(slave);
- if (slavePtr->in != NULL) {
- if (TkGetWindowFromObj(interp, slave, slavePtr->in, &parent)
+ struct Gridder *contentPtr = GetGrid(content);
+ if (contentPtr->in != NULL) {
+ if (TkGetWindowFromObj(interp, content, contentPtr->in, &parent)
== TCL_OK) {
containerPtr = GetGrid(parent);
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
}
}
}
if (containerPtr == NULL) {
- parent = Tk_Parent(slave);
+ parent = Tk_Parent(content);
if (parent != NULL) {
containerPtr = GetGrid(parent);
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
}
}
numWindows++;
@@ -3071,7 +3071,7 @@ ConfigureContent(
return TCL_ERROR;
}
containerPtr = GetGrid(other);
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
} else if (index == CONF_ROW) {
if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK
|| tmp < 0) {
@@ -3100,10 +3100,10 @@ ConfigureContent(
}
/*
- * Iterate over all of the slave windows and short-cuts, parsing options
- * for each slave. It's a bit wasteful to re-parse the options for each
- * slave, but things get too messy if we try to parse the arguments just
- * once at the beginning. For example, if a slave already is managed we
+ * Iterate over all of the content windows and short-cuts, parsing options
+ * for each content. It's a bit wasteful to re-parse the options for each
+ * content, but things get too messy if we try to parse the arguments just
+ * once at the beginning. For example, if a content already is managed we
* want to just change a few existing values without resetting everything.
* If there are multiple windows, the -in option only gets processed for
* the first window.
@@ -3116,7 +3116,7 @@ ConfigureContent(
/*
* '^' and 'x' cause us to skip a column. '-' is processed as part of
- * its preceeding slave.
+ * its preceeding content.
*/
if ((firstChar == REL_VERT) || (firstChar == REL_SKIP)) {
@@ -3136,27 +3136,27 @@ ConfigureContent(
}
}
- if (TkGetWindowFromObj(interp, tkwin, objv[j], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[j], &content) != TCL_OK) {
return TCL_ERROR;
}
- if (Tk_TopWinHierarchy(slave)) {
+ if (Tk_TopWinHierarchy(content)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't manage \"%s\": it's a top-level window",
Tcl_GetString(objv[j])));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL);
return TCL_ERROR;
}
- slavePtr = GetGrid(slave);
+ contentPtr = GetGrid(content);
/*
* The following statement is taken from tkPack.c:
*
- * "If the slave isn't currently managed, reset all of its
+ * "If the content isn't currently managed, reset all of its
* configuration information to default values (there could be old
* values left from a previous packer)."
*
- * I [D.S.] disagree with this statement. If a slave is disabled
+ * I [D.S.] disagree with this statement. If a content is disabled
* (using "forget") and then re-enabled, I submit that 90% of the time
* the programmer will want it to retain its old configuration
* information. If the programmer doesn't want this behavior, then the
@@ -3177,7 +3177,7 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", NULL);
return TCL_ERROR;
}
- if (SetSlaveColumn(interp, slavePtr, tmp, -1) != TCL_OK) {
+ if (SetContentColumn(interp, contentPtr, tmp, -1) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -3190,7 +3190,7 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", NULL);
return TCL_ERROR;
}
- if (SetSlaveColumn(interp, slavePtr, -1, tmp) != TCL_OK) {
+ if (SetContentColumn(interp, contentPtr, -1, tmp) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -3199,7 +3199,7 @@ ConfigureContent(
&other) != TCL_OK) {
return TCL_ERROR;
}
- if (other == slave) {
+ if (other == content) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"window can't be managed in itself", -1));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL);
@@ -3207,7 +3207,7 @@ ConfigureContent(
}
positionGiven = 1;
containerPtr = GetGrid(other);
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
break;
case CONF_STICKY: {
int sticky = StringToSticky(Tcl_GetString(objv[i+1]));
@@ -3220,11 +3220,11 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", NULL);
return TCL_ERROR;
}
- slavePtr->sticky = sticky;
+ contentPtr->sticky = sticky;
break;
}
case CONF_IPADX:
- if ((Tk_GetPixelsFromObj(NULL, slave, objv[i+1],
+ if ((Tk_GetPixelsFromObj(NULL, content, objv[i+1],
&tmp) != TCL_OK) || (tmp < 0)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipadx value \"%s\": must be positive screen distance",
@@ -3232,10 +3232,10 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
return TCL_ERROR;
}
- slavePtr->iPadX = tmp * 2;
+ contentPtr->iPadX = tmp * 2;
break;
case CONF_IPADY:
- if ((Tk_GetPixelsFromObj(NULL, slave, objv[i+1],
+ if ((Tk_GetPixelsFromObj(NULL, content, objv[i+1],
&tmp) != TCL_OK) || (tmp < 0)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipady value \"%s\": must be positive screen distance",
@@ -3243,17 +3243,17 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
return TCL_ERROR;
}
- slavePtr->iPadY = tmp * 2;
+ contentPtr->iPadY = tmp * 2;
break;
case CONF_PADX:
if (TkParsePadAmount(interp, tkwin, objv[i+1],
- &slavePtr->padLeft, &slavePtr->padX) != TCL_OK) {
+ &contentPtr->padLeft, &contentPtr->padX) != TCL_OK) {
return TCL_ERROR;
}
break;
case CONF_PADY:
if (TkParsePadAmount(interp, tkwin, objv[i+1],
- &slavePtr->padTop, &slavePtr->padY) != TCL_OK) {
+ &contentPtr->padTop, &contentPtr->padY) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -3266,7 +3266,7 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", NULL);
return TCL_ERROR;
}
- if (SetSlaveRow(interp, slavePtr, tmp, -1) != TCL_OK) {
+ if (SetContentRow(interp, contentPtr, tmp, -1) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -3279,7 +3279,7 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", NULL);
return TCL_ERROR;
}
- if (SetSlaveRow(interp, slavePtr, -1, tmp) != TCL_OK) {
+ if (SetContentRow(interp, contentPtr, -1, tmp) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -3287,12 +3287,12 @@ ConfigureContent(
}
/*
- * If no position was specified via -in and the slave is already
+ * If no position was specified via -in and the content is already
* packed, then leave it in its current location.
*/
- if (!positionGiven && (slavePtr->containerPtr != NULL)) {
- containerPtr = slavePtr->containerPtr;
+ if (!positionGiven && (contentPtr->containerPtr != NULL)) {
+ containerPtr = contentPtr->containerPtr;
goto scheduleLayout;
}
@@ -3301,41 +3301,41 @@ ConfigureContent(
* its current location.
*/
- if (positionGiven && (containerPtr == slavePtr->containerPtr)) {
+ if (positionGiven && (containerPtr == contentPtr->containerPtr)) {
goto scheduleLayout;
}
/*
* Make sure we have a geometry container. We look at:
* 1) the -in flag
- * 2) the parent of the first slave.
+ * 2) the parent of the first content.
*/
- parent = Tk_Parent(slave);
+ parent = Tk_Parent(content);
if (containerPtr == NULL) {
containerPtr = GetGrid(parent);
- InitMasterData(containerPtr);
+ InitContainerData(containerPtr);
}
- if (slavePtr->containerPtr != NULL && slavePtr->containerPtr != containerPtr) {
- if (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->containerPtr->tkwin);
+ if (contentPtr->containerPtr != NULL && contentPtr->containerPtr != containerPtr) {
+ if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin);
}
- Unlink(slavePtr);
- slavePtr->containerPtr = NULL;
+ Unlink(contentPtr);
+ contentPtr->containerPtr = NULL;
}
- if (slavePtr->containerPtr == NULL) {
- Gridder *tempPtr = containerPtr->slavePtr;
+ if (contentPtr->containerPtr == NULL) {
+ Gridder *tempPtr = containerPtr->contentPtr;
- slavePtr->containerPtr = containerPtr;
- containerPtr->slavePtr = slavePtr;
- slavePtr->nextPtr = tempPtr;
+ contentPtr->containerPtr = containerPtr;
+ containerPtr->contentPtr = contentPtr;
+ contentPtr->nextPtr = tempPtr;
}
/*
- * Make sure that the slave's parent is either the container or an
- * ancestor of the container, and that the container and slave aren't the
+ * Make sure that the content's parent is either the container or an
+ * ancestor of the container, and that the container and content aren't the
* same.
*/
@@ -3348,7 +3348,7 @@ ConfigureContent(
"can't put %s inside %s", Tcl_GetString(objv[j]),
Tk_PathName(containerPtr->tkwin)));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL);
- Unlink(slavePtr);
+ Unlink(contentPtr);
return TCL_ERROR;
}
}
@@ -3359,26 +3359,26 @@ ConfigureContent(
for (container = (TkWindow *)containerPtr->tkwin; container != NULL;
container = (TkWindow *)TkGetGeomMaster(container)) {
- if (container == (TkWindow *)slave) {
+ if (container == (TkWindow *)content) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't put %s inside %s, would cause management loop",
Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin)));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL);
- Unlink(slavePtr);
+ Unlink(contentPtr);
return TCL_ERROR;
}
}
- if (containerPtr->tkwin != Tk_Parent(slave)) {
- ((TkWindow *)slave)->maintainerPtr = (TkWindow *)containerPtr->tkwin;
+ if (containerPtr->tkwin != Tk_Parent(content)) {
+ ((TkWindow *)content)->maintainerPtr = (TkWindow *)containerPtr->tkwin;
}
- Tk_ManageGeometry(slave, &gridMgrType, slavePtr);
+ Tk_ManageGeometry(content, &gridMgrType, contentPtr);
if (!(containerPtr->flags & DONT_PROPAGATE)) {
if (TkSetGeometryContainer(interp, containerPtr->tkwin, "grid")
!= TCL_OK) {
- Tk_ManageGeometry(slave, NULL, NULL);
- Unlink(slavePtr);
+ Tk_ManageGeometry(content, NULL, NULL);
+ Unlink(contentPtr);
return TCL_ERROR;
}
containerPtr->flags |= ALLOCED_CONTAINER;
@@ -3388,21 +3388,21 @@ ConfigureContent(
* Assign default position information.
*/
- if (slavePtr->column == -1) {
- if (SetSlaveColumn(interp, slavePtr, defaultColumn,-1) != TCL_OK){
+ if (contentPtr->column == -1) {
+ if (SetContentColumn(interp, contentPtr, defaultColumn,-1) != TCL_OK){
return TCL_ERROR;
}
}
- if (SetSlaveColumn(interp, slavePtr, -1,
- slavePtr->numCols + defaultColumnSpan - 1) != TCL_OK) {
+ if (SetContentColumn(interp, contentPtr, -1,
+ contentPtr->numCols + defaultColumnSpan - 1) != TCL_OK) {
return TCL_ERROR;
}
- if (slavePtr->row == -1) {
- if (SetSlaveRow(interp, slavePtr, defaultRow, -1) != TCL_OK) {
+ if (contentPtr->row == -1) {
+ if (SetContentRow(interp, contentPtr, defaultRow, -1) != TCL_OK) {
return TCL_ERROR;
}
}
- defaultColumn += slavePtr->numCols;
+ defaultColumn += contentPtr->numCols;
defaultColumnSpan = 1;
/*
@@ -3480,19 +3480,19 @@ ConfigureContent(
lastColumn += numSkip;
match = 0;
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
-
- if (slavePtr->column == lastColumn
- && slavePtr->row + slavePtr->numRows - 1 == lastRow) {
- if (slavePtr->numCols <= width) {
- if (SetSlaveRow(interp, slavePtr, -1,
- slavePtr->numRows + 1) != TCL_OK) {
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+
+ if (contentPtr->column == lastColumn
+ && contentPtr->row + contentPtr->numRows - 1 == lastRow) {
+ if (contentPtr->numCols <= width) {
+ if (SetContentRow(interp, contentPtr, -1,
+ contentPtr->numRows + 1) != TCL_OK) {
return TCL_ERROR;
}
match++;
- j += slavePtr->numCols - 1;
- lastWindow = Tk_PathName(slavePtr->tkwin);
+ j += contentPtr->numCols - 1;
+ lastWindow = Tk_PathName(contentPtr->tkwin);
numSkip = 0;
break;
}
@@ -3515,11 +3515,11 @@ ConfigureContent(
SetGridSize(containerPtr);
/*
- * If we have emptied this container from slaves it means we are no longer
+ * If we have emptied this container from content it means we are no longer
* handling it and should mark it as free.
*/
- if (containerPtr->slavePtr == NULL && containerPtr->flags & ALLOCED_CONTAINER) {
+ if (containerPtr->contentPtr == NULL && containerPtr->flags & ALLOCED_CONTAINER) {
TkFreeGeometryContainer(containerPtr->tkwin, "grid");
containerPtr->flags &= ~ALLOCED_CONTAINER;
}
diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h
index 90705e9..9cd4195 100644
--- a/generic/tkImgPhoto.h
+++ b/generic/tkImgPhoto.h
@@ -27,11 +27,11 @@
* Forward declarations of the structures we define.
*/
-#define PhotoMaster PhotoModel
+#define PhotoModel PhotoMaster
typedef struct ColorTableId ColorTableId;
typedef struct ColorTable ColorTable;
typedef struct PhotoInstance PhotoInstance;
-typedef struct PhotoModel PhotoModel;
+typedef struct PhotoMaster PhotoMaster;
/*
* A signed 8-bit integral type. If chars are unsigned and the compiler isn't
@@ -141,8 +141,8 @@ struct ColorTable {
* Definition of the data associated with each photo image master.
*/
-struct PhotoModel {
- Tk_ImageModel tkMaster; /* Tk's token for image model. NULL means the
+struct PhotoMaster {
+ Tk_ImageMaster 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. */
@@ -169,7 +169,7 @@ struct PhotoModel {
};
/*
- * Bit definitions for the flags field of a PhotoModel.
+ * Bit definitions for the flags field of a PhotoMaster.
* COLOR_IMAGE: 1 means that the image has different color
* components.
* IMAGE_CHANGED: 1 means that the instances of this image need
@@ -196,7 +196,7 @@ struct PhotoModel {
*/
struct PhotoInstance {
- PhotoModel *masterPtr; /* Pointer to master for image. */
+ PhotoMaster *masterPtr; /* Pointer to master 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/tkOldConfig.c b/generic/tkOldConfig.c
index f20f38f..d05a2c7 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -1104,7 +1104,7 @@ GetCachedSpecs(
/*
* Now allocate our working copy's space and copy over the contents
- * from the master copy.
+ * from the origin.
*/
cachedSpecs = ckalloc(entrySpace);
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 0272e5b..28ae74b 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -20,7 +20,7 @@ static const char *const sideNames[] = {
/*
* For each window that the packer cares about (either because the window is
- * managed by the packer or because the window has slaves that are managed by
+ * managed by the packer or because the window has content managed by
* the packer), there is a structure of the following type:
*/
@@ -29,15 +29,15 @@ typedef struct Packer {
* window has been deleted, but the packet
* hasn't had a chance to clean up yet because
* the structure is still in use. */
- struct Packer *containerPtr; /* Master window within which this window is
+ struct Packer *containerPtr; /* Container window within which this window is
* packed (NULL means this window isn't
* managed by the packer). */
- struct Packer *nextPtr; /* Next window packed within same master. List
+ struct Packer *nextPtr; /* Next window packed within same container. List
* is priority-ordered: first on list gets
* packed first. */
- struct Packer *slavePtr; /* First in list of slaves packed inside this
- * window (NULL means no packed slaves). */
- Side side; /* Side of master against which this window is
+ struct Packer *contentPtr; /* First in list of content packed inside this
+ * window (NULL means no packed content). */
+ Side side; /* Side of container against which this window is
* packed. */
Tk_Anchor anchor; /* If frame allocated for window is larger
* than window needs, this indicates how where
@@ -55,13 +55,13 @@ typedef struct Packer {
* each side). */
int doubleBw; /* Twice the window's last known border width.
* If this changes, the window must be
- * repacked within its master. */
+ * repacked within its container. */
int *abortPtr; /* If non-NULL, it means that there is a
* nested call to ArrangePacking already
* working on this window. *abortPtr may be
* set to 1 to abort that nested call. This
* happens, for example, if tkwin or any of
- * its slaves is deleted. */
+ * its content is deleted. */
int flags; /* Miscellaneous flags; see below for
* definitions. */
} Packer;
@@ -70,7 +70,7 @@ typedef struct Packer {
* Flag values for Packer structures:
*
* REQUESTED_REPACK: 1 means a Tcl_DoWhenIdle request has already
- * been made to repack all the slaves of this
+ * been made to repack all the content of this
* window.
* FILLX: 1 means if frame allocated for window is wider
* than window needs, expand window to fill
@@ -78,15 +78,15 @@ typedef struct Packer {
* than needed.
* FILLY: Same as FILLX, except for height.
* EXPAND: 1 means this window's frame will absorb any
- * extra space in the master window.
+ * extra space in the container window.
* OLD_STYLE: 1 means this window is being managed with the
* old-style packer algorithms (before Tk version
* 3.3). The main difference is that padding and
* filling are done differently.
* DONT_PROPAGATE: 1 means don't set this window's requested
- * size. 0 means if this window is a master then
+ * size. 0 means if this window is a container then
* Tk will set its requested size to fit the
- * needs of its slaves.
+ * needs of its content.
* ALLOCED_CONTAINER 1 means that Pack has allocated itself as
* geometry container for this window.
*/
@@ -110,7 +110,7 @@ static void PackLostContentProc(ClientData clientData,
static const Tk_GeomMgr packerType = {
"pack", /* name */
PackReqProc, /* requestProc */
- PackLostContentProc, /* lostSlaveProc */
+ PackLostContentProc, /* lostContentProc */
};
/*
@@ -127,8 +127,8 @@ static int PackAfter(Tcl_Interp *interp, Packer *prevPtr,
static void PackStructureProc(ClientData clientData,
XEvent *eventPtr);
static void Unlink(Packer *packPtr);
-static int XExpansion(Packer *slavePtr, int cavityWidth);
-static int YExpansion(Packer *slavePtr, int cavityHeight);
+static int XExpansion(Packer *contentPtr, int cavityWidth);
+static int YExpansion(Packer *contentPtr, int cavityHeight);
/*
*------------------------------------------------------------------------
@@ -194,7 +194,7 @@ Tk_PackObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
const char *argv2;
static const char *const optionStrings[] = {
/* after, append, before and unpack are deprecated */
@@ -258,7 +258,7 @@ Tk_PackObjCmd(
return TCL_ERROR;
}
containerPtr = GetPacker(tkwin2);
- prevPtr = containerPtr->slavePtr;
+ prevPtr = containerPtr->contentPtr;
if (prevPtr != NULL) {
while (prevPtr->nextPtr != NULL) {
prevPtr = prevPtr->nextPtr;
@@ -282,7 +282,7 @@ Tk_PackObjCmd(
return TCL_ERROR;
}
containerPtr = packPtr->containerPtr;
- prevPtr = containerPtr->slavePtr;
+ prevPtr = containerPtr->contentPtr;
if (prevPtr == packPtr) {
prevPtr = NULL;
} else {
@@ -306,41 +306,41 @@ Tk_PackObjCmd(
}
return ConfigureContent(interp, tkwin, objc-2, objv+2);
case PACK_FORGET: {
- Tk_Window slave;
- Packer *slavePtr;
+ Tk_Window content;
+ Packer *contentPtr;
int i;
for (i = 2; i < objc; i++) {
- if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i], &content) != TCL_OK) {
continue;
}
- slavePtr = GetPacker(slave);
- if ((slavePtr != NULL) && (slavePtr->containerPtr != NULL)) {
- Tk_ManageGeometry(slave, NULL, NULL);
- if (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin,
- slavePtr->containerPtr->tkwin);
+ contentPtr = GetPacker(content);
+ if ((contentPtr != NULL) && (contentPtr->containerPtr != NULL)) {
+ Tk_ManageGeometry(content, NULL, NULL);
+ if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin,
+ contentPtr->containerPtr->tkwin);
}
- Unlink(slavePtr);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Unlink(contentPtr);
+ Tk_UnmapWindow(contentPtr->tkwin);
}
}
break;
}
case PACK_INFO: {
- Packer *slavePtr;
- Tk_Window slave;
+ Packer *contentPtr;
+ Tk_Window content;
Tcl_Obj *infoObj;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &content) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr = GetPacker(slave);
- if (slavePtr->containerPtr == NULL) {
+ contentPtr = GetPacker(content);
+ if (contentPtr->containerPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"window \"%s\" isn't packed", argv2));
Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL);
@@ -349,12 +349,12 @@ Tk_PackObjCmd(
infoObj = Tcl_NewObj();
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-in", -1),
- TkNewWindowObj(slavePtr->containerPtr->tkwin));
+ TkNewWindowObj(contentPtr->containerPtr->tkwin));
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-anchor", -1),
- Tcl_NewStringObj(Tk_NameOfAnchor(slavePtr->anchor), -1));
+ Tcl_NewStringObj(Tk_NameOfAnchor(contentPtr->anchor), -1));
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-expand", -1),
- Tcl_NewBooleanObj(slavePtr->flags & EXPAND));
- switch (slavePtr->flags & (FILLX|FILLY)) {
+ Tcl_NewBooleanObj(contentPtr->flags & EXPAND));
+ switch (contentPtr->flags & (FILLX|FILLY)) {
case 0:
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-fill", -1),
Tcl_NewStringObj("none", -1));
@@ -372,17 +372,17 @@ Tk_PackObjCmd(
Tcl_NewStringObj("both", -1));
break;
}
- TkAppendPadAmount(infoObj, "-ipadx", slavePtr->iPadX/2, slavePtr->iPadX);
- TkAppendPadAmount(infoObj, "-ipady", slavePtr->iPadY/2, slavePtr->iPadY);
- TkAppendPadAmount(infoObj, "-padx", slavePtr->padLeft,slavePtr->padX);
- TkAppendPadAmount(infoObj, "-pady", slavePtr->padTop, slavePtr->padY);
+ TkAppendPadAmount(infoObj, "-ipadx", contentPtr->iPadX/2, contentPtr->iPadX);
+ TkAppendPadAmount(infoObj, "-ipady", contentPtr->iPadY/2, contentPtr->iPadY);
+ TkAppendPadAmount(infoObj, "-padx", contentPtr->padLeft,contentPtr->padX);
+ TkAppendPadAmount(infoObj, "-pady", contentPtr->padTop, contentPtr->padY);
Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-side", -1),
- Tcl_NewStringObj(sideNames[slavePtr->side], -1));
+ Tcl_NewStringObj(sideNames[contentPtr->side], -1));
Tcl_SetObjResult(interp, infoObj);
break;
}
case PACK_PROPAGATE: {
- Tk_Window master;
+ Tk_Window container;
Packer *containerPtr;
int propagate;
@@ -390,10 +390,10 @@ Tk_PackObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
return TCL_ERROR;
}
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) {
return TCL_ERROR;
}
- containerPtr = GetPacker(master);
+ containerPtr = GetPacker(container);
if (objc == 3) {
Tcl_SetObjResult(interp,
Tcl_NewBooleanObj(!(containerPtr->flags & DONT_PROPAGATE)));
@@ -407,8 +407,8 @@ Tk_PackObjCmd(
* If we have content windows, we need to register as geometry container.
*/
- if (containerPtr->slavePtr != NULL) {
- if (TkSetGeometryContainer(interp, master, "pack") != TCL_OK) {
+ if (containerPtr->contentPtr != NULL) {
+ if (TkSetGeometryContainer(interp, container, "pack") != TCL_OK) {
return TCL_ERROR;
}
containerPtr->flags |= ALLOCED_CONTAINER;
@@ -416,8 +416,8 @@ Tk_PackObjCmd(
containerPtr->flags &= ~DONT_PROPAGATE;
/*
- * Repack the master to allow new geometry information to
- * propagate upwards to the master's master.
+ * Repack the container to allow new geometry information to
+ * propagate upwards to the container's container.
*/
if (containerPtr->abortPtr != NULL) {
@@ -429,7 +429,7 @@ Tk_PackObjCmd(
}
} else {
if (containerPtr->flags & ALLOCED_CONTAINER) {
- TkFreeGeometryContainer(master, "pack");
+ TkFreeGeometryContainer(container, "pack");
containerPtr->flags &= ~ALLOCED_CONTAINER;
}
containerPtr->flags |= DONT_PROPAGATE;
@@ -438,23 +438,23 @@ Tk_PackObjCmd(
}
case PACK_CONTENT:
case PACK_SLAVES: {
- Tk_Window master;
- Packer *containerPtr, *slavePtr;
+ Tk_Window container;
+ Packer *containerPtr, *contentPtr;
Tcl_Obj *resultObj;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) {
return TCL_ERROR;
}
resultObj = Tcl_NewObj();
- containerPtr = GetPacker(master);
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
+ containerPtr = GetPacker(container);
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
Tcl_ListObjAppendElement(NULL, resultObj,
- TkNewWindowObj(slavePtr->tkwin));
+ TkNewWindowObj(contentPtr->tkwin));
}
Tcl_SetObjResult(interp, resultObj);
break;
@@ -505,15 +505,14 @@ Tk_PackObjCmd(
*------------------------------------------------------------------------
*/
- /* ARGSUSED */
static void
PackReqProc(
ClientData clientData, /* Packer's information about window that got
* new preferred geometry. */
- Tk_Window tkwin) /* Other Tk-related information about the
+ TCL_UNUSED(Tk_Window)) /* Other Tk-related information about the
* window. */
{
- Packer *packPtr = clientData;
+ Packer *packPtr = (Packer *)clientData;
packPtr = packPtr->containerPtr;
if (!(packPtr->flags & REQUESTED_REPACK)) {
@@ -534,25 +533,24 @@ PackReqProc(
* None.
*
* Side effects:
- * Forgets all packer-related information about the slave.
+ * Forgets all packer-related information about the content.
*
*------------------------------------------------------------------------
*/
- /* ARGSUSED */
static void
PackLostContentProc(
- ClientData clientData, /* Packer structure for slave window that was
+ void *clientData, /* Packer structure for content window that was
* stolen away. */
- Tk_Window tkwin) /* Tk's handle for the slave window. */
+ TCL_UNUSED(Tk_Window)) /* Tk's handle for the content window. */
{
- Packer *slavePtr = clientData;
+ Packer *contentPtr = (Packer *)clientData;
- if (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->containerPtr->tkwin);
+ if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin);
}
- Unlink(slavePtr);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Unlink(contentPtr);
+ Tk_UnmapWindow(contentPtr->tkwin);
}
/*
@@ -569,22 +567,22 @@ PackLostContentProc(
* None.
*
* Side effects:
- * The packed slaves of containerPtr may get resized or moved.
+ * The packed content of containerPtr may get resized or moved.
*
*------------------------------------------------------------------------
*/
static void
ArrangePacking(
- ClientData clientData) /* Structure describing master whose slaves
+ ClientData clientData) /* Structure describing container whose content
* are to be re-layed out. */
{
- Packer *containerPtr = clientData;
- Packer *slavePtr;
+ Packer *containerPtr = (Packer *)clientData;
+ Packer *contentPtr;
int cavityX, cavityY, cavityWidth, cavityHeight;
/* These variables keep track of the
* as-yet-unallocated space remaining in the
- * middle of the master window. */
+ * middle of the container window. */
int frameX, frameY, frameWidth, frameHeight;
/* These variables keep track of the frame
* allocated to the current window. */
@@ -600,11 +598,12 @@ ArrangePacking(
containerPtr->flags &= ~REQUESTED_REPACK;
/*
- * If the master has no slaves anymore, then don't do anything at all:
- * just leave the master's size as-is.
+ * If the container has no content anymore, then leave the container size as-is.
+ * Otherwise there is no way to "relinquish" control over the container
+ * so another geometry manager can take over.
*/
- if (containerPtr->slavePtr == NULL) {
+ if (containerPtr->contentPtr == NULL) {
return;
}
@@ -622,18 +621,18 @@ ArrangePacking(
Tcl_Preserve(containerPtr);
/*
- * Pass #1: scan all the slaves to figure out the total amount of space
+ * Pass #1: scan all the content to figure out the total amount of space
* needed. Two separate width and height values are computed:
*
* width - Holds the sum of the widths (plus padding) of all the
- * slaves seen so far that were packed LEFT or RIGHT.
+ * content seen so far that were packed LEFT or RIGHT.
* height - Holds the sum of the heights (plus padding) of all the
- * slaves seen so far that were packed TOP or BOTTOM.
+ * content seen so far that were packed TOP or BOTTOM.
*
- * maxWidth - Gradually builds up the width needed by the master to
- * just barely satisfy all the slave's needs. For each
- * slave, the code computes the width needed for all the
- * slaves so far and updates maxWidth if the new value is
+ * maxWidth - Gradually builds up the width needed by the container to
+ * just barely satisfy all the content's needs. For each
+ * content, the code computes the width needed for all the
+ * content so far and updates maxWidth if the new value is
* greater.
* maxHeight - Same as maxWidth, except keeps height info.
*/
@@ -642,24 +641,24 @@ ArrangePacking(
Tk_InternalBorderRight(containerPtr->tkwin);
height = maxHeight = Tk_InternalBorderTop(containerPtr->tkwin) +
Tk_InternalBorderBottom(containerPtr->tkwin);
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) {
- tmp = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padX + slavePtr->iPadX + width;
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ if ((contentPtr->side == TOP) || (contentPtr->side == BOTTOM)) {
+ tmp = Tk_ReqWidth(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padX + contentPtr->iPadX + width;
if (tmp > maxWidth) {
maxWidth = tmp;
}
- height += Tk_ReqHeight(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padY + slavePtr->iPadY;
+ height += Tk_ReqHeight(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padY + contentPtr->iPadY;
} else {
- tmp = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padY + slavePtr->iPadY + height;
+ tmp = Tk_ReqHeight(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padY + contentPtr->iPadY + height;
if (tmp > maxHeight) {
maxHeight = tmp;
}
- width += Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padX + slavePtr->iPadX;
+ width += Tk_ReqWidth(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padX + contentPtr->iPadX;
}
}
if (width > maxWidth) {
@@ -677,10 +676,10 @@ ArrangePacking(
}
/*
- * If the total amount of space needed in the master window has changed,
+ * If the total amount of space needed in the container window has changed,
* and if we're propagating geometry information, then notify the next
* geometry manager up and requeue ourselves to start again after the
- * master has had a chance to resize us.
+ * container has had a chance to resize us.
*/
if (((maxWidth != Tk_ReqWidth(containerPtr->tkwin))
@@ -693,7 +692,7 @@ ArrangePacking(
}
/*
- * Pass #2: scan the slaves a second time assigning new sizes. The
+ * Pass #2: scan the content a second time assigning new sizes. The
* "cavity" variables keep track of the unclaimed space in the cavity of
* the window; this shrinks inward as we allocate windows around the
* edges. The "frame" variables keep track of the space allocated to the
@@ -709,14 +708,14 @@ ArrangePacking(
cavityHeight = Tk_Height(containerPtr->tkwin) -
Tk_InternalBorderTop(containerPtr->tkwin) -
Tk_InternalBorderBottom(containerPtr->tkwin);
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) {
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ if ((contentPtr->side == TOP) || (contentPtr->side == BOTTOM)) {
frameWidth = cavityWidth;
- frameHeight = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padY + slavePtr->iPadY;
- if (slavePtr->flags & EXPAND) {
- frameHeight += YExpansion(slavePtr, cavityHeight);
+ frameHeight = Tk_ReqHeight(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padY + contentPtr->iPadY;
+ if (contentPtr->flags & EXPAND) {
+ frameHeight += YExpansion(contentPtr, cavityHeight);
}
cavityHeight -= frameHeight;
if (cavityHeight < 0) {
@@ -724,7 +723,7 @@ ArrangePacking(
cavityHeight = 0;
}
frameX = cavityX;
- if (slavePtr->side == TOP) {
+ if (contentPtr->side == TOP) {
frameY = cavityY;
cavityY += frameHeight;
} else {
@@ -732,10 +731,10 @@ ArrangePacking(
}
} else {
frameHeight = cavityHeight;
- frameWidth = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padX + slavePtr->iPadX;
- if (slavePtr->flags & EXPAND) {
- frameWidth += XExpansion(slavePtr, cavityWidth);
+ frameWidth = Tk_ReqWidth(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padX + contentPtr->iPadX;
+ if (contentPtr->flags & EXPAND) {
+ frameWidth += XExpansion(contentPtr, cavityWidth);
}
cavityWidth -= frameWidth;
if (cavityWidth < 0) {
@@ -743,7 +742,7 @@ ArrangePacking(
cavityWidth = 0;
}
frameY = cavityY;
- if (slavePtr->side == LEFT) {
+ if (contentPtr->side == LEFT) {
frameX = cavityX;
cavityX += frameWidth;
} else {
@@ -760,31 +759,31 @@ ArrangePacking(
* completely ignored except when computing frame size).
*/
- if (slavePtr->flags & OLD_STYLE) {
+ if (contentPtr->flags & OLD_STYLE) {
borderX = borderY = 0;
borderTop = borderBtm = 0;
borderLeft = borderRight = 0;
} else {
- borderX = slavePtr->padX;
- borderY = slavePtr->padY;
- borderLeft = slavePtr->padLeft;
+ borderX = contentPtr->padX;
+ borderY = contentPtr->padY;
+ borderLeft = contentPtr->padLeft;
borderRight = borderX - borderLeft;
- borderTop = slavePtr->padTop;
+ borderTop = contentPtr->padTop;
borderBtm = borderY - borderTop;
}
- width = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->iPadX;
- if ((slavePtr->flags & FILLX)
+ width = Tk_ReqWidth(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->iPadX;
+ if ((contentPtr->flags & FILLX)
|| (width > (frameWidth - borderX))) {
width = frameWidth - borderX;
}
- height = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->iPadY;
- if ((slavePtr->flags & FILLY)
+ height = Tk_ReqHeight(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->iPadY;
+ if ((contentPtr->flags & FILLY)
|| (height > (frameHeight - borderY))) {
height = frameHeight - borderY;
}
- switch (slavePtr->anchor) {
+ switch (contentPtr->anchor) {
case TK_ANCHOR_N:
x = frameX + (borderLeft + frameWidth - width - borderRight)/2;
y = frameY + borderTop;
@@ -824,44 +823,44 @@ ArrangePacking(
default:
Tcl_Panic("bad frame factor in ArrangePacking");
}
- width -= slavePtr->doubleBw;
- height -= slavePtr->doubleBw;
+ width -= contentPtr->doubleBw;
+ height -= contentPtr->doubleBw;
/*
* The final step is to set the position, size, and mapped/unmapped
- * state of the slave. If the slave is a child of the master, then do
+ * state of the content. If the content is a child of the container, then do
* this here. Otherwise let Tk_MaintainGeometry do the work.
*/
- if (containerPtr->tkwin == Tk_Parent(slavePtr->tkwin)) {
+ if (containerPtr->tkwin == Tk_Parent(contentPtr->tkwin)) {
if ((width <= 0) || (height <= 0)) {
- Tk_UnmapWindow(slavePtr->tkwin);
+ Tk_UnmapWindow(contentPtr->tkwin);
} else {
- if ((x != Tk_X(slavePtr->tkwin))
- || (y != Tk_Y(slavePtr->tkwin))
- || (width != Tk_Width(slavePtr->tkwin))
- || (height != Tk_Height(slavePtr->tkwin))) {
- Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
+ if ((x != Tk_X(contentPtr->tkwin))
+ || (y != Tk_Y(contentPtr->tkwin))
+ || (width != Tk_Width(contentPtr->tkwin))
+ || (height != Tk_Height(contentPtr->tkwin))) {
+ Tk_MoveResizeWindow(contentPtr->tkwin, x, y, width, height);
}
if (abort) {
goto done;
}
/*
- * Don't map the slave if the master isn't mapped: wait until
- * the master gets mapped later.
+ * Don't map the content if the container isn't mapped: wait until
+ * the container gets mapped later.
*/
if (Tk_IsMapped(containerPtr->tkwin)) {
- Tk_MapWindow(slavePtr->tkwin);
+ Tk_MapWindow(contentPtr->tkwin);
}
}
} else {
if ((width <= 0) || (height <= 0)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, containerPtr->tkwin);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Tk_UnmaintainGeometry(contentPtr->tkwin, containerPtr->tkwin);
+ Tk_UnmapWindow(contentPtr->tkwin);
} else {
- Tk_MaintainGeometry(slavePtr->tkwin, containerPtr->tkwin,
+ Tk_MaintainGeometry(contentPtr->tkwin, containerPtr->tkwin,
x, y, width, height);
}
}
@@ -887,7 +886,7 @@ ArrangePacking(
*
* XExpansion --
*
- * Given a list of packed slaves, the first of which is packed on the
+ * Given a list of packed content, the first of which is packed on the
* left or right and is expandable, compute how much to expand the child.
*
* Results:
@@ -902,9 +901,9 @@ ArrangePacking(
static int
XExpansion(
- Packer *slavePtr, /* First in list of remaining slaves. */
+ Packer *contentPtr, /* First in list of remaining content. */
int cavityWidth) /* Horizontal space left for all remaining
- * slaves. */
+ * content. */
{
int numExpand, minExpand, curExpand;
int childWidth;
@@ -922,10 +921,10 @@ XExpansion(
minExpand = cavityWidth;
numExpand = 0;
- for ( ; slavePtr != NULL; slavePtr = slavePtr->nextPtr) {
- childWidth = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padX + slavePtr->iPadX;
- if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) {
+ for ( ; contentPtr != NULL; contentPtr = contentPtr->nextPtr) {
+ childWidth = Tk_ReqWidth(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padX + contentPtr->iPadX;
+ if ((contentPtr->side == TOP) || (contentPtr->side == BOTTOM)) {
if (numExpand) {
curExpand = (cavityWidth - childWidth)/numExpand;
if (curExpand < minExpand) {
@@ -934,7 +933,7 @@ XExpansion(
}
} else {
cavityWidth -= childWidth;
- if (slavePtr->flags & EXPAND) {
+ if (contentPtr->flags & EXPAND) {
numExpand++;
}
}
@@ -953,7 +952,7 @@ XExpansion(
*
* YExpansion --
*
- * Given a list of packed slaves, the first of which is packed on the top
+ * Given a list of packed content, the first of which is packed on the top
* or bottom and is expandable, compute how much to expand the child.
*
* Results:
@@ -968,9 +967,9 @@ XExpansion(
static int
YExpansion(
- Packer *slavePtr, /* First in list of remaining slaves. */
+ Packer *contentPtr, /* First in list of remaining content. */
int cavityHeight) /* Vertical space left for all remaining
- * slaves. */
+ * content. */
{
int numExpand, minExpand, curExpand;
int childHeight;
@@ -981,10 +980,10 @@ YExpansion(
minExpand = cavityHeight;
numExpand = 0;
- for ( ; slavePtr != NULL; slavePtr = slavePtr->nextPtr) {
- childHeight = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->doubleBw
- + slavePtr->padY + slavePtr->iPadY;
- if ((slavePtr->side == LEFT) || (slavePtr->side == RIGHT)) {
+ for ( ; contentPtr != NULL; contentPtr = contentPtr->nextPtr) {
+ childHeight = Tk_ReqHeight(contentPtr->tkwin) + contentPtr->doubleBw
+ + contentPtr->padY + contentPtr->iPadY;
+ if ((contentPtr->side == LEFT) || (contentPtr->side == RIGHT)) {
if (numExpand) {
curExpand = (cavityHeight - childHeight)/numExpand;
if (curExpand < minExpand) {
@@ -993,7 +992,7 @@ YExpansion(
}
} else {
cavityHeight -= childHeight;
- if (slavePtr->flags & EXPAND) {
+ if (contentPtr->flags & EXPAND) {
numExpand++;
}
}
@@ -1049,13 +1048,13 @@ GetPacker(
hPtr = Tcl_CreateHashEntry(&dispPtr->packerHashTable, (char *) tkwin,
&isNew);
if (!isNew) {
- return Tcl_GetHashValue(hPtr);
+ return (Packer *)Tcl_GetHashValue(hPtr);
}
- packPtr = ckalloc(sizeof(Packer));
+ packPtr = (Packer *)ckalloc(sizeof(Packer));
packPtr->tkwin = tkwin;
packPtr->containerPtr = NULL;
packPtr->nextPtr = NULL;
- packPtr->slavePtr = NULL;
+ packPtr->contentPtr = NULL;
packPtr->side = TOP;
packPtr->anchor = TK_ANCHOR_CENTER;
packPtr->padX = packPtr->padY = 0;
@@ -1076,7 +1075,7 @@ GetPacker(
* PackAfter --
*
* This function does most of the real work of adding one or more windows
- * into the packing order for its master.
+ * into the packing order for its container.
*
* Results:
* A standard Tcl return value.
@@ -1094,7 +1093,7 @@ PackAfter(
Packer *prevPtr, /* Pack windows in argv just after this
* window; NULL means pack as first child of
* containerPtr. */
- Packer *containerPtr, /* Master in which to pack windows. */
+ Packer *containerPtr, /* Container in which to pack windows. */
int objc, /* Number of elements in objv. */
Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements:
* window name and side against which to
@@ -1170,8 +1169,8 @@ PackAfter(
packPtr->flags |= OLD_STYLE;
for (index = 0 ; index < optionCount; index++) {
Tcl_Obj *curOptPtr = options[index];
- const char *curOpt = Tcl_GetString(curOptPtr);
- size_t length = curOptPtr->length;
+ int length;
+ const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length);
c = curOpt[0];
@@ -1228,7 +1227,7 @@ PackAfter(
packPtr->iPadY = 0;
index++;
} else if ((c == 'f') && (length > 1)
- && (strncmp(curOpt, "frame", (size_t) length) == 0)) {
+ && (strncmp(curOpt, "frame", length) == 0)) {
if (optionCount < (index+2)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"wrong # args: \"frame\""
@@ -1269,14 +1268,14 @@ PackAfter(
}
/*
- * Add the window in the correct place in its master's packing
+ * Add the window in the correct place in its container's packing
* order, then make sure that the window is managed by us.
*/
packPtr->containerPtr = containerPtr;
if (prevPtr == NULL) {
- packPtr->nextPtr = containerPtr->slavePtr;
- containerPtr->slavePtr = packPtr;
+ packPtr->nextPtr = containerPtr->contentPtr;
+ containerPtr->contentPtr = packPtr;
} else {
packPtr->nextPtr = prevPtr->nextPtr;
prevPtr->nextPtr = packPtr;
@@ -1296,7 +1295,7 @@ PackAfter(
}
/*
- * Arrange for the master to be re-packed at the first idle moment.
+ * Arrange for the container to be re-packed at the first idle moment.
*/
if (containerPtr->abortPtr != NULL) {
@@ -1314,13 +1313,13 @@ PackAfter(
*
* Unlink --
*
- * Remove a packer from its master's list of slaves.
+ * Remove a packer from its container's list of content.
*
* Results:
* None.
*
* Side effects:
- * The master will be scheduled for repacking.
+ * The container will be scheduled for repacking.
*
*----------------------------------------------------------------------
*/
@@ -1335,10 +1334,10 @@ Unlink(
if (containerPtr == NULL) {
return;
}
- if (containerPtr->slavePtr == packPtr) {
- containerPtr->slavePtr = packPtr->nextPtr;
+ if (containerPtr->contentPtr == packPtr) {
+ containerPtr->contentPtr = packPtr->nextPtr;
} else {
- for (packPtr2 = containerPtr->slavePtr; ; packPtr2 = packPtr2->nextPtr) {
+ for (packPtr2 = containerPtr->contentPtr; ; packPtr2 = packPtr2->nextPtr) {
if (packPtr2 == NULL) {
Tcl_Panic("Unlink couldn't find previous window");
}
@@ -1359,11 +1358,11 @@ Unlink(
packPtr->containerPtr = NULL;
/*
- * If we have emptied this master from slaves it means we are no longer
+ * If we have emptied this container from content it means we are no longer
* handling it and should mark it as free.
*/
- if ((containerPtr->slavePtr == NULL) && (containerPtr->flags & ALLOCED_CONTAINER)) {
+ if ((containerPtr->contentPtr == NULL) && (containerPtr->flags & ALLOCED_CONTAINER)) {
TkFreeGeometryContainer(containerPtr->tkwin, "pack");
containerPtr->flags &= ~ALLOCED_CONTAINER;
}
@@ -1393,7 +1392,7 @@ DestroyPacker(
void *memPtr) /* Info about packed window that is now
* dead. */
{
- Packer *packPtr = memPtr;
+ Packer *packPtr = (Packer *)memPtr;
ckfree(packPtr);
}
@@ -1411,7 +1410,7 @@ DestroyPacker(
*
* Side effects:
* If a window was just deleted, clean up all its packer-related
- * information. If it was just resized, repack its slaves, if any.
+ * information. If it was just resized, repack its content, if any.
*
*----------------------------------------------------------------------
*/
@@ -1422,10 +1421,10 @@ PackStructureProc(
* eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- Packer *packPtr = clientData;
+ Packer *packPtr = (Packer *)clientData;
if (eventPtr->type == ConfigureNotify) {
- if ((packPtr->slavePtr != NULL)
+ if ((packPtr->contentPtr != NULL)
&& !(packPtr->flags & REQUESTED_REPACK)) {
packPtr->flags |= REQUESTED_REPACK;
Tcl_DoWhenIdle(ArrangePacking, packPtr);
@@ -1439,25 +1438,25 @@ PackStructureProc(
}
}
} else if (eventPtr->type == DestroyNotify) {
- Packer *slavePtr, *nextPtr;
+ Packer *contentPtr, *nextPtr;
if (packPtr->containerPtr != NULL) {
Unlink(packPtr);
}
- for (slavePtr = packPtr->slavePtr; slavePtr != NULL;
- slavePtr = nextPtr) {
- Tk_ManageGeometry(slavePtr->tkwin, NULL, NULL);
- Tk_UnmapWindow(slavePtr->tkwin);
- slavePtr->containerPtr = NULL;
- nextPtr = slavePtr->nextPtr;
- slavePtr->nextPtr = NULL;
+ for (contentPtr = packPtr->contentPtr; contentPtr != NULL;
+ contentPtr = nextPtr) {
+ Tk_ManageGeometry(contentPtr->tkwin, NULL, NULL);
+ Tk_UnmapWindow(contentPtr->tkwin);
+ contentPtr->containerPtr = NULL;
+ nextPtr = contentPtr->nextPtr;
+ contentPtr->nextPtr = NULL;
}
if (packPtr->tkwin != NULL) {
TkDisplay *dispPtr = ((TkWindow *) packPtr->tkwin)->dispPtr;
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->packerHashTable,
- (char *) packPtr->tkwin));
+ (void *)packPtr->tkwin));
}
if (packPtr->flags & REQUESTED_REPACK) {
@@ -1467,11 +1466,11 @@ PackStructureProc(
Tcl_EventuallyFree(packPtr, (Tcl_FreeProc *) DestroyPacker);
} else if (eventPtr->type == MapNotify) {
/*
- * When a master gets mapped, must redo the geometry computation so
- * that all of its slaves get remapped.
+ * When a container gets mapped, must redo the geometry computation so
+ * that all of its content get remapped.
*/
- if ((packPtr->slavePtr != NULL)
+ if ((packPtr->contentPtr != NULL)
&& !(packPtr->flags & REQUESTED_REPACK)) {
packPtr->flags |= REQUESTED_REPACK;
Tcl_DoWhenIdle(ArrangePacking, packPtr);
@@ -1480,11 +1479,11 @@ PackStructureProc(
Packer *packPtr2;
/*
- * Unmap all of the slaves when the master gets unmapped, so that they
+ * Unmap all of the content when the container gets unmapped, so that they
* don't bother to keep redisplaying themselves.
*/
- for (packPtr2 = packPtr->slavePtr; packPtr2 != NULL;
+ for (packPtr2 = packPtr->contentPtr; packPtr2 != NULL;
packPtr2 = packPtr2->nextPtr) {
Tk_UnmapWindow(packPtr2->tkwin);
}
@@ -1497,15 +1496,15 @@ PackStructureProc(
* ConfigureContent --
*
* This implements the guts of the "pack configure" command. Given a list
- * of slaves and configuration options, it arranges for the packer to
- * manage the slaves and sets the specified options.
+ * of content and configuration options, it arranges for the packer to
+ * manage the content and sets the specified options.
*
* Results:
* TCL_OK is returned if all went well. Otherwise, TCL_ERROR is returned
* and the interp's result is set to contain an error message.
*
* Side effects:
- * Slave windows get taken over by the packer.
+ * Content windows get taken over by the packer.
*
*----------------------------------------------------------------------
*/
@@ -1514,16 +1513,16 @@ static int
ConfigureContent(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Any window in application containing
- * slaves. Used to look up slave names. */
+ * content. Used to look up content names. */
int objc, /* Number of elements in argv. */
Tcl_Obj *const objv[]) /* Argument objects: contains one or more
* window names followed by any number of
* "option value" pairs. Caller must make sure
* that there is at least one window name. */
{
- Packer *containerPtr, *slavePtr, *prevPtr, *otherPtr;
- Tk_Window other, slave, parent, ancestor;
- TkWindow *master;
+ Packer *containerPtr, *contentPtr, *prevPtr, *otherPtr;
+ Tk_Window other, content, parent, ancestor;
+ TkWindow *container;
int i, j, numWindows, tmp, positionGiven;
const char *string;
static const char *const optionStrings[] = {
@@ -1546,10 +1545,10 @@ ConfigureContent(
}
/*
- * Iterate over all of the slave windows, parsing the configuration
- * options for each slave. It's a bit wasteful to re-parse the options for
- * each slave, but things get too messy if we try to parse the arguments
- * just once at the beginning. For example, if a slave already is packed
+ * Iterate over all of the content windows, parsing the configuration
+ * options for each content. It's a bit wasteful to re-parse the options for
+ * each content, but things get too messy if we try to parse the arguments
+ * just once at the beginning. For example, if a content already is packed
* we want to just change a few existing values without resetting
* everything. If there are multiple windows, the -after, -before, and -in
* options only get processed for the first window.
@@ -1559,32 +1558,32 @@ ConfigureContent(
prevPtr = NULL;
positionGiven = 0;
for (j = 0; j < numWindows; j++) {
- if (TkGetWindowFromObj(interp, tkwin, objv[j], &slave) != TCL_OK) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[j], &content) != TCL_OK) {
return TCL_ERROR;
}
- if (Tk_TopWinHierarchy(slave)) {
+ if (Tk_TopWinHierarchy(content)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't pack \"%s\": it's a top-level window",
Tcl_GetString(objv[j])));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL);
return TCL_ERROR;
}
- slavePtr = GetPacker(slave);
- slavePtr->flags &= ~OLD_STYLE;
+ contentPtr = GetPacker(content);
+ contentPtr->flags &= ~OLD_STYLE;
/*
- * If the slave isn't currently packed, reset all of its configuration
+ * If the content isn't currently packed, reset all of its configuration
* information to default values (there could be old values left from
* a previous packing).
*/
- if (slavePtr->containerPtr == NULL) {
- slavePtr->side = TOP;
- slavePtr->anchor = TK_ANCHOR_CENTER;
- slavePtr->padX = slavePtr->padY = 0;
- slavePtr->padLeft = slavePtr->padTop = 0;
- slavePtr->iPadX = slavePtr->iPadY = 0;
- slavePtr->flags &= ~(FILLX|FILLY|EXPAND);
+ if (contentPtr->containerPtr == NULL) {
+ contentPtr->side = TOP;
+ contentPtr->anchor = TK_ANCHOR_CENTER;
+ contentPtr->padX = contentPtr->padY = 0;
+ contentPtr->padLeft = contentPtr->padTop = 0;
+ contentPtr->iPadX = contentPtr->iPadY = 0;
+ contentPtr->flags &= ~(FILLX|FILLY|EXPAND);
}
for (i = numWindows; i < objc; i+=2) {
@@ -1622,7 +1621,7 @@ ConfigureContent(
}
break;
case CONF_ANCHOR:
- if (Tk_GetAnchorFromObj(interp, objv[i+1], &slavePtr->anchor)
+ if (Tk_GetAnchorFromObj(interp, objv[i+1], &contentPtr->anchor)
!= TCL_OK) {
return TCL_ERROR;
}
@@ -1638,7 +1637,7 @@ ConfigureContent(
goto notPacked;
}
containerPtr = otherPtr->containerPtr;
- prevPtr = containerPtr->slavePtr;
+ prevPtr = containerPtr->contentPtr;
if (prevPtr == otherPtr) {
prevPtr = NULL;
} else {
@@ -1653,21 +1652,21 @@ ConfigureContent(
if (Tcl_GetBooleanFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr->flags &= ~EXPAND;
+ contentPtr->flags &= ~EXPAND;
if (tmp) {
- slavePtr->flags |= EXPAND;
+ contentPtr->flags |= EXPAND;
}
break;
case CONF_FILL:
string = Tcl_GetString(objv[i+1]);
if (strcmp(string, "none") == 0) {
- slavePtr->flags &= ~(FILLX|FILLY);
+ contentPtr->flags &= ~(FILLX|FILLY);
} else if (strcmp(string, "x") == 0) {
- slavePtr->flags = (slavePtr->flags & ~FILLY) | FILLX;
+ contentPtr->flags = (contentPtr->flags & ~FILLY) | FILLX;
} else if (strcmp(string, "y") == 0) {
- slavePtr->flags = (slavePtr->flags & ~FILLX) | FILLY;
+ contentPtr->flags = (contentPtr->flags & ~FILLX) | FILLY;
} else if (strcmp(string, "both") == 0) {
- slavePtr->flags |= FILLX|FILLY;
+ contentPtr->flags |= FILLX|FILLY;
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad fill style \"%s\": must be "
@@ -1683,7 +1682,7 @@ ConfigureContent(
return TCL_ERROR;
}
containerPtr = GetPacker(other);
- prevPtr = containerPtr->slavePtr;
+ prevPtr = containerPtr->contentPtr;
if (prevPtr != NULL) {
while (prevPtr->nextPtr != NULL) {
prevPtr = prevPtr->nextPtr;
@@ -1693,7 +1692,7 @@ ConfigureContent(
}
break;
case CONF_IPADX:
- if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp)
!= TCL_OK) || (tmp < 0)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipadx value \"%s\": must be positive screen"
@@ -1701,10 +1700,10 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
return TCL_ERROR;
}
- slavePtr->iPadX = tmp * 2;
+ contentPtr->iPadX = tmp * 2;
break;
case CONF_IPADY:
- if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp)
!= TCL_OK) || (tmp < 0)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipady value \"%s\": must be positive screen"
@@ -1712,17 +1711,17 @@ ConfigureContent(
Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
return TCL_ERROR;
}
- slavePtr->iPadY = tmp * 2;
+ contentPtr->iPadY = tmp * 2;
break;
case CONF_PADX:
- if (TkParsePadAmount(interp, slave, objv[i+1],
- &slavePtr->padLeft, &slavePtr->padX) != TCL_OK) {
+ if (TkParsePadAmount(interp, content, objv[i+1],
+ &contentPtr->padLeft, &contentPtr->padX) != TCL_OK) {
return TCL_ERROR;
}
break;
case CONF_PADY:
- if (TkParsePadAmount(interp, slave, objv[i+1],
- &slavePtr->padTop, &slavePtr->padY) != TCL_OK) {
+ if (TkParsePadAmount(interp, content, objv[i+1],
+ &contentPtr->padTop, &contentPtr->padY) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -1731,42 +1730,42 @@ ConfigureContent(
sizeof(char *), "side", TCL_EXACT, &side) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr->side = (Side) side;
+ contentPtr->side = (Side) side;
break;
}
}
/*
- * If no position in a packing list was specified and the slave is
+ * If no position in a packing list was specified and the content is
* already packed, then leave it in its current location in its
* current packing list.
*/
- if (!positionGiven && (slavePtr->containerPtr != NULL)) {
- containerPtr = slavePtr->containerPtr;
+ if (!positionGiven && (contentPtr->containerPtr != NULL)) {
+ containerPtr = contentPtr->containerPtr;
goto scheduleLayout;
}
/*
- * If the slave is going to be put back after itself or the same -in
+ * If the content is going to be put back after itself or the same -in
* window is passed in again, then just skip the whole operation,
* since it won't work anyway.
*/
- if (prevPtr == slavePtr) {
- containerPtr = slavePtr->containerPtr;
+ if (prevPtr == contentPtr) {
+ containerPtr = contentPtr->containerPtr;
goto scheduleLayout;
}
/*
* If none of the "-in", "-before", or "-after" options has been
- * specified, arrange for the slave to go at the end of the order for
+ * specified, arrange for the content to go at the end of the order for
* its parent.
*/
if (!positionGiven) {
- containerPtr = GetPacker(Tk_Parent(slave));
- prevPtr = containerPtr->slavePtr;
+ containerPtr = GetPacker(Tk_Parent(content));
+ prevPtr = containerPtr->contentPtr;
if (prevPtr != NULL) {
while (prevPtr->nextPtr != NULL) {
prevPtr = prevPtr->nextPtr;
@@ -1775,12 +1774,12 @@ ConfigureContent(
}
/*
- * Make sure that the slave's parent is either the master or an
- * ancestor of the master, and that the master and slave aren't the
+ * Make sure that the content's parent is either the container or an
+ * ancestor of the container, and that the container and content aren't the
* same.
*/
- parent = Tk_Parent(slave);
+ parent = Tk_Parent(content);
for (ancestor = containerPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) {
if (ancestor == parent) {
break;
@@ -1793,7 +1792,7 @@ ConfigureContent(
return TCL_ERROR;
}
}
- if (slave == containerPtr->tkwin) {
+ if (content == containerPtr->tkwin) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't pack %s inside itself", Tcl_GetString(objv[j])));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL);
@@ -1804,9 +1803,9 @@ ConfigureContent(
* Check for management loops.
*/
- for (master = (TkWindow *)containerPtr->tkwin; master != NULL;
- master = (TkWindow *)TkGetGeomMaster(master)) {
- if (master == (TkWindow *)slave) {
+ for (container = (TkWindow *)containerPtr->tkwin; container != NULL;
+ container = (TkWindow *)TkGetGeomMaster(container)) {
+ if (container == (TkWindow *)content) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't put %s inside %s, would cause management loop",
Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin)));
@@ -1814,48 +1813,48 @@ ConfigureContent(
return TCL_ERROR;
}
}
- if (containerPtr->tkwin != Tk_Parent(slave)) {
- ((TkWindow *)slave)->maintainerPtr = (TkWindow *)containerPtr->tkwin;
+ if (containerPtr->tkwin != Tk_Parent(content)) {
+ ((TkWindow *)content)->maintainerPtr = (TkWindow *)containerPtr->tkwin;
}
/*
- * Unpack the slave if it's currently packed, then position it after
+ * Unpack the content if it's currently packed, then position it after
* prevPtr.
*/
- if (slavePtr->containerPtr != NULL) {
- if ((slavePtr->containerPtr != containerPtr) &&
- (slavePtr->containerPtr->tkwin
- != Tk_Parent(slavePtr->tkwin))) {
- Tk_UnmaintainGeometry(slavePtr->tkwin,
- slavePtr->containerPtr->tkwin);
+ if (contentPtr->containerPtr != NULL) {
+ if ((contentPtr->containerPtr != containerPtr) &&
+ (contentPtr->containerPtr->tkwin
+ != Tk_Parent(contentPtr->tkwin))) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin,
+ contentPtr->containerPtr->tkwin);
}
- Unlink(slavePtr);
+ Unlink(contentPtr);
}
- slavePtr->containerPtr = containerPtr;
+ contentPtr->containerPtr = containerPtr;
if (prevPtr == NULL) {
- slavePtr->nextPtr = containerPtr->slavePtr;
- containerPtr->slavePtr = slavePtr;
+ contentPtr->nextPtr = containerPtr->contentPtr;
+ containerPtr->contentPtr = contentPtr;
} else {
- slavePtr->nextPtr = prevPtr->nextPtr;
- prevPtr->nextPtr = slavePtr;
+ contentPtr->nextPtr = prevPtr->nextPtr;
+ prevPtr->nextPtr = contentPtr;
}
- Tk_ManageGeometry(slave, &packerType, slavePtr);
- prevPtr = slavePtr;
+ Tk_ManageGeometry(content, &packerType, contentPtr);
+ prevPtr = contentPtr;
if (!(containerPtr->flags & DONT_PROPAGATE)) {
if (TkSetGeometryContainer(interp, containerPtr->tkwin, "pack")
!= TCL_OK) {
- Tk_ManageGeometry(slave, NULL, NULL);
- Unlink(slavePtr);
+ Tk_ManageGeometry(content, NULL, NULL);
+ Unlink(contentPtr);
return TCL_ERROR;
}
containerPtr->flags |= ALLOCED_CONTAINER;
}
/*
- * Arrange for the master to be re-packed at the first idle moment.
+ * Arrange for the container to be re-packed at the first idle moment.
*/
scheduleLayout:
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index d044fa9..615eb9e 100644
--- a/generic/tkPlace.c
+++ b/generic/tkPlace.c
@@ -35,15 +35,15 @@ typedef enum {BM_INSIDE, BM_OUTSIDE, BM_IGNORE} BorderMode;
* structure of the following type:
*/
-typedef struct Slave {
+typedef struct Content {
Tk_Window tkwin; /* Tk's token for window. */
Tk_Window inTkwin; /* Token for the -in window. */
- struct Master *containerPtr; /* Pointer to information for window relative
+ struct Container *containerPtr; /* Pointer to information for window relative
* to which tkwin is placed. This isn't
* necessarily the logical parent of tkwin.
* NULL means the container was deleted or never
* assigned. */
- struct Slave *nextPtr; /* Next in list of windows placed relative to
+ struct Content *nextPtr; /* Next in list of windows placed relative to
* same container (NULL for end of list). */
Tk_OptionTable optionTable; /* Table that defines configuration options
* available for this command. */
@@ -72,7 +72,7 @@ typedef struct Slave {
BorderMode borderMode; /* How to treat borders of container window. */
int flags; /* Various flags; see below for bit
* definitions. */
-} Slave;
+} Content;
/*
* Type masks for options:
@@ -82,34 +82,34 @@ typedef struct Slave {
static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", -1,
- Tk_Offset(Slave, anchor), 0, 0, 0},
+ Tk_Offset(Content, anchor), 0, 0, 0},
{TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", -1,
- Tk_Offset(Slave, borderMode), 0, borderModeStrings, 0},
- {TK_OPTION_PIXELS, "-height", NULL, NULL, "", Tk_Offset(Slave, heightPtr),
- Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_WINDOW, "-in", NULL, NULL, "", -1, Tk_Offset(Slave, inTkwin),
+ Tk_Offset(Content, borderMode), 0, borderModeStrings, 0},
+ {TK_OPTION_PIXELS, "-height", NULL, NULL, "", Tk_Offset(Content, heightPtr),
+ Tk_Offset(Content, height), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_WINDOW, "-in", NULL, NULL, "", -1, Tk_Offset(Content, inTkwin),
0, 0, IN_MASK},
{TK_OPTION_DOUBLE, "-relheight", NULL, NULL, "",
- Tk_Offset(Slave, relHeightPtr), Tk_Offset(Slave, relHeight),
+ Tk_Offset(Content, relHeightPtr), Tk_Offset(Content, relHeight),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, "",
- Tk_Offset(Slave, relWidthPtr), Tk_Offset(Slave, relWidth),
+ Tk_Offset(Content, relWidthPtr), Tk_Offset(Content, relWidth),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0", -1,
- Tk_Offset(Slave, relX), 0, 0, 0},
+ Tk_Offset(Content, relX), 0, 0, 0},
{TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0", -1,
- Tk_Offset(Slave, relY), 0, 0, 0},
- {TK_OPTION_PIXELS, "-width", NULL, NULL, "", Tk_Offset(Slave, widthPtr),
- Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", Tk_Offset(Slave, xPtr),
- Tk_Offset(Slave, x), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", Tk_Offset(Slave, yPtr),
- Tk_Offset(Slave, y), TK_OPTION_NULL_OK, 0, 0},
+ Tk_Offset(Content, relY), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-width", NULL, NULL, "", Tk_Offset(Content, widthPtr),
+ Tk_Offset(Content, width), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", Tk_Offset(Content, xPtr),
+ Tk_Offset(Content, x), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", Tk_Offset(Content, yPtr),
+ Tk_Offset(Content, y), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
/*
- * Flag definitions for Slave structures:
+ * Flag definitions for Content structures:
*
* CHILD_WIDTH - 1 means -width was specified;
* CHILD_REL_WIDTH - 1 means -relwidth was specified.
@@ -123,22 +123,22 @@ static const Tk_OptionSpec optionSpecs[] = {
#define CHILD_REL_HEIGHT 8
/*
- * For each container window that has a slave managed by the placer there is a
+ * For each container window that has a content managed by the placer there is a
* structure of the following form:
*/
-typedef struct Master {
+typedef struct Container {
Tk_Window tkwin; /* Tk's token for container window. */
- struct Slave *slavePtr; /* First in linked list of slaves placed
+ struct Content *contentPtr; /* First in linked list of content placed
* relative to this container. */
int *abortPtr; /* If non-NULL, it means that there is a nested
* call to RecomputePlacement already working on
* this window. *abortPtr may be set to 1 to
* abort that nested call. This happens, for
- * example, if tkwin or any of its slaves
+ * example, if tkwin or any of its content
* is deleted. */
int flags; /* See below for bit definitions. */
-} Master;
+} Container;
/*
* Flag definitions for containers:
@@ -161,28 +161,28 @@ static void PlaceLostContentProc(ClientData clientData,
static const Tk_GeomMgr placerType = {
"place", /* name */
PlaceRequestProc, /* requestProc */
- PlaceLostContentProc, /* lostSlaveProc */
+ PlaceLostContentProc, /* lostContentProc */
};
/*
* Forward declarations for functions defined later in this file:
*/
-static void SlaveStructureProc(ClientData clientData,
+static void ContentStructureProc(ClientData clientData,
XEvent *eventPtr);
static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin,
Tk_OptionTable table, int objc,
Tcl_Obj *const objv[]);
static int PlaceInfoCommand(Tcl_Interp *interp, Tk_Window tkwin);
-static Slave * CreateSlave(Tk_Window tkwin, Tk_OptionTable table);
-static void FreeSlave(Slave *slavePtr);
-static Slave * FindSlave(Tk_Window tkwin);
-static Master * CreateMaster(Tk_Window tkwin);
-static Master * FindMaster(Tk_Window tkwin);
+static Content * CreateContent(Tk_Window tkwin, Tk_OptionTable table);
+static void FreeContent(Content *contentPtr);
+static Content * FindContent(Tk_Window tkwin);
+static Container * CreateContainer(Tk_Window tkwin);
+static Container * FindContainer(Tk_Window tkwin);
static void PlaceStructureProc(ClientData clientData,
XEvent *eventPtr);
static void RecomputePlacement(ClientData clientData);
-static void UnlinkSlave(Slave *slavePtr);
+static void UnlinkContent(Content *contentPtr);
/*
*--------------------------------------------------------------
@@ -208,9 +208,9 @@ Tk_PlaceObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window main_win = clientData;
+ Tk_Window main_win = (Tk_Window)clientData;
Tk_Window tkwin;
- Slave *slavePtr;
+ Content *contentPtr;
TkDisplay *dispPtr;
Tk_OptionTable optionTable;
static const char *const optionStrings[] = {
@@ -286,11 +286,11 @@ Tk_PlaceObjCmd(
if (objc == 3 || objc == 4) {
Tcl_Obj *objPtr;
- slavePtr = FindSlave(tkwin);
- if (slavePtr == NULL) {
+ contentPtr = FindContent(tkwin);
+ if (contentPtr == NULL) {
return TCL_OK;
}
- objPtr = Tk_GetOptionInfo(interp, (char *) slavePtr, optionTable,
+ objPtr = Tk_GetOptionInfo(interp, (char *)contentPtr, optionTable,
(objc == 4) ? objv[3] : NULL, tkwin);
if (objPtr == NULL) {
return TCL_ERROR;
@@ -305,22 +305,22 @@ Tk_PlaceObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "pathName");
return TCL_ERROR;
}
- slavePtr = FindSlave(tkwin);
- if (slavePtr == NULL) {
+ contentPtr = FindContent(tkwin);
+ if (contentPtr == NULL) {
return TCL_OK;
}
- if ((slavePtr->containerPtr != NULL) &&
- (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin))) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->containerPtr->tkwin);
+ if ((contentPtr->containerPtr != NULL) &&
+ (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin))) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin);
}
- UnlinkSlave(slavePtr);
+ UnlinkContent(contentPtr);
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable,
- (char *) tkwin));
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- slavePtr);
+ (void *)tkwin));
+ Tk_DeleteEventHandler(tkwin, StructureNotifyMask, ContentStructureProc,
+ contentPtr);
Tk_ManageGeometry(tkwin, NULL, NULL);
Tk_UnmapWindow(tkwin);
- FreeSlave(slavePtr);
+ FreeContent(contentPtr);
break;
case PLACE_INFO:
@@ -332,20 +332,20 @@ Tk_PlaceObjCmd(
case PLACE_CONTENT:
case PLACE_SLAVES: {
- Master *containerPtr;
+ Container *containerPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "pathName");
return TCL_ERROR;
}
- containerPtr = FindMaster(tkwin);
+ containerPtr = FindContainer(tkwin);
if (containerPtr != NULL) {
Tcl_Obj *listPtr = Tcl_NewObj();
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
Tcl_ListObjAppendElement(NULL, listPtr,
- TkNewWindowObj(slavePtr->tkwin));
+ TkNewWindowObj(contentPtr->tkwin));
}
Tcl_SetObjResult(interp, listPtr);
}
@@ -359,59 +359,59 @@ Tk_PlaceObjCmd(
/*
*----------------------------------------------------------------------
*
- * CreateSlave --
+ * CreateContent --
*
- * Given a Tk_Window token, find the Slave structure corresponding to
+ * Given a Tk_Window token, find the Content structure corresponding to
* that token, creating a new one if necessary.
*
* Results:
- * Pointer to the Slave structure.
+ * Pointer to the Content structure.
*
* Side effects:
- * A new Slave structure may be created.
+ * A new Content structure may be created.
*
*----------------------------------------------------------------------
*/
-static Slave *
-CreateSlave(
- Tk_Window tkwin, /* Token for desired slave. */
+static Content *
+CreateContent(
+ Tk_Window tkwin, /* Token for desired content. */
Tk_OptionTable table)
{
Tcl_HashEntry *hPtr;
- Slave *slavePtr;
+ Content *contentPtr;
int isNew;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
hPtr = Tcl_CreateHashEntry(&dispPtr->slaveTable, (char *) tkwin, &isNew);
if (!isNew) {
- return Tcl_GetHashValue(hPtr);
+ return (Content *)Tcl_GetHashValue(hPtr);
}
/*
- * No preexisting slave structure for that window, so make a new one and
+ * No preexisting content structure for that window, so make a new one and
* populate it with some default values.
*/
- slavePtr = ckalloc(sizeof(Slave));
- memset(slavePtr, 0, sizeof(Slave));
- slavePtr->tkwin = tkwin;
- slavePtr->inTkwin = NULL;
- slavePtr->anchor = TK_ANCHOR_NW;
- slavePtr->borderMode = BM_INSIDE;
- slavePtr->optionTable = table;
- Tcl_SetHashValue(hPtr, slavePtr);
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- slavePtr);
- return slavePtr;
+ contentPtr = (Content *)ckalloc(sizeof(Content));
+ memset(contentPtr, 0, sizeof(Content));
+ contentPtr->tkwin = tkwin;
+ contentPtr->inTkwin = NULL;
+ contentPtr->anchor = TK_ANCHOR_NW;
+ contentPtr->borderMode = BM_INSIDE;
+ contentPtr->optionTable = table;
+ Tcl_SetHashValue(hPtr, contentPtr);
+ Tk_CreateEventHandler(tkwin, StructureNotifyMask, ContentStructureProc,
+ contentPtr);
+ return contentPtr;
}
/*
*----------------------------------------------------------------------
*
- * FreeSlave --
+ * FreeContent --
*
- * Frees the resources held by a Slave structure.
+ * Frees the resources held by a Content structure.
*
* Results:
* None
@@ -423,25 +423,25 @@ CreateSlave(
*/
static void
-FreeSlave(
- Slave *slavePtr)
+FreeContent(
+ Content *contentPtr)
{
- Tk_FreeConfigOptions((char *) slavePtr, slavePtr->optionTable,
- slavePtr->tkwin);
- ckfree(slavePtr);
+ Tk_FreeConfigOptions((char *) contentPtr, contentPtr->optionTable,
+ contentPtr->tkwin);
+ ckfree(contentPtr);
}
/*
*----------------------------------------------------------------------
*
- * FindSlave --
+ * FindContent --
*
- * Given a Tk_Window token, find the Slave structure corresponding to
+ * Given a Tk_Window token, find the Content structure corresponding to
* that token. This is purely a lookup function; it will not create a
* record if one does not yet exist.
*
* Results:
- * Pointer to Slave structure; NULL if none exists.
+ * Pointer to Content structure; NULL if none exists.
*
* Side effects:
* None.
@@ -449,9 +449,9 @@ FreeSlave(
*----------------------------------------------------------------------
*/
-static Slave *
-FindSlave(
- Tk_Window tkwin) /* Token for desired slave. */
+static Content *
+FindContent(
+ Tk_Window tkwin) /* Token for desired content. */
{
Tcl_HashEntry *hPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -460,46 +460,46 @@ FindSlave(
if (hPtr == NULL) {
return NULL;
}
- return Tcl_GetHashValue(hPtr);
+ return (Content *)Tcl_GetHashValue(hPtr);
}
/*
*----------------------------------------------------------------------
*
- * UnlinkSlave --
+ * UnlinkContent --
*
- * This function removes a slave window from the chain of slaves in its
+ * This function removes a content window from the chain of content in its
* container.
*
* Results:
* None.
*
* Side effects:
- * The slave list of slavePtr's container changes.
+ * The content list of contentPtr's container changes.
*
*----------------------------------------------------------------------
*/
static void
-UnlinkSlave(
- Slave *slavePtr) /* Slave structure to be unlinked. */
+UnlinkContent(
+ Content *contentPtr) /* Content structure to be unlinked. */
{
- Master *containerPtr;
- Slave *prevPtr;
+ Container *containerPtr;
+ Content *prevPtr;
- containerPtr = slavePtr->containerPtr;
+ containerPtr = contentPtr->containerPtr;
if (containerPtr == NULL) {
return;
}
- if (containerPtr->slavePtr == slavePtr) {
- containerPtr->slavePtr = slavePtr->nextPtr;
+ if (containerPtr->contentPtr == contentPtr) {
+ containerPtr->contentPtr = contentPtr->nextPtr;
} else {
- for (prevPtr = containerPtr->slavePtr; ; prevPtr = prevPtr->nextPtr) {
+ for (prevPtr = containerPtr->contentPtr; ; prevPtr = prevPtr->nextPtr) {
if (prevPtr == NULL) {
- Tcl_Panic("UnlinkSlave couldn't find slave to unlink");
+ Tcl_Panic("UnlinkContent couldn't find slave to unlink");
}
- if (prevPtr->nextPtr == slavePtr) {
- prevPtr->nextPtr = slavePtr->nextPtr;
+ if (prevPtr->nextPtr == contentPtr) {
+ prevPtr->nextPtr = contentPtr->nextPtr;
break;
}
}
@@ -508,47 +508,47 @@ UnlinkSlave(
if (containerPtr->abortPtr != NULL) {
*containerPtr->abortPtr = 1;
}
- slavePtr->containerPtr = NULL;
+ contentPtr->containerPtr = NULL;
}
/*
*----------------------------------------------------------------------
*
- * CreateMaster --
+ * CreateContainer --
*
- * Given a Tk_Window token, find the Master structure corresponding to
+ * Given a Tk_Window token, find the Container structure corresponding to
* that token, creating a new one if necessary.
*
* Results:
- * Pointer to the Master structure.
+ * Pointer to the Container structure.
*
* Side effects:
- * A new Master structure may be created.
+ * A new Container structure may be created.
*
*----------------------------------------------------------------------
*/
-static Master *
-CreateMaster(
+static Container *
+CreateContainer(
Tk_Window tkwin) /* Token for desired container. */
{
Tcl_HashEntry *hPtr;
- Master *containerPtr;
+ Container *containerPtr;
int isNew;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- hPtr = Tcl_CreateHashEntry(&dispPtr->masterTable, (char *) tkwin, &isNew);
+ hPtr = Tcl_CreateHashEntry(&dispPtr->masterTable, (char *)tkwin, &isNew);
if (isNew) {
- containerPtr = ckalloc(sizeof(Master));
+ containerPtr = (Container *)ckalloc(sizeof(Container));
containerPtr->tkwin = tkwin;
- containerPtr->slavePtr = NULL;
+ containerPtr->contentPtr = NULL;
containerPtr->abortPtr = NULL;
containerPtr->flags = 0;
Tcl_SetHashValue(hPtr, containerPtr);
Tk_CreateEventHandler(containerPtr->tkwin, StructureNotifyMask,
PlaceStructureProc, containerPtr);
} else {
- containerPtr = Tcl_GetHashValue(hPtr);
+ containerPtr = (Container *)Tcl_GetHashValue(hPtr);
}
return containerPtr;
}
@@ -556,14 +556,14 @@ CreateMaster(
/*
*----------------------------------------------------------------------
*
- * FindMaster --
+ * FindContainer --
*
- * Given a Tk_Window token, find the Master structure corresponding to
+ * Given a Tk_Window token, find the Container structure corresponding to
* that token. This is simply a lookup function; a new record will not be
* created if one does not already exist.
*
* Results:
- * Pointer to the Master structure; NULL if one does not exist for the
+ * Pointer to the Container structure; NULL if one does not exist for the
* given Tk_Window token.
*
* Side effects:
@@ -572,8 +572,8 @@ CreateMaster(
*----------------------------------------------------------------------
*/
-static Master *
-FindMaster(
+static Container *
+FindContainer(
Tk_Window tkwin) /* Token for desired container. */
{
Tcl_HashEntry *hPtr;
@@ -583,7 +583,7 @@ FindMaster(
if (hPtr == NULL) {
return NULL;
}
- return Tcl_GetHashValue(hPtr);
+ return (Container *)Tcl_GetHashValue(hPtr);
}
/*
@@ -599,7 +599,7 @@ FindMaster(
* the interp's result.
*
* Side effects:
- * Information in slavePtr may change, and slavePtr's container is scheduled
+ * Information in contentPtr may change, and contentPtr's container is scheduled
* for reconfiguration.
*
*----------------------------------------------------------------------
@@ -613,10 +613,10 @@ ConfigureContent(
int objc, /* Number of config arguments. */
Tcl_Obj *const objv[]) /* Object values for arguments. */
{
- Master *containerPtr;
+ Container *containerPtr;
Tk_SavedOptions savedOptions;
int mask;
- Slave *slavePtr;
+ Content *contentPtr;
Tk_Window containerWin = NULL;
TkWindow *container;
@@ -628,71 +628,71 @@ ConfigureContent(
return TCL_ERROR;
}
- slavePtr = CreateSlave(tkwin, table);
+ contentPtr = CreateContent(tkwin, table);
- if (Tk_SetOptions(interp, (char *) slavePtr, table, objc, objv,
- slavePtr->tkwin, &savedOptions, &mask) != TCL_OK) {
+ if (Tk_SetOptions(interp, (char *)contentPtr, table, objc, objv,
+ contentPtr->tkwin, &savedOptions, &mask) != TCL_OK) {
goto error;
}
/*
- * Set slave flags. First clear the field, then add bits as needed.
+ * Set content flags. First clear the field, then add bits as needed.
*/
- slavePtr->flags = 0;
- if (slavePtr->heightPtr) {
- slavePtr->flags |= CHILD_HEIGHT;
+ contentPtr->flags = 0;
+ if (contentPtr->heightPtr) {
+ contentPtr->flags |= CHILD_HEIGHT;
}
- if (slavePtr->relHeightPtr) {
- slavePtr->flags |= CHILD_REL_HEIGHT;
+ if (contentPtr->relHeightPtr) {
+ contentPtr->flags |= CHILD_REL_HEIGHT;
}
- if (slavePtr->relWidthPtr) {
- slavePtr->flags |= CHILD_REL_WIDTH;
+ if (contentPtr->relWidthPtr) {
+ contentPtr->flags |= CHILD_REL_WIDTH;
}
- if (slavePtr->widthPtr) {
- slavePtr->flags |= CHILD_WIDTH;
+ if (contentPtr->widthPtr) {
+ contentPtr->flags |= CHILD_WIDTH;
}
- if (!(mask & IN_MASK) && (slavePtr->containerPtr != NULL)) {
+ if (!(mask & IN_MASK) && (contentPtr->containerPtr != NULL)) {
/*
- * If no -in option was passed and the slave is already placed then
+ * If no -in option was passed and the content is already placed then
* just recompute the placement.
*/
- containerPtr = slavePtr->containerPtr;
+ containerPtr = contentPtr->containerPtr;
goto scheduleLayout;
} else if (mask & IN_MASK) {
/* -in changed */
Tk_Window tkwin;
Tk_Window ancestor;
- tkwin = slavePtr->inTkwin;
+ tkwin = contentPtr->inTkwin;
/*
* Make sure that the new container is either the logical parent of the
- * slave or a descendant of that window, and that the container and slave
+ * content or a descendant of that window, and that the container and content
* aren't the same.
*/
for (ancestor = tkwin; ; ancestor = Tk_Parent(ancestor)) {
- if (ancestor == Tk_Parent(slavePtr->tkwin)) {
+ if (ancestor == Tk_Parent(contentPtr->tkwin)) {
break;
}
if (Tk_TopWinHierarchy(ancestor)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't place %s relative to %s",
- Tk_PathName(slavePtr->tkwin), Tk_PathName(tkwin)));
+ Tk_PathName(contentPtr->tkwin), Tk_PathName(tkwin)));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL);
goto error;
}
}
- if (slavePtr->tkwin == tkwin) {
+ if (contentPtr->tkwin == tkwin) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't place %s relative to itself",
- Tk_PathName(slavePtr->tkwin)));
+ Tk_PathName(contentPtr->tkwin)));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL);
goto error;
}
@@ -703,53 +703,53 @@ ConfigureContent(
for (container = (TkWindow *)tkwin; container != NULL;
container = (TkWindow *)TkGetGeomMaster(container)) {
- if (container == (TkWindow *)slavePtr->tkwin) {
+ if (container == (TkWindow *)contentPtr->tkwin) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't put %s inside %s, would cause management loop",
- Tk_PathName(slavePtr->tkwin), Tk_PathName(tkwin)));
+ Tk_PathName(contentPtr->tkwin), Tk_PathName(tkwin)));
Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL);
goto error;
}
}
- if (tkwin != Tk_Parent(slavePtr->tkwin)) {
- ((TkWindow *)slavePtr->tkwin)->maintainerPtr = (TkWindow *)tkwin;
+ if (tkwin != Tk_Parent(contentPtr->tkwin)) {
+ ((TkWindow *)contentPtr->tkwin)->maintainerPtr = (TkWindow *)tkwin;
}
- if ((slavePtr->containerPtr != NULL)
- && (slavePtr->containerPtr->tkwin == tkwin)) {
+ if ((contentPtr->containerPtr != NULL)
+ && (contentPtr->containerPtr->tkwin == tkwin)) {
/*
* Re-using same old container. Nothing to do.
*/
- containerPtr = slavePtr->containerPtr;
+ containerPtr = contentPtr->containerPtr;
goto scheduleLayout;
}
- if ((slavePtr->containerPtr != NULL) &&
- (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin))) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->containerPtr->tkwin);
+ if ((contentPtr->containerPtr != NULL) &&
+ (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin))) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin);
}
- UnlinkSlave(slavePtr);
+ UnlinkContent(contentPtr);
containerWin = tkwin;
}
/*
- * If there's no container specified for this slave, use its Tk_Parent.
+ * If there's no container specified for this content, use its Tk_Parent.
*/
if (containerWin == NULL) {
- containerWin = Tk_Parent(slavePtr->tkwin);
- slavePtr->inTkwin = containerWin;
+ containerWin = Tk_Parent(contentPtr->tkwin);
+ contentPtr->inTkwin = containerWin;
}
/*
- * Manage the slave window in this container.
+ * Manage the content window in this container.
*/
- containerPtr = CreateMaster(containerWin);
- slavePtr->containerPtr = containerPtr;
- slavePtr->nextPtr = containerPtr->slavePtr;
- containerPtr->slavePtr = slavePtr;
- Tk_ManageGeometry(slavePtr->tkwin, &placerType, slavePtr);
+ containerPtr = CreateContainer(containerWin);
+ contentPtr->containerPtr = containerPtr;
+ contentPtr->nextPtr = containerPtr->contentPtr;
+ containerPtr->contentPtr = contentPtr;
+ Tk_ManageGeometry(contentPtr->tkwin, &placerType, contentPtr);
/*
* Arrange for the container to be re-arranged at the first idle moment.
@@ -796,49 +796,49 @@ PlaceInfoCommand(
Tcl_Interp *interp, /* Interp into which to place result. */
Tk_Window tkwin) /* Token for the window to get info on. */
{
- Slave *slavePtr;
+ Content *contentPtr;
Tcl_Obj *infoObj;
- slavePtr = FindSlave(tkwin);
- if (slavePtr == NULL) {
+ contentPtr = FindContent(tkwin);
+ if (contentPtr == NULL) {
return TCL_OK;
}
infoObj = Tcl_NewObj();
- if (slavePtr->containerPtr != NULL) {
+ if (contentPtr->containerPtr != NULL) {
Tcl_AppendToObj(infoObj, "-in", -1);
Tcl_ListObjAppendElement(NULL, infoObj,
- TkNewWindowObj(slavePtr->containerPtr->tkwin));
+ TkNewWindowObj(contentPtr->containerPtr->tkwin));
Tcl_AppendToObj(infoObj, " ", -1);
}
Tcl_AppendPrintfToObj(infoObj,
"-x %d -relx %.4g -y %d -rely %.4g",
- slavePtr->x, slavePtr->relX, slavePtr->y, slavePtr->relY);
- if (slavePtr->flags & CHILD_WIDTH) {
- Tcl_AppendPrintfToObj(infoObj, " -width %d", slavePtr->width);
+ contentPtr->x, contentPtr->relX, contentPtr->y, contentPtr->relY);
+ if (contentPtr->flags & CHILD_WIDTH) {
+ Tcl_AppendPrintfToObj(infoObj, " -width %d", contentPtr->width);
} else {
Tcl_AppendToObj(infoObj, " -width {}", -1);
}
- if (slavePtr->flags & CHILD_REL_WIDTH) {
+ if (contentPtr->flags & CHILD_REL_WIDTH) {
Tcl_AppendPrintfToObj(infoObj,
- " -relwidth %.4g", slavePtr->relWidth);
+ " -relwidth %.4g", contentPtr->relWidth);
} else {
Tcl_AppendToObj(infoObj, " -relwidth {}", -1);
}
- if (slavePtr->flags & CHILD_HEIGHT) {
- Tcl_AppendPrintfToObj(infoObj, " -height %d", slavePtr->height);
+ if (contentPtr->flags & CHILD_HEIGHT) {
+ Tcl_AppendPrintfToObj(infoObj, " -height %d", contentPtr->height);
} else {
Tcl_AppendToObj(infoObj, " -height {}", -1);
}
- if (slavePtr->flags & CHILD_REL_HEIGHT) {
+ if (contentPtr->flags & CHILD_REL_HEIGHT) {
Tcl_AppendPrintfToObj(infoObj,
- " -relheight %.4g", slavePtr->relHeight);
+ " -relheight %.4g", contentPtr->relHeight);
} else {
Tcl_AppendToObj(infoObj, " -relheight {}", -1);
}
Tcl_AppendPrintfToObj(infoObj, " -anchor %s -bordermode %s",
- Tk_NameOfAnchor(slavePtr->anchor),
- borderModeStrings[slavePtr->borderMode]);
+ Tk_NameOfAnchor(contentPtr->anchor),
+ borderModeStrings[contentPtr->borderMode]);
Tcl_SetObjResult(interp, infoObj);
return TCL_OK;
}
@@ -849,7 +849,7 @@ PlaceInfoCommand(
* RecomputePlacement --
*
* This function is called as a when-idle handler. It recomputes the
- * geometries of all the slaves of a given container.
+ * geometries of all the content of a given container.
*
* Results:
* None.
@@ -862,10 +862,10 @@ PlaceInfoCommand(
static void
RecomputePlacement(
- ClientData clientData) /* Pointer to Master record. */
+ ClientData clientData) /* Pointer to Container record. */
{
- Master *containerPtr = clientData;
- Slave *slavePtr;
+ Container *containerPtr = (Container *)clientData;
+ Content *contentPtr;
int x, y, width, height, tmp;
int containerWidth, containerHeight, containerX, containerY;
double x1, y1, x2, y2;
@@ -888,14 +888,14 @@ RecomputePlacement(
Tcl_Preserve(containerPtr);
/*
- * Iterate over all the slaves for the container. Each slave's geometry can
- * be computed independently of the other slaves. Changes to the window's
+ * Iterate over all the content for the container. Each content's geometry can
+ * be computed independently of the other content. Changes to the window's
* structure could cause almost anything to happen, including deleting the
* parent or child. If this happens, we'll be told to abort.
*/
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL && !abort;
- slavePtr = slavePtr->nextPtr) {
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL && !abort;
+ contentPtr = contentPtr->nextPtr) {
/*
* Step 1: compute size and borderwidth of container, taking into account
* desired border mode.
@@ -904,33 +904,33 @@ RecomputePlacement(
containerX = containerY = 0;
containerWidth = Tk_Width(containerPtr->tkwin);
containerHeight = Tk_Height(containerPtr->tkwin);
- if (slavePtr->borderMode == BM_INSIDE) {
+ if (contentPtr->borderMode == BM_INSIDE) {
containerX = Tk_InternalBorderLeft(containerPtr->tkwin);
containerY = Tk_InternalBorderTop(containerPtr->tkwin);
containerWidth -= containerX + Tk_InternalBorderRight(containerPtr->tkwin);
containerHeight -= containerY +
Tk_InternalBorderBottom(containerPtr->tkwin);
- } else if (slavePtr->borderMode == BM_OUTSIDE) {
+ } else if (contentPtr->borderMode == BM_OUTSIDE) {
containerX = containerY = -Tk_Changes(containerPtr->tkwin)->border_width;
containerWidth -= 2 * containerX;
containerHeight -= 2 * containerY;
}
/*
- * Step 2: compute size of slave (outside dimensions including border)
+ * Step 2: compute size of content (outside dimensions including border)
* and location of anchor point within container.
*/
- x1 = slavePtr->x + containerX + (slavePtr->relX*containerWidth);
+ x1 = contentPtr->x + containerX + (contentPtr->relX*containerWidth);
x = (int) (x1 + ((x1 > 0) ? 0.5 : -0.5));
- y1 = slavePtr->y + containerY + (slavePtr->relY*containerHeight);
+ y1 = contentPtr->y + containerY + (contentPtr->relY*containerHeight);
y = (int) (y1 + ((y1 > 0) ? 0.5 : -0.5));
- if (slavePtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH)) {
+ if (contentPtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH)) {
width = 0;
- if (slavePtr->flags & CHILD_WIDTH) {
- width += slavePtr->width;
+ if (contentPtr->flags & CHILD_WIDTH) {
+ width += contentPtr->width;
}
- if (slavePtr->flags & CHILD_REL_WIDTH) {
+ if (contentPtr->flags & CHILD_REL_WIDTH) {
/*
* The code below is a bit tricky. In order to round correctly
* when both relX and relWidth are specified, compute the
@@ -939,40 +939,40 @@ RecomputePlacement(
* errors in relX and relWidth accumulate.
*/
- x2 = x1 + (slavePtr->relWidth*containerWidth);
+ x2 = x1 + (contentPtr->relWidth*containerWidth);
tmp = (int) (x2 + ((x2 > 0) ? 0.5 : -0.5));
width += tmp - x;
}
} else {
- width = Tk_ReqWidth(slavePtr->tkwin)
- + 2*Tk_Changes(slavePtr->tkwin)->border_width;
+ width = Tk_ReqWidth(contentPtr->tkwin)
+ + 2*Tk_Changes(contentPtr->tkwin)->border_width;
}
- if (slavePtr->flags & (CHILD_HEIGHT|CHILD_REL_HEIGHT)) {
+ if (contentPtr->flags & (CHILD_HEIGHT|CHILD_REL_HEIGHT)) {
height = 0;
- if (slavePtr->flags & CHILD_HEIGHT) {
- height += slavePtr->height;
+ if (contentPtr->flags & CHILD_HEIGHT) {
+ height += contentPtr->height;
}
- if (slavePtr->flags & CHILD_REL_HEIGHT) {
+ if (contentPtr->flags & CHILD_REL_HEIGHT) {
/*
* See note above for rounding errors in width computation.
*/
- y2 = y1 + (slavePtr->relHeight*containerHeight);
+ y2 = y1 + (contentPtr->relHeight*containerHeight);
tmp = (int) (y2 + ((y2 > 0) ? 0.5 : -0.5));
height += tmp - y;
}
} else {
- height = Tk_ReqHeight(slavePtr->tkwin)
- + 2*Tk_Changes(slavePtr->tkwin)->border_width;
+ height = Tk_ReqHeight(contentPtr->tkwin)
+ + 2*Tk_Changes(contentPtr->tkwin)->border_width;
}
/*
* Step 3: adjust the x and y positions so that the desired anchor
- * point on the slave appears at that position. Also adjust for the
+ * point on the content appears at that position. Also adjust for the
* border mode and container's border.
*/
- switch (slavePtr->anchor) {
+ switch (contentPtr->anchor) {
case TK_ANCHOR_N:
x -= width/2;
break;
@@ -1011,8 +1011,8 @@ RecomputePlacement(
* height aren't zero.
*/
- width -= 2*Tk_Changes(slavePtr->tkwin)->border_width;
- height -= 2*Tk_Changes(slavePtr->tkwin)->border_width;
+ width -= 2*Tk_Changes(contentPtr->tkwin)->border_width;
+ height -= 2*Tk_Changes(contentPtr->tkwin)->border_width;
if (width <= 0) {
width = 1;
}
@@ -1021,37 +1021,37 @@ RecomputePlacement(
}
/*
- * Step 5: reconfigure the window and map it if needed. If the slave
- * is a child of the container, we do this ourselves. If the slave isn't
+ * Step 5: reconfigure the window and map it if needed. If the content
+ * is a child of the container, we do this ourselves. If the content isn't
* a child of the container, let Tk_MaintainGeometry do the work (it will
* re-adjust things as relevant windows map, unmap, and move).
*/
- if (containerPtr->tkwin == Tk_Parent(slavePtr->tkwin)) {
- if ((x != Tk_X(slavePtr->tkwin))
- || (y != Tk_Y(slavePtr->tkwin))
- || (width != Tk_Width(slavePtr->tkwin))
- || (height != Tk_Height(slavePtr->tkwin))) {
- Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
+ if (containerPtr->tkwin == Tk_Parent(contentPtr->tkwin)) {
+ if ((x != Tk_X(contentPtr->tkwin))
+ || (y != Tk_Y(contentPtr->tkwin))
+ || (width != Tk_Width(contentPtr->tkwin))
+ || (height != Tk_Height(contentPtr->tkwin))) {
+ Tk_MoveResizeWindow(contentPtr->tkwin, x, y, width, height);
}
if (abort) {
break;
}
/*
- * Don't map the slave unless the container is mapped: the slave will
+ * Don't map the content unless the container is mapped: the content will
* get mapped later, when the container is mapped.
*/
if (Tk_IsMapped(containerPtr->tkwin)) {
- Tk_MapWindow(slavePtr->tkwin);
+ Tk_MapWindow(contentPtr->tkwin);
}
} else {
if ((width <= 0) || (height <= 0)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, containerPtr->tkwin);
- Tk_UnmapWindow(slavePtr->tkwin);
+ Tk_UnmaintainGeometry(contentPtr->tkwin, containerPtr->tkwin);
+ Tk_UnmapWindow(contentPtr->tkwin);
} else {
- Tk_MaintainGeometry(slavePtr->tkwin, containerPtr->tkwin,
+ Tk_MaintainGeometry(contentPtr->tkwin, containerPtr->tkwin,
x, y, width, height);
}
}
@@ -1074,35 +1074,35 @@ RecomputePlacement(
*
* Side effects:
* Structures get cleaned up if the window was deleted. If the window was
- * resized then slave geometries get recomputed.
+ * resized then content geometries get recomputed.
*
*----------------------------------------------------------------------
*/
static void
PlaceStructureProc(
- ClientData clientData, /* Pointer to Master structure for window
+ ClientData clientData, /* Pointer to Container structure for window
* referred to by eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- Master *containerPtr = clientData;
- Slave *slavePtr, *nextPtr;
+ Container *containerPtr = (Container *)clientData;
+ Content *contentPtr, *nextPtr;
TkDisplay *dispPtr = ((TkWindow *) containerPtr->tkwin)->dispPtr;
switch (eventPtr->type) {
case ConfigureNotify:
- if ((containerPtr->slavePtr != NULL)
+ if ((containerPtr->contentPtr != NULL)
&& !(containerPtr->flags & PARENT_RECONFIG_PENDING)) {
containerPtr->flags |= PARENT_RECONFIG_PENDING;
Tcl_DoWhenIdle(RecomputePlacement, containerPtr);
}
return;
case DestroyNotify:
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = nextPtr) {
- slavePtr->containerPtr = NULL;
- nextPtr = slavePtr->nextPtr;
- slavePtr->nextPtr = NULL;
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = nextPtr) {
+ contentPtr->containerPtr = NULL;
+ nextPtr = contentPtr->nextPtr;
+ contentPtr->nextPtr = NULL;
}
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->masterTable,
(char *) containerPtr->tkwin));
@@ -1118,10 +1118,10 @@ PlaceStructureProc(
case MapNotify:
/*
* When a container gets mapped, must redo the geometry computation so
- * that all of its slaves get remapped.
+ * that all of its content get remapped.
*/
- if ((containerPtr->slavePtr != NULL)
+ if ((containerPtr->contentPtr != NULL)
&& !(containerPtr->flags & PARENT_RECONFIG_PENDING)) {
containerPtr->flags |= PARENT_RECONFIG_PENDING;
Tcl_DoWhenIdle(RecomputePlacement, containerPtr);
@@ -1129,13 +1129,13 @@ PlaceStructureProc(
return;
case UnmapNotify:
/*
- * Unmap all of the slaves when the container gets unmapped, so that they
+ * Unmap all of the content when the container gets unmapped, so that they
* don't keep redisplaying themselves.
*/
- for (slavePtr = containerPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- Tk_UnmapWindow(slavePtr->tkwin);
+ for (contentPtr = containerPtr->contentPtr; contentPtr != NULL;
+ contentPtr = contentPtr->nextPtr) {
+ Tk_UnmapWindow(contentPtr->tkwin);
}
return;
}
@@ -1144,10 +1144,10 @@ PlaceStructureProc(
/*
*----------------------------------------------------------------------
*
- * SlaveStructureProc --
+ * ContentStructureProc --
*
* This function is invoked by the Tk event handler when StructureNotify
- * events occur for a slave window.
+ * events occur for a content window.
*
* Results:
* None.
@@ -1159,21 +1159,21 @@ PlaceStructureProc(
*/
static void
-SlaveStructureProc(
- ClientData clientData, /* Pointer to Slave structure for window
+ContentStructureProc(
+ ClientData clientData, /* Pointer to Content structure for window
* referred to by eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- Slave *slavePtr = clientData;
- TkDisplay *dispPtr = ((TkWindow *) slavePtr->tkwin)->dispPtr;
+ Content *contentPtr = (Content *)clientData;
+ TkDisplay *dispPtr = ((TkWindow *) contentPtr->tkwin)->dispPtr;
if (eventPtr->type == DestroyNotify) {
- if (slavePtr->containerPtr != NULL) {
- UnlinkSlave(slavePtr);
+ if (contentPtr->containerPtr != NULL) {
+ UnlinkContent(contentPtr);
}
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable,
- (char *) slavePtr->tkwin));
- FreeSlave(slavePtr);
+ (char *) contentPtr->tkwin));
+ FreeContent(contentPtr);
}
}
@@ -1182,7 +1182,7 @@ SlaveStructureProc(
*
* PlaceRequestProc --
*
- * This function is invoked by Tk whenever a slave managed by us changes
+ * This function is invoked by Tk whenever a content managed by us changes
* its requested geometry.
*
* Results:
@@ -1195,26 +1195,25 @@ SlaveStructureProc(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static void
PlaceRequestProc(
- ClientData clientData, /* Pointer to our record for slave. */
- Tk_Window tkwin) /* Window that changed its desired size. */
+ ClientData clientData, /* Pointer to our record for content. */
+ TCL_UNUSED(Tk_Window)) /* Window that changed its desired size. */
{
- Slave *slavePtr = clientData;
- Master *containerPtr;
+ Content *contentPtr = (Content *)clientData;
+ Container *containerPtr;
- if ((slavePtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH))
- && (slavePtr->flags & (CHILD_HEIGHT|CHILD_REL_HEIGHT))) {
+ if ((contentPtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH))
+ && (contentPtr->flags & (CHILD_HEIGHT|CHILD_REL_HEIGHT))) {
/*
* Send a ConfigureNotify to indicate that the size change
* request was rejected.
*/
- TkDoConfigureNotify((TkWindow *)(slavePtr->tkwin));
+ TkDoConfigureNotify((TkWindow *)(contentPtr->tkwin));
return;
}
- containerPtr = slavePtr->containerPtr;
+ containerPtr = contentPtr->containerPtr;
if (containerPtr == NULL) {
return;
}
@@ -1241,26 +1240,25 @@ PlaceRequestProc(
*--------------------------------------------------------------
*/
- /* ARGSUSED */
static void
PlaceLostContentProc(
- ClientData clientData, /* Slave structure for slave window that was
+ ClientData clientData, /* Content structure for content window that was
* stolen away. */
- Tk_Window tkwin) /* Tk's handle for the slave window. */
+ Tk_Window tkwin) /* Tk's handle for the content window. */
{
- Slave *slavePtr = clientData;
- TkDisplay *dispPtr = ((TkWindow *) slavePtr->tkwin)->dispPtr;
+ Content *contentPtr = (Content *)clientData;
+ TkDisplay *dispPtr = ((TkWindow *) contentPtr->tkwin)->dispPtr;
- if (slavePtr->containerPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->containerPtr->tkwin);
+ if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) {
+ Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin);
}
Tk_UnmapWindow(tkwin);
- UnlinkSlave(slavePtr);
+ UnlinkContent(contentPtr);
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable,
(char *) tkwin));
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- slavePtr);
- FreeSlave(slavePtr);
+ Tk_DeleteEventHandler(tkwin, StructureNotifyMask, ContentStructureProc,
+ contentPtr);
+ FreeContent(contentPtr);
}
/*
diff --git a/generic/tkTest.c b/generic/tkTest.c
index bb7bde5..3c17407 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -1062,14 +1062,14 @@ TestobjconfigObjCmd(
}
case TWO_WINDOWS: {
- typedef struct SlaveRecord {
+ typedef struct ContentRecord {
TrivialCommandHeader header;
Tcl_Obj *windowPtr;
- } SlaveRecord;
- SlaveRecord *recordPtr;
- static const Tk_OptionSpec slaveSpecs[] = {
+ } ContentRecord;
+ ContentRecord *recordPtr;
+ static const Tk_OptionSpec contentSpecs[] = {
{TK_OPTION_WINDOW, "-window", "window", "Window", ".bar",
- Tk_Offset(SlaveRecord, windowPtr), -1, TK_CONFIG_NULL_OK, NULL, 0},
+ Tk_Offset(ContentRecord, windowPtr), -1, TK_CONFIG_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_Window tkwin = Tk_CreateWindowFromPath(interp,
@@ -1080,10 +1080,10 @@ TestobjconfigObjCmd(
}
Tk_SetClass(tkwin, "Test");
- recordPtr = ckalloc(sizeof(SlaveRecord));
+ recordPtr = ckalloc(sizeof(ContentRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = Tk_CreateOptionTable(interp,
- slaveSpecs);
+ contentSpecs);
tables[index] = recordPtr->header.optionTable;
recordPtr->header.tkwin = tkwin;
recordPtr->windowPtr = NULL;