From 9353f4752d719dabcbfd4794332748dfe1537423 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 12 Aug 2020 09:44:56 +0000 Subject: Implementation ofr TIP #581 for Tk --- doc/CrtImgType.3 | 15 ++++++++++++++- doc/ImgChanged.3 | 4 ++++ doc/NameOfImg.3 | 4 ++++ generic/tk.h | 1 + generic/tkDecls.h | 1 + generic/tkGrid.c | 9 +++++---- generic/tkInt.h | 6 ++++++ generic/tkIntPlatDecls.h | 2 ++ generic/tkPack.c | 9 +++++---- generic/tkPlace.c | 5 +++-- generic/tkWindow.c | 2 +- tests/grid.test | 2 +- tests/oldpack.test | 4 ++-- tests/pack.test | 2 +- tests/place.test | 2 +- 15 files changed, 51 insertions(+), 17 deletions(-) diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index cbbc11e..8e6b826 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -9,7 +9,7 @@ .so man.macros .BS .SH NAME -Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image +Tk_CreateImageType, Tk_GetImageMasterData, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image .SH SYNOPSIS .nf \fB#include \fR @@ -19,6 +19,11 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind o ClientData \fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR) .sp +.VS "TIP 581" +ClientData +\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR) +.VE "TIP 581" +.sp \fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR) .SH ARGUMENTS .AS "const Tk_ImageType" *typePtrPtr @@ -241,6 +246,10 @@ and the return value is the ClientData value returned by the \fIcreateProc\fR when the image was created (this is typically a pointer to the image master data structure). If no such image exists then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. +.PP +.VS "TIP 581" +\fBTk_GetImageModelData\fR is synonym for \fBTk_GetImageMasterData\fR +.VE "TIP 581" .SH "LEGACY INTERFACE SUPPORT" .PP In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR @@ -261,6 +270,10 @@ interface. The Tk header file will still support this legacy interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR defined. .PP +.VS "TIP 581" +\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR +.VE "TIP 581" +.PP When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may see the routine \fBTk_InitImageArgs\fR in use. This was a migration tool used to create stub-enabled extensions that could be loaded diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3 index f4d2c04..aa56548 100644 --- a/doc/ImgChanged.3 +++ b/doc/ImgChanged.3 @@ -48,6 +48,10 @@ specify a rectangular region within the image that needs to be redrawn. \fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size. .PP +.VS "TIP 581" +\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR +.VE "TIP 581" +.PP An image manager should call \fBTk_ImageChanged\fR during its \fIcreateProc\fR to specify the image's initial size and to force redisplay if there are existing instances for the image. diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3 index 8c191ce..484e479 100644 --- a/doc/NameOfImg.3 +++ b/doc/NameOfImg.3 @@ -26,5 +26,9 @@ the image was created. This procedure is invoked by image managers to find out the name of an image. Given the token for the image, it returns the string name for the image. +.PP +.VS "TIP 581" +\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR +.VE "TIP 581" .SH KEYWORDS image manager, image name diff --git a/generic/tk.h b/generic/tk.h index 01f3657..116f6d8 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -137,6 +137,7 @@ typedef struct Tk_3DBorder_ *Tk_3DBorder; typedef struct Tk_Style_ *Tk_Style; typedef struct Tk_StyleEngine_ *Tk_StyleEngine; typedef struct Tk_StyledElement_ *Tk_StyledElement; +#define Tk_ImageModel Tk_ImageMaster /* * Additional types exported to clients. diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 64c32cd..b02f286 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -1720,6 +1720,7 @@ extern const TkStubs *tkStubsPtr; #undef Tk_Init #undef Tk_SafeInit #undef Tk_CreateConsoleWindow +#define Tk_GetImageModelData Tk_GetImageMasterData #if defined(_WIN32) && defined(UNICODE) # define Tk_MainEx Tk_MainExW diff --git a/generic/tkGrid.c b/generic/tkGrid.c index be15c14..835971d 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -338,13 +338,13 @@ Tk_GridObjCmd( Tk_Window tkwin = clientData; static const char *const optionStrings[] = { "anchor", "bbox", "columnconfigure", "configure", - "forget", "info", "location", "propagate", "remove", - "rowconfigure", "size", "slaves", NULL + "content", "forget", "info", "location", "propagate", + "remove", "rowconfigure", "size", "slaves", NULL }; enum options { GRID_ANCHOR, GRID_BBOX, GRID_COLUMNCONFIGURE, GRID_CONFIGURE, - GRID_FORGET, GRID_INFO, GRID_LOCATION, GRID_PROPAGATE, GRID_REMOVE, - GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES + GRID_CONTENT, GRID_FORGET, GRID_INFO, GRID_LOCATION, GRID_PROPAGATE, + GRID_REMOVE, GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES }; int index; @@ -384,6 +384,7 @@ Tk_GridObjCmd( return GridPropagateCommand(tkwin, interp, objc, objv); case GRID_SIZE: return GridSizeCommand(tkwin, interp, objc, objv); + case GRID_CONTENT: case GRID_SLAVES: return GridSlavesCommand(tkwin, interp, objc, objv); diff --git a/generic/tkInt.h b/generic/tkInt.h index 2f64f99..9735c32 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -84,6 +84,11 @@ # endif #endif + +#ifndef Tcl_GetParent +# define Tcl_GetParent Tcl_GetMaster +#endif + /* * Macros used to cast between pointers and integers (e.g. when storing an int * in ClientData), on 64-bit architectures they avoid gcc warning about "cast @@ -360,6 +365,7 @@ typedef struct TkDisplay { #define TkGetGeomMaster(tkwin) (((TkWindow *)tkwin)->maintainerPtr != NULL ? \ ((TkWindow *)tkwin)->maintainerPtr : ((TkWindow *)tkwin)->parentPtr) +#define TkGetGeomContainer TkGetGeomMaster /* * Information used by tkGet.c only: diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 8221d7a..02bb9ae 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -799,6 +799,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; #undef TkpTestsendCmd_ #undef TkGenerateActivateEvents_ +#define TkGetTransientContainer TkGetTransientMaster + #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/generic/tkPack.c b/generic/tkPack.c index 9005d7f..245c6a4 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -198,11 +198,11 @@ Tk_PackObjCmd( const char *argv2; static const char *const optionStrings[] = { /* after, append, before and unpack are deprecated */ - "after", "append", "before", "unpack", - "configure", "forget", "info", "propagate", "slaves", NULL }; + "after", "append", "before", "unpack", "configure", + "content", "forget", "info", "propagate", "slaves", NULL }; enum options { - PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK, - PACK_CONFIGURE, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; + PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK, PACK_CONFIGURE, + PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; int index; if (objc >= 2) { @@ -436,6 +436,7 @@ Tk_PackObjCmd( } break; } + case PACK_CONTENT: case PACK_SLAVES: { Tk_Window master; Packer *masterPtr, *slavePtr; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 59b8a2b..f5afa38 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -214,9 +214,9 @@ Tk_PlaceObjCmd( TkDisplay *dispPtr; Tk_OptionTable optionTable; static const char *const optionStrings[] = { - "configure", "forget", "info", "slaves", NULL + "configure", "content", "forget", "info", "slaves", NULL }; - enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES }; + enum options { PLACE_CONFIGURE, PLACE_CONTENT, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES }; int index; if (objc < 3) { @@ -330,6 +330,7 @@ Tk_PlaceObjCmd( } return PlaceInfoCommand(interp, tkwin); + case PLACE_CONTENT: case PLACE_SLAVES: { Master *masterPtr; diff --git a/generic/tkWindow.c b/generic/tkWindow.c index a67329c..5e5e836 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3094,7 +3094,7 @@ Initialize( Tcl_Interp *parent = interp; while (Tcl_IsSafe(parent)) { - parent = Tcl_GetMaster(parent); + parent = Tcl_GetParent(parent); if (parent == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "no controlling parent interpreter", -1)); diff --git a/tests/grid.test b/tests/grid.test index 62474ff..eef42e1 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -45,7 +45,7 @@ test grid-1.1 {basic argument checking} -body { } -returnCodes error -result {wrong # args: should be "grid option arg ?arg ...?"} test grid-1.2 {basic argument checking} -body { grid foo bar -} -returnCodes error -result {bad option "foo": must be anchor, bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves} +} -returnCodes error -result {bad option "foo": must be anchor, bbox, columnconfigure, configure, content, forget, info, location, propagate, remove, rowconfigure, size, or slaves} test grid-1.3 {basic argument checking} -body { button .b grid .b -row 0 -column diff --git a/tests/oldpack.test b/tests/oldpack.test index 72ec065..92c411d 100644 --- a/tests/oldpack.test +++ b/tests/oldpack.test @@ -452,10 +452,10 @@ test oldpack-8.2 {syntax errors} -body { } -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} test oldpack-8.3 {syntax errors} -body { pack gorp foo -} -returnCodes error -result {bad option "gorp": must be configure, forget, info, propagate, or slaves} +} -returnCodes error -result {bad option "gorp": must be configure, content, forget, info, propagate, or slaves} test oldpack-8.4 {syntax errors} -body { pack a .pack -} -returnCodes error -result {bad option "a": must be configure, forget, info, propagate, or slaves} +} -returnCodes error -result {bad option "a": must be configure, content, forget, info, propagate, or slaves} test oldpack-8.5 {syntax errors} -body { pack after foobar } -returnCodes error -result {bad window path name "foobar"} diff --git a/tests/pack.test b/tests/pack.test index 86fcad2..7b75363 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -1373,7 +1373,7 @@ test pack-12.46 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { pack lousy .pack -} -returnCodes error -result {bad option "lousy": must be configure, forget, info, propagate, or slaves} +} -returnCodes error -result {bad option "lousy": must be configure, content, forget, info, propagate, or slaves} test pack-13.1 {window deletion} -setup { diff --git a/tests/place.test b/tests/place.test index 0a5e22f..e7cf5ff 100644 --- a/tests/place.test +++ b/tests/place.test @@ -329,7 +329,7 @@ test place-9.5 {PlaceObjCmd} -setup { place badopt .foo } -cleanup { destroy .foo -} -returnCodes error -result {bad option "badopt": must be configure, forget, info, or slaves} +} -returnCodes error -result {bad option "badopt": must be configure, content, forget, info, or slaves} test place-9.6 {PlaceObjCmd, configure errors} -setup { destroy .foo } -body { -- cgit v0.12 From 65f39447cc34c5c9f1a5f8324115bd076c840d12 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 2 Sep 2020 19:43:41 +0000 Subject: Slave ->Pane, Master->Container in tkPanedwindow.c --- generic/tkPanedWindow.c | 814 ++++++++++++++++++++++++------------------------ 1 file changed, 407 insertions(+), 407 deletions(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index ac61ba8..fec9448 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -70,7 +70,7 @@ enum stretch { typedef struct { Tk_OptionTable pwOptions; /* Token for paned window option table. */ - Tk_OptionTable slaveOpts; /* Token for slave cget option table. */ + Tk_OptionTable paneOpts; /* Token for pane cget option table. */ } OptionTables; /* @@ -78,35 +78,35 @@ typedef struct { * managed by a paned window widget. */ -typedef struct Slave { +typedef struct Pane { Tk_Window tkwin; /* Window being managed. */ int minSize; /* Minimum size of this pane, on the relevant * axis, in pixels. */ - int padx; /* Additional padding requested for slave, in + int padx; /* Additional padding requested for pane, in * the x dimension. */ - int pady; /* Additional padding requested for slave, in + int pady; /* Additional padding requested for pane, in * the y dimension. */ Tcl_Obj *widthPtr, *heightPtr; - /* Tcl_Obj rep's of slave width/height, to + /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ - int width; /* Slave width. */ - int height; /* Slave height. */ + int width; /* Pane width. */ + int height; /* Pane height. */ int sticky; /* Sticky string. */ int x, y; /* Coordinates of the widget. */ int paneWidth, paneHeight; /* Pane dimensions (may be different from - * slave width/height). */ + * pane width/height). */ int sashx, sashy; /* Coordinates of the sash of the right or * bottom of this pane. */ int markx, marky; /* Coordinates of the last mark set for the * sash. */ int handlex, handley; /* Coordinates of the sash handle. */ - enum stretch stretch; /* Controls how slave grows/shrinks */ + enum stretch stretch; /* Controls how pane grows/shrinks */ int hide; /* Controls visibility of pane */ - struct PanedWindow *masterPtr; + struct PanedWindow *containerPtr; /* Paned window managing the window. */ Tk_Window after; /* Placeholder for parsing options. */ Tk_Window before; /* Placeholder for parsing options. */ -} Slave; +} Pane; /* * A data structure of the following type is kept for each paned window widget @@ -121,7 +121,7 @@ typedef struct PanedWindow { Tcl_Command widgetCmd; /* Token for square's widget command. */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ - Tk_OptionTable slaveOpts; /* Token for slave cget table. */ + Tk_OptionTable paneOpts; /* Token for pane cget table. */ Tk_3DBorder background; /* Background color. */ int borderWidth; /* Value of -borderwidth option. */ int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */ @@ -151,9 +151,9 @@ typedef struct PanedWindow { Tcl_Obj *proxyBorderWidthPtr; /* Tcl_Obj rep for proxyBorderWidth */ int proxyBorderWidth; /* Borderwidth used to draw proxy. */ int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */ - Slave **slaves; /* Pointer to array of Slaves. */ - int numSlaves; /* Number of slaves. */ - int sizeofSlaves; /* Number of elements in the slaves array. */ + Pane **panes; /* Pointer to array of Panes. */ + int numPanes; /* Number of panes. */ + int sizeofPanes; /* Number of elements in the panes array. */ int flags; /* Flags for widget; see below. */ } PanedWindow; @@ -200,16 +200,16 @@ static void DisplayProxyWindow(ClientData clientData); static void PanedWindowWorldChanged(ClientData instanceData); static int PanedWindowWidgetObjCmd(ClientData clientData, Tcl_Interp *, int objc, Tcl_Obj * const objv[]); -static void PanedWindowLostSlaveProc(ClientData clientData, +static void PanedWindowLostPaneProc(ClientData clientData, Tk_Window tkwin); static void PanedWindowReqProc(ClientData clientData, Tk_Window tkwin); static void ArrangePanes(ClientData clientData); -static void Unlink(Slave *slavePtr); -static Slave * GetPane(PanedWindow *pwPtr, Tk_Window tkwin); +static void Unlink(Pane *panePtr); +static Pane * GetPane(PanedWindow *pwPtr, Tk_Window tkwin); static void GetFirstLastVisiblePane(PanedWindow *pwPtr, int *firstPtr, int *lastPtr); -static void SlaveStructureProc(ClientData clientData, +static void PaneStructureProc(ClientData clientData, XEvent *eventPtr); static int PanedWindowSashCommand(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, @@ -218,7 +218,7 @@ static int PanedWindowProxyCommand(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]); static void ComputeGeometry(PanedWindow *pwPtr); -static int ConfigureSlaves(PanedWindow *pwPtr, +static int ConfigurePanes(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]); static void DestroyOptionTables(ClientData clientData, @@ -233,7 +233,7 @@ static void RestoreSticky(ClientData clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr); static void AdjustForSticky(int sticky, int cavityWidth, int cavityHeight, int *xPtr, int *yPtr, - int *slaveWidthPtr, int *slaveHeightPtr); + int *paneWidthPtr, int *paneHeightPtr); static void MoveSash(PanedWindow *pwPtr, int sash, int diff); static int ObjectIsEmpty(Tcl_Obj *objPtr); static char * ComputeSlotAddress(char *recordPtr, int offset); @@ -241,16 +241,16 @@ static int PanedWindowIdentifyCoords(PanedWindow *pwPtr, Tcl_Interp *interp, int x, int y); /* - * Sashes are between panes only, so there is one less sash than slaves + * Sashes are between panes only, so there is one less sash than panes */ #define ValidSashIndex(pwPtr, sash) \ - (((sash) >= 0) && ((sash) < ((pwPtr)->numSlaves-1))) + (((sash) >= 0) && ((sash) < ((pwPtr)->numPanes-1))) static const Tk_GeomMgr panedWindowMgrType = { "panedwindow", /* name */ PanedWindowReqProc, /* requestProc */ - PanedWindowLostSlaveProc, /* lostSlaveProc */ + PanedWindowLostPaneProc, /* lostPaneProc */ }; /* @@ -261,7 +261,7 @@ static const Tk_GeomMgr panedWindowMgrType = { /* * The following structure contains pointers to functions used for processing - * the custom "-sticky" option for slave windows. + * the custom "-sticky" option for panes. */ static const Tk_ObjCustomOption stickyOption = { @@ -334,33 +334,33 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; -static const Tk_OptionSpec slaveOptionSpecs[] = { +static const Tk_OptionSpec paneOptionSpecs[] = { {TK_OPTION_WINDOW, "-after", NULL, NULL, - DEF_PANEDWINDOW_PANE_AFTER, -1, Tk_Offset(Slave, after), + DEF_PANEDWINDOW_PANE_AFTER, -1, Tk_Offset(Pane, after), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-before", NULL, NULL, - DEF_PANEDWINDOW_PANE_BEFORE, -1, Tk_Offset(Slave, before), + DEF_PANEDWINDOW_PANE_BEFORE, -1, Tk_Offset(Pane, before), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, - DEF_PANEDWINDOW_PANE_HEIGHT, Tk_Offset(Slave, heightPtr), - Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_HEIGHT, Tk_Offset(Pane, heightPtr), + Tk_Offset(Pane, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", - DEF_PANEDWINDOW_PANE_HIDE, -1, Tk_Offset(Slave, hide), 0,0,GEOMETRY}, + DEF_PANEDWINDOW_PANE_HIDE, -1, Tk_Offset(Pane, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, - DEF_PANEDWINDOW_PANE_MINSIZE, -1, Tk_Offset(Slave, minSize), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_MINSIZE, -1, Tk_Offset(Pane, minSize), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADX, -1, Tk_Offset(Slave, padx), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADX, -1, Tk_Offset(Pane, padx), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Slave, pady), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Pane, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, - DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Slave, sticky), 0, + DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Pane, sticky), 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", - DEF_PANEDWINDOW_PANE_STRETCH, -1, Tk_Offset(Slave, stretch), 0, + DEF_PANEDWINDOW_PANE_STRETCH, -1, Tk_Offset(Pane, stretch), 0, (ClientData) stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, - DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Slave, widthPtr), - Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Pane, widthPtr), + Tk_Offset(Pane, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -428,7 +428,7 @@ Tk_PanedWindowObjCmd( */ pwOpts->pwOptions = Tk_CreateOptionTable(interp, optionSpecs); - pwOpts->slaveOpts = Tk_CreateOptionTable(interp, slaveOptionSpecs); + pwOpts->paneOpts = Tk_CreateOptionTable(interp, paneOptionSpecs); } Tk_SetClass(tkwin, "Panedwindow"); @@ -446,7 +446,7 @@ Tk_PanedWindowObjCmd( Tk_PathName(pwPtr->tkwin), PanedWindowWidgetObjCmd, pwPtr, PanedWindowCmdDeletedProc); pwPtr->optionTable = pwOpts->pwOptions; - pwPtr->slaveOpts = pwOpts->slaveOpts; + pwPtr->paneOpts = pwOpts->paneOpts; pwPtr->relief = TK_RELIEF_RAISED; pwPtr->gc = NULL; pwPtr->cursor = NULL; @@ -471,7 +471,7 @@ Tk_PanedWindowObjCmd( /* * Find the toplevel ancestor of the panedwindow, and make a proxy win as * a child of that window; this way the proxy can always float above - * slaves in the panedwindow. + * panes in the panedwindow. */ parent = Tk_Parent(pwPtr->tkwin); @@ -548,7 +548,7 @@ PanedWindowWidgetObjCmd( Tcl_Obj *resultObj; int index, count, i, x, y; Tk_Window tkwin; - Slave *slavePtr; + Pane *panePtr; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg...?"); @@ -569,7 +569,7 @@ PanedWindowWidgetObjCmd( result = TCL_ERROR; break; } - result = ConfigureSlaves(pwPtr, interp, objc, objv); + result = ConfigurePanes(pwPtr, interp, objc, objv); break; case PW_CGET: @@ -616,21 +616,21 @@ PanedWindowWidgetObjCmd( * Clean up each window named in the arg list. */ for (count = 0, i = 2; i < objc; i++) { - Tk_Window slave = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), + Tk_Window pane = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), pwPtr->tkwin); - if (slave == NULL) { + if (pane == NULL) { continue; } - slavePtr = GetPane(pwPtr, slave); - if ((slavePtr != NULL) && (slavePtr->masterPtr != NULL)) { + panePtr = GetPane(pwPtr, pane); + if ((panePtr != NULL) && (panePtr->containerPtr != NULL)) { count++; - Tk_ManageGeometry(slave, NULL, NULL); - Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin); - Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask, - SlaveStructureProc, slavePtr); - Tk_UnmapWindow(slavePtr->tkwin); - Unlink(slavePtr); + Tk_ManageGeometry(pane, NULL, NULL); + Tk_UnmaintainGeometry(panePtr->tkwin, pwPtr->tkwin); + Tk_DeleteEventHandler(panePtr->tkwin, StructureNotifyMask, + PaneStructureProc, panePtr); + Tk_UnmapWindow(panePtr->tkwin); + Unlink(panePtr); } if (count != 0) { ComputeGeometry(pwPtr); @@ -666,15 +666,15 @@ PanedWindowWidgetObjCmd( break; } resultObj = NULL; - for (i = 0; i < pwPtr->numSlaves; i++) { - if (pwPtr->slaves[i]->tkwin == tkwin) { + for (i = 0; i < pwPtr->numPanes; i++) { + if (pwPtr->panes[i]->tkwin == tkwin) { resultObj = Tk_GetOptionValue(interp, - (char *) pwPtr->slaves[i], pwPtr->slaveOpts, + (char *) pwPtr->panes[i], pwPtr->paneOpts, objv[3], tkwin); } } if (resultObj == NULL) { - if (i == pwPtr->numSlaves) { + if (i == pwPtr->numPanes) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not managed by this window", -1)); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", @@ -706,10 +706,10 @@ PanedWindowWidgetObjCmd( result = TCL_ERROR; break; } - for (i = 0; i < pwPtr->numSlaves; i++) { - if (pwPtr->slaves[i]->tkwin == tkwin) { + for (i = 0; i < pwPtr->numPanes; i++) { + if (pwPtr->panes[i]->tkwin == tkwin) { resultObj = Tk_GetOptionInfo(interp, - (char *) pwPtr->slaves[i], pwPtr->slaveOpts, + (char *) pwPtr->panes[i], pwPtr->paneOpts, (objc == 4) ? objv[3] : NULL, pwPtr->tkwin); if (resultObj == NULL) { @@ -721,15 +721,15 @@ PanedWindowWidgetObjCmd( } } } else { - result = ConfigureSlaves(pwPtr, interp, objc, objv); + result = ConfigurePanes(pwPtr, interp, objc, objv); } break; case PW_PANES: resultObj = Tcl_NewObj(); - for (i = 0; i < pwPtr->numSlaves; i++) { + for (i = 0; i < pwPtr->numPanes; i++) { Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj(pwPtr->slaves[i]->tkwin)); + TkNewWindowObj(pwPtr->panes[i]->tkwin)); } Tcl_SetObjResult(interp, resultObj); break; @@ -749,37 +749,37 @@ PanedWindowWidgetObjCmd( /* *---------------------------------------------------------------------- * - * ConfigureSlaves -- + * ConfigurePanes -- * - * Add or alter the configuration options of a slave in a paned window. + * Add or alter the configuration options of a pane in a paned window. * * Results: * Standard Tcl result. * * Side effects: - * Depends on options; may add a slave to the paned window, may alter the - * geometry management options of a slave. + * Depends on options; may add a pane to the paned window, may alter the + * geometry management options of a pane. * *---------------------------------------------------------------------- */ static int -ConfigureSlaves( +ConfigurePanes( PanedWindow *pwPtr, /* Information about paned window. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, firstOptionArg, j, found, doubleBw, index, numNewSlaves, haveLoc; + int i, firstOptionArg, j, found, doubleBw, index, numNewPanes, haveLoc; int insertIndex; Tk_Window tkwin = NULL, ancestor, parent; - Slave *slavePtr, **inserts, **newSlaves; - Slave options; + Pane *panePtr, **inserts, **newPanes; + Pane options; const char *arg; /* * Find the non-window name arguments; these are the configure options for - * the slaves. Also validate that the window names given are legitimate + * the panes. Also validate that the window names given are legitimate * (ie, they are real windows, they are not the panedwindow itself, etc.). */ @@ -817,8 +817,8 @@ ConfigureSlaves( return TCL_ERROR; } else { /* - * Make sure the panedwindow is the parent of the slave, - * or a descendant of the slave's parent. + * Make sure the panedwindow is the parent of the pane, + * or a descendant of the pane's parent. */ parent = Tk_Parent(tkwin); @@ -847,8 +847,8 @@ ConfigureSlaves( * extra testing in the for loop below. */ - memset((void *)&options, 0, sizeof(Slave)); - if (Tk_SetOptions(interp, (char *) &options, pwPtr->slaveOpts, + memset((void *)&options, 0, sizeof(Pane)); + if (Tk_SetOptions(interp, (char *) &options, pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, pwPtr->tkwin, NULL, NULL) != TCL_OK) { return TCL_ERROR; @@ -865,8 +865,8 @@ ConfigureSlaves( if (options.after != NULL) { tkwin = options.after; haveLoc = 1; - for (i = 0; i < pwPtr->numSlaves; i++) { - if (options.after == pwPtr->slaves[i]->tkwin) { + for (i = 0; i < pwPtr->numPanes; i++) { + if (options.after == pwPtr->panes[i]->tkwin) { index = i + 1; break; } @@ -874,8 +874,8 @@ ConfigureSlaves( } else if (options.before != NULL) { tkwin = options.before; haveLoc = 1; - for (i = 0; i < pwPtr->numSlaves; i++) { - if (options.before == pwPtr->slaves[i]->tkwin) { + for (i = 0; i < pwPtr->numPanes; i++) { + if (options.before == pwPtr->panes[i]->tkwin) { index = i; break; } @@ -892,28 +892,28 @@ ConfigureSlaves( "window \"%s\" is not managed by %s", Tk_PathName(tkwin), Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", NULL); - Tk_FreeConfigOptions((char *) &options, pwPtr->slaveOpts, + Tk_FreeConfigOptions((char *) &options, pwPtr->paneOpts, pwPtr->tkwin); return TCL_ERROR; } /* - * Allocate an array to hold, in order, the pointers to the slave + * Allocate an array to hold, in order, the pointers to the pane * structures corresponding to the windows specified. Some of those * structures may already have existed, some may be new. */ - inserts = ckalloc(sizeof(Slave *) * (firstOptionArg - 2)); + inserts = ckalloc(sizeof(Pane *) * (firstOptionArg - 2)); insertIndex = 0; /* - * Populate the inserts array, creating new slave structures as necessary, + * Populate the inserts array, creating new pane structures as necessary, * applying the options to each structure as we go, and, if necessary, - * marking the spot in the original slaves array as empty (for - * pre-existing slave structures). + * marking the spot in the original panes array as empty (for + * pre-existing pane structures). */ - for (i = 0, numNewSlaves = 0; i < firstOptionArg - 2; i++) { + for (i = 0, numNewPanes = 0; i < firstOptionArg - 2; i++) { /* * We don't check that tkwin is NULL here, because the pre-pass above * guarantees that the input at this stage is good. @@ -923,24 +923,24 @@ ConfigureSlaves( pwPtr->tkwin); found = 0; - for (j = 0; j < pwPtr->numSlaves; j++) { - if (pwPtr->slaves[j] != NULL && pwPtr->slaves[j]->tkwin == tkwin) { - Tk_SetOptions(interp, (char *) pwPtr->slaves[j], - pwPtr->slaveOpts, objc - firstOptionArg, + for (j = 0; j < pwPtr->numPanes; j++) { + if (pwPtr->panes[j] != NULL && pwPtr->panes[j]->tkwin == tkwin) { + Tk_SetOptions(interp, (char *) pwPtr->panes[j], + pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, pwPtr->tkwin, NULL, NULL); - if (pwPtr->slaves[j]->minSize < 0) { - pwPtr->slaves[j]->minSize = 0; + if (pwPtr->panes[j]->minSize < 0) { + pwPtr->panes[j]->minSize = 0; } found = 1; /* - * If the slave is supposed to move, add it to the inserts + * If the pane is supposed to move, add it to the inserts * array now; otherwise, leave it where it is. */ if (index != -1) { - inserts[insertIndex++] = pwPtr->slaves[j]; - pwPtr->slaves[j] = NULL; + inserts[insertIndex++] = pwPtr->panes[j]; + pwPtr->panes[j] = NULL; } break; } @@ -951,7 +951,7 @@ ConfigureSlaves( } /* - * Make sure this slave wasn't already put into the inserts array, + * Make sure this pane wasn't already put into the inserts array, * i.e., when the user specifies the same window multiple times in a * single add commaned. */ @@ -966,104 +966,104 @@ ConfigureSlaves( } /* - * Create a new slave structure and initialize it. All slaves start + * Create a new pane structure and initialize it. All panes start * out with their "natural" dimensions. */ - slavePtr = ckalloc(sizeof(Slave)); - memset(slavePtr, 0, sizeof(Slave)); - Tk_InitOptions(interp, (char *)slavePtr, pwPtr->slaveOpts, + panePtr = ckalloc(sizeof(Pane)); + memset(panePtr, 0, sizeof(Pane)); + Tk_InitOptions(interp, (char *)panePtr, pwPtr->paneOpts, pwPtr->tkwin); - Tk_SetOptions(interp, (char *)slavePtr, pwPtr->slaveOpts, + Tk_SetOptions(interp, (char *)panePtr, pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, pwPtr->tkwin, NULL, NULL); - slavePtr->tkwin = tkwin; - slavePtr->masterPtr = pwPtr; - doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width; - if (slavePtr->width > 0) { - slavePtr->paneWidth = slavePtr->width; + panePtr->tkwin = tkwin; + panePtr->containerPtr = pwPtr; + doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; + if (panePtr->width > 0) { + panePtr->paneWidth = panePtr->width; } else { - slavePtr->paneWidth = Tk_ReqWidth(tkwin) + doubleBw; + panePtr->paneWidth = Tk_ReqWidth(tkwin) + doubleBw; } - if (slavePtr->height > 0) { - slavePtr->paneHeight = slavePtr->height; + if (panePtr->height > 0) { + panePtr->paneHeight = panePtr->height; } else { - slavePtr->paneHeight = Tk_ReqHeight(tkwin) + doubleBw; + panePtr->paneHeight = Tk_ReqHeight(tkwin) + doubleBw; } - if (slavePtr->minSize < 0) { - slavePtr->minSize = 0; + if (panePtr->minSize < 0) { + panePtr->minSize = 0; } /* - * Set up the geometry management callbacks for this slave. + * Set up the geometry management callbacks for this pane. */ - Tk_CreateEventHandler(slavePtr->tkwin, StructureNotifyMask, - SlaveStructureProc, slavePtr); - Tk_ManageGeometry(slavePtr->tkwin, &panedWindowMgrType, slavePtr); - inserts[insertIndex++] = slavePtr; - numNewSlaves++; + Tk_CreateEventHandler(panePtr->tkwin, StructureNotifyMask, + PaneStructureProc, panePtr); + Tk_ManageGeometry(panePtr->tkwin, &panedWindowMgrType, panePtr); + inserts[insertIndex++] = panePtr; + numNewPanes++; } /* - * Allocate the new slaves array, then copy the slaves into it, in order. + * Allocate the new panes array, then copy the panes into it, in order. */ - i = sizeof(Slave *) * (pwPtr->numSlaves + numNewSlaves); - newSlaves = ckalloc(i); - memset(newSlaves, 0, (size_t) i); + i = sizeof(Pane *) * (pwPtr->numPanes + numNewPanes); + newPanes = ckalloc(i); + memset(newPanes, 0, (size_t) i); if (index == -1) { /* - * If none of the existing slaves have to be moved, just copy the old + * If none of the existing panes have to be moved, just copy the old * and append the new. */ - memcpy((void *)&(newSlaves[0]), pwPtr->slaves, - sizeof(Slave *) * pwPtr->numSlaves); - memcpy((void *)&(newSlaves[pwPtr->numSlaves]), inserts, - sizeof(Slave *) * numNewSlaves); + memcpy((void *)&(newPanes[0]), pwPtr->panes, + sizeof(Pane *) * pwPtr->numPanes); + memcpy((void *)&(newPanes[pwPtr->numPanes]), inserts, + sizeof(Pane *) * numNewPanes); } else { /* - * If some of the existing slaves were moved, the old slaves array + * If some of the existing panes were moved, the old panes array * will be partially populated, with some valid and some invalid - * entries. Walk through it, copying valid entries to the new slaves + * entries. Walk through it, copying valid entries to the new panes * array as we go; when we get to the insert location for the new - * slaves, copy the inserts array over, then finish off the old slaves + * panes, copy the inserts array over, then finish off the old panes * array. */ for (i = 0, j = 0; i < index; i++) { - if (pwPtr->slaves[i] != NULL) { - newSlaves[j] = pwPtr->slaves[i]; + if (pwPtr->panes[i] != NULL) { + newPanes[j] = pwPtr->panes[i]; j++; } } - memcpy((void *)&(newSlaves[j]), inserts, sizeof(Slave *)*insertIndex); + memcpy((void *)&(newPanes[j]), inserts, sizeof(Pane *)*insertIndex); j += firstOptionArg - 2; - for (i = index; i < pwPtr->numSlaves; i++) { - if (pwPtr->slaves[i] != NULL) { - newSlaves[j] = pwPtr->slaves[i]; + for (i = index; i < pwPtr->numPanes; i++) { + if (pwPtr->panes[i] != NULL) { + newPanes[j] = pwPtr->panes[i]; j++; } } } /* - * Make the new slaves array the paned window's slave array, and clean up. + * Make the new panes array the paned window's pane array, and clean up. */ - ckfree(pwPtr->slaves); + ckfree(pwPtr->panes); ckfree(inserts); - pwPtr->slaves = newSlaves; + pwPtr->panes = newPanes; /* - * Set the paned window's slave count to the new value. + * Set the paned window's pane count to the new value. */ - pwPtr->numSlaves += numNewSlaves; + pwPtr->numPanes += numNewPanes; - Tk_FreeConfigOptions((char *) &options, pwPtr->slaveOpts, pwPtr->tkwin); + Tk_FreeConfigOptions((char *) &options, pwPtr->paneOpts, pwPtr->tkwin); ComputeGeometry(pwPtr); return TCL_OK; @@ -1101,7 +1101,7 @@ PanedWindowSashCommand( }; int index, sash, x, y, diff; Tcl_Obj *coords[2]; - Slave *slavePtr; + Pane *panePtr; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); @@ -1130,10 +1130,10 @@ PanedWindowSashCommand( Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); return TCL_ERROR; } - slavePtr = pwPtr->slaves[sash]; + panePtr = pwPtr->panes[sash]; - coords[0] = Tcl_NewIntObj(slavePtr->sashx); - coords[1] = Tcl_NewIntObj(slavePtr->sashy); + coords[0] = Tcl_NewIntObj(panePtr->sashx); + coords[1] = Tcl_NewIntObj(panePtr->sashy); Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords)); break; @@ -1163,11 +1163,11 @@ PanedWindowSashCommand( return TCL_ERROR; } - pwPtr->slaves[sash]->markx = x; - pwPtr->slaves[sash]->marky = y; + pwPtr->panes[sash]->markx = x; + pwPtr->panes[sash]->marky = y; } else { - coords[0] = Tcl_NewIntObj(pwPtr->slaves[sash]->markx); - coords[1] = Tcl_NewIntObj(pwPtr->slaves[sash]->marky); + coords[0] = Tcl_NewIntObj(pwPtr->panes[sash]->markx); + coords[1] = Tcl_NewIntObj(pwPtr->panes[sash]->marky); Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords)); } break; @@ -1198,18 +1198,18 @@ PanedWindowSashCommand( return TCL_ERROR; } - slavePtr = pwPtr->slaves[sash]; + panePtr = pwPtr->panes[sash]; if (pwPtr->orient == ORIENT_HORIZONTAL) { if (index == SASH_PLACE) { - diff = x - pwPtr->slaves[sash]->sashx; + diff = x - pwPtr->panes[sash]->sashx; } else { - diff = x - pwPtr->slaves[sash]->markx; + diff = x - pwPtr->panes[sash]->markx; } } else { if (index == SASH_PLACE) { - diff = y - pwPtr->slaves[sash]->sashy; + diff = y - pwPtr->panes[sash]->sashy; } else { - diff = y - pwPtr->slaves[sash]->marky; + diff = y - pwPtr->panes[sash]->marky; } } @@ -1369,15 +1369,15 @@ PanedWindowEventProc( } else if (eventPtr->type == DestroyNotify) { DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { - for (i = 0; i < pwPtr->numSlaves; i++) { - if (!pwPtr->slaves[i]->hide) { - Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); + for (i = 0; i < pwPtr->numPanes; i++) { + if (!pwPtr->panes[i]->hide) { + Tk_UnmapWindow(pwPtr->panes[i]->tkwin); } } } else if (eventPtr->type == MapNotify) { - for (i = 0; i < pwPtr->numSlaves; i++) { - if (!pwPtr->slaves[i]->hide) { - Tk_MapWindow(pwPtr->slaves[i]->tkwin); + for (i = 0; i < pwPtr->numPanes; i++) { + if (!pwPtr->panes[i]->hide) { + Tk_MapWindow(pwPtr->panes[i]->tkwin); } } } @@ -1443,7 +1443,7 @@ DisplayPanedWindow( ClientData clientData) /* Information about window. */ { PanedWindow *pwPtr = clientData; - Slave *slavePtr; + Pane *panePtr; Pixmap pixmap; Tk_Window tkwin = pwPtr->tkwin; int i, sashWidth, sashHeight; @@ -1496,19 +1496,19 @@ DisplayPanedWindow( */ GetFirstLastVisiblePane(pwPtr, &first, &last); - for (i = 0; i < pwPtr->numSlaves - 1; i++) { - slavePtr = pwPtr->slaves[i]; - if (slavePtr->hide || i == last) { + for (i = 0; i < pwPtr->numPanes - 1; i++) { + panePtr = pwPtr->panes[i]; + if (panePtr->hide || i == last) { continue; } if (sashWidth > 0 && sashHeight > 0) { Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, - slavePtr->sashx, slavePtr->sashy, sashWidth, sashHeight, + panePtr->sashx, panePtr->sashy, sashWidth, sashHeight, 1, pwPtr->sashRelief); } if (pwPtr->showHandle) { Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, - slavePtr->handlex, slavePtr->handley, + panePtr->handlex, panePtr->handley, pwPtr->handleSize, pwPtr->handleSize, 1, TK_RELIEF_RAISED); } @@ -1569,23 +1569,23 @@ DestroyPanedWindow( } /* - * Clean up the slave list; foreach slave: - * o Cancel the slave's structure notification callback - * o Cancel geometry management for the slave. - * o Free memory for the slave + * Clean up the pane list; foreach pane: + * o Cancel the pane's structure notification callback + * o Cancel geometry management for the pane. + * o Free memory for the pane */ - for (i = 0; i < pwPtr->numSlaves; i++) { - Tk_DeleteEventHandler(pwPtr->slaves[i]->tkwin, StructureNotifyMask, - SlaveStructureProc, pwPtr->slaves[i]); - Tk_ManageGeometry(pwPtr->slaves[i]->tkwin, NULL, NULL); - Tk_FreeConfigOptions((char *) pwPtr->slaves[i], pwPtr->slaveOpts, + for (i = 0; i < pwPtr->numPanes; i++) { + Tk_DeleteEventHandler(pwPtr->panes[i]->tkwin, StructureNotifyMask, + PaneStructureProc, pwPtr->panes[i]); + Tk_ManageGeometry(pwPtr->panes[i]->tkwin, NULL, NULL); + Tk_FreeConfigOptions((char *) pwPtr->panes[i], pwPtr->paneOpts, pwPtr->tkwin); - ckfree(pwPtr->slaves[i]); - pwPtr->slaves[i] = NULL; + ckfree(pwPtr->panes[i]); + pwPtr->panes[i] = NULL; } - if (pwPtr->slaves) { - ckfree(pwPtr->slaves); + if (pwPtr->panes) { + ckfree(pwPtr->panes); } /* @@ -1630,8 +1630,8 @@ PanedWindowReqProc( Tk_Window tkwin) /* Other Tk-related information about the * window. */ { - Slave *slavePtr = clientData; - PanedWindow *pwPtr = (PanedWindow *) slavePtr->masterPtr; + Pane *panePtr = clientData; + PanedWindow *pwPtr = (PanedWindow *) panePtr->containerPtr; if (Tk_IsMapped(pwPtr->tkwin)) { if (!(pwPtr->flags & RESIZE_PENDING)) { @@ -1639,13 +1639,13 @@ PanedWindowReqProc( Tcl_DoWhenIdle(ArrangePanes, pwPtr); } } else { - int doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width; + int doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; - if (slavePtr->width <= 0) { - slavePtr->paneWidth = Tk_ReqWidth(slavePtr->tkwin) + doubleBw; + if (panePtr->width <= 0) { + panePtr->paneWidth = Tk_ReqWidth(panePtr->tkwin) + doubleBw; } - if (slavePtr->height <= 0) { - slavePtr->paneHeight = Tk_ReqHeight(slavePtr->tkwin) + doubleBw; + if (panePtr->height <= 0) { + panePtr->paneHeight = Tk_ReqHeight(panePtr->tkwin) + doubleBw; } ComputeGeometry(pwPtr); } @@ -1654,39 +1654,39 @@ PanedWindowReqProc( /* *-------------------------------------------------------------- * - * PanedWindowLostSlaveProc -- + * PanedWindowLostPaneProc -- * * This function is invoked by Tk whenever some other geometry claims - * control over a slave that used to be managed by us. + * control over a pane that used to be managed by us. * * Results: * None. * * Side effects: - * Forgets all information about the slave. Causes geometry to be + * Forgets all information about the pane. Causes geometry to be * recomputed for the panedwindow. * *-------------------------------------------------------------- */ static void -PanedWindowLostSlaveProc( - ClientData clientData, /* Grid structure for slave window that was +PanedWindowLostPaneProc( + ClientData clientData, /* Grid structure for the pane that was * stolen away. */ - Tk_Window tkwin) /* Tk's handle for the slave window. */ + Tk_Window tkwin) /* Tk's handle for the pane. */ { - register Slave *slavePtr = clientData; - PanedWindow *pwPtr = (PanedWindow *) slavePtr->masterPtr; - - if (pwPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { - Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin); - } - Unlink(slavePtr); - Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask, - SlaveStructureProc, slavePtr); - Tk_UnmapWindow(slavePtr->tkwin); - slavePtr->tkwin = NULL; - ckfree(slavePtr); + register Pane *panePtr = clientData; + PanedWindow *pwPtr = (PanedWindow *) panePtr->containerPtr; + + if (pwPtr->tkwin != Tk_Parent(panePtr->tkwin)) { + Tk_UnmaintainGeometry(panePtr->tkwin, pwPtr->tkwin); + } + Unlink(panePtr); + Tk_DeleteEventHandler(panePtr->tkwin, StructureNotifyMask, + PaneStructureProc, panePtr); + Tk_UnmapWindow(panePtr->tkwin); + panePtr->tkwin = NULL; + ckfree(panePtr); ComputeGeometry(pwPtr); } @@ -1704,19 +1704,19 @@ PanedWindowLostSlaveProc( * None. * * Side effects: - * The slaves of masterPtr may get resized or moved. + * The panes of containerPtr may get resized or moved. * *-------------------------------------------------------------- */ static void ArrangePanes( - ClientData clientData) /* Structure describing parent whose slaves + ClientData clientData) /* Structure describing parent whose panes * are to be re-layed out. */ { register PanedWindow *pwPtr = clientData; - register Slave *slavePtr; - int i, slaveWidth, slaveHeight, slaveX, slaveY; + register Pane *panePtr; + int i, newPaneWidth, newPaneHeight, paneX, paneY; int paneWidth, paneHeight, paneSize, paneMinSize; int doubleBw; int x, y; @@ -1731,13 +1731,13 @@ ArrangePanes( pwPtr->flags &= ~(REQUESTED_RELAYOUT|RESIZE_PENDING); /* - * If the parent has no slaves anymore, then don't do anything at all: + * If the parent has no panes anymore, then don't do anything at all: * just leave the parent's size as-is. Otherwise there is no way to * "relinquish" control over the parent so another geometry manager can * take over. */ - if (pwPtr->numSlaves == 0) { + if (pwPtr->numPanes == 0) { return; } @@ -1776,37 +1776,37 @@ ArrangePanes( + pwPtr->sashPad; } - for (i = sashCount = 0; i < pwPtr->numSlaves; i++) { - slavePtr = pwPtr->slaves[i]; + for (i = sashCount = 0; i < pwPtr->numPanes; i++) { + panePtr = pwPtr->panes[i]; - if (slavePtr->hide) { + if (panePtr->hide) { continue; } /* - * Compute the total size needed by all the slaves and the left-over, + * Compute the total size needed by all the panes and the left-over, * or shortage of space available. */ if (horizontal) { - if (slavePtr->width > 0) { - paneSize = slavePtr->width; + if (panePtr->width > 0) { + paneSize = panePtr->width; } else { - paneSize = slavePtr->paneWidth; + paneSize = panePtr->paneWidth; } - stretchReserve -= paneSize + (2 * slavePtr->padx); + stretchReserve -= paneSize + (2 * panePtr->padx); } else { - if (slavePtr->height > 0) { - paneSize = slavePtr->height; + if (panePtr->height > 0) { + paneSize = panePtr->height; } else { - paneSize = slavePtr->paneHeight; + paneSize = panePtr->paneHeight; } - stretchReserve -= paneSize + (2 * slavePtr->pady); + stretchReserve -= paneSize + (2 * panePtr->pady); } - if (IsStretchable(slavePtr->stretch,i,first,last) + if (IsStretchable(panePtr->stretch,i,first,last) && Tk_IsMapped(pwPtr->tkwin)) { paneDynSize += paneSize; - paneDynMinSize += slavePtr->minSize; + paneDynMinSize += panePtr->minSize; } if (i != last) { stretchReserve -= sashWidth; @@ -1818,53 +1818,53 @@ ArrangePanes( * Second pass; adjust/arrange panes. */ - for (i = 0; i < pwPtr->numSlaves; i++) { - slavePtr = pwPtr->slaves[i]; + for (i = 0; i < pwPtr->numPanes; i++) { + panePtr = pwPtr->panes[i]; - if (slavePtr->hide) { - Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin); - Tk_UnmapWindow(slavePtr->tkwin); + if (panePtr->hide) { + Tk_UnmaintainGeometry(panePtr->tkwin, pwPtr->tkwin); + Tk_UnmapWindow(panePtr->tkwin); continue; } /* - * Compute the size of this slave. The algorithm (assuming a + * Compute the size of this pane. The algorithm (assuming a * horizontal paned window) is: * * 1. Get "base" dimensions. If a width or height is specified for - * this slave, use those values; else use the ReqWidth/ReqHeight. + * this pane, use those values; else use the ReqWidth/ReqHeight. * 2. Using base dimensions, pane dimensions, and sticky values, * determine the x and y, and actual width and height of the * widget. */ - doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width; - slaveWidth = (slavePtr->width > 0 ? slavePtr->width : - Tk_ReqWidth(slavePtr->tkwin) + doubleBw); - slaveHeight = (slavePtr->height > 0 ? slavePtr->height : - Tk_ReqHeight(slavePtr->tkwin) + doubleBw); - paneMinSize = slavePtr->minSize; + doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; + newPaneWidth = (panePtr->width > 0 ? panePtr->width : + Tk_ReqWidth(panePtr->tkwin) + doubleBw); + newPaneHeight = (panePtr->height > 0 ? panePtr->height : + Tk_ReqHeight(panePtr->tkwin) + doubleBw); + paneMinSize = panePtr->minSize; /* * Calculate pane width and height. */ if (horizontal) { - if (slavePtr->width > 0) { - paneSize = slavePtr->width; + if (panePtr->width > 0) { + paneSize = panePtr->width; } else { - paneSize = slavePtr->paneWidth; + paneSize = panePtr->paneWidth; } pwSize = pwWidth; } else { - if (slavePtr->height > 0) { - paneSize = slavePtr->height; + if (panePtr->height > 0) { + paneSize = panePtr->height; } else { - paneSize = slavePtr->paneHeight; + paneSize = panePtr->paneHeight; } pwSize = pwHeight; } - if (IsStretchable(slavePtr->stretch, i, first, last)) { + if (IsStretchable(panePtr->stretch, i, first, last)) { double frac; if (paneDynSize > 0) { @@ -1874,7 +1874,7 @@ ArrangePanes( } paneDynSize -= paneSize; - paneDynMinSize -= slavePtr->minSize; + paneDynMinSize -= panePtr->minSize; stretchAmount = (int) (frac * stretchReserve); if (paneSize + stretchAmount >= paneMinSize) { stretchReserve -= stretchAmount; @@ -1899,9 +1899,9 @@ ArrangePanes( } if (horizontal) { paneWidth = paneSize; - paneHeight = pwHeight - (2 * slavePtr->pady); + paneHeight = pwHeight - (2 * panePtr->pady); } else { - paneWidth = pwWidth - (2 * slavePtr->padx); + paneWidth = pwWidth - (2 * panePtr->padx); paneHeight = paneSize; } @@ -1929,15 +1929,15 @@ ArrangePanes( paneHeight = pwHeight - syReserve - y + internalBW; } - if (slaveWidth > paneWidth) { - slaveWidth = paneWidth; + if (newPaneWidth > paneWidth) { + newPaneWidth = paneWidth; } - if (slaveHeight > paneHeight) { - slaveHeight = paneHeight; + if (newPaneHeight > paneHeight) { + newPaneHeight = paneHeight; } - slavePtr->x = x; - slavePtr->y = y; + panePtr->x = x; + panePtr->y = y; /* * Compute the location of the sash at the right or bottom of the @@ -1945,51 +1945,51 @@ ArrangePanes( */ if (horizontal) { - x += paneWidth + (2 * slavePtr->padx); + x += paneWidth + (2 * panePtr->padx); if (x < internalBW) { x = internalBW; } - slavePtr->sashx = x + sashOffset; - slavePtr->sashy = y; - slavePtr->handlex = x + handleOffset; - slavePtr->handley = y + pwPtr->handlePad; + panePtr->sashx = x + sashOffset; + panePtr->sashy = y; + panePtr->handlex = x + handleOffset; + panePtr->handley = y + pwPtr->handlePad; x += sashWidth; } else { - y += paneHeight + (2 * slavePtr->pady); + y += paneHeight + (2 * panePtr->pady); if (y < internalBW) { y = internalBW; } - slavePtr->sashx = x; - slavePtr->sashy = y + sashOffset; - slavePtr->handlex = x + pwPtr->handlePad; - slavePtr->handley = y + handleOffset; + panePtr->sashx = x; + panePtr->sashy = y + sashOffset; + panePtr->handlex = x + pwPtr->handlePad; + panePtr->handley = y + handleOffset; y += sashWidth; } /* - * Compute the actual dimensions of the slave in the pane. + * Compute the actual dimensions of the pane in the pane. */ - slaveX = slavePtr->x; - slaveY = slavePtr->y; - AdjustForSticky(slavePtr->sticky, paneWidth, paneHeight, - &slaveX, &slaveY, &slaveWidth, &slaveHeight); + paneX = panePtr->x; + paneY = panePtr->y; + AdjustForSticky(panePtr->sticky, paneWidth, paneHeight, + &paneX, &paneY, &newPaneWidth, &newPaneHeight); - slaveX += slavePtr->padx; - slaveY += slavePtr->pady; + paneX += panePtr->padx; + paneY += panePtr->pady; /* * Now put the window in the proper spot. */ - if (slaveWidth <= 0 || slaveHeight <= 0 || - (horizontal ? slaveX - internalBW > pwWidth : - slaveY - internalBW > pwHeight)) { - Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin); - Tk_UnmapWindow(slavePtr->tkwin); + if (newPaneWidth <= 0 || newPaneHeight <= 0 || + (horizontal ? paneX - internalBW > pwWidth : + paneY - internalBW > pwHeight)) { + Tk_UnmaintainGeometry(panePtr->tkwin, pwPtr->tkwin); + Tk_UnmapWindow(panePtr->tkwin); } else { - Tk_MaintainGeometry(slavePtr->tkwin, pwPtr->tkwin, - slaveX, slaveY, slaveWidth, slaveHeight); + Tk_MaintainGeometry(panePtr->tkwin, pwPtr->tkwin, + paneX, paneY, newPaneWidth, newPaneHeight); } sashCount--; } @@ -2001,7 +2001,7 @@ ArrangePanes( * * Unlink -- * - * Remove a slave from a paned window. + * Remove a pane from a paned window. * * Results: * None. @@ -2014,57 +2014,57 @@ ArrangePanes( static void Unlink( - register Slave *slavePtr) /* Window to unlink. */ + register Pane *panePtr) /* Window to unlink. */ { - register PanedWindow *masterPtr; + register PanedWindow *containerPtr; int i, j; - masterPtr = slavePtr->masterPtr; - if (masterPtr == NULL) { + containerPtr = panePtr->containerPtr; + if (containerPtr == NULL) { return; } /* - * Find the specified slave in the panedwindow's list of slaves, then + * Find the specified pane in the panedwindow's list of panes, then * remove it from that list. */ - for (i = 0; i < masterPtr->numSlaves; i++) { - if (masterPtr->slaves[i] == slavePtr) { - for (j = i; j < masterPtr->numSlaves - 1; j++) { - masterPtr->slaves[j] = masterPtr->slaves[j + 1]; + for (i = 0; i < containerPtr->numPanes; i++) { + if (containerPtr->panes[i] == panePtr) { + for (j = i; j < containerPtr->numPanes - 1; j++) { + containerPtr->panes[j] = containerPtr->panes[j + 1]; } break; } } /* - * Clean out any -after or -before references to this slave + * Clean out any -after or -before references to this pane */ - for (i = 0; i < masterPtr->numSlaves; i++) { - if (masterPtr->slaves[i]->before == slavePtr->tkwin) { - masterPtr->slaves[i]->before = NULL; + for (i = 0; i < containerPtr->numPanes; i++) { + if (containerPtr->panes[i]->before == panePtr->tkwin) { + containerPtr->panes[i]->before = NULL; } - if (masterPtr->slaves[i]->after == slavePtr->tkwin) { - masterPtr->slaves[i]->after = NULL; + if (containerPtr->panes[i]->after == panePtr->tkwin) { + containerPtr->panes[i]->after = NULL; } } - masterPtr->flags |= REQUESTED_RELAYOUT; - if (!(masterPtr->flags & REDRAW_PENDING)) { - masterPtr->flags |= REDRAW_PENDING; - Tcl_DoWhenIdle(DisplayPanedWindow, masterPtr); + containerPtr->flags |= REQUESTED_RELAYOUT; + if (!(containerPtr->flags & REDRAW_PENDING)) { + containerPtr->flags |= REDRAW_PENDING; + Tcl_DoWhenIdle(DisplayPanedWindow, containerPtr); } /* - * Set the slave's masterPtr to NULL, so that we can tell that the slave + * Set the pane's containerPtr to NULL, so that we can tell that the pane * is no longer attached to any panedwindow. */ - slavePtr->masterPtr = NULL; + panePtr->containerPtr = NULL; - masterPtr->numSlaves--; + containerPtr->numPanes--; } /* @@ -2076,7 +2076,7 @@ Unlink( * token in a given paned window. * * Results: - * Pointer to the slave structure, or NULL if the window is not managed + * Pointer to the pane structure, or NULL if the window is not managed * by this paned window. * * Side effects: @@ -2085,16 +2085,16 @@ Unlink( *---------------------------------------------------------------------- */ -static Slave * +static Pane * GetPane( PanedWindow *pwPtr, /* Pointer to the paned window info. */ Tk_Window tkwin) /* Window to search for. */ { int i; - for (i = 0; i < pwPtr->numSlaves; i++) { - if (pwPtr->slaves[i]->tkwin == tkwin) { - return pwPtr->slaves[i]; + for (i = 0; i < pwPtr->numPanes; i++) { + if (pwPtr->panes[i]->tkwin == tkwin) { + return pwPtr->panes[i]; } } return NULL; @@ -2125,8 +2125,8 @@ GetFirstLastVisiblePane( { int i; - for (i = 0, *lastPtr = 0, *firstPtr = -1; i < pwPtr->numSlaves; i++) { - if (pwPtr->slaves[i]->hide == 0) { + for (i = 0, *lastPtr = 0, *firstPtr = -1; i < pwPtr->numPanes; i++) { + if (pwPtr->panes[i]->hide == 0) { if (*firstPtr < 0) { *firstPtr = i; } @@ -2138,7 +2138,7 @@ GetFirstLastVisiblePane( /* *-------------------------------------------------------------- * - * SlaveStructureProc -- + * PaneStructureProc -- * * This function is invoked whenever StructureNotify events occur for a * window that's managed by a paned window. This function's only purpose @@ -2148,25 +2148,25 @@ GetFirstLastVisiblePane( * None. * * Side effects: - * The paned window slave structure associated with the window - * is freed, and the slave is disassociated from the paned + * The paned window pane structure associated with the window + * is freed, and the pane is disassociated from the paned * window which managed it. * *-------------------------------------------------------------- */ static void -SlaveStructureProc( +PaneStructureProc( ClientData clientData, /* Pointer to record describing window item. */ XEvent *eventPtr) /* Describes what just happened. */ { - Slave *slavePtr = clientData; - PanedWindow *pwPtr = slavePtr->masterPtr; + Pane *panePtr = clientData; + PanedWindow *pwPtr = panePtr->containerPtr; if (eventPtr->type == DestroyNotify) { - Unlink(slavePtr); - slavePtr->tkwin = NULL; - ckfree(slavePtr); + Unlink(panePtr); + panePtr->tkwin = NULL; + ckfree(panePtr); ComputeGeometry(pwPtr); } } @@ -2177,7 +2177,7 @@ SlaveStructureProc( * ComputeGeometry -- * * Compute geometry for the paned window, including coordinates of all - * slave windows and each sash. + * panes and each sash. * * Results: * None. @@ -2195,7 +2195,7 @@ ComputeGeometry( int i, x, y, doubleBw, internalBw; int sashWidth, sashOffset, handleOffset; int reqWidth, reqHeight, dim; - Slave *slavePtr; + Pane *panePtr; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); pwPtr->flags |= REQUESTED_RELAYOUT; @@ -2221,20 +2221,20 @@ ComputeGeometry( + pwPtr->sashPad; } - for (i = 0; i < pwPtr->numSlaves; i++) { - slavePtr = pwPtr->slaves[i]; + for (i = 0; i < pwPtr->numPanes; i++) { + panePtr = pwPtr->panes[i]; - if (slavePtr->hide) { + if (panePtr->hide) { continue; } /* - * First set the coordinates for the top left corner of the slave's + * First set the coordinates for the top left corner of the pane's * parcel. */ - slavePtr->x = x; - slavePtr->y = y; + panePtr->x = x; + panePtr->y = y; /* * Make sure the pane's paned dimension is at least minsize. This @@ -2243,12 +2243,12 @@ ComputeGeometry( */ if (horizontal) { - if (slavePtr->paneWidth < slavePtr->minSize) { - slavePtr->paneWidth = slavePtr->minSize; + if (panePtr->paneWidth < panePtr->minSize) { + panePtr->paneWidth = panePtr->minSize; } } else { - if (slavePtr->paneHeight < slavePtr->minSize) { - slavePtr->paneHeight = slavePtr->minSize; + if (panePtr->paneHeight < panePtr->minSize) { + panePtr->paneHeight = panePtr->minSize; } } @@ -2258,55 +2258,55 @@ ComputeGeometry( */ if (horizontal) { - x += slavePtr->paneWidth + (2 * slavePtr->padx); - slavePtr->sashx = x + sashOffset; - slavePtr->sashy = y; - slavePtr->handlex = x + handleOffset; - slavePtr->handley = y + pwPtr->handlePad; + x += panePtr->paneWidth + (2 * panePtr->padx); + panePtr->sashx = x + sashOffset; + panePtr->sashy = y; + panePtr->handlex = x + handleOffset; + panePtr->handley = y + pwPtr->handlePad; x += sashWidth; } else { - y += slavePtr->paneHeight + (2 * slavePtr->pady); - slavePtr->sashx = x; - slavePtr->sashy = y + sashOffset; - slavePtr->handlex = x + pwPtr->handlePad; - slavePtr->handley = y + handleOffset; + y += panePtr->paneHeight + (2 * panePtr->pady); + panePtr->sashx = x; + panePtr->sashy = y + sashOffset; + panePtr->handlex = x + pwPtr->handlePad; + panePtr->handley = y + handleOffset; y += sashWidth; } /* - * Find the maximum height/width of the slaves, for computing the + * Find the maximum height/width of the panes, for computing the * requested height/width of the paned window. */ if (horizontal) { /* - * If the slave has an explicit height set, use that; otherwise, - * use the slave's requested height. + * If the pane has an explicit height set, use that; otherwise, + * use the pane's requested height. */ - if (slavePtr->height > 0) { - dim = slavePtr->height; + if (panePtr->height > 0) { + dim = panePtr->height; } else { - doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width; - dim = Tk_ReqHeight(slavePtr->tkwin) + doubleBw; + doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; + dim = Tk_ReqHeight(panePtr->tkwin) + doubleBw; } - dim += 2 * slavePtr->pady; + dim += 2 * panePtr->pady; if (dim > reqHeight) { reqHeight = dim; } } else { /* - * If the slave has an explicit width set use that; otherwise, use - * the slave's requested width. + * If the pane has an explicit width set use that; otherwise, use + * the pane's requested width. */ - if (slavePtr->width > 0) { - dim = slavePtr->width; + if (panePtr->width > 0) { + dim = panePtr->width; } else { - doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width; - dim = Tk_ReqWidth(slavePtr->tkwin) + doubleBw; + doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; + dim = Tk_ReqWidth(panePtr->tkwin) + doubleBw; } - dim += 2 * slavePtr->padx; + dim += 2 * panePtr->padx; if (dim > reqWidth) { reqWidth = dim; } @@ -2324,7 +2324,7 @@ ComputeGeometry( * the paned window. * * The height (or width) is equal to the maximum height (or width) of the - * slaves, plus the width of the border of the top and bottom (or left and + * panes, plus the width of the border of the top and bottom (or left and * right) of the paned window. * * If the panedwindow has an explicit width/height set use that; @@ -2535,11 +2535,11 @@ RestoreSticky( * AdjustForSticky -- * * Given the x,y coords of the top-left corner of a pane, the dimensions - * of that pane, and the dimensions of a slave, compute the x,y coords - * and actual dimensions of the slave based on the slave's sticky value. + * of that pane, and the dimensions of a pane, compute the x,y coords + * and actual dimensions of the pane based on the pane's sticky value. * * Results: - * No direct return; sets the x, y, slaveWidth and slaveHeight to correct + * No direct return; sets the x, y, paneWidth and paneHeight to correct * values. * * Side effects: @@ -2556,26 +2556,26 @@ AdjustForSticky( int cavityHeight, /* Height of the cavity. */ int *xPtr, int *yPtr, /* Initially, coordinates of the top-left * corner of cavity; also return values for - * actual x, y coords of slave. */ - int *slaveWidthPtr, /* Slave width. */ - int *slaveHeightPtr) /* Slave height. */ + * actual x, y coords of pane. */ + int *paneWidthPtr, /* Pane width. */ + int *paneHeightPtr) /* Pane height. */ { - int diffx = 0; /* Cavity width - slave width. */ - int diffy = 0; /* Cavity hight - slave height. */ + int diffx = 0; /* Cavity width - pane width. */ + int diffy = 0; /* Cavity hight - pane height. */ - if (cavityWidth > *slaveWidthPtr) { - diffx = cavityWidth - *slaveWidthPtr; + if (cavityWidth > *paneWidthPtr) { + diffx = cavityWidth - *paneWidthPtr; } - if (cavityHeight > *slaveHeightPtr) { - diffy = cavityHeight - *slaveHeightPtr; + if (cavityHeight > *paneHeightPtr) { + diffy = cavityHeight - *paneHeightPtr; } if ((sticky & STICK_EAST) && (sticky & STICK_WEST)) { - *slaveWidthPtr += diffx; + *paneWidthPtr += diffx; } if ((sticky & STICK_NORTH) && (sticky & STICK_SOUTH)) { - *slaveHeightPtr += diffy; + *paneHeightPtr += diffy; } if (!(sticky & STICK_WEST)) { *xPtr += (sticky & STICK_EAST) ? diffx : diffx/2; @@ -2608,8 +2608,8 @@ MoveSash( int diff) { int i; - int expandPane, reduceFirst, reduceLast, reduceIncr, slaveSize, sashOffset; - Slave *slavePtr; + int expandPane, reduceFirst, reduceLast, reduceIncr, paneSize, sashOffset; + Pane *panePtr; int stretchReserve = 0; int nextSash = sash + 1; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); @@ -2618,7 +2618,7 @@ MoveSash( return; /* - * Update the slave sizes with their real sizes. + * Update the pane sizes with their real sizes. */ if (pwPtr->showHandle && pwPtr->handleSize > pwPtr->sashWidth) { @@ -2627,17 +2627,17 @@ MoveSash( } else { sashOffset = pwPtr->sashPad; } - for (i = 0; i < pwPtr->numSlaves; i++) { - slavePtr = pwPtr->slaves[i]; - if (slavePtr->hide) { + for (i = 0; i < pwPtr->numPanes; i++) { + panePtr = pwPtr->panes[i]; + if (panePtr->hide) { continue; } if (horizontal) { - slavePtr->paneWidth = slavePtr->width = slavePtr->sashx - - sashOffset - slavePtr->x - (2 * slavePtr->padx); + panePtr->paneWidth = panePtr->width = panePtr->sashx + - sashOffset - panePtr->x - (2 * panePtr->padx); } else { - slavePtr->paneHeight = slavePtr->height = slavePtr->sashy - - sashOffset - slavePtr->y - (2 * slavePtr->pady); + panePtr->paneHeight = panePtr->height = panePtr->sashy + - sashOffset - panePtr->y - (2 * panePtr->pady); } } @@ -2647,7 +2647,7 @@ MoveSash( * pane to either side of the sash. */ - while (nextSash < pwPtr->numSlaves-1 && pwPtr->slaves[nextSash]->hide) { + while (nextSash < pwPtr->numPanes-1 && pwPtr->panes[nextSash]->hide) { nextSash++; } @@ -2658,7 +2658,7 @@ MoveSash( if (diff > 0) { expandPane = sash; reduceFirst = nextSash; - reduceLast = pwPtr->numSlaves; + reduceLast = pwPtr->numPanes; reduceIncr = 1; } else { diff = abs(diff); @@ -2674,14 +2674,14 @@ MoveSash( */ for (i = reduceFirst; i != reduceLast; i += reduceIncr) { - slavePtr = pwPtr->slaves[i]; - if (slavePtr->hide) { + panePtr = pwPtr->panes[i]; + if (panePtr->hide) { continue; } if (horizontal) { - stretchReserve += slavePtr->width - slavePtr->minSize; + stretchReserve += panePtr->width - panePtr->minSize; } else { - stretchReserve += slavePtr->height - slavePtr->minSize; + stretchReserve += panePtr->height - panePtr->minSize; } } if (stretchReserve <= 0) { @@ -2695,11 +2695,11 @@ MoveSash( * Expand pane by diff amount. */ - slavePtr = pwPtr->slaves[expandPane]; + panePtr = pwPtr->panes[expandPane]; if (horizontal) { - slavePtr->paneWidth = slavePtr->width += diff; + panePtr->paneWidth = panePtr->width += diff; } else { - slavePtr->paneHeight = slavePtr->height += diff; + panePtr->paneHeight = panePtr->height += diff; } /* @@ -2707,26 +2707,26 @@ MoveSash( */ for (i = reduceFirst; i != reduceLast; i += reduceIncr) { - slavePtr = pwPtr->slaves[i]; - if (slavePtr->hide) { + panePtr = pwPtr->panes[i]; + if (panePtr->hide) { continue; } if (horizontal) { - slaveSize = slavePtr->width; + paneSize = panePtr->width; } else { - slaveSize = slavePtr->height; + paneSize = panePtr->height; } - if (diff > (slaveSize - slavePtr->minSize)) { - diff -= slaveSize - slavePtr->minSize; - slaveSize = slavePtr->minSize; + if (diff > (paneSize - panePtr->minSize)) { + diff -= paneSize - panePtr->minSize; + paneSize = panePtr->minSize; } else { - slaveSize -= diff; + paneSize -= diff; i = reduceLast - reduceIncr; } if (horizontal) { - slavePtr->paneWidth = slavePtr->width = slaveSize; + panePtr->paneWidth = panePtr->width = paneSize; } else { - slavePtr->paneHeight = slavePtr->height = slaveSize; + panePtr->paneHeight = panePtr->height = paneSize; } } } @@ -2949,9 +2949,9 @@ PanedWindowProxyCommand( /* * Make sure the proxy window is higher in the stacking order than the - * slaves, so that it will be visible when drawn. It would be more + * panes, so that it will be visible when drawn. It would be more * correct to push the proxy window just high enough to appear above - * the highest slave, but it's much easier to just force it all the + * the highest pane, but it's much easier to just force it all the * way to the top of the stacking order. */ @@ -3101,12 +3101,12 @@ PanedWindowIdentifyCoords( GetFirstLastVisiblePane(pwPtr, &first, &last); isHandle = 0; found = -1; - for (i = 0; i < pwPtr->numSlaves - 1; i++) { - if (pwPtr->slaves[i]->hide || i == last) { + for (i = 0; i < pwPtr->numPanes - 1; i++) { + if (pwPtr->panes[i]->hide || i == last) { continue; } - thisx = pwPtr->slaves[i]->sashx; - thisy = pwPtr->slaves[i]->sashy; + thisx = pwPtr->panes[i]->sashx; + thisy = pwPtr->panes[i]->sashy; if (((thisx - lpad) <= x && x <= (thisx + rpad + sashWidth)) && ((thisy - tpad) <= y && y <= (thisy + bpad + sashHeight))) { @@ -3117,8 +3117,8 @@ PanedWindowIdentifyCoords( */ if (pwPtr->showHandle) { - thisx = pwPtr->slaves[i]->handlex; - thisy = pwPtr->slaves[i]->handley; + thisx = pwPtr->panes[i]->handlex; + thisy = pwPtr->panes[i]->handley; if (pwPtr->orient == ORIENT_HORIZONTAL) { if (thisy <= y && y <= (thisy + pwPtr->handleSize)) { isHandle = 1; -- cgit v0.12