diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-04 13:53:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-04 13:53:56 (GMT) |
commit | 71f52ef43250086759c25b7bb44760a9510dd8f1 (patch) | |
tree | 5a5dc10e4165141fd08f07440f668ef0bc5a6c80 /generic | |
parent | 1a1f6bb851a8f05fd555d9e28bc01edea61adef5 (diff) | |
parent | 7fbdc22e15b48b888546a5df320f8d7ffedb78b1 (diff) | |
download | tk-71f52ef43250086759c25b7bb44760a9510dd8f1.zip tk-71f52ef43250086759c25b7bb44760a9510dd8f1.tar.gz tk-71f52ef43250086759c25b7bb44760a9510dd8f1.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tk.h | 18 | ||||
-rw-r--r-- | generic/tkConfig.c | 6 | ||||
-rw-r--r-- | generic/tkGrid.c | 258 | ||||
-rw-r--r-- | generic/tkImgPhoto.h | 2 | ||||
-rw-r--r-- | generic/tkOldConfig.c | 2 | ||||
-rw-r--r-- | generic/tkPack.c | 210 | ||||
-rw-r--r-- | generic/tkPlace.c | 66 | ||||
-rw-r--r-- | generic/tkTest.c | 14 |
8 files changed, 288 insertions, 288 deletions
diff --git a/generic/tk.h b/generic/tk.h index 9672110..0c7c69f 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -660,13 +660,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 *lostContentProc; - /* 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; /* @@ -1306,18 +1306,18 @@ typedef struct Tk_ImageType Tk_ImageType; #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE) typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc, char **argv, Tk_ImageType *typePtr, Tk_ImageModel model, - ClientData *modelDataPtr); + ClientData *clientDataPtr); #else typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, int objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, - ClientData *modelDataPtr); + ClientData *clientDataPtr); #endif /* USE_OLD_IMAGE */ -typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData modelData); -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 modelData); +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 859f2d0..97c1f89 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/tkGrid.c b/generic/tkGrid.c index b016fc8..00a8546 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. */ @@ -148,7 +148,7 @@ typedef struct { /* * 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 *contentPtr; /* First in list of slaves managed inside this - * window (NULL means no grid slaves). */ + 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. */ @@ -291,15 +291,15 @@ static void GridStructureProc(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(Tcl_WideInt, Tcl_WideInt); static Tcl_Obj * NewQuadObj(Tcl_WideInt, Tcl_WideInt, Tcl_WideInt, Tcl_WideInt); static int ResolveConstraints(Gridder *gridPtr, int rowOrColumn, int maxOffset); static void SetGridSize(Gridder *gridPtr); -static int SetSlaveColumn(Tcl_Interp *interp, Gridder *contentPtr, +static int SetContentColumn(Tcl_Interp *interp, Gridder *contentPtr, int column, int numCols); -static int SetSlaveRow(Tcl_Interp *interp, Gridder *contentPtr, +static int SetContentRow(Tcl_Interp *interp, Gridder *contentPtr, int row, int numRows); static Tcl_Obj * StickyToObj(int flags); static int StringToSticky(const char *string); @@ -339,7 +339,7 @@ Tk_GridObjCmd( static const char *const optionStrings[] = { "anchor", "bbox", "columnconfigure", "configure", "content", "forget", "info", "location", "propagate", - "remove", "rowconfigure", "size", "slaves", NULL + "remove", "rowconfigure", "size", "slaves", NULL }; enum options { GRID_ANCHOR, GRID_BBOX, GRID_COLUMNCONFIGURE, GRID_CONFIGURE, @@ -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) { @@ -631,18 +631,18 @@ GridForgetRemoveCommand( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window slave; + 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; } - contentPtr = GetGrid(slave); + contentPtr = GetGrid(content); if (contentPtr->containerPtr != NULL) { /* * For "forget", reset all the settings to their defaults @@ -685,7 +685,7 @@ GridForgetRemoveCommand( Tcl_IncrRefCount(contentPtr->in); } } - Tk_ManageGeometry(slave, NULL, NULL); + Tk_ManageGeometry(content, NULL, NULL); if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) { Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin); @@ -722,17 +722,17 @@ GridInfoCommand( Tcl_Obj *const objv[]) /* Argument objects. */ { Gridder *contentPtr; - Tk_Window slave; + 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; } - contentPtr = GetGrid(slave); + contentPtr = GetGrid(content); if (contentPtr->containerPtr == NULL) { Tcl_ResetResult(interp); return TCL_OK; @@ -784,7 +784,7 @@ GridLocationCommand( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window container; - Gridder *containerPtr; /* Master grid record. */ + Gridder *containerPtr; /* Container grid record. */ GridContainer *gridPtr; /* Pointer to grid data. */ SlotInfo *slotPtr; int x, y; /* Offset in pixels, from edge of container. */ @@ -906,7 +906,7 @@ 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->contentPtr != NULL) { @@ -964,7 +964,7 @@ GridRowColumnConfigureCommand( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window container, slave; + Tk_Window container, content; Gridder *containerPtr, *contentPtr; SlotInfo *slotPtr = NULL; int slot; /* the column or row number */ @@ -1102,7 +1102,7 @@ GridRowColumnConfigureCommand( } for (j = 0; j < lObjc; j++) { - int allSlaves = 0; + int allContent = 0; if (Tcl_GetIntFromObj(NULL, lObjv[j], &slot) == TCL_OK) { first = slot; @@ -1113,20 +1113,20 @@ GridRowColumnConfigureCommand( * Make sure container is initialised. */ - InitMasterData(containerPtr); + InitContainerData(containerPtr); 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? */ - contentPtr = GetGrid(slave); + contentPtr = GetGrid(content); if (contentPtr->containerPtr != containerPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "the window \"%s\" is not managed by \"%s\"", @@ -1225,7 +1225,7 @@ GridRowColumnConfigureCommand( if (contentPtr != NULL) { contentPtr = contentPtr->nextPtr; } - } while ((allSlaves == 1) && (contentPtr != NULL)); + } while ((allContent == 1) && (contentPtr != NULL)); } Tcl_DecrRefCount(listCopy); @@ -1447,13 +1447,13 @@ GridReqProc( * 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. * *---------------------------------------------------------------------- */ @@ -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,14 +1659,14 @@ AdjustOffsets( static void AdjustForSticky( - Gridder *contentPtr, /* 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 diffx = 0; /* Cavity width - content width. */ + int diffy = 0; /* Cavity hight - content height. */ int sticky = contentPtr->sticky; *xPtr += contentPtr->padLeft; @@ -1712,14 +1712,14 @@ 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 = (Gridder *)clientData; @@ -1733,8 +1733,8 @@ ArrangeGrid( containerPtr->flags &= ~REQUESTED_RELAYOUT; /* - * If the master has no slaves anymore, then don't change the master size. - * Otherwise there is no way to "relinquish" control over the master + * If the container has no content anymore, then don't change the container size. + * Otherwise there is no way to "relinquish" control over the container * so another geometry manager can take over. */ @@ -1812,14 +1812,14 @@ 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 (contentPtr = containerPtr->contentPtr; contentPtr != NULL && !abort; contentPtr = contentPtr->nextPtr) { int x, y; /* Top left coordinate */ - int width, height; /* Slot or slave size */ + int width, height; /* Slot or content size */ int col = contentPtr->column; int row = contentPtr->row; @@ -1836,7 +1836,7 @@ ArrangeGrid( /* * 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. */ @@ -1855,7 +1855,7 @@ ArrangeGrid( } /* - * 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. */ @@ -1904,7 +1904,7 @@ ResolveConstraints( * pixels, or 0 (not currently used). */ { SlotInfo *slotPtr; /* Pointer to row/col constraints. */ - Gridder *contentPtr; /* 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. */ @@ -1913,7 +1913,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 @@ -1997,14 +1997,14 @@ 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) { @@ -2129,7 +2129,7 @@ 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++) { @@ -2478,7 +2478,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 @@ -2495,7 +2495,7 @@ static void SetGridSize( Gridder *containerPtr) /* The geometry container for this grid. */ { - Gridder *contentPtr; /* Current slave window. */ + Gridder *contentPtr; /* Current content window. */ int maxX = 0, maxY = 0; for (contentPtr = containerPtr->contentPtr; contentPtr != NULL; @@ -2512,24 +2512,24 @@ 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 *contentPtr, /* 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. */ { @@ -2553,24 +2553,24 @@ SetSlaveColumn( /* *---------------------------------------------------------------------- * - * 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 *contentPtr, /* 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. */ { @@ -2639,7 +2639,7 @@ CheckSlotData( * of the offsets as well. */ - InitMasterData(containerPtr); + InitContainerData(containerPtr); end = (slotType == ROW) ? containerPtr->containerDataPtr->rowMax : containerPtr->containerDataPtr->columnMax; if (checkOnly == CHECK_ONLY) { @@ -2681,7 +2681,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. @@ -2697,7 +2697,7 @@ CheckSlotData( */ static void -InitMasterData( +InitContainerData( Gridder *containerPtr) { if (containerPtr->containerDataPtr == NULL) { @@ -2727,7 +2727,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. @@ -2775,10 +2775,10 @@ Unlink( 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. * - * Send the event "NoManagedChild" to the master to inform it about there + * Send the event "NoManagedChild" to the container to inform it about there * being no managed children inside it. */ @@ -2843,7 +2843,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. * *---------------------------------------------------------------------- */ @@ -2914,8 +2914,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: @@ -2923,7 +2923,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. * *---------------------------------------------------------------------- */ @@ -2932,7 +2932,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 @@ -2941,7 +2941,7 @@ ConfigureContent( { Gridder *containerPtr = NULL; Gridder *contentPtr; - Tk_Window other, slave, parent, ancestor; + Tk_Window other, content, parent, ancestor; TkWindow *container; int i, j, tmp; int numWindows; @@ -2978,34 +2978,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 *contentPtr = GetGrid(slave); + struct Gridder *contentPtr = GetGrid(content); if (contentPtr->in != NULL) { - if (TkGetWindowFromObj(interp, slave, contentPtr->in, &parent) + 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++; @@ -3074,7 +3074,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) { @@ -3103,10 +3103,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. @@ -3119,7 +3119,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)) { @@ -3139,27 +3139,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; } - contentPtr = 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 @@ -3180,7 +3180,7 @@ ConfigureContent( Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", NULL); return TCL_ERROR; } - if (SetSlaveColumn(interp, contentPtr, tmp, -1) != TCL_OK) { + if (SetContentColumn(interp, contentPtr, tmp, -1) != TCL_OK) { return TCL_ERROR; } break; @@ -3193,7 +3193,7 @@ ConfigureContent( Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", NULL); return TCL_ERROR; } - if (SetSlaveColumn(interp, contentPtr, -1, tmp) != TCL_OK) { + if (SetContentColumn(interp, contentPtr, -1, tmp) != TCL_OK) { return TCL_ERROR; } break; @@ -3202,7 +3202,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); @@ -3210,7 +3210,7 @@ ConfigureContent( } positionGiven = 1; containerPtr = GetGrid(other); - InitMasterData(containerPtr); + InitContainerData(containerPtr); break; case CONF_STICKY: { int sticky = StringToSticky(Tcl_GetString(objv[i+1])); @@ -3227,7 +3227,7 @@ ConfigureContent( 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", @@ -3238,7 +3238,7 @@ ConfigureContent( 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", @@ -3269,7 +3269,7 @@ ConfigureContent( Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", NULL); return TCL_ERROR; } - if (SetSlaveRow(interp, contentPtr, tmp, -1) != TCL_OK) { + if (SetContentRow(interp, contentPtr, tmp, -1) != TCL_OK) { return TCL_ERROR; } break; @@ -3282,7 +3282,7 @@ ConfigureContent( Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", NULL); return TCL_ERROR; } - if (SetSlaveRow(interp, contentPtr, -1, tmp) != TCL_OK) { + if (SetContentRow(interp, contentPtr, -1, tmp) != TCL_OK) { return TCL_ERROR; } break; @@ -3290,7 +3290,7 @@ 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. */ @@ -3311,13 +3311,13 @@ ConfigureContent( /* * 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 (contentPtr->containerPtr != NULL && contentPtr->containerPtr != containerPtr) { @@ -3337,8 +3337,8 @@ ConfigureContent( } /* - * 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( } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't put %s inside %s", Tcl_GetString(objv[j]), + "can't put \"%s\" inside \"%s\"", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); Unlink(contentPtr); @@ -3362,25 +3362,25 @@ 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", + "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(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, contentPtr); + Tk_ManageGeometry(content, &gridMgrType, contentPtr); if (!(containerPtr->flags & DONT_PROPAGATE)) { if (TkSetGeometryContainer(interp, containerPtr->tkwin, "grid") != TCL_OK) { - Tk_ManageGeometry(slave, NULL, NULL); + Tk_ManageGeometry(content, NULL, NULL); Unlink(contentPtr); return TCL_ERROR; } @@ -3392,16 +3392,16 @@ ConfigureContent( */ if (contentPtr->column == -1) { - if (SetSlaveColumn(interp, contentPtr, defaultColumn,-1) != TCL_OK){ + if (SetContentColumn(interp, contentPtr, defaultColumn,-1) != TCL_OK){ return TCL_ERROR; } } - if (SetSlaveColumn(interp, contentPtr, -1, + if (SetContentColumn(interp, contentPtr, -1, contentPtr->numCols + defaultColumnSpan - 1) != TCL_OK) { return TCL_ERROR; } if (contentPtr->row == -1) { - if (SetSlaveRow(interp, contentPtr, defaultRow, -1) != TCL_OK) { + if (SetContentRow(interp, contentPtr, defaultRow, -1) != TCL_OK) { return TCL_ERROR; } } @@ -3489,7 +3489,7 @@ ConfigureContent( if (contentPtr->column == lastColumn && contentPtr->row + contentPtr->numRows - 1 == lastRow) { if (contentPtr->numCols <= width) { - if (SetSlaveRow(interp, contentPtr, -1, + if (SetContentRow(interp, contentPtr, -1, contentPtr->numRows + 1) != TCL_OK) { return TCL_ERROR; } @@ -3518,10 +3518,10 @@ 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. * - * Send the event "NoManagedChild" to the master to inform it about there + * Send the event "NoManagedChild" to the container to inform it about there * being no managed children inside it. */ diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h index e65893f..1e3a91f 100644 --- a/generic/tkImgPhoto.h +++ b/generic/tkImgPhoto.h @@ -176,7 +176,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 diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 96d386b..df3a5e4 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -1108,7 +1108,7 @@ GetCachedSpecs( /* * Now allocate our working copy's space and copy over the contents - * from the main copy. + * from the origin. */ cachedSpecs = (Tk_ConfigSpec *)ckalloc(entrySpace); diff --git a/generic/tkPack.c b/generic/tkPack.c index ed9624f..65a2512 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 that are 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 *contentPtr; /* 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. */ @@ -315,17 +315,17 @@ Tk_PackObjCmd( } return ConfigureContent(interp, tkwin, objc-2, objv+2); case PACK_FORGET: { - Tk_Window slave; + 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; } - contentPtr = GetPacker(slave); + contentPtr = GetPacker(content); if ((contentPtr != NULL) && (contentPtr->containerPtr != NULL)) { - Tk_ManageGeometry(slave, NULL, NULL); + Tk_ManageGeometry(content, NULL, NULL); if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) { Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin); @@ -338,17 +338,17 @@ Tk_PackObjCmd( } case PACK_INFO: { Packer *contentPtr; - Tk_Window slave; + 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; } - contentPtr = GetPacker(slave); + contentPtr = GetPacker(content); if (contentPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); @@ -391,7 +391,7 @@ Tk_PackObjCmd( break; } case PACK_PROPAGATE: { - Tk_Window master; + Tk_Window container; Packer *containerPtr; int propagate; @@ -399,10 +399,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))); @@ -417,7 +417,7 @@ Tk_PackObjCmd( */ if (containerPtr->contentPtr != NULL) { - if (TkSetGeometryContainer(interp, master, "pack") != TCL_OK) { + if (TkSetGeometryContainer(interp, container, "pack") != TCL_OK) { return TCL_ERROR; } containerPtr->flags |= ALLOCED_CONTAINER; @@ -425,8 +425,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) { @@ -438,7 +438,7 @@ Tk_PackObjCmd( } } else { if (containerPtr->flags & ALLOCED_CONTAINER) { - TkFreeGeometryContainer(master, "pack"); + TkFreeGeometryContainer(container, "pack"); containerPtr->flags &= ~ALLOCED_CONTAINER; } containerPtr->flags |= DONT_PROPAGATE; @@ -447,7 +447,7 @@ Tk_PackObjCmd( } case PACK_CONTENT: case PACK_SLAVES: { - Tk_Window master; + Tk_Window container; Packer *containerPtr, *contentPtr; Tcl_Obj *resultObj; @@ -455,11 +455,11 @@ Tk_PackObjCmd( 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); + containerPtr = GetPacker(container); for (contentPtr = containerPtr->contentPtr; contentPtr != NULL; contentPtr = contentPtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, @@ -544,7 +544,7 @@ PackReqProc( * None. * * Side effects: - * Forgets all packer-related information about the slave. + * Forgets all packer-related information about the content. * *------------------------------------------------------------------------ */ @@ -578,14 +578,14 @@ 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 = (Packer *)clientData; @@ -593,7 +593,7 @@ ArrangePacking( 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. */ @@ -609,8 +609,8 @@ ArrangePacking( containerPtr->flags &= ~REQUESTED_REPACK; /* - * If the master has no slaves anymore, then leave the master's size as-is. - * Otherwise there is no way to "relinquish" control over the master + * If the container has no content anymore, then 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. */ @@ -632,18 +632,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. */ @@ -687,10 +687,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)) @@ -703,7 +703,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 @@ -839,7 +839,7 @@ ArrangePacking( /* * 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. */ @@ -858,8 +858,8 @@ ArrangePacking( } /* - * 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)) { @@ -897,7 +897,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: @@ -912,9 +912,9 @@ ArrangePacking( static int XExpansion( - Packer *contentPtr, /* 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; @@ -963,7 +963,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: @@ -978,9 +978,9 @@ XExpansion( static int YExpansion( - Packer *contentPtr, /* 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; @@ -1086,7 +1086,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. @@ -1105,7 +1105,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 @@ -1150,7 +1150,7 @@ PackAfter( if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) { badWindow: Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't pack %s inside %s", Tcl_GetString(objv[0]), + "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); return TCL_ERROR; @@ -1280,7 +1280,7 @@ 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. */ @@ -1307,7 +1307,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) { @@ -1326,13 +1326,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. * *---------------------------------------------------------------------- */ @@ -1371,10 +1371,10 @@ 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. * - * Send the event "NoManagedChild" to the master to inform it about there + * Send the event "NoManagedChild" to the container to inform it about there * being no managed children inside it. */ @@ -1427,7 +1427,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. * *---------------------------------------------------------------------- */ @@ -1483,8 +1483,8 @@ 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->contentPtr != NULL) @@ -1496,7 +1496,7 @@ 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. */ @@ -1513,15 +1513,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. * *---------------------------------------------------------------------- */ @@ -1530,7 +1530,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 @@ -1538,8 +1538,8 @@ ConfigureContent( * that there is at least one window name. */ { Packer *containerPtr, *contentPtr, *prevPtr, *otherPtr; - Tk_Window other, slave, parent, ancestor; - TkWindow *master; + Tk_Window other, content, parent, ancestor; + TkWindow *container; int i, j, numWindows, tmp, positionGiven; const char *string; static const char *const optionStrings[] = { @@ -1562,10 +1562,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. @@ -1575,21 +1575,21 @@ 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; } - contentPtr = GetPacker(slave); + 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). */ @@ -1709,7 +1709,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" @@ -1720,7 +1720,7 @@ ConfigureContent( 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" @@ -1731,13 +1731,13 @@ ConfigureContent( contentPtr->iPadY = tmp * 2; break; case CONF_PADX: - if (TkParsePadAmount(interp, slave, objv[i+1], + 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], + if (TkParsePadAmount(interp, content, objv[i+1], &contentPtr->padTop, &contentPtr->padY) != TCL_OK) { return TCL_ERROR; } @@ -1753,7 +1753,7 @@ ConfigureContent( } /* - * 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. */ @@ -1764,7 +1764,7 @@ ConfigureContent( } /* - * 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. */ @@ -1776,12 +1776,12 @@ ConfigureContent( /* * 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)); + containerPtr = GetPacker(Tk_Parent(content)); prevPtr = containerPtr->contentPtr; if (prevPtr != NULL) { while (prevPtr->nextPtr != NULL) { @@ -1791,27 +1791,27 @@ 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; } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't pack %s inside %s", Tcl_GetString(objv[j]), + "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); 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]))); + "can't pack \"%s\" inside itself", Tcl_GetString(objv[j]))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL); return TCL_ERROR; } @@ -1820,22 +1820,22 @@ 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", + "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); 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. */ @@ -1857,13 +1857,13 @@ ConfigureContent( contentPtr->nextPtr = prevPtr->nextPtr; prevPtr->nextPtr = contentPtr; } - Tk_ManageGeometry(slave, &packerType, contentPtr); + 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); + Tk_ManageGeometry(content, NULL, NULL); Unlink(contentPtr); return TCL_ERROR; } @@ -1871,7 +1871,7 @@ ConfigureContent( } /* - * 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 b4b358f..fdfc3e4 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -123,19 +123,19 @@ 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 Container { Tk_Window tkwin; /* Tk's token for container window. */ - struct Content *contentPtr; /* First in linked list of slaves placed + struct Content *contentPtr; /* First in linked list of content windowslaced * 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. */ } Container; @@ -375,7 +375,7 @@ Tk_PlaceObjCmd( static Content * CreateContent( - Tk_Window tkwin, /* Token for desired slave. */ + Tk_Window tkwin, /* Token for desired content. */ Tk_OptionTable table) { Tcl_HashEntry *hPtr; @@ -389,7 +389,7 @@ CreateContent( } /* - * 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. */ @@ -451,7 +451,7 @@ FreeContent( static Content * FindContent( - Tk_Window tkwin) /* Token for desired slave. */ + Tk_Window tkwin) /* Token for desired content. */ { Tcl_HashEntry *hPtr; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; @@ -468,14 +468,14 @@ FindContent( * * 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 windows in its * container. * * Results: * None. * * Side effects: - * The slave list of contentPtr's container changes. + * The content list of contentPtr's container changes. * *---------------------------------------------------------------------- */ @@ -496,7 +496,7 @@ UnlinkContent( } else { for (prevPtr = containerPtr->contentPtr; ; prevPtr = prevPtr->nextPtr) { if (prevPtr == NULL) { - Tcl_Panic("UnlinkContent couldn't find slave to unlink"); + Tcl_Panic("UnlinkContent couldn't find content to unlink"); } if (prevPtr->nextPtr == contentPtr) { prevPtr->nextPtr = contentPtr->nextPtr; @@ -636,7 +636,7 @@ ConfigureContent( } /* - * Set slave flags. First clear the field, then add bits as needed. + * Set content flags. First clear the field, then add bits as needed. */ contentPtr->flags = 0; @@ -658,7 +658,7 @@ ConfigureContent( 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. */ @@ -673,7 +673,7 @@ ConfigureContent( /* * 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 window or a descendant of that window, and that the container and content * aren't the same. */ @@ -683,7 +683,7 @@ ConfigureContent( } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't place %s relative to %s", + "can't place \"%s\" relative to \"%s\"", Tk_PathName(contentPtr->tkwin), Tk_PathName(tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); goto error; @@ -691,7 +691,7 @@ ConfigureContent( } if (contentPtr->tkwin == tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't place %s relative to itself", + "can't place \"%s\" relative to itself", Tk_PathName(contentPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); goto error; @@ -705,7 +705,7 @@ ConfigureContent( container = (TkWindow *)TkGetGeomMaster(container)) { if (container == (TkWindow *)contentPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't put %s inside %s, would cause management loop", + "can't put \"%s\" inside \"%s\": would cause management loop", Tk_PathName(contentPtr->tkwin), Tk_PathName(tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); goto error; @@ -733,7 +733,7 @@ ConfigureContent( } /* - * 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) { @@ -742,7 +742,7 @@ ConfigureContent( } /* - * Manage the slave window in this container. + * Manage the content window in this container. */ containerPtr = CreateContainer(containerWin); @@ -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. @@ -888,8 +888,8 @@ 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 windows 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. */ @@ -917,7 +917,7 @@ RecomputePlacement( } /* - * 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. */ @@ -968,7 +968,7 @@ RecomputePlacement( /* * 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. */ @@ -1021,8 +1021,8 @@ 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). */ @@ -1039,7 +1039,7 @@ RecomputePlacement( } /* - * 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. */ @@ -1074,7 +1074,7 @@ 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. * *---------------------------------------------------------------------- */ @@ -1118,7 +1118,7 @@ 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->contentPtr != NULL) @@ -1129,7 +1129,7 @@ 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. */ @@ -1147,7 +1147,7 @@ PlaceStructureProc( * 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. @@ -1182,7 +1182,7 @@ ContentStructureProc( * * 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: @@ -1197,7 +1197,7 @@ ContentStructureProc( static void PlaceRequestProc( - ClientData clientData, /* Pointer to our record for slave. */ + ClientData clientData, /* Pointer to our record for content. */ TCL_UNUSED(Tk_Window)) /* Window that changed its desired size. */ { Content *contentPtr = (Content *)clientData; @@ -1242,9 +1242,9 @@ PlaceRequestProc( static void PlaceLostContentProc( - ClientData clientData, /* Content 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. */ { Content *contentPtr = (Content *)clientData; TkDisplay *dispPtr = ((TkWindow *) contentPtr->tkwin)->dispPtr; diff --git a/generic/tkTest.c b/generic/tkTest.c index e4ef0b1..db10124 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -1074,14 +1074,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", - offsetof(SlaveRecord, windowPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, NULL, 0}, + offsetof(ContentRecord, windowPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_Window tkwin = Tk_CreateWindowFromPath(interp, @@ -1092,10 +1092,10 @@ TestobjconfigObjCmd( } Tk_SetClass(tkwin, "Test"); - recordPtr = (SlaveRecord *)ckalloc(sizeof(SlaveRecord)); + recordPtr = (ContentRecord *)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; |