From ad53ca0af06e1300fb06d68be098a961a06eb05a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Nov 2022 16:28:54 +0000 Subject: alwaysRedraw -> flags --- doc/CrtItemType.3 | 8 ++++---- generic/tk.h | 10 ++++------ generic/tkCanvWind.c | 2 +- generic/tkCanvas.c | 4 ++-- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index c46ad2d..af0eaee 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -71,7 +71,7 @@ typedef struct Tk_ItemType { Tk_ItemCoordProc *\fIcoordProc\fR; Tk_ItemDeleteProc *\fIdeleteProc\fR; Tk_ItemDisplayProc *\fIdisplayProc\fR; - int \fIalwaysRedraw\fR; + int \fIflags\fR; Tk_ItemPointProc *\fIpointProc\fR; Tk_ItemAreaProc *\fIareaProc\fR; Tk_ItemPostscriptProc *\fIpostscriptProc\fR; @@ -169,7 +169,7 @@ If there already existed an item type by this name then the new item type replaces the old one. .SS "FLAGS (IN ALWAYSREDRAW)" .PP -The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons) +The \fItypePtr\->flags\fR field contains a collection of flag bits that modify how the canvas core interacts with the item. The following bits are defined: .TP @@ -384,9 +384,9 @@ of \fIdst\fR. .PP Normally an item's \fIdisplayProc\fR is only invoked if the item overlaps the area being displayed. -However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1, +However, if bit zero of \fItypePtr\->flags\fR is 1, (i.e.\| -.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" ) +.QW "\fItypePtr\->flags & 1 == 1\fR" ) then \fIdisplayProc\fR is invoked during every redisplay operation, even if the item does not overlap the area of redisplay; this is useful for cases such as window items, where the subwindow needs to be unmapped when it diff --git a/generic/tk.h b/generic/tk.h index e1b76b2..167ed56 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1089,9 +1089,7 @@ typedef struct Tk_ItemType { * type. */ Tk_ItemDisplayProc *displayProc; /* Procedure to display items of this type. */ - int alwaysRedraw; /* Non-zero means displayProc should be called - * even when the item has been moved - * off-screen. */ + int flags; /* Combination of TK_ALWAYS_REDRAW/TK_MOVABLE_POINTS */ Tk_ItemPointProc *pointProc;/* Computes distance from item to a given * point. */ Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside, @@ -1128,11 +1126,11 @@ typedef struct Tk_ItemType { } Tk_ItemType; /* - * Flag (used in the alwaysRedraw field) to say whether an item supports - * point-level manipulation like the line and polygon items. + * Possible flags for 'flags' field. */ -#define TK_MOVABLE_POINTS 2 +#define TK_ALWAYS_REDRAW 1 /* item should be redrawn always*/ +#define TK_MOVABLE_POINTS 2 /* item supports point-level manipulation */ #endif /* __NO_OLD_CONFIG */ diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 4691e63..2472c3f 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -120,7 +120,7 @@ Tk_ItemType tkWindowType = { WinItemCoords, /* coordProc */ DeleteWinItem, /* deleteProc */ DisplayWinItem, /* displayProc */ - 1, /* flags */ + TK_ALWAYS_REDRAW, /* flags */ WinItemToPoint, /* pointProc */ WinItemToArea, /* areaProc */ WinItemToPostscript, /* postscriptProc */ diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 82ab17e..705df64 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -323,7 +323,7 @@ static inline int AlwaysRedraw( Tk_Item *itemPtr) { - return itemPtr->typePtr->alwaysRedraw & 1; + return itemPtr->typePtr->flags & TK_ALWAYS_REDRAW; } static inline int @@ -1164,7 +1164,7 @@ CanvasWidgetCmd( */ if (itemPtr == NULL || - !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) { + !(itemPtr->typePtr->flags & TK_MOVABLE_POINTS)) { continue; } -- cgit v0.12