summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-03 21:17:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-03 21:17:50 (GMT)
commite1188642314803f517fa3b8cf093d7ef0d20fe3e (patch)
treefbc638cb9281478d92aec05f4a34e93953413bc1
parent5dd4251644115731a5874f1a6ad24edd6f5369e8 (diff)
parent9997531222f9a5ea6e8da18ca5eb0241f06c0c61 (diff)
downloadtk-e1188642314803f517fa3b8cf093d7ef0d20fe3e.zip
tk-e1188642314803f517fa3b8cf093d7ef0d20fe3e.tar.gz
tk-e1188642314803f517fa3b8cf093d7ef0d20fe3e.tar.bz2
re-base to 'cleaned-up' core-8-6-branch
-rw-r--r--generic/tk3d.c6
-rw-r--r--generic/tkBind.c4
-rw-r--r--generic/tkBusy.c14
-rw-r--r--generic/tkButton.c12
-rw-r--r--generic/tkCanvArc.c24
-rw-r--r--generic/tkCanvBmap.c6
-rw-r--r--generic/tkCanvLine.c28
-rw-r--r--generic/tkCanvPoly.c92
-rw-r--r--generic/tkCanvText.c76
-rw-r--r--generic/tkCanvUtil.c4
-rw-r--r--generic/tkCanvas.c6
-rw-r--r--generic/tkColor.c6
-rw-r--r--generic/tkConfig.c6
-rw-r--r--generic/tkCursor.c10
-rw-r--r--generic/tkEntry.c24
-rw-r--r--generic/tkEntry.h2
-rw-r--r--generic/tkEvent.c2
-rw-r--r--generic/tkFrame.c4
-rw-r--r--generic/tkImgBmap.c18
-rw-r--r--generic/tkImgPhInstance.c16
-rw-r--r--generic/tkListbox.c8
-rw-r--r--generic/tkMenu.c2
-rw-r--r--generic/tkMenuDraw.c26
-rw-r--r--generic/tkMenubutton.c10
-rw-r--r--generic/tkMessage.c6
-rw-r--r--generic/tkOldConfig.c4
-rw-r--r--generic/tkPanedWindow.c10
-rw-r--r--generic/tkPlace.c2
-rw-r--r--generic/tkRectOval.c16
-rw-r--r--generic/tkScale.c8
-rw-r--r--generic/tkScale.h2
-rw-r--r--generic/tkScrollbar.c2
-rw-r--r--generic/tkSquare.c2
-rw-r--r--generic/tkText.c6
-rw-r--r--generic/tkTextDisp.c20
-rw-r--r--generic/tkTextTag.c4
-rw-r--r--generic/tkWindow.c8
-rw-r--r--generic/ttk/ttkEntry.c2
-rw-r--r--macosx/tkMacOSXDefault.h4
-rw-r--r--macosx/tkMacOSXDialog.c2
-rw-r--r--macosx/tkMacOSXEmbed.c6
-rw-r--r--macosx/tkMacOSXMenu.c4
-rw-r--r--macosx/tkMacOSXScrlbr.c4
-rw-r--r--unix/tkUnix3d.c4
-rw-r--r--unix/tkUnixDefault.h2
-rw-r--r--unix/tkUnixMenubu.c12
-rw-r--r--win/stubs.c2
-rw-r--r--win/tkWin3d.c12
-rw-r--r--win/tkWinButton.c6
-rw-r--r--win/tkWinDefault.h2
-rw-r--r--win/tkWinDialog.c4
-rw-r--r--win/tkWinDraw.c14
-rw-r--r--win/tkWinEmbed.c2
-rw-r--r--win/tkWinFont.c18
-rw-r--r--win/tkWinMenu.c4
-rw-r--r--win/tkWinPixmap.c2
-rw-r--r--win/tkWinPointer.c6
-rw-r--r--win/tkWinPort.h4
-rw-r--r--win/tkWinScrlbr.c2
-rw-r--r--win/tkWinWindow.c6
-rw-r--r--win/tkWinWm.c42
-rw-r--r--win/tkWinX.c18
-rw-r--r--win/ttkWinXPTheme.c2
-rw-r--r--xlib/X11/X.h9
-rw-r--r--xlib/xgc.c22
-rw-r--r--xlib/ximage.c2
66 files changed, 359 insertions, 356 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c
index ce97a2e..87ddf76 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -236,9 +236,9 @@ Tk_Get3DBorder(
borderPtr->darkColorPtr = NULL;
borderPtr->lightColorPtr = NULL;
borderPtr->shadow = None;
- borderPtr->bgGC = 0;
- borderPtr->darkGC = 0;
- borderPtr->lightGC = 0;
+ borderPtr->bgGC = None;
+ borderPtr->darkGC = None;
+ borderPtr->lightGC = None;
borderPtr->hashPtr = hashPtr;
borderPtr->nextPtr = existingBorderPtr;
Tcl_SetHashValue(hashPtr, borderPtr);
diff --git a/generic/tkBind.c b/generic/tkBind.c
index c8f2610..af5306b 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -3580,14 +3580,14 @@ DoWarp(
if ((dispPtr->warpWindow == NULL) ||
(Tk_IsMapped(dispPtr->warpWindow)
- && Tk_WindowId(dispPtr->warpWindow))) {
+ && (Tk_WindowId(dispPtr->warpWindow) != None))) {
TkpWarpPointer(dispPtr);
XForceScreenSaver(dispPtr->display, ScreenSaverReset);
}
if (dispPtr->warpWindow) {
Tcl_Release(dispPtr->warpWindow);
- dispPtr->warpWindow = 0;
+ dispPtr->warpWindow = None;
}
dispPtr->flags &= ~TK_DISPLAY_IN_WARP;
}
diff --git a/generic/tkBusy.c b/generic/tkBusy.c
index d32800e..514465a 100644
--- a/generic/tkBusy.c
+++ b/generic/tkBusy.c
@@ -205,7 +205,7 @@ DoConfigureNotify(
if (winPtr->changes.stack_mode == Above) {
event.xconfigure.above = winPtr->changes.sibling;
} else {
- event.xconfigure.above = 0;
+ event.xconfigure.above = None;
}
event.xconfigure.override_redirect = winPtr->atts.override_redirect;
Tk_HandleEvent(&event);
@@ -421,7 +421,7 @@ MakeTransparentWindowExist(
int notUsed;
TkDisplay *dispPtr;
- if (winPtr->window) {
+ if (winPtr->window != None) {
return; /* Window already exists. */
}
@@ -431,7 +431,7 @@ MakeTransparentWindowExist(
TkpMakeTransparentWindowExist(tkwin, parent);
- if (!winPtr->window) {
+ if (winPtr->window == None) {
return; /* Platform didn't make Window. */
}
@@ -458,7 +458,7 @@ MakeTransparentWindowExist(
for (winPtr2 = winPtr->nextPtr; winPtr2 != NULL;
winPtr2 = winPtr2->nextPtr) {
- if ((winPtr2->window) &&
+ if ((winPtr2->window != None) &&
!(winPtr2->flags & (TK_TOP_HIERARCHY|TK_REPARENTED))) {
XWindowChanges changes;
@@ -568,7 +568,7 @@ CreateBusy(
busyPtr->height = Tk_Height(tkRef);
busyPtr->x = Tk_X(tkRef);
busyPtr->y = Tk_Y(tkRef);
- busyPtr->cursor = 0;
+ busyPtr->cursor = None;
Tk_SetClass(tkBusy, "Busy");
busyPtr->optionTable = Tk_CreateOptionTable(interp, busyOptionSpecs);
if (Tk_InitOptions(interp, (char *) busyPtr, busyPtr->optionTable,
@@ -598,7 +598,7 @@ CreateBusy(
*/
Tk_ManageGeometry(tkBusy, &busyMgrInfo, busyPtr);
- if (busyPtr->cursor) {
+ if (busyPtr->cursor != None) {
Tk_DefineCursor(tkBusy, busyPtr->cursor);
}
@@ -643,7 +643,7 @@ ConfigureBusy(
return TCL_ERROR;
}
if (busyPtr->cursor != oldCursor) {
- if (!busyPtr->cursor) {
+ if (busyPtr->cursor == None) {
Tk_UndefineCursor(busyPtr->tkBusy);
} else {
Tk_DefineCursor(busyPtr->tkBusy, busyPtr->cursor);
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 1cf6247..7760359 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -710,12 +710,12 @@ ButtonCreate(
butPtr->normalFg = NULL;
butPtr->activeFg = NULL;
butPtr->disabledFg = NULL;
- butPtr->normalTextGC = NULL;
- butPtr->activeTextGC = NULL;
- butPtr->disabledGC = NULL;
- butPtr->stippleGC = NULL;
+ butPtr->normalTextGC = None;
+ butPtr->activeTextGC = None;
+ butPtr->disabledGC = None;
+ butPtr->stippleGC = None;
butPtr->gray = None;
- butPtr->copyGC = NULL;
+ butPtr->copyGC = None;
butPtr->widthPtr = NULL;
butPtr->width = 0;
butPtr->heightPtr = NULL;
@@ -740,7 +740,7 @@ ButtonCreate(
butPtr->onValuePtr = NULL;
butPtr->offValuePtr = NULL;
butPtr->tristateValuePtr = NULL;
- butPtr->cursor = NULL;
+ butPtr->cursor = None;
butPtr->takeFocusPtr = NULL;
butPtr->commandPtr = NULL;
butPtr->flags = 0;
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index cd9ab33..4e4c582 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -290,7 +290,7 @@ CreateArc(
arcPtr->activeFillStipple = None;
arcPtr->disabledFillStipple = None;
arcPtr->style = PIESLICE_STYLE;
- arcPtr->fillGC = NULL;
+ arcPtr->fillGC = None;
/*
* Process the arguments to fill in the item record.
@@ -478,7 +478,7 @@ ConfigureArc(
mask |= GCCapStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else {
- newGC = NULL;
+ newGC = None;
}
if (arcPtr->outline.gc != None) {
Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc);
@@ -511,8 +511,10 @@ ConfigureArc(
}
}
- if ((arcPtr->style == ARC_STYLE) || (!color)) {
- newGC = NULL;
+ if (arcPtr->style == ARC_STYLE) {
+ newGC = None;
+ } else if (color == NULL) {
+ newGC = None;
} else {
gcValues.foreground = color->pixel;
if (arcPtr->style == CHORD_STYLE) {
@@ -903,13 +905,13 @@ DisplayArc(
} else {
if (arcPtr->style == CHORD_STYLE) {
TkFillPolygon(canvas, arcPtr->outlinePtr, CHORD_OUTLINE_PTS,
- display, drawable, arcPtr->outline.gc, NULL);
+ display, drawable, arcPtr->outline.gc, None);
} else if (arcPtr->style == PIESLICE_STYLE) {
TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS,
- display, drawable, arcPtr->outline.gc, NULL);
+ display, drawable, arcPtr->outline.gc, None);
TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
PIE_OUTLINE2_PTS, display, drawable,
- arcPtr->outline.gc, NULL);
+ arcPtr->outline.gc, None);
}
}
@@ -1901,7 +1903,7 @@ ArcToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (fillStipple) {
+ if (fillStipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
@@ -1910,7 +1912,7 @@ ArcToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (arcPtr->outline.gc) {
+ if (arcPtr->outline.gc != None) {
Tcl_AppendToObj(psObj, "grestore gsave\n", -1);
}
} else {
@@ -1953,7 +1955,7 @@ ArcToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple) {
+ if (stipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
@@ -1976,7 +1978,7 @@ ArcToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple) {
+ if (stipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index 42ea262..d7d54f4 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -189,7 +189,7 @@ TkcCreateBitmap(
bmapPtr->bgColor = NULL;
bmapPtr->activeBgColor = NULL;
bmapPtr->disabledBgColor = NULL;
- bmapPtr->gc = NULL;
+ bmapPtr->gc = None;
/*
* Process the arguments to fill in the item record. Only 1 (list) or 2 (x
@@ -371,8 +371,8 @@ ConfigureBitmap(
}
}
- if (!bitmap) {
- newGC = NULL;
+ if (bitmap == None) {
+ newGC = None;
} else {
gcValues.foreground = fgColor->pixel;
mask = GCForeground;
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index f862238..087aa56 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -296,7 +296,7 @@ CreateLine(
linePtr->coordPtr = NULL;
linePtr->capStyle = CapButt;
linePtr->joinStyle = JoinRound;
- linePtr->arrowGC = NULL;
+ linePtr->arrowGC = None;
linePtr->arrow = ARROWS_NONE;
linePtr->arrowShapeA = (float)8.0;
linePtr->arrowShapeB = (float)10.0;
@@ -521,12 +521,12 @@ ConfigureLine(
#endif
arrowGC = Tk_GetGC(tkwin, mask, &gcValues);
} else {
- newGC = arrowGC = NULL;
+ newGC = arrowGC = None;
}
- if (linePtr->outline.gc) {
+ if (linePtr->outline.gc != None) {
Tk_FreeGC(Tk_Display(tkwin), linePtr->outline.gc);
}
- if (linePtr->arrowGC) {
+ if (linePtr->arrowGC != None) {
Tk_FreeGC(Tk_Display(tkwin), linePtr->arrowGC);
}
linePtr->outline.gc = newGC;
@@ -654,7 +654,7 @@ ComputeLineBbox(
state = Canvas(canvas)->canvas_state;
}
- if (!(linePtr->numPoints) || (state==TK_STATE_HIDDEN)) {
+ if (!(linePtr->numPoints) || (state == TK_STATE_HIDDEN)) {
linePtr->header.x1 = -1;
linePtr->header.x2 = -1;
linePtr->header.y1 = -1;
@@ -667,7 +667,7 @@ ComputeLineBbox(
if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
@@ -840,7 +840,7 @@ DisplayLine(
int numPoints;
Tk_State state = itemPtr->state;
- if ((!linePtr->numPoints) || !linePtr->outline.gc) {
+ if ((!linePtr->numPoints) || (linePtr->outline.gc == None)) {
return;
}
@@ -2277,20 +2277,20 @@ LineToPostscript(
if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- if (linePtr->outline.activeColor) {
+ if (linePtr->outline.activeColor != NULL) {
color = linePtr->outline.activeColor;
}
- if (linePtr->outline.activeStipple) {
+ if (linePtr->outline.activeStipple != None) {
stipple = linePtr->outline.activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
- if (linePtr->outline.disabledColor) {
+ if (linePtr->outline.disabledColor != NULL) {
color = linePtr->outline.disabledColor;
}
- if (linePtr->outline.disabledStipple) {
+ if (linePtr->outline.disabledStipple != None) {
stipple = linePtr->outline.disabledStipple;
}
}
@@ -2324,7 +2324,7 @@ LineToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple) {
+ if (stipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
@@ -2345,7 +2345,7 @@ LineToPostscript(
Tcl_ResetResult(interp);
if ((!linePtr->smooth) || (linePtr->numPoints < 3)) {
Tk_CanvasPsPath(interp, canvas, linePtr->coordPtr, linePtr->numPoints);
- } else if (!stipple && linePtr->smooth->postscriptProc) {
+ } else if ((stipple == None) && linePtr->smooth->postscriptProc) {
linePtr->smooth->postscriptProc(interp, canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps);
} else {
@@ -2495,7 +2495,7 @@ ArrowheadPostscript(
Tk_CanvasPsPath(interp, canvas, arrowPtr, PTS_IN_ARROW);
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple) {
+ if (stipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index d541b3b..b4ef098 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -270,10 +270,10 @@ CreatePolygon(
polyPtr->fillColor = NULL;
polyPtr->activeFillColor = NULL;
polyPtr->disabledFillColor = NULL;
- polyPtr->fillStipple = 0;
- polyPtr->activeFillStipple = 0;
- polyPtr->disabledFillStipple = 0;
- polyPtr->fillGC = 0;
+ polyPtr->fillStipple = None;
+ polyPtr->activeFillStipple = None;
+ polyPtr->disabledFillStipple = None;
+ polyPtr->fillGC = None;
polyPtr->smooth = NULL;
polyPtr->splineSteps = 12;
polyPtr->autoClosed = 0;
@@ -453,11 +453,11 @@ ConfigurePolygon(
state = itemPtr->state;
if (polyPtr->outline.activeWidth > polyPtr->outline.width ||
- polyPtr->outline.activeDash.number ||
- polyPtr->outline.activeColor ||
- polyPtr->outline.activeStipple ||
- polyPtr->activeFillColor ||
- polyPtr->activeFillStipple) {
+ polyPtr->outline.activeDash.number != 0 ||
+ polyPtr->outline.activeColor != NULL ||
+ polyPtr->outline.activeStipple != None ||
+ polyPtr->activeFillColor != NULL ||
+ polyPtr->activeFillStipple != None) {
itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;
} else {
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
@@ -478,9 +478,9 @@ ConfigurePolygon(
mask |= GCCapStyle|GCJoinStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else {
- newGC = 0;
+ newGC = None;
}
- if (polyPtr->outline.gc) {
+ if (polyPtr->outline.gc != None) {
Tk_FreeGC(Tk_Display(tkwin), polyPtr->outline.gc);
}
polyPtr->outline.gc = newGC;
@@ -491,24 +491,24 @@ ConfigurePolygon(
if (polyPtr->activeFillColor != NULL) {
color = polyPtr->activeFillColor;
}
- if (polyPtr->activeFillStipple) {
+ if (polyPtr->activeFillStipple != None) {
stipple = polyPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (polyPtr->disabledFillColor != NULL) {
color = polyPtr->disabledFillColor;
}
- if (polyPtr->disabledFillStipple) {
+ if (polyPtr->disabledFillStipple != None) {
stipple = polyPtr->disabledFillStipple;
}
}
if (color == NULL) {
- newGC = 0;
+ newGC = None;
} else {
gcValues.foreground = color->pixel;
mask = GCForeground;
- if (stipple) {
+ if (stipple != None) {
gcValues.stipple = stipple;
gcValues.fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
@@ -518,13 +518,13 @@ ConfigurePolygon(
* Mac OS X CG drawing needs access to the outline linewidth
* even for fills (as linewidth controls antialiasing).
*/
- gcValues.line_width = polyPtr->outline.gc ?
+ gcValues.line_width = polyPtr->outline.gc != None ?
polyPtr->outline.gc->line_width : 0;
mask |= GCLineWidth;
#endif
newGC = Tk_GetGC(tkwin, mask, &gcValues);
}
- if (polyPtr->fillGC) {
+ if (polyPtr->fillGC != None) {
Tk_FreeGC(Tk_Display(tkwin), polyPtr->fillGC);
}
polyPtr->fillGC = newGC;
@@ -569,28 +569,28 @@ DeletePolygon(
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
Tk_DeleteOutline(display, &polyPtr->outline);
- if (polyPtr->coordPtr) {
+ if (polyPtr->coordPtr != NULL) {
ckfree(polyPtr->coordPtr);
}
- if (polyPtr->fillColor) {
+ if (polyPtr->fillColor != NULL) {
Tk_FreeColor(polyPtr->fillColor);
}
- if (polyPtr->activeFillColor) {
+ if (polyPtr->activeFillColor != NULL) {
Tk_FreeColor(polyPtr->activeFillColor);
}
- if (polyPtr->disabledFillColor) {
+ if (polyPtr->disabledFillColor != NULL) {
Tk_FreeColor(polyPtr->disabledFillColor);
}
- if (polyPtr->fillStipple) {
+ if (polyPtr->fillStipple != None) {
Tk_FreeBitmap(display, polyPtr->fillStipple);
}
- if (polyPtr->activeFillStipple) {
+ if (polyPtr->activeFillStipple != None) {
Tk_FreeBitmap(display, polyPtr->activeFillStipple);
}
- if (polyPtr->disabledFillStipple) {
+ if (polyPtr->disabledFillStipple != None) {
Tk_FreeBitmap(display, polyPtr->disabledFillStipple);
}
- if (polyPtr->fillGC) {
+ if (polyPtr->fillGC != None) {
Tk_FreeGC(display, polyPtr->fillGC);
}
}
@@ -694,7 +694,7 @@ ComputePolygonBbox(
}
}
- if (polyPtr->outline.gc) {
+ if (polyPtr->outline.gc != None) {
tsoffset = &polyPtr->outline.tsoffset;
if (tsoffset) {
if (tsoffset->flags & TK_OFFSET_INDEX) {
@@ -836,11 +836,11 @@ TkFillPolygon(
* allocated.
*/
- if (gc && numPoints > 3) {
+ if (gc != None && numPoints > 3) {
XFillPolygon(display, drawable, gc, pointPtr, numPoints, Complex,
CoordModeOrigin);
}
- if (outlineGC) {
+ if (outlineGC != None) {
XDrawLines(display, drawable, outlineGC, pointPtr, numPoints,
CoordModeOrigin);
}
@@ -881,9 +881,9 @@ DisplayPolygon(
Pixmap stipple = polyPtr->fillStipple;
double linewidth = polyPtr->outline.width;
- if ((!polyPtr->fillGC && !polyPtr->outline.gc) ||
+ if (((polyPtr->fillGC == None) && (polyPtr->outline.gc == None)) ||
(polyPtr->numPoints < 1) ||
- (polyPtr->numPoints < 3 && !polyPtr->outline.gc)) {
+ (polyPtr->numPoints < 3 && polyPtr->outline.gc == None)) {
return;
}
@@ -894,14 +894,14 @@ DisplayPolygon(
if (polyPtr->outline.activeWidth > linewidth) {
linewidth = polyPtr->outline.activeWidth;
}
- if (polyPtr->activeFillStipple) {
+ if (polyPtr->activeFillStipple != None) {
stipple = polyPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (polyPtr->outline.disabledWidth > 0.0) {
linewidth = polyPtr->outline.disabledWidth;
}
- if (polyPtr->disabledFillStipple) {
+ if (polyPtr->disabledFillStipple != None) {
stipple = polyPtr->disabledFillStipple;
}
}
@@ -911,7 +911,7 @@ DisplayPolygon(
* reset the offset when done, since the GC is supposed to be read-only.
*/
- if (stipple && polyPtr->fillGC) {
+ if ((stipple != None) && (polyPtr->fillGC != None)) {
Tk_TSOffset *tsoffset = &polyPtr->tsoffset;
int w = 0, h = 0;
int flags = tsoffset->flags;
@@ -973,11 +973,11 @@ DisplayPolygon(
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
polyPtr->numPoints, polyPtr->splineSteps, pointPtr, NULL);
- if (polyPtr->fillGC) {
+ if (polyPtr->fillGC != None) {
XFillPolygon(display, drawable, polyPtr->fillGC, pointPtr,
numPoints, Complex, CoordModeOrigin);
}
- if (polyPtr->outline.gc) {
+ if (polyPtr->outline.gc != None) {
XDrawLines(display, drawable, polyPtr->outline.gc, pointPtr,
numPoints, CoordModeOrigin);
}
@@ -986,7 +986,7 @@ DisplayPolygon(
}
}
Tk_ResetOutlineGC(canvas, itemPtr, &polyPtr->outline);
- if (stipple && polyPtr->fillGC) {
+ if ((stipple != None) && (polyPtr->fillGC != None)) {
XSetTSOrigin(display, polyPtr->fillGC, 0, 0);
}
}
@@ -1299,7 +1299,7 @@ PolygonToPoint(
if (bestDist <= 0.0) {
goto donepoint;
}
- if (polyPtr->outline.gc && (polyPtr->joinStyle == JoinRound)) {
+ if ((polyPtr->outline.gc != None) && (polyPtr->joinStyle == JoinRound)) {
dist = bestDist - radius;
if (dist <= 0.0) {
bestDist = 0.0;
@@ -1309,7 +1309,7 @@ PolygonToPoint(
}
}
- if (!polyPtr->outline.gc || (width <= 1)) {
+ if ((polyPtr->outline.gc == None) || (width <= 1)) {
goto donepoint;
}
@@ -1515,7 +1515,7 @@ PolygonToArea(
goto donearea;
}
- if (!polyPtr->outline.gc) {
+ if (polyPtr->outline.gc == None) {
goto donearea;
}
@@ -1829,13 +1829,13 @@ PolygonToPostscript(
if (polyPtr->outline.activeColor != NULL) {
color = polyPtr->outline.activeColor;
}
- if (polyPtr->outline.activeStipple) {
+ if (polyPtr->outline.activeStipple != None) {
stipple = polyPtr->outline.activeStipple;
}
if (polyPtr->activeFillColor != NULL) {
fillColor = polyPtr->activeFillColor;
}
- if (polyPtr->activeFillStipple) {
+ if (polyPtr->activeFillStipple != None) {
fillStipple = polyPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
@@ -1845,13 +1845,13 @@ PolygonToPostscript(
if (polyPtr->outline.disabledColor != NULL) {
color = polyPtr->outline.disabledColor;
}
- if (polyPtr->outline.disabledStipple) {
+ if (polyPtr->outline.disabledStipple != None) {
stipple = polyPtr->outline.disabledStipple;
}
if (polyPtr->disabledFillColor != NULL) {
fillColor = polyPtr->disabledFillColor;
}
- if (polyPtr->disabledFillStipple) {
+ if (polyPtr->disabledFillStipple != None) {
fillStipple = polyPtr->disabledFillStipple;
}
}
@@ -1894,7 +1894,7 @@ PolygonToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple) {
+ if (stipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
@@ -1926,7 +1926,7 @@ PolygonToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (fillStipple) {
+ if (fillStipple != None) {
Tcl_AppendToObj(psObj, "eoclip ", -1);
Tcl_ResetResult(interp);
@@ -1947,7 +1947,7 @@ PolygonToPostscript(
* Now draw the outline, if there is one.
*/
- if (color) {
+ if (color != NULL) {
Tcl_ResetResult(interp);
if (!polyPtr->smooth || !polyPtr->smooth->postscriptProc) {
Tk_CanvasPsPath(interp, canvas, polyPtr->coordPtr,
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 7f5f23d..eb8dfe3 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -256,9 +256,9 @@ CreateText(
textPtr->disabledColor = NULL;
textPtr->tkfont = NULL;
textPtr->justify = TK_JUSTIFY_LEFT;
- textPtr->stipple = 0;
- textPtr->activeStipple = 0;
- textPtr->disabledStipple = 0;
+ textPtr->stipple = None;
+ textPtr->activeStipple = None;
+ textPtr->disabledStipple = None;
textPtr->text = NULL;
textPtr->width = 0;
textPtr->underline = -1;
@@ -269,9 +269,9 @@ CreateText(
textPtr->textLayout = NULL;
textPtr->actualWidth = 0;
textPtr->drawOrigin[0] = textPtr->drawOrigin[1] = 0.0;
- textPtr->gc = 0;
- textPtr->selTextGC = 0;
- textPtr->cursorOffGC = 0;
+ textPtr->gc = None;
+ textPtr->selTextGC = None;
+ textPtr->cursorOffGC = None;
textPtr->sine = 0.0;
textPtr->cosine = 1.0;
@@ -419,7 +419,7 @@ ConfigureText(
state = itemPtr->state;
- if (textPtr->activeColor || textPtr->activeStipple) {
+ if (textPtr->activeColor != NULL || textPtr->activeStipple != None) {
itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;
} else {
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
@@ -435,26 +435,26 @@ ConfigureText(
if (textPtr->activeColor != NULL) {
color = textPtr->activeColor;
}
- if (textPtr->activeStipple) {
+ if (textPtr->activeStipple != None) {
stipple = textPtr->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (textPtr->disabledColor != NULL) {
color = textPtr->disabledColor;
}
- if (textPtr->disabledStipple) {
+ if (textPtr->disabledStipple != None) {
stipple = textPtr->disabledStipple;
}
}
- newGC = newSelGC = 0;
- if (textPtr->tkfont) {
+ newGC = newSelGC = None;
+ if (textPtr->tkfont != NULL) {
gcValues.font = Tk_FontId(textPtr->tkfont);
mask = GCFont;
- if (color) {
+ if (color != NULL) {
gcValues.foreground = color->pixel;
mask |= GCForeground;
- if (stipple) {
+ if (stipple != None) {
gcValues.stipple = stipple;
gcValues.fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
@@ -462,7 +462,7 @@ ConfigureText(
newGC = Tk_GetGC(tkwin, mask, &gcValues);
}
mask &= ~(GCTile|GCFillStyle|GCStipple);
- if (stipple) {
+ if (stipple != None) {
gcValues.stipple = stipple;
gcValues.fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
@@ -472,11 +472,11 @@ ConfigureText(
}
newSelGC = Tk_GetGC(tkwin, mask|GCForeground, &gcValues);
}
- if (textPtr->gc) {
+ if (textPtr->gc != None) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->gc);
}
textPtr->gc = newGC;
- if (textPtr->selTextGC) {
+ if (textPtr->selTextGC != None) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->selTextGC);
}
textPtr->selTextGC = newSelGC;
@@ -491,9 +491,9 @@ ConfigureText(
}
newGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
} else {
- newGC = 0;
+ newGC = None;
}
- if (textPtr->cursorOffGC) {
+ if (textPtr->cursorOffGC != None) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC);
}
textPtr->cursorOffGC = newGC;
@@ -568,37 +568,37 @@ DeleteText(
{
TextItem *textPtr = (TextItem *) itemPtr;
- if (textPtr->color) {
+ if (textPtr->color != NULL) {
Tk_FreeColor(textPtr->color);
}
- if (textPtr->activeColor) {
+ if (textPtr->activeColor != NULL) {
Tk_FreeColor(textPtr->activeColor);
}
- if (textPtr->disabledColor) {
+ if (textPtr->disabledColor != NULL) {
Tk_FreeColor(textPtr->disabledColor);
}
Tk_FreeFont(textPtr->tkfont);
- if (textPtr->stipple) {
+ if (textPtr->stipple != None) {
Tk_FreeBitmap(display, textPtr->stipple);
}
- if (textPtr->activeStipple) {
+ if (textPtr->activeStipple != None) {
Tk_FreeBitmap(display, textPtr->activeStipple);
}
- if (textPtr->disabledStipple) {
+ if (textPtr->disabledStipple != None) {
Tk_FreeBitmap(display, textPtr->disabledStipple);
}
- if (textPtr->text) {
+ if (textPtr->text != NULL) {
ckfree(textPtr->text);
}
Tk_FreeTextLayout(textPtr->textLayout);
- if (textPtr->gc) {
+ if (textPtr->gc != None) {
Tk_FreeGC(display, textPtr->gc);
}
- if (textPtr->selTextGC) {
+ if (textPtr->selTextGC != None) {
Tk_FreeGC(display, textPtr->selTextGC);
}
- if (textPtr->cursorOffGC) {
+ if (textPtr->cursorOffGC != None) {
Tk_FreeGC(display, textPtr->cursorOffGC);
}
}
@@ -811,16 +811,16 @@ DisplayCanvText(
}
stipple = textPtr->stipple;
if (Canvas(canvas)->currentItemPtr == itemPtr) {
- if (textPtr->activeStipple) {
+ if (textPtr->activeStipple != None) {
stipple = textPtr->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
- if (textPtr->disabledStipple) {
+ if (textPtr->disabledStipple != None) {
stipple = textPtr->disabledStipple;
}
}
- if (!textPtr->gc) {
+ if (textPtr->gc == None) {
return;
}
@@ -830,7 +830,7 @@ DisplayCanvText(
* read-only.
*/
- if (stipple) {
+ if (stipple != None) {
Tk_CanvasSetOffset(canvas, textPtr->gc, &textPtr->tsoffset);
}
@@ -932,7 +932,7 @@ DisplayCanvText(
Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable,
textInfoPtr->insertBorder, points, 4,
textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED);
- } else if (textPtr->cursorOffGC) {
+ } else if (textPtr->cursorOffGC != None) {
/*
* Redraw the background over the area of the cursor, even
* though the cursor is turned off. This guarantees that the
@@ -975,7 +975,7 @@ DisplayCanvText(
textPtr->textLayout, drawableX, drawableY, textPtr->angle,
textPtr->underline);
- if (stipple) {
+ if (stipple != None) {
XSetTSOrigin(display, textPtr->gc, 0, 0);
}
}
@@ -1559,14 +1559,14 @@ TextToPostscript(
if (textPtr->activeColor != NULL) {
color = textPtr->activeColor;
}
- if (textPtr->activeStipple) {
+ if (textPtr->activeStipple != None) {
stipple = textPtr->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (textPtr->disabledColor != NULL) {
color = textPtr->disabledColor;
}
- if (textPtr->disabledStipple) {
+ if (textPtr->disabledStipple != None) {
stipple = textPtr->disabledStipple;
}
}
@@ -1598,7 +1598,7 @@ TextToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple) {
+ if (stipple != None) {
Tcl_ResetResult(interp);
Tk_CanvasPsStipple(interp, canvas, stipple);
Tcl_AppendPrintfToObj(psObj, "/StippleText {\n %s} bind def\n",
@@ -1633,7 +1633,7 @@ TextToPostscript(
Tcl_AppendPrintfToObj(psObj,
"] %d %g %g %s %s DrawText\n",
fm.linespace, x / -2.0, y / 2.0, justify,
- (stipple ? "true" : "false"));
+ ((stipple == None) ? "false" : "true"));
/*
* Plug the accumulated postscript back into the result.
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index 5ab3a28..09ce98c 100644
--- a/generic/tkCanvUtil.c
+++ b/generic/tkCanvUtil.c
@@ -961,7 +961,7 @@ void
Tk_CreateOutline(
Tk_Outline *outline) /* Outline structure to be filled in. */
{
- outline->gc = NULL;
+ outline->gc = None;
outline->width = 1.0;
outline->activeWidth = 0.0;
outline->disabledWidth = 0.0;
@@ -1477,7 +1477,7 @@ Tk_CanvasPsOutline(
* Note that psObj might hold an invalid reference now.
*/
- if (stipple) {
+ if (stipple != None) {
Tcl_AppendToObj(GetPostscriptBuffer(interp), "StrokeClip ", -1);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 134ff8d..ecabe22 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -678,7 +678,7 @@ Tk_CanvasObjCmd(
canvasPtr->highlightBgColorPtr = NULL;
canvasPtr->highlightColorPtr = NULL;
canvasPtr->inset = 0;
- canvasPtr->pixmapGC = NULL;
+ canvasPtr->pixmapGC = None;
canvasPtr->width = None;
canvasPtr->height = None;
canvasPtr->confine = 0;
@@ -724,7 +724,7 @@ Tk_CanvasObjCmd(
canvasPtr->scanYOrigin = 0;
canvasPtr->hotPtr = NULL;
canvasPtr->hotPrevPtr = NULL;
- canvasPtr->cursor = NULL;
+ canvasPtr->cursor = None;
canvasPtr->takeFocus = NULL;
canvasPtr->pixelsPerMM = WidthOfScreen(Tk_Screen(newWin));
canvasPtr->pixelsPerMM /= WidthMMOfScreen(Tk_Screen(newWin));
@@ -2754,7 +2754,7 @@ CanvasEventProc(
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
itemPtr = itemPtr->nextPtr) {
if (AlwaysRedraw(itemPtr)) {
- ItemDisplay(canvasPtr, itemPtr, 0, 0, 0, 0, 0);
+ ItemDisplay(canvasPtr, itemPtr, None, 0, 0, 0, 0);
}
}
}
diff --git a/generic/tkColor.c b/generic/tkColor.c
index 0798067..9abb448 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -245,7 +245,7 @@ Tk_GetColor(
*/
tkColPtr->magic = COLOR_MAGIC;
- tkColPtr->gc = 0;
+ tkColPtr->gc = None;
tkColPtr->screen = Tk_Screen(tkwin);
tkColPtr->colormap = Tk_Colormap(tkwin);
tkColPtr->visual = Tk_Visual(tkwin);
@@ -326,7 +326,7 @@ Tk_GetColorByValue(
tkColPtr = TkpGetColorByValue(tkwin, colorPtr);
tkColPtr->magic = COLOR_MAGIC;
- tkColPtr->gc = 0;
+ tkColPtr->gc = None;
tkColPtr->screen = Tk_Screen(tkwin);
tkColPtr->colormap = valueKey.colormap;
tkColPtr->visual = Tk_Visual(tkwin);
@@ -493,7 +493,7 @@ Tk_FreeColor(
if (tkColPtr->gc != None) {
XFreeGC(DisplayOfScreen(screen), tkColPtr->gc);
- tkColPtr->gc = 0;
+ tkColPtr->gc = None;
}
TkpFreeColor(tkColPtr);
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 2465d5b..795a8e8 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -800,7 +800,7 @@ DoObjConfig(
Tk_Cursor newCursor;
if (nullOK && ObjectIsEmpty(valuePtr)) {
- newCursor = 0;
+ newCursor = None;
valuePtr = NULL;
} else {
newCursor = Tk_AllocCursorFromObj(interp, tkwin, valuePtr);
@@ -862,7 +862,7 @@ DoObjConfig(
if (nullOK && ObjectIsEmpty(valuePtr)) {
valuePtr = NULL;
- newWin = 0;
+ newWin = None;
} else {
if (TkGetWindowFromObj(interp, tkwin, valuePtr,
&newWin) != TCL_OK) {
@@ -1668,7 +1668,7 @@ FreeResources(
if (internalFormExists) {
if (*((Tk_Cursor *) internalPtr) != None) {
Tk_FreeCursor(Tk_Display(tkwin), *((Tk_Cursor *) internalPtr));
- *((Tk_Cursor *) internalPtr) = 0;
+ *((Tk_Cursor *) internalPtr) = None;
}
} else if (objPtr != NULL) {
Tk_FreeCursorFromObj(tkwin, objPtr);
diff --git a/generic/tkCursor.c b/generic/tkCursor.c
index 18a0d72..6b2d5f4 100644
--- a/generic/tkCursor.c
+++ b/generic/tkCursor.c
@@ -150,7 +150,7 @@ Tk_AllocCursorFromObj(
cursorPtr = TkcGetCursor(interp, tkwin, Tcl_GetString(objPtr));
objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr;
if (cursorPtr == NULL) {
- return 0;
+ return None;
}
cursorPtr->objRefCount++;
return cursorPtr->cursor;
@@ -188,7 +188,11 @@ Tk_GetCursor(
* details on legal syntax. */
{
TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string);
- return cursorPtr ? cursorPtr->cursor : NULL;
+
+ if (cursorPtr == NULL) {
+ return None;
+ }
+ return cursorPtr->cursor;
}
/*
@@ -384,7 +388,7 @@ Tk_GetCursorFromData(
error:
Tcl_DeleteHashEntry(dataHashPtr);
- return 0;
+ return None;
}
/*
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 9df8da6..678691f 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -524,16 +524,16 @@ Tk_EntryObjCmd(
entryPtr->selectFirst = -1;
entryPtr->selectLast = -1;
- entryPtr->cursor = NULL;
+ entryPtr->cursor = None;
entryPtr->exportSelection = 1;
entryPtr->justify = TK_JUSTIFY_LEFT;
entryPtr->relief = TK_RELIEF_FLAT;
entryPtr->state = STATE_NORMAL;
entryPtr->displayString = entryPtr->string;
entryPtr->inset = XPAD;
- entryPtr->textGC = NULL;
- entryPtr->selTextGC = NULL;
- entryPtr->highlightGC = NULL;
+ entryPtr->textGC = None;
+ entryPtr->selTextGC = None;
+ entryPtr->highlightGC = None;
entryPtr->avgWidth = 1;
entryPtr->validate = VALIDATE_NONE;
@@ -1430,7 +1430,7 @@ EntryWorldChanged(
ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
- GC gc = NULL;
+ GC gc = None;
unsigned long mask;
Tk_3DBorder border;
XColor *colorPtr;
@@ -2457,9 +2457,9 @@ EntryEventProc(
} else if ((elem == SEL_BUTTONDOWN) || (elem == SEL_BUTTONUP)) {
cursor = sbPtr->bCursor;
} else {
- cursor = NULL;
+ cursor = None;
}
- if (cursor) {
+ if (cursor != None) {
Tk_DefineCursor(entryPtr->tkwin, cursor);
} else {
Tk_UndefineCursor(entryPtr->tkwin);
@@ -3633,22 +3633,22 @@ Tk_SpinboxObjCmd(
entryPtr->selectFirst = -1;
entryPtr->selectLast = -1;
- entryPtr->cursor = NULL;
+ entryPtr->cursor = None;
entryPtr->exportSelection = 1;
entryPtr->justify = TK_JUSTIFY_LEFT;
entryPtr->relief = TK_RELIEF_FLAT;
entryPtr->state = STATE_NORMAL;
entryPtr->displayString = entryPtr->string;
entryPtr->inset = XPAD;
- entryPtr->textGC = NULL;
- entryPtr->selTextGC = NULL;
- entryPtr->highlightGC = NULL;
+ entryPtr->textGC = None;
+ entryPtr->selTextGC = None;
+ entryPtr->highlightGC = None;
entryPtr->avgWidth = 1;
entryPtr->validate = VALIDATE_NONE;
sbPtr->selElement = SEL_NONE;
sbPtr->curElement = SEL_NONE;
- sbPtr->bCursor = NULL;
+ sbPtr->bCursor = None;
sbPtr->repeatDelay = 400;
sbPtr->repeatInterval = 100;
sbPtr->fromValue = 0.0;
diff --git a/generic/tkEntry.h b/generic/tkEntry.h
index 15b4c21..12c0374 100644
--- a/generic/tkEntry.h
+++ b/generic/tkEntry.h
@@ -221,7 +221,7 @@ typedef struct {
* value that the users requests. Malloc'ed */
char *valueFormat; /* Sprintf conversion specifier used for the
* value. */
- char digitFormat[14]; /* Sprintf conversion specifier computed from
+ char digitFormat[16]; /* Sprintf conversion specifier computed from
* digits and other information; used for the
* value. */
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index b68ba54..d058e7c 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -1439,7 +1439,7 @@ TkEventDeadWindow(
ipPtr->nextHandler = NULL;
}
if (ipPtr->winPtr == winPtr) {
- ipPtr->winPtr = 0;
+ ipPtr->winPtr = None;
}
}
ckfree(handlerPtr);
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 81b6405..0f1a1b3 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -662,13 +662,13 @@ CreateFrame(
framePtr->type = type;
framePtr->colormap = colormap;
framePtr->relief = TK_RELIEF_FLAT;
- framePtr->cursor = NULL;
+ framePtr->cursor = None;
if (framePtr->type == TYPE_LABELFRAME) {
Labelframe *labelframePtr = (Labelframe *) framePtr;
labelframePtr->labelAnchor = LABELANCHOR_NW;
- labelframePtr->textGC = NULL;
+ labelframePtr->textGC = None;
}
/*
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index aa977c4..0906673 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -403,18 +403,18 @@ ImgBmapConfigureInstance(
(unsigned) masterPtr->height);
}
- if (oldMask) {
+ if (oldMask != None) {
Tk_FreePixmap(Tk_Display(instancePtr->tkwin), oldMask);
}
- if (oldBitmap) {
+ if (oldBitmap != None) {
Tk_FreePixmap(Tk_Display(instancePtr->tkwin), oldBitmap);
}
- if (masterPtr->data) {
+ if (masterPtr->data != NULL) {
gcValues.foreground = instancePtr->fg->pixel;
gcValues.graphics_exposures = False;
mask = GCForeground|GCGraphicsExposures;
- if (instancePtr->bg) {
+ if (instancePtr->bg != NULL) {
gcValues.background = instancePtr->bg->pixel;
mask |= GCBackground;
if (instancePtr->mask != None) {
@@ -427,9 +427,9 @@ ImgBmapConfigureInstance(
}
gc = Tk_GetGC(instancePtr->tkwin, mask, &gcValues);
} else {
- gc = NULL;
+ gc = None;
}
- if (instancePtr->gc) {
+ if (instancePtr->gc != None) {
Tk_FreeGC(Tk_Display(instancePtr->tkwin), instancePtr->gc);
}
instancePtr->gc = gc;
@@ -441,10 +441,10 @@ ImgBmapConfigureInstance(
* it clear that this instance cannot be displayed. Then report the error.
*/
- if (instancePtr->gc) {
+ if (instancePtr->gc != None) {
Tk_FreeGC(Tk_Display(instancePtr->tkwin), instancePtr->gc);
}
- instancePtr->gc = NULL;
+ instancePtr->gc = None;
Tcl_AppendObjToErrorInfo(masterPtr->interp, Tcl_ObjPrintf(
"\n (while configuring image \"%s\")", Tk_NameOfImage(
masterPtr->tkMaster)));
@@ -848,7 +848,7 @@ ImgBmapGet(
instancePtr->bg = NULL;
instancePtr->bitmap = None;
instancePtr->mask = None;
- instancePtr->gc = NULL;
+ instancePtr->gc = None;
instancePtr->nextPtr = masterPtr->instancePtr;
masterPtr->instancePtr = instancePtr;
ImgBmapConfigureInstance(instancePtr);
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c
index 27d2766..3314f5e 100644
--- a/generic/tkImgPhInstance.c
+++ b/generic/tkImgPhInstance.c
@@ -167,7 +167,7 @@ TkImgPhotoConfigureInstance(
* has the side effect of allocating a pixmap for us.
*/
- if (!instancePtr->pixels || (instancePtr->error == NULL)
+ if ((instancePtr->pixels == None) || (instancePtr->error == NULL)
|| (instancePtr->width != masterPtr->width)
|| (instancePtr->height != masterPtr->height)) {
TkImgPhotoInstanceSetSize(instancePtr);
@@ -285,7 +285,7 @@ TkImgPhotoGet(
Tk_PreserveColormap(instancePtr->display, instancePtr->colormap);
instancePtr->refCount = 1;
instancePtr->colorTablePtr = NULL;
- instancePtr->pixels = 0;
+ instancePtr->pixels = None;
instancePtr->error = NULL;
instancePtr->width = 0;
instancePtr->height = 0;
@@ -621,7 +621,7 @@ TkImgPhotoDisplay(
* the image instance so it can't be displayed.
*/
- if (!instancePtr->pixels) {
+ if (instancePtr->pixels == None) {
return;
}
@@ -697,7 +697,7 @@ TkImgPhotoDisplay(
XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc,
imageX, imageY, (unsigned) width, (unsigned) height,
drawableX, drawableY);
- XSetClipMask(display, instancePtr->gc, 0);
+ XSetClipMask(display, instancePtr->gc, None);
XSetClipOrigin(display, instancePtr->gc, 0, 0);
}
XFlush(display);
@@ -784,7 +784,7 @@ TkImgPhotoInstanceSetSize(
if ((instancePtr->width != masterPtr->width)
|| (instancePtr->height != masterPtr->height)
- || !instancePtr->pixels) {
+ || (instancePtr->pixels == None)) {
newPixmap = Tk_GetPixmap(instancePtr->display,
RootWindow(instancePtr->display,
instancePtr->visualInfo.screen),
@@ -806,7 +806,7 @@ TkImgPhotoInstanceSetSize(
TkSetPixmapColormap(newPixmap, instancePtr->colormap);
- if (instancePtr->pixels) {
+ if (instancePtr->pixels != None) {
/*
* Copy any common pixels from the old pixmap and free it.
*/
@@ -1587,10 +1587,10 @@ TkImgDisposeInstance(
PhotoInstance *instancePtr = clientData;
PhotoInstance *prevPtr;
- if (instancePtr->pixels) {
+ if (instancePtr->pixels != None) {
Tk_FreePixmap(instancePtr->display, instancePtr->pixels);
}
- if (instancePtr->gc) {
+ if (instancePtr->gc != None) {
Tk_FreeGC(instancePtr->display, instancePtr->gc);
}
if (instancePtr->imagePtr != NULL) {
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index b2584da..5f650fe 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -542,13 +542,13 @@ Tk_ListboxObjCmd(
listPtr->itemAttrTable = ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->itemAttrTable, TCL_ONE_WORD_KEYS);
listPtr->relief = TK_RELIEF_RAISED;
- listPtr->textGC = NULL;
- listPtr->selFgColorPtr = NULL;
- listPtr->selTextGC = NULL;
+ listPtr->textGC = None;
+ listPtr->selFgColorPtr = None;
+ listPtr->selTextGC = None;
listPtr->fullLines = 1;
listPtr->xScrollUnit = 1;
listPtr->exportSelection = 1;
- listPtr->cursor = NULL;
+ listPtr->cursor = None;
listPtr->state = STATE_NORMAL;
listPtr->gray = None;
listPtr->justify = TK_JUSTIFY_LEFT;
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index a31666d..26ffc88 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -455,7 +455,7 @@ Tk_MenuObjCmd(
Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, menuPtr,
MenuCmdDeletedProc);
menuPtr->active = -1;
- menuPtr->cursorPtr = NULL;
+ menuPtr->cursorPtr = None;
menuPtr->masterMenuPtr = menuPtr;
menuPtr->menuType = UNKNOWN_TYPE;
TkMenuInitializeDrawingFields(menuPtr);
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index e9b1c98..3f492db 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -43,12 +43,12 @@ void
TkMenuInitializeDrawingFields(
TkMenu *menuPtr) /* The menu we are initializing. */
{
- menuPtr->textGC = NULL;
+ menuPtr->textGC = None;
menuPtr->gray = None;
- menuPtr->disabledGC = NULL;
- menuPtr->activeGC = NULL;
- menuPtr->indicatorGC = NULL;
- menuPtr->disabledImageGC = NULL;
+ menuPtr->disabledGC = None;
+ menuPtr->activeGC = None;
+ menuPtr->indicatorGC = None;
+ menuPtr->disabledImageGC = None;
menuPtr->totalWidth = menuPtr->totalHeight = 0;
}
@@ -79,10 +79,10 @@ TkMenuInitializeEntryDrawingFields(
mePtr->y = 0;
mePtr->indicatorSpace = 0;
mePtr->labelWidth = 0;
- mePtr->textGC = NULL;
- mePtr->activeGC = NULL;
- mePtr->disabledGC = NULL;
- mePtr->indicatorGC = NULL;
+ mePtr->textGC = None;
+ mePtr->activeGC = None;
+ mePtr->disabledGC = None;
+ mePtr->indicatorGC = None;
}
/*
@@ -385,10 +385,10 @@ TkMenuConfigureEntryDrawOptions(
GCForeground|GCBackground|GCFont|GCGraphicsExposures,
&gcValues);
} else {
- newGC = NULL;
- newActiveGC = NULL;
- newDisabledGC = NULL;
- newIndicatorGC = NULL;
+ newGC = None;
+ newActiveGC = None;
+ newDisabledGC = None;
+ newIndicatorGC = None;
}
if (mePtr->textGC != None) {
Tk_FreeGC(menuPtr->display, mePtr->textGC);
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index f0927c9..2c1676c 100644
--- a/generic/tkMenubutton.c
+++ b/generic/tkMenubutton.c
@@ -279,11 +279,11 @@ Tk_MenubuttonObjCmd(
mbPtr->normalFg = NULL;
mbPtr->activeFg = NULL;
mbPtr->disabledFg = NULL;
- mbPtr->normalTextGC = NULL;
- mbPtr->activeTextGC = NULL;
+ mbPtr->normalTextGC = None;
+ mbPtr->activeTextGC = None;
mbPtr->gray = None;
- mbPtr->disabledGC = NULL;
- mbPtr->stippleGC = NULL;
+ mbPtr->disabledGC = None;
+ mbPtr->stippleGC = None;
mbPtr->leftBearing = 0;
mbPtr->rightBearing = 0;
mbPtr->widthString = NULL;
@@ -300,7 +300,7 @@ Tk_MenubuttonObjCmd(
mbPtr->indicatorWidth = 0;
mbPtr->indicatorHeight = 0;
mbPtr->direction = DIRECTION_FLUSH;
- mbPtr->cursor = NULL;
+ mbPtr->cursor = None;
mbPtr->takeFocus = NULL;
mbPtr->flags = 0;
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index e44da06..f65b046 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -256,11 +256,11 @@ Tk_MessageObjCmd(
MessageCmdDeletedProc);
msgPtr->optionTable = optionTable;
msgPtr->relief = TK_RELIEF_FLAT;
- msgPtr->textGC = NULL;
+ msgPtr->textGC = None;
msgPtr->anchor = TK_ANCHOR_CENTER;
msgPtr->aspect = 150;
msgPtr->justify = TK_JUSTIFY_LEFT;
- msgPtr->cursor = NULL;
+ msgPtr->cursor = None;
Tk_SetClass(msgPtr->tkwin, "Message");
Tk_SetClassProcs(msgPtr->tkwin, &messageClass, msgPtr);
@@ -525,7 +525,7 @@ MessageWorldChanged(
ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
- GC gc = NULL;
+ GC gc = None;
Tk_FontMetrics fm;
Message *msgPtr = instanceData;
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 698e8a9..920d93e 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -477,7 +477,7 @@ DoConfig(
Tk_Cursor newCursor, oldCursor;
if (nullValue) {
- newCursor = 0;
+ newCursor = None;
} else {
uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
newCursor = Tk_GetCursor(interp, tkwin, uid);
@@ -1024,7 +1024,7 @@ Tk_FreeOptions(
case TK_CONFIG_ACTIVE_CURSOR:
if (*((Tk_Cursor *) ptr) != None) {
Tk_FreeCursor(display, *((Tk_Cursor *) ptr));
- *((Tk_Cursor *) ptr) = NULL;
+ *((Tk_Cursor *) ptr) = None;
}
}
}
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 8233d35..45d784a 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -448,9 +448,9 @@ Tk_PanedWindowObjCmd(
pwPtr->optionTable = pwOpts->pwOptions;
pwPtr->slaveOpts = pwOpts->slaveOpts;
pwPtr->relief = TK_RELIEF_RAISED;
- pwPtr->gc = NULL;
- pwPtr->cursor = NULL;
- pwPtr->sashCursor = NULL;
+ pwPtr->gc = None;
+ pwPtr->cursor = None;
+ pwPtr->sashCursor = None;
/*
* Keep a hold of the associated tkwin until we destroy the widget,
@@ -2044,10 +2044,10 @@ Unlink(
for (i = 0; i < masterPtr->numSlaves; i++) {
if (masterPtr->slaves[i]->before == slavePtr->tkwin) {
- masterPtr->slaves[i]->before = NULL;
+ masterPtr->slaves[i]->before = None;
}
if (masterPtr->slaves[i]->after == slavePtr->tkwin) {
- masterPtr->slaves[i]->after = NULL;
+ masterPtr->slaves[i]->after = None;
}
}
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index c1b16b3..9fa406a 100644
--- a/generic/tkPlace.c
+++ b/generic/tkPlace.c
@@ -395,7 +395,7 @@ CreateSlave(
slavePtr = ckalloc(sizeof(Slave));
memset(slavePtr, 0, sizeof(Slave));
slavePtr->tkwin = tkwin;
- slavePtr->inTkwin = 0;
+ slavePtr->inTkwin = None;
slavePtr->anchor = TK_ANCHOR_NW;
slavePtr->borderMode = BM_INSIDE;
slavePtr->optionTable = table;
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 30e1d50..4d48fe7 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -258,7 +258,7 @@ CreateRectOval(
rectOvalPtr->fillStipple = None;
rectOvalPtr->activeFillStipple = None;
rectOvalPtr->disabledFillStipple = None;
- rectOvalPtr->fillGC = NULL;
+ rectOvalPtr->fillGC = None;
/*
* Process the arguments to fill in the item record.
@@ -466,9 +466,9 @@ ConfigureRectOval(
mask |= GCCapStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else {
- newGC = NULL;
+ newGC = None;
}
- if (rectOvalPtr->outline.gc) {
+ if (rectOvalPtr->outline.gc != None) {
Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->outline.gc);
}
rectOvalPtr->outline.gc = newGC;
@@ -499,8 +499,8 @@ ConfigureRectOval(
}
}
- if (!color) {
- newGC = NULL;
+ if (color == NULL) {
+ newGC = None;
} else {
gcValues.foreground = color->pixel;
if (stipple != None) {
@@ -516,13 +516,13 @@ ConfigureRectOval(
* fills (as linewidth controls antialiasing).
*/
- gcValues.line_width = rectOvalPtr->outline.gc ?
+ gcValues.line_width = rectOvalPtr->outline.gc != None ?
rectOvalPtr->outline.gc->line_width : 0;
mask |= GCLineWidth;
#endif
newGC = Tk_GetGC(tkwin, mask, &gcValues);
}
- if (rectOvalPtr->fillGC) {
+ if (rectOvalPtr->fillGC != None) {
Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->fillGC);
}
rectOvalPtr->fillGC = newGC;
@@ -1470,7 +1470,7 @@ RectOvalToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (fillStipple) {
+ if (fillStipple != None) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
diff --git a/generic/tkScale.c b/generic/tkScale.c
index 71de55f..af45afa 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -270,11 +270,11 @@ Tk_ScaleObjCmd(
scalePtr->activeBorder = NULL;
scalePtr->sliderRelief = TK_RELIEF_RAISED;
scalePtr->troughColorPtr = NULL;
- scalePtr->troughGC = NULL;
- scalePtr->copyGC = NULL;
+ scalePtr->troughGC = None;
+ scalePtr->copyGC = None;
scalePtr->tkfont = NULL;
scalePtr->textColorPtr = NULL;
- scalePtr->textGC = NULL;
+ scalePtr->textGC = None;
scalePtr->relief = TK_RELIEF_FLAT;
scalePtr->highlightWidth = 0;
scalePtr->highlightBorder = NULL;
@@ -291,7 +291,7 @@ Tk_ScaleObjCmd(
scalePtr->vertTroughX = 0;
scalePtr->vertLabelX = 0;
scalePtr->fontHeight = 0;
- scalePtr->cursor = NULL;
+ scalePtr->cursor = None;
scalePtr->takeFocusPtr = NULL;
scalePtr->flags = NEVER_SET;
diff --git a/generic/tkScale.h b/generic/tkScale.h
index 73678ed..aa0feff 100644
--- a/generic/tkScale.h
+++ b/generic/tkScale.h
@@ -73,7 +73,7 @@ typedef struct TkScale {
* values. 0 means we get to choose the number
* based on resolution and/or the range of the
* scale. */
- char format[14]; /* Sprintf conversion specifier computed from
+ char format[16]; /* Sprintf conversion specifier computed from
* digits and other information. */
double bigIncrement; /* Amount to use for large increments to scale
* value. (0 means we pick a value). */
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index 9a85532..5017d30 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -185,7 +185,7 @@ Tk_ScrollbarObjCmd(
scrollPtr->lastUnit = 0;
scrollPtr->firstFraction = 0.0;
scrollPtr->lastFraction = 0.0;
- scrollPtr->cursor = NULL;
+ scrollPtr->cursor = None;
scrollPtr->takeFocus = NULL;
scrollPtr->flags = 0;
diff --git a/generic/tkSquare.c b/generic/tkSquare.c
index 39083d4..36d2d6e 100644
--- a/generic/tkSquare.c
+++ b/generic/tkSquare.c
@@ -169,7 +169,7 @@ SquareObjCmd(
squarePtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(squarePtr->tkwin), SquareWidgetObjCmd, squarePtr,
SquareDeletedProc);
- squarePtr->gc = NULL;
+ squarePtr->gc = None;
squarePtr->optionTable = optionTable;
if (Tk_InitOptions(interp, (char *) squarePtr, optionTable, tkwin)
diff --git a/generic/tkText.c b/generic/tkText.c
index 6c1512d..3d9977f 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -586,7 +586,7 @@ CreateWidget(
textPtr->state = TK_TEXT_STATE_NORMAL;
textPtr->relief = TK_RELIEF_FLAT;
- textPtr->cursor = NULL;
+ textPtr->cursor = None;
textPtr->charWidth = 1;
textPtr->charHeight = 10;
textPtr->wrapMode = TEXT_WRAPMODE_CHAR;
@@ -2294,10 +2294,10 @@ ConfigureText(
if ((textPtr->selTagPtr->border != NULL)
|| (textPtr->selTagPtr->selBorder != NULL)
|| (textPtr->selTagPtr->reliefString != NULL)
- || textPtr->selTagPtr->bgStipple
+ || (textPtr->selTagPtr->bgStipple != None)
|| (textPtr->selTagPtr->fgColor != NULL)
|| (textPtr->selTagPtr->selFgColor != NULL)
- || textPtr->selTagPtr->fgStipple
+ || (textPtr->selTagPtr->fgStipple != None)
|| (textPtr->selTagPtr->overstrikeString != NULL)
|| (textPtr->selTagPtr->overstrikeColor != NULL)
|| (textPtr->selTagPtr->underlineString != NULL)
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 4fb30e0..356e8b7 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -666,7 +666,7 @@ TkTextCreateDInfo(
dInfoPtr = ckalloc(sizeof(TextDInfo));
Tcl_InitHashTable(&dInfoPtr->styleTable, sizeof(StyleValues)/sizeof(int));
dInfoPtr->dLinePtr = NULL;
- dInfoPtr->copyGC = NULL;
+ dInfoPtr->copyGC = None;
gcValues.graphics_exposures = True;
dInfoPtr->scrollGC = Tk_GetGC(textPtr->tkwin, GCGraphicsExposures,
&gcValues);
@@ -862,7 +862,7 @@ GetStyle(
border = tagPtr->selBorder;
}
- if ((tagPtr->selFgColor) && (isSelected)) {
+ if ((tagPtr->selFgColor != None) && (isSelected)) {
fgColor = tagPtr->selFgColor;
}
@@ -889,7 +889,7 @@ GetStyle(
styleValues.bgStipple = tagPtr->bgStipple;
bgStipplePrio = tagPtr->priority;
}
- if (fgColor && (tagPtr->priority > fgPrio)) {
+ if ((fgColor != None) && (tagPtr->priority > fgPrio)) {
styleValues.fgColor = fgColor;
fgPrio = tagPtr->priority;
}
@@ -931,9 +931,9 @@ GetStyle(
&& (tagPtr->priority > overstrikePrio)) {
styleValues.overstrike = tagPtr->overstrike;
overstrikePrio = tagPtr->priority;
- if (tagPtr->overstrikeColor) {
+ if (tagPtr->overstrikeColor != None) {
styleValues.overstrikeColor = tagPtr->overstrikeColor;
- } else if (fgColor) {
+ } else if (fgColor != None) {
styleValues.overstrikeColor = fgColor;
}
}
@@ -976,9 +976,9 @@ GetStyle(
&& (tagPtr->priority > underlinePrio)) {
styleValues.underline = tagPtr->underline;
underlinePrio = tagPtr->priority;
- if (tagPtr->underlineColor) {
+ if (tagPtr->underlineColor != None) {
styleValues.underlineColor = tagPtr->underlineColor;
- } else if (fgColor) {
+ } else if (fgColor != None) {
styleValues.underlineColor = fgColor;
}
}
@@ -1025,7 +1025,7 @@ GetStyle(
}
stylePtr->bgGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues);
} else {
- stylePtr->bgGC = NULL;
+ stylePtr->bgGC = None;
}
mask = GCFont;
gcValues.font = Tk_FontId(styleValues.tkfont);
@@ -1082,10 +1082,10 @@ FreeStyle(
if (stylePtr->fgGC != None) {
Tk_FreeGC(textPtr->display, stylePtr->fgGC);
}
- if (stylePtr->ulGC) {
+ if (stylePtr->ulGC != None) {
Tk_FreeGC(textPtr->display, stylePtr->ulGC);
}
- if (stylePtr->ovGC) {
+ if (stylePtr->ovGC != None) {
Tk_FreeGC(textPtr->display, stylePtr->ovGC);
}
Tcl_DeleteHashEntry(stylePtr->hPtr);
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 3a7052a..9ade3ad 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -534,10 +534,10 @@ TkTextTagCmd(
if ((tagPtr->border != NULL)
|| (tagPtr->selBorder != NULL)
|| (tagPtr->reliefString != NULL)
- || tagPtr->bgStipple
+ || (tagPtr->bgStipple != None)
|| (tagPtr->fgColor != NULL)
|| (tagPtr->selFgColor != NULL)
- || tagPtr->fgStipple
+ || (tagPtr->fgStipple != None)
|| (tagPtr->overstrikeString != NULL)
|| (tagPtr->overstrikeColor != NULL)
|| (tagPtr->underlineString != NULL)
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 839e860..d175ef9 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -474,9 +474,9 @@ GetScreen(
dispPtr->lastEventTime = CurrentTime;
dispPtr->bindInfoStale = 1;
- dispPtr->cursorFont = 0;
+ dispPtr->cursorFont = None;
dispPtr->warpWindow = NULL;
- dispPtr->multipleAtom = 0;
+ dispPtr->multipleAtom = None;
/*
* By default we do want to collapse motion events in
@@ -2088,7 +2088,7 @@ void
Tk_UndefineCursor(
Tk_Window tkwin) /* Window to manipulate. */
{
- Tk_DefineCursor(tkwin, NULL);
+ Tk_DefineCursor(tkwin, None);
}
void
@@ -2357,7 +2357,7 @@ Tk_IdToWindow(
break;
}
}
- if (!window) {
+ if (window == None) {
return NULL;
}
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index a8bb717..f6a9c27 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1265,7 +1265,7 @@ static void EntryDisplay(void *clientData, Drawable d)
cursorX = field.x + field.width - cursorWidth;
}
- gc = EntryGetGC(entryPtr, es.insertColorObj, 0);
+ gc = EntryGetGC(entryPtr, es.insertColorObj, None);
XFillRectangle(Tk_Display(tkwin), d, gc,
cursorX, cursorY, cursorWidth, cursorHeight);
Tk_FreeGC(Tk_Display(tkwin), gc);
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index a0b6a79..b749673 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -37,7 +37,7 @@
#define ACTIVE_BG "systemButtonFacePressed"
#define ACTIVE_FG "systemPushButtonPressedText"
#define SELECT_BG "systemHighlight"
-#define SELECT_FG NULL
+#define SELECT_FG None
#define INACTIVE_SELECT_BG "systemHighlightSecondary"
#define TROUGH "#c3c3c3"
#define INDICATOR "#b03060"
@@ -282,7 +282,7 @@
#define DEF_MENU_ENTRY_ACTIVE_FG NULL
#define DEF_MENU_ENTRY_ACCELERATOR NULL
#define DEF_MENU_ENTRY_BG NULL
-#define DEF_MENU_ENTRY_BITMAP NULL
+#define DEF_MENU_ENTRY_BITMAP None
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
#define DEF_MENU_ENTRY_COMMAND NULL
#define DEF_MENU_ENTRY_COMPOUND "none"
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index fd1ec22..e828b39 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -1950,7 +1950,7 @@ FontchooserParentEventHandler(
if (eventPtr->type == DestroyNotify) {
Tk_DeleteEventHandler(fcdPtr->parent, StructureNotifyMask,
FontchooserParentEventHandler, fcdPtr);
- fcdPtr->parent = NULL;
+ fcdPtr->parent = None;
FontchooserHideCmd(NULL, NULL, 0, NULL);
}
}
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 589475c..f6c32b3 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -494,7 +494,7 @@ TkMacOSXContainerId(
}
}
Tcl_Panic("TkMacOSXContainerId couldn't find window");
- return NULL;
+ return None;
}
/*
@@ -530,8 +530,8 @@ TkMacOSXGetHostToplevel(
* TODO: Here we should handle out of process embedding.
*/
- if (!contWinPtr) {
- return NULL;
+ if (contWinPtr == NULL) {
+ return None;
}
return TkMacOSXGetHostToplevel(contWinPtr);
}
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 8f3be9f..ec32a78 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -1481,10 +1481,10 @@ TkpMenuInit(void)
#undef observe
[NSMenuItem setUsesUserKeyEquivalents:NO];
- tkColPtr = TkpGetColor(NULL, DEF_MENU_BG_COLOR);
+ tkColPtr = TkpGetColor(None, DEF_MENU_BG_COLOR);
defaultBg = tkColPtr->color.pixel;
ckfree(tkColPtr);
- tkColPtr = TkpGetColor(NULL, DEF_MENU_FG);
+ tkColPtr = TkpGetColor(None, DEF_MENU_FG);
defaultFg = tkColPtr->color.pixel;
ckfree(tkColPtr);
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c
index 688829d..d1287bb 100644
--- a/macosx/tkMacOSXScrlbr.c
+++ b/macosx/tkMacOSXScrlbr.c
@@ -119,8 +119,8 @@ TkpCreateScrollbar(
MacScrollbar *scrollPtr = (MacScrollbar *)ckalloc(sizeof(MacScrollbar));
- scrollPtr->troughGC = NULL;
- scrollPtr->copyGC = NULL;
+ scrollPtr->troughGC = None;
+ scrollPtr->copyGC = None;
scrollPtr->info = defaultInfo;
scrollPtr->buttonDown = false;
diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c
index 58004d9..038d4e1 100644
--- a/unix/tkUnix3d.c
+++ b/unix/tkUnix3d.c
@@ -48,7 +48,7 @@ TkpGetBorder(void)
{
UnixBorder *borderPtr = ckalloc(sizeof(UnixBorder));
- borderPtr->solidGC = NULL;
+ borderPtr->solidGC = None;
return (TkBorder *) borderPtr;
}
@@ -216,7 +216,7 @@ Tk_3DHorizontalBevel(
Display *display = Tk_Display(tkwin);
int bottom, halfway, x1, x2, x1Delta, x2Delta;
UnixBorder *unixBorderPtr = (UnixBorder *) borderPtr;
- GC topGC = NULL, bottomGC = NULL;
+ GC topGC = None, bottomGC = None;
/* Initializations needed only to prevent
* compiler warnings. */
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index 21f6276..2c3854d 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -244,7 +244,7 @@
#define DEF_MENU_ENTRY_ACTIVE_FG ((char *) NULL)
#define DEF_MENU_ENTRY_ACCELERATOR ((char *) NULL)
#define DEF_MENU_ENTRY_BG ((char *) NULL)
-#define DEF_MENU_ENTRY_BITMAP NULL
+#define DEF_MENU_ENTRY_BITMAP None
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
#define DEF_MENU_ENTRY_COMMAND ((char *) NULL)
#define DEF_MENU_ENTRY_COMPOUND "none"
diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c
index 6cb80f4..ad71b7b 100644
--- a/unix/tkUnixMenubu.c
+++ b/unix/tkUnixMenubu.c
@@ -92,10 +92,10 @@ TkpDisplayMenuButton(
border = mbPtr->normalBorder;
}
- if (mbPtr->image) {
+ if (mbPtr->image != None) {
Tk_SizeOfImage(mbPtr->image, &width, &height);
haveImage = 1;
- } else if (mbPtr->bitmap) {
+ } else if (mbPtr->bitmap != None) {
Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
haveImage = 1;
}
@@ -183,7 +183,7 @@ TkpDisplayMenuButton(
if (mbPtr->image != NULL) {
Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,
imageXOffset, imageYOffset);
- } else if (mbPtr->bitmap) {
+ } else if (mbPtr->bitmap != None) {
XSetClipOrigin(mbPtr->display, gc, imageXOffset, imageYOffset);
XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,
gc, 0, 0, (unsigned) width, (unsigned) height,
@@ -203,7 +203,7 @@ TkpDisplayMenuButton(
if (mbPtr->image != NULL) {
Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,
imageXOffset, imageYOffset);
- } else if (mbPtr->bitmap) {
+ } else if (mbPtr->bitmap != None) {
XSetClipOrigin(mbPtr->display, gc, x, y);
XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,
gc, 0, 0, (unsigned) width, (unsigned) height,
@@ -358,10 +358,10 @@ TkpComputeMenuButtonGeometry(
txtHeight = 0;
avgWidth = 0;
- if (mbPtr->image) {
+ if (mbPtr->image != None) {
Tk_SizeOfImage(mbPtr->image, &width, &height);
haveImage = 1;
- } else if (mbPtr->bitmap) {
+ } else if (mbPtr->bitmap != None) {
Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
haveImage = 1;
}
diff --git a/win/stubs.c b/win/stubs.c
index 24df27c..1cf23ef 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -397,7 +397,7 @@ XGetWindowProperty(
unsigned long *bytes_after_return,
unsigned char **prop_return)
{
- *actual_type_return = 0;
+ *actual_type_return = None;
*actual_format_return = 0;
*nitems_return = 0;
*bytes_after_return = 0;
diff --git a/win/tkWin3d.c b/win/tkWin3d.c
index bf7a539..d3c443d 100644
--- a/win/tkWin3d.c
+++ b/win/tkWin3d.c
@@ -127,7 +127,7 @@ Tk_3DVerticalBevel(
HDC dc = TkWinGetDrawableDC(display, drawable, &state);
int half;
- if (!borderPtr->lightGC && (relief != TK_RELIEF_FLAT)) {
+ if ((borderPtr->lightGC == None) && (relief != TK_RELIEF_FLAT)) {
TkpGetShadows(borderPtr, tkwin);
}
@@ -222,7 +222,7 @@ Tk_3DHorizontalBevel(
HDC dc = TkWinGetDrawableDC(display, drawable, &state);
int topColor, bottomColor;
- if (!borderPtr->lightGC && (relief != TK_RELIEF_FLAT)) {
+ if ((borderPtr->lightGC == None) && (relief != TK_RELIEF_FLAT)) {
TkpGetShadows(borderPtr, tkwin);
}
@@ -339,7 +339,7 @@ TkpGetShadows(
int r, g, b;
XGCValues gcValues;
- if (borderPtr->lightGC) {
+ if (borderPtr->lightGC != None) {
return;
}
@@ -465,10 +465,10 @@ TkpGetShadows(
return;
}
- if (!borderPtr->shadow) {
+ if (borderPtr->shadow == None) {
borderPtr->shadow = Tk_GetBitmap((Tcl_Interp *) NULL, tkwin,
Tk_GetUid("gray50"));
- if (!borderPtr->shadow) {
+ if (borderPtr->shadow == None) {
Tcl_Panic("TkpGetShadows couldn't allocate bitmap for border");
}
}
@@ -540,7 +540,7 @@ TkWinGetBorderPixels(
{
WinBorder *borderPtr = (WinBorder *) border;
- if (!borderPtr->info.lightGC) {
+ if (borderPtr->info.lightGC == None) {
TkpGetShadows(&borderPtr->info, tkwin);
}
switch (which) {
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 32c2499..e46bcb3 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -433,10 +433,10 @@ TkpDisplayButton(
* Display image or bitmap or text for button.
*/
- if (butPtr->image) {
+ if (butPtr->image != None) {
Tk_SizeOfImage(butPtr->image, &width, &height);
haveImage = 1;
- } else if (butPtr->bitmap) {
+ } else if (butPtr->bitmap != None) {
Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
haveImage = 1;
}
@@ -839,7 +839,7 @@ TkpComputeButtonGeometry(
if (butPtr->image != NULL) {
Tk_SizeOfImage(butPtr->image, &imgWidth, &imgHeight);
haveImage = 1;
- } else if (butPtr->bitmap) {
+ } else if (butPtr->bitmap != None) {
Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap,
&imgWidth, &imgHeight);
haveImage = 1;
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index 028c204..f389075 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -247,7 +247,7 @@
#define DEF_MENU_ENTRY_ACTIVE_FG ((char *) NULL)
#define DEF_MENU_ENTRY_ACCELERATOR ((char *) NULL)
#define DEF_MENU_ENTRY_BG ((char *) NULL)
-#define DEF_MENU_ENTRY_BITMAP NULL
+#define DEF_MENU_ENTRY_BITMAP None
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
#define DEF_MENU_ENTRY_COMMAND ((char *) NULL)
#define DEF_MENU_ENTRY_COMPOUND "none"
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 6795ef3..d6d2c7d 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -3351,7 +3351,7 @@ FontchooserConfigureCmd(
Tk_Window parent = Tk_NameToWindow(interp,
Tcl_GetString(objv[i+1]), tkwin);
- if (!parent) {
+ if (parent == None) {
return TCL_ERROR;
}
if (hdPtr->parentObj) {
@@ -3446,7 +3446,7 @@ FontchooserShowCmd(
if (hdPtr->parentObj) {
parent = Tk_NameToWindow(interp, Tcl_GetString(hdPtr->parentObj),
tkwin);
- if (!parent) {
+ if (parent == None) {
return TCL_ERROR;
}
}
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 2c35d3b..e13a5e5 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -644,7 +644,7 @@ XFillRectangles(
TkWinDCState state;
HBRUSH brush, oldBrush;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -654,7 +654,7 @@ XFillRectangles(
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HBRUSH stipple;
HBITMAP oldBitmap, bitmap;
@@ -818,7 +818,7 @@ RenderObject(
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HDC dcMem;
@@ -942,7 +942,7 @@ XDrawLines(
TkWinDCState state;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -987,7 +987,7 @@ XFillPolygon(
TkWinDCState state;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -1029,7 +1029,7 @@ XDrawRectangle(
HBRUSH oldBrush;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -1214,7 +1214,7 @@ DrawOrFillArc(
int xstart, ystart, xend, yend;
double radian_start, radian_end, xr, yr;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 25bb6f8..43c5e25 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -242,7 +242,7 @@ TkpUseWindow(
*/
/*
- if (winPtr->window) {
+ if (winPtr->window != None) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't modify container after widget is created", -1));
Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL);
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 977086b..d67ea66 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -519,7 +519,7 @@ TkpGetFontFromAttributes(
tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr;
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
/*
@@ -632,7 +632,7 @@ TkpGetFontFamilies(
Tcl_Obj *resultObj;
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
resultObj = Tcl_NewObj();
@@ -1089,7 +1089,7 @@ Tk_DrawChars(
fontPtr = (WinFont *) gc->font;
display->request++;
- if (!drawable) {
+ if (drawable == None) {
return;
}
@@ -1097,14 +1097,14 @@ Tk_DrawChars(
SetROP2(dc, tkpWinRopModes[gc->function]);
- if (gc->clip_mask &&
+ if ((gc->clip_mask != None) &&
((TkpClipMask *) gc->clip_mask)->type == TKP_CLIP_REGION) {
SelectClipRgn(dc, (HRGN)((TkpClipMask *)gc->clip_mask)->value.region);
}
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *) gc->stipple;
HBRUSH oldBrush, stipple;
HBITMAP oldBitmap, bitmap;
@@ -1237,7 +1237,7 @@ TkDrawAngledChars(
fontPtr = (WinFont *) gc->font;
display->request++;
- if (!drawable) {
+ if (drawable == None) {
return;
}
@@ -1245,14 +1245,14 @@ TkDrawAngledChars(
SetROP2(dc, tkpWinRopModes[gc->function]);
- if (gc->clip_mask &&
+ if ((gc->clip_mask != None) &&
((TkpClipMask *) gc->clip_mask)->type == TKP_CLIP_REGION) {
SelectClipRgn(dc, (HRGN)((TkpClipMask *)gc->clip_mask)->value.region);
}
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HBRUSH oldBrush, stipple;
HBITMAP oldBitmap, bitmap;
@@ -1568,7 +1568,7 @@ InitFont(
TCHAR buf[LF_FACESIZE];
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
oldFont = SelectObject(hdc, hFont);
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index b03cf6d..a409764 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -2364,7 +2364,7 @@ DrawMenuEntryLabel(
XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
(unsigned) width, (unsigned) height);
} else if ((mePtr->image != NULL)
- && menuPtr->disabledImageGC) {
+ && (menuPtr->disabledImageGC != None)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
leftEdge + imageXOffset,
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
@@ -3005,7 +3005,7 @@ MenuSelectEvent(
Tk_MakeWindowExist(menuPtr->tkwin);
event.event = Tk_WindowId(menuPtr->tkwin);
event.root = XRootWindow(menuPtr->display, 0);
- event.subwindow = 0;
+ event.subwindow = None;
event.time = TkpGetMS();
root.msgpos = GetMessagePos();
diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c
index a45a322..aa1ebde 100644
--- a/win/tkWinPixmap.c
+++ b/win/tkWinPixmap.c
@@ -115,7 +115,7 @@ Tk_GetPixmap(
if (newTwdPtr->bitmap.handle == NULL) {
ckfree(newTwdPtr);
- return 0;
+ return None;
}
return (Pixmap) newTwdPtr;
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index 869c059..6f1f840 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -401,7 +401,7 @@ XGetInputFocus(
{
Tk_Window tkwin = Tk_HWNDToWindow(GetFocus());
- *focus_return = tkwin ? Tk_WindowId(tkwin) : 0;
+ *focus_return = tkwin ? Tk_WindowId(tkwin) : None;
*revert_to_return = RevertToParent;
display->request++;
return Success;
@@ -432,7 +432,7 @@ XSetInputFocus(
Time time)
{
display->request++;
- if (focus) {
+ if (focus != None) {
SetFocus(Tk_GetHWND(focus));
}
return Success;
@@ -479,7 +479,7 @@ TkpChangeFocus(
}
}
- if (!winPtr->window) {
+ if (winPtr->window == None) {
Tcl_Panic("ChangeXFocus got null X window");
}
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index d9e7812..965dbc5 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -117,7 +117,7 @@
*/
#define TkpDefineNativeBitmaps()
-#define TkpCreateNativeBitmap(display, source) 0
-#define TkpGetNativeAppBitmap(display, name, w, h) 0
+#define TkpCreateNativeBitmap(display, source) None
+#define TkpGetNativeAppBitmap(display, name, w, h) None
#endif /* _WINPORT */
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c
index 5393054..1b3717e 100644
--- a/win/tkWinScrlbr.c
+++ b/win/tkWinScrlbr.c
@@ -237,7 +237,7 @@ CreateProc(
for (winPtr = ((TkWindow*)tkwin)->nextPtr; winPtr != NULL;
winPtr = winPtr->nextPtr) {
- if ((winPtr->window) && !(winPtr->flags & TK_TOP_HIERARCHY)) {
+ if ((winPtr->window != None) && !(winPtr->flags & TK_TOP_HIERARCHY)) {
TkWinSetWindowPos(scrollPtr->hwnd, Tk_GetHWND(winPtr->window),
Below);
break;
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index d037f07..385e72b 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -233,7 +233,7 @@ TkpScanWindowId(
if (tkwin) {
*idPtr = Tk_WindowId(tkwin);
} else {
- *idPtr = 0;
+ *idPtr = None;
}
return TCL_OK;
}
@@ -264,7 +264,7 @@ TkpMakeWindow(
int style;
HWND hwnd;
- if (parent) {
+ if (parent != None) {
parentWin = Tk_GetHWND(parent);
style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
} else {
@@ -674,7 +674,7 @@ XConfigureWindow(
if (valueMask & CWStackMode) {
HWND sibling;
- if ((valueMask & CWSibling) && values->sibling) {
+ if ((valueMask & CWSibling) && (values->sibling != None)) {
sibling = Tk_GetHWND(values->sibling);
} else {
sibling = NULL;
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 7c73094..4e7618d 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -978,7 +978,7 @@ WinSetIcon(
NULL);
return TCL_ERROR;
}
- if (!Tk_WindowId(tkw)) {
+ if (Tk_WindowId(tkw) == None) {
Tk_MakeWindowExist(tkw);
}
@@ -1144,7 +1144,7 @@ TkWinGetIcon(
}
}
- if (!Tk_WindowId(tkwin)) {
+ if (Tk_WindowId(tkwin) == None) {
Tk_MakeWindowExist(tkwin);
}
@@ -1922,11 +1922,11 @@ TkWmNewWindow(
wmPtr->hints.flags = InputHint | StateHint;
wmPtr->hints.input = True;
wmPtr->hints.initial_state = NormalState;
- wmPtr->hints.icon_pixmap = 0;
- wmPtr->hints.icon_window = 0;
+ wmPtr->hints.icon_pixmap = None;
+ wmPtr->hints.icon_window = None;
wmPtr->hints.icon_x = wmPtr->hints.icon_y = 0;
- wmPtr->hints.icon_mask = 0;
- wmPtr->hints.window_group = 0;
+ wmPtr->hints.icon_mask = None;
+ wmPtr->hints.window_group = None;
/*
* Default the maximum dimensions to the size of the display.
@@ -2007,7 +2007,7 @@ UpdateWrapper(
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (!winPtr->window) {
+ if (winPtr->window == None) {
/*
* Ensure existence of the window to update the wrapper for.
*/
@@ -2625,7 +2625,7 @@ TkWmDeadWindow(
VisibilityChangeMask|StructureNotifyMask,
WmWaitVisibilityOrMapProc, wmPtr2->winPtr);
wmPtr2->masterPtr = NULL;
- if (wmPtr2->wrapper
+ if ((wmPtr2->wrapper != None)
&& !(wmPtr2->flags & (WM_NEVER_MAPPED))) {
UpdateWrapper(wmPtr2->winPtr);
}
@@ -3433,7 +3433,7 @@ WmColormapwindowsCmd(
if (winPtr2 == winPtr) {
gotToplevel = 1;
}
- if (!winPtr2->window) {
+ if (winPtr2->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr2);
}
cmapList[i] = winPtr2;
@@ -3721,7 +3721,7 @@ WmFrameCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- if (!Tk_WindowId((Tk_Window) winPtr)) {
+ if (Tk_WindowId((Tk_Window) winPtr) == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
}
hwnd = wmPtr->wrapper;
@@ -4023,9 +4023,9 @@ WmIconbitmapCmd(
string = Tcl_GetString(objv[objc-1]);
if (*string == '\0') {
- if (wmPtr->hints.icon_pixmap) {
+ if (wmPtr->hints.icon_pixmap != None) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
- wmPtr->hints.icon_pixmap = 0;
+ wmPtr->hints.icon_pixmap = None;
}
wmPtr->hints.flags &= ~IconPixmapHint;
if (WinSetIcon(interp, NULL, (Tk_Window) useWinPtr) != TCL_OK) {
@@ -4078,7 +4078,7 @@ WmIconbitmapCmd(
Tcl_ResetResult(interp);
pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, string);
- if (!pixmap) {
+ if (pixmap == None) {
return TCL_ERROR;
}
wmPtr->hints.icon_pixmap = pixmap;
@@ -4206,13 +4206,13 @@ WmIconmaskCmd(
}
argv3 = Tcl_GetString(objv[3]);
if (*argv3 == '\0') {
- if (wmPtr->hints.icon_mask) {
+ if (wmPtr->hints.icon_mask != None) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
}
wmPtr->hints.flags &= ~IconMaskHint;
} else {
pixmap = Tk_GetBitmap(interp, tkwin, argv3);
- if (!pixmap) {
+ if (pixmap == None) {
return TCL_ERROR;
}
wmPtr->hints.icon_mask = pixmap;
@@ -6427,7 +6427,7 @@ Tk_GetRootCoords(
* If the window is mapped, let Windows figure out the translation.
*/
- if (winPtr->window) {
+ if (winPtr->window != None) {
HWND hwnd = Tk_GetHWND(winPtr->window);
POINT point;
@@ -6854,7 +6854,7 @@ TkWmRestackToplevel(
* (mapping it may give it a reparent window).
*/
- if (!winPtr->window) {
+ if (winPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
}
if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
@@ -6864,7 +6864,7 @@ TkWmRestackToplevel(
? winPtr->wmInfoPtr->wrapper : Tk_GetHWND(winPtr->window);
if (otherPtr != NULL) {
- if (!otherPtr->window) {
+ if (otherPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) otherPtr);
}
if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
@@ -6915,7 +6915,7 @@ TkWmAddToColormapWindows(
TkWindow **oldPtr, **newPtr;
int count, i;
- if (!winPtr->window) {
+ if (winPtr->window == None) {
return;
}
@@ -7350,7 +7350,7 @@ GenerateConfigureNotify(
event.xconfigure.y = winPtr->changes.y;
event.xconfigure.width = winPtr->changes.width;
event.xconfigure.height = winPtr->changes.height;
- event.xconfigure.above = 0;
+ event.xconfigure.above = None;
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
}
@@ -8623,7 +8623,7 @@ TkpWinToplevelDetachWindow(
SendMessage(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0);
winPtr->flags &= ~TK_EMBEDDED;
winPtr->privatePtr = NULL;
- wmPtr->wrapper = 0;
+ wmPtr->wrapper = None;
if (state >= 0 && state <= 3) {
wmPtr->hints.initial_state = state;
}
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 661be57..a217108 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -522,10 +522,10 @@ TkWinDisplayChanged(
screen->root_visual->bits_per_rgb = screen->root_depth;
ReleaseDC(NULL, dc);
- if (screen->cmap) {
+ if (screen->cmap != None) {
XFreeColormap(display, screen->cmap);
}
- screen->cmap = XCreateColormap(display, 0, screen->root_visual,
+ screen->cmap = XCreateColormap(display, None, screen->root_visual,
AllocNone);
}
@@ -585,7 +585,7 @@ TkpOpenDisplay(
twdPtr = ckalloc(sizeof(TkWinDrawable));
if (twdPtr == NULL) {
- return 0;
+ return None;
}
twdPtr->type = TWD_WINDOW;
twdPtr->window.winPtr = NULL;
@@ -598,7 +598,7 @@ TkpOpenDisplay(
screen->white_pixel = RGB(255, 255, 255);
screen->black_pixel = RGB(0, 0, 0);
- screen->cmap = 0;
+ screen->cmap = None;
display->screens = screen;
display->nscreens = 1;
@@ -655,10 +655,10 @@ TkpCloseDisplay(
if (display->screens->root_visual != NULL) {
ckfree(display->screens->root_visual);
}
- if (display->screens->root) {
+ if (display->screens->root != None) {
ckfree(display->screens->root);
}
- if (display->screens->cmap) {
+ if (display->screens->cmap != None) {
XFreeColormap(display, display->screens->cmap);
}
ckfree(display->screens);
@@ -998,7 +998,7 @@ GenerateXEvent(
}
winPtr = (TkWindow *) Tk_HWNDToWindow(hwnd);
- if (!winPtr || !winPtr->window) {
+ if (!winPtr || winPtr->window == None) {
return;
}
@@ -1121,7 +1121,7 @@ GenerateXEvent(
*/
event.xbutton.root = RootWindow(winPtr->display, winPtr->screenNum);
- event.xbutton.subwindow = 0;
+ event.xbutton.subwindow = None;
event.xbutton.x = clientPoint.x;
event.xbutton.y = clientPoint.y;
event.xbutton.x_root = root.point.x;
@@ -1623,7 +1623,7 @@ HandleIMEComposition(
event.xkey.display = winPtr->display;
event.xkey.window = winPtr->window;
event.xkey.root = RootWindow(winPtr->display, winPtr->screenNum);
- event.xkey.subwindow = 0;
+ event.xkey.subwindow = None;
event.xkey.state = TkWinGetModifierState();
event.xkey.time = TkpGetMS();
event.xkey.same_screen = True;
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index de207ad..3de1504 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -455,7 +455,7 @@ InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d)
{
Window win = Tk_WindowId(tkwin);
- if (win) {
+ if (win != None) {
elementData->hwnd = Tk_GetHWND(win);
} else {
elementData->hwnd = elementData->procs->stubWindow;
diff --git a/xlib/X11/X.h b/xlib/X11/X.h
index 316683b..daf2283 100644
--- a/xlib/X11/X.h
+++ b/xlib/X11/X.h
@@ -73,7 +73,7 @@ typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs
* RESERVED RESOURCE AND CONSTANT DEFINITIONS
*****************************************************************/
-/* define None 0L See bug [9e31fd9449] and below */
+#define None 0L /* universal null resource or null atom */
#define ParentRelative 1L /* background pixmap in CreateWindow
and ChangeWindowAttributes */
@@ -179,16 +179,13 @@ are reserved in the protocol for errors and replies. */
#define ShiftMask (1<<0)
#define LockMask (1<<1)
-/* define ControlMask (1<<2) See bug [9e31fd9449] and below */
+#define ControlMask (1<<2)
#define Mod1Mask (1<<3)
#define Mod2Mask (1<<4)
#define Mod3Mask (1<<5)
#define Mod4Mask (1<<6)
#define Mod5Mask (1<<7)
-/* See bug [9e31fd9449], this way prevents conflicts with Win32 headers */
-enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) };
-
/* modifier names. Used to build a SetModifierMapping request or
to read a GetModifierMapping request. These correspond to the
masks defined above. */
@@ -297,7 +294,7 @@ enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) };
/* Used in SetInputFocus, GetInputFocus */
-#define RevertToNone 0
+#define RevertToNone (int)None
#define RevertToPointerRoot (int)PointerRoot
#define RevertToParent 2
diff --git a/xlib/xgc.c b/xlib/xgc.c
index be66b21..984c949 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -50,7 +50,7 @@
static TkpClipMask *AllocClipMask(GC gc) {
TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask;
- if (!clip_mask) {
+ if (clip_mask == None) {
clip_mask = ckalloc(sizeof(TkpClipMask));
gc->clip_mask = (Pixmap) clip_mask;
#ifdef MAC_OSX_TK
@@ -78,14 +78,14 @@ static TkpClipMask *AllocClipMask(GC gc) {
*/
static void FreeClipMask(GC gc) {
- if (gc->clip_mask) {
+ if (gc->clip_mask != None) {
#ifdef MAC_OSX_TK
if (((TkpClipMask*) gc->clip_mask)->type == TKP_CLIP_REGION) {
TkpReleaseRegion(((TkpClipMask*) gc->clip_mask)->value.region);
}
#endif
ckfree(gc->clip_mask);
- gc->clip_mask = 0;
+ gc->clip_mask = None;
}
}
@@ -125,7 +125,7 @@ XCreateGC(
gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
if (!gp) {
- return 0;
+ return None;
}
#define InitField(name,maskbit,default) \
@@ -144,11 +144,11 @@ XCreateGC(
InitField(fill_style, GCFillStyle, FillSolid);
InitField(fill_rule, GCFillRule, WindingRule);
InitField(arc_mode, GCArcMode, ArcPieSlice);
- InitField(tile, GCTile, 0);
- InitField(stipple, GCStipple, 0);
+ InitField(tile, GCTile, None);
+ InitField(stipple, GCStipple, None);
InitField(ts_x_origin, GCTileStipXOrigin, 0);
InitField(ts_y_origin, GCTileStipYOrigin, 0);
- InitField(font, GCFont, 0);
+ InitField(font, GCFont, None);
InitField(subwindow_mode, GCSubwindowMode, ClipByChildren);
InitField(graphics_exposures, GCGraphicsExposures, True);
InitField(clip_x_origin, GCClipXOrigin, 0);
@@ -157,7 +157,7 @@ XCreateGC(
InitField(dashes, GCDashList, 4);
(&(gp->dashes))[1] = 0;
- gp->clip_mask = 0;
+ gp->clip_mask = None;
if (mask & GCClipMask) {
TkpClipMask *clip_mask = AllocClipMask(gp);
@@ -268,7 +268,7 @@ int XFreeGC(
Display *d,
GC gc)
{
- if (gc) {
+ if (gc != None) {
FreeClipMask(gc);
TkpFreeGCCache(gc);
ckfree(gc);
@@ -464,7 +464,7 @@ TkSetRegion(
GC gc,
TkRegion r)
{
- if (!r) {
+ if (r == None) {
Tcl_Panic("must not pass None to TkSetRegion for compatibility with X11; use XSetClipMask instead");
} else {
TkpClipMask *clip_mask = AllocClipMask(gc);
@@ -483,7 +483,7 @@ XSetClipMask(
GC gc,
Pixmap pixmap)
{
- if (!pixmap) {
+ if (pixmap == None) {
FreeClipMask(gc);
} else {
TkpClipMask *clip_mask = AllocClipMask(gc);
diff --git a/xlib/ximage.c b/xlib/ximage.c
index f7bf1cc..aaab946 100644
--- a/xlib/ximage.c
+++ b/xlib/ximage.c
@@ -47,7 +47,7 @@ XCreateBitmapFromData(
pix = Tk_GetPixmap(display, d, (int) width, (int) height, 1);
gc = XCreateGC(display, pix, 0, NULL);
if (gc == NULL) {
- return 0;
+ return None;
}
ximage = XCreateImage(display, NULL, 1, XYBitmap, 0, (char*) data, width,
height, 8, (width + 7) / 8);