summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvArc.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-31 15:56:41 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-31 15:56:41 (GMT)
commit4224e39596e02ca9cf11a2c160d8f8e7b43a45f9 (patch)
treee78b5e9ecbd064bd24bc43894cd3dd4e9e075480 /generic/tkCanvArc.c
parentccc7f53ac59980eae109a3314ba3599a8b851fb1 (diff)
parentf2b5a87d6dc6d3468828d48929583d950690a40b (diff)
downloadtk-4224e39596e02ca9cf11a2c160d8f8e7b43a45f9.zip
tk-4224e39596e02ca9cf11a2c160d8f8e7b43a45f9.tar.gz
tk-4224e39596e02ca9cf11a2c160d8f8e7b43a45f9.tar.bz2
As requested by Christian Werner/François Vogel and others: Undo many None -> 0 changes, in order to reduce the probability of merge conflicts with other branches.
Remark: Many usages of "None" in Tk are wrong, "NULL" should be used in many places where pointers are referenced in stead of XID's. Those places are corrected.
Diffstat (limited to 'generic/tkCanvArc.c')
-rw-r--r--generic/tkCanvArc.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index f163c60..cd9ab33 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -286,11 +286,11 @@ CreateArc(
arcPtr->fillColor = NULL;
arcPtr->activeFillColor = NULL;
arcPtr->disabledFillColor = NULL;
- arcPtr->fillStipple = 0;
- arcPtr->activeFillStipple = 0;
- arcPtr->disabledFillStipple = 0;
+ arcPtr->fillStipple = None;
+ arcPtr->activeFillStipple = None;
+ arcPtr->disabledFillStipple = None;
arcPtr->style = PIESLICE_STYLE;
- arcPtr->fillGC = 0;
+ arcPtr->fillGC = NULL;
/*
* Process the arguments to fill in the item record.
@@ -437,11 +437,11 @@ ConfigureArc(
*/
if (arcPtr->outline.activeWidth > arcPtr->outline.width ||
- arcPtr->outline.activeDash.number ||
- arcPtr->outline.activeColor ||
- arcPtr->outline.activeStipple ||
- arcPtr->activeFillColor ||
- arcPtr->activeFillStipple) {
+ arcPtr->outline.activeDash.number != 0 ||
+ arcPtr->outline.activeColor != NULL ||
+ arcPtr->outline.activeStipple != None ||
+ arcPtr->activeFillColor != NULL ||
+ arcPtr->activeFillStipple != None) {
itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;
} else {
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
@@ -478,9 +478,9 @@ ConfigureArc(
mask |= GCCapStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else {
- newGC = 0;
+ newGC = NULL;
}
- if (arcPtr->outline.gc) {
+ if (arcPtr->outline.gc != None) {
Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc);
}
arcPtr->outline.gc = newGC;
@@ -496,23 +496,23 @@ ConfigureArc(
color = arcPtr->fillColor;
stipple = arcPtr->fillStipple;
if (Canvas(canvas)->currentItemPtr == itemPtr) {
- if (arcPtr->activeFillColor) {
+ if (arcPtr->activeFillColor!=NULL) {
color = arcPtr->activeFillColor;
}
- if (arcPtr->activeFillStipple) {
+ if (arcPtr->activeFillStipple!=None) {
stipple = arcPtr->activeFillStipple;
}
} else if (state==TK_STATE_DISABLED) {
- if (arcPtr->disabledFillColor) {
+ if (arcPtr->disabledFillColor!=NULL) {
color = arcPtr->disabledFillColor;
}
- if (arcPtr->disabledFillStipple) {
+ if (arcPtr->disabledFillStipple!=None) {
stipple = arcPtr->disabledFillStipple;
}
}
- if ((arcPtr->style == ARC_STYLE) || !color) {
- newGC = 0;
+ if ((arcPtr->style == ARC_STYLE) || (!color)) {
+ newGC = NULL;
} else {
gcValues.foreground = color->pixel;
if (arcPtr->style == CHORD_STYLE) {
@@ -521,14 +521,14 @@ ConfigureArc(
gcValues.arc_mode = ArcPieSlice;
}
mask = GCForeground|GCArcMode;
- if (stipple) {
+ if (stipple != None) {
gcValues.stipple = stipple;
gcValues.fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
}
newGC = Tk_GetGC(tkwin, mask, &gcValues);
}
- if (arcPtr->fillGC) {
+ if (arcPtr->fillGC != None) {
Tk_FreeGC(Tk_Display(tkwin), arcPtr->fillGC);
}
arcPtr->fillGC = newGC;
@@ -583,25 +583,25 @@ DeleteArc(
if (arcPtr->numOutlinePoints != 0) {
ckfree(arcPtr->outlinePtr);
}
- if (arcPtr->fillColor) {
+ if (arcPtr->fillColor != NULL) {
Tk_FreeColor(arcPtr->fillColor);
}
- if (arcPtr->activeFillColor) {
+ if (arcPtr->activeFillColor != NULL) {
Tk_FreeColor(arcPtr->activeFillColor);
}
- if (arcPtr->disabledFillColor) {
+ if (arcPtr->disabledFillColor != NULL) {
Tk_FreeColor(arcPtr->disabledFillColor);
}
- if (arcPtr->fillStipple) {
+ if (arcPtr->fillStipple != None) {
Tk_FreeBitmap(display, arcPtr->fillStipple);
}
- if (arcPtr->activeFillStipple) {
+ if (arcPtr->activeFillStipple != None) {
Tk_FreeBitmap(display, arcPtr->activeFillStipple);
}
- if (arcPtr->disabledFillStipple) {
+ if (arcPtr->disabledFillStipple != None) {
Tk_FreeBitmap(display, arcPtr->disabledFillStipple);
}
- if (arcPtr->fillGC) {
+ if (arcPtr->fillGC != None) {
Tk_FreeGC(display, arcPtr->fillGC);
}
}
@@ -732,7 +732,7 @@ ComputeArcBbox(
* drawn) and add one extra pixel just for safety.
*/
- if (!arcPtr->outline.gc) {
+ if (arcPtr->outline.gc == None) {
tmp = 1;
} else {
tmp = (int) ((width + 1.0)/2.0 + 1);
@@ -789,20 +789,20 @@ DisplayArc(
if (arcPtr->outline.activeWidth>lineWidth) {
lineWidth = arcPtr->outline.activeWidth;
}
- if (arcPtr->outline.activeDash.number) {
+ if (arcPtr->outline.activeDash.number != 0) {
dashnumber = arcPtr->outline.activeDash.number;
}
- if (arcPtr->activeFillStipple) {
+ if (arcPtr->activeFillStipple != None) {
stipple = arcPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (arcPtr->outline.disabledWidth > 0) {
lineWidth = arcPtr->outline.disabledWidth;
}
- if (arcPtr->outline.disabledDash.number) {
+ if (arcPtr->outline.disabledDash.number != 0) {
dashnumber = arcPtr->outline.disabledDash.number;
}
- if (arcPtr->disabledFillStipple) {
+ if (arcPtr->disabledFillStipple != None) {
stipple = arcPtr->disabledFillStipple;
}
}
@@ -831,8 +831,8 @@ DisplayArc(
* window servers to crash and should be a no-op anyway.
*/
- if ((arcPtr->fillGC) && (extent != 0)) {
- if (stipple) {
+ if ((arcPtr->fillGC != None) && (extent != 0)) {
+ if (stipple != None) {
int w = 0;
int h = 0;
Tk_TSOffset *tsoffset = &arcPtr->tsoffset;
@@ -861,14 +861,14 @@ DisplayArc(
}
XFillArc(display, drawable, arcPtr->fillGC, x1, y1, (unsigned) (x2-x1),
(unsigned) (y2-y1), start, extent);
- if (stipple) {
+ if (stipple != None) {
XSetTSOrigin(display, arcPtr->fillGC, 0, 0);
}
}
- if (arcPtr->outline.gc) {
+ if (arcPtr->outline.gc != None) {
Tk_ChangeOutlineGC(canvas, itemPtr, &(arcPtr->outline));
- if (extent) {
+ if (extent != 0) {
XDrawArc(display, drawable, arcPtr->outline.gc, x1, y1,
(unsigned) (x2-x1), (unsigned) (y2-y1), start, extent);
}
@@ -880,7 +880,7 @@ DisplayArc(
* outline is dashed, because then polygons don't work.
*/
- if (lineWidth < 1.5 || dashnumber) {
+ if (lineWidth < 1.5 || dashnumber != 0) {
Tk_CanvasDrawableCoords(canvas, arcPtr->center1[0],
arcPtr->center1[1], &x1, &y1);
Tk_CanvasDrawableCoords(canvas, arcPtr->center2[0],
@@ -903,13 +903,13 @@ DisplayArc(
} else {
if (arcPtr->style == CHORD_STYLE) {
TkFillPolygon(canvas, arcPtr->outlinePtr, CHORD_OUTLINE_PTS,
- display, drawable, arcPtr->outline.gc, 0);
+ display, drawable, arcPtr->outline.gc, NULL);
} else if (arcPtr->style == PIESLICE_STYLE) {
TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS,
- display, drawable, arcPtr->outline.gc, 0);
+ display, drawable, arcPtr->outline.gc, NULL);
TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
PIE_OUTLINE2_PTS, display, drawable,
- arcPtr->outline.gc, 0);
+ arcPtr->outline.gc, NULL);
}
}
@@ -1015,12 +1015,12 @@ ArcToPoint(
return dist;
}
- if (arcPtr->fillGC || !arcPtr->outline.gc) {
+ if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) {
filled = 1;
} else {
filled = 0;
}
- if (!arcPtr->outline.gc) {
+ if (arcPtr->outline.gc == None) {
width = 0.0;
}
@@ -1142,12 +1142,12 @@ ArcToArea(
}
}
- if ((arcPtr->fillGC) || !arcPtr->outline.gc) {
+ if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) {
filled = 1;
} else {
filled = 0;
}
- if (!arcPtr->outline.gc) {
+ if (arcPtr->outline.gc == None) {
width = 0.0;
}
@@ -1842,29 +1842,29 @@ ArcToPostscript(
fillColor = arcPtr->fillColor;
fillStipple = arcPtr->fillStipple;
if (Canvas(canvas)->currentItemPtr == itemPtr) {
- if (arcPtr->outline.activeColor) {
+ if (arcPtr->outline.activeColor!=NULL) {
color = arcPtr->outline.activeColor;
}
- if (arcPtr->outline.activeStipple) {
+ if (arcPtr->outline.activeStipple!=None) {
stipple = arcPtr->outline.activeStipple;
}
- if (arcPtr->activeFillColor) {
+ if (arcPtr->activeFillColor!=NULL) {
fillColor = arcPtr->activeFillColor;
}
- if (arcPtr->activeFillStipple) {
+ if (arcPtr->activeFillStipple!=None) {
fillStipple = arcPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
- if (arcPtr->outline.disabledColor) {
+ if (arcPtr->outline.disabledColor!=NULL) {
color = arcPtr->outline.disabledColor;
}
- if (arcPtr->outline.disabledStipple) {
+ if (arcPtr->outline.disabledStipple!=None) {
stipple = arcPtr->outline.disabledStipple;
}
- if (arcPtr->disabledFillColor) {
+ if (arcPtr->disabledFillColor!=NULL) {
fillColor = arcPtr->disabledFillColor;
}
- if (arcPtr->disabledFillStipple) {
+ if (arcPtr->disabledFillStipple!=None) {
fillStipple = arcPtr->disabledFillStipple;
}
}
@@ -1881,7 +1881,7 @@ ArcToPostscript(
* arc.
*/
- if (arcPtr->fillGC) {
+ if (arcPtr->fillGC != None) {
Tcl_AppendPrintfToObj(psObj,
"matrix currentmatrix\n"
"%.15g %.15g translate %.15g %.15g scale\n",
@@ -1922,7 +1922,7 @@ ArcToPostscript(
* If there's an outline for the arc, draw it.
*/
- if (arcPtr->outline.gc) {
+ if (arcPtr->outline.gc != None) {
Tcl_AppendPrintfToObj(psObj,
"matrix currentmatrix\n"
"%.15g %.15g translate %.15g %.15g scale\n",