summaryrefslogtreecommitdiffstats
path: root/generic/tkRectOval.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-20 09:44:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-20 09:44:05 (GMT)
commite26cd8eb2b04a4bd764e382cbcbfe4b1030796c6 (patch)
tree6bca925436edc8dce431cfd10502d50117b62d46 /generic/tkRectOval.c
parent0c4227b6cc6e9716ddd086a75e45c4e9373fa51b (diff)
parent81b0bd7641a9d2f63154c97d41c27bbb696ef674 (diff)
downloadtk-e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6.zip
tk-e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6.tar.gz
tk-e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6.tar.bz2
Fix [9e31fd9449]: X11/X.h and Windows.h have conflicting symbols
*** POTENTIAL INCOMPATIBILITY *** for Win32 only: On X11 and Mac, "None" can still be used as before
Diffstat (limited to 'generic/tkRectOval.c')
-rw-r--r--generic/tkRectOval.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 4d48fe7..01890e1 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -255,10 +255,10 @@ CreateRectOval(
rectOvalPtr->fillColor = NULL;
rectOvalPtr->activeFillColor = NULL;
rectOvalPtr->disabledFillColor = NULL;
- rectOvalPtr->fillStipple = None;
- rectOvalPtr->activeFillStipple = None;
- rectOvalPtr->disabledFillStipple = None;
- rectOvalPtr->fillGC = None;
+ rectOvalPtr->fillStipple = 0;
+ rectOvalPtr->activeFillStipple = 0;
+ rectOvalPtr->disabledFillStipple = 0;
+ rectOvalPtr->fillGC = 0;
/*
* Process the arguments to fill in the item record.
@@ -422,11 +422,11 @@ ConfigureRectOval(
*/
if (rectOvalPtr->outline.activeWidth > rectOvalPtr->outline.width ||
- rectOvalPtr->outline.activeDash.number != 0 ||
- rectOvalPtr->outline.activeColor != NULL ||
- rectOvalPtr->outline.activeStipple != None ||
- rectOvalPtr->activeFillColor != NULL ||
- rectOvalPtr->activeFillStipple != None) {
+ rectOvalPtr->outline.activeDash.number ||
+ rectOvalPtr->outline.activeColor ||
+ rectOvalPtr->outline.activeStipple ||
+ rectOvalPtr->activeFillColor ||
+ rectOvalPtr->activeFillStipple) {
itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;
} else {
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
@@ -460,15 +460,15 @@ ConfigureRectOval(
mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr,
&(rectOvalPtr->outline));
if (mask && \
- rectOvalPtr->outline.width != 0 && \
- rectOvalPtr->outline.color != NULL) {
+ rectOvalPtr->outline.width && \
+ rectOvalPtr->outline.color) {
gcValues.cap_style = CapProjecting;
mask |= GCCapStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else {
- newGC = None;
+ newGC = 0;
}
- if (rectOvalPtr->outline.gc != None) {
+ if (rectOvalPtr->outline.gc) {
Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->outline.gc);
}
rectOvalPtr->outline.gc = newGC;
@@ -487,23 +487,23 @@ ConfigureRectOval(
if (rectOvalPtr->activeFillColor!=NULL) {
color = rectOvalPtr->activeFillColor;
}
- if (rectOvalPtr->activeFillStipple!=None) {
+ if (rectOvalPtr->activeFillStipple) {
stipple = rectOvalPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
- if (rectOvalPtr->disabledFillColor!=NULL) {
+ if (rectOvalPtr->disabledFillColor) {
color = rectOvalPtr->disabledFillColor;
}
- if (rectOvalPtr->disabledFillStipple!=None) {
+ if (rectOvalPtr->disabledFillStipple) {
stipple = rectOvalPtr->disabledFillStipple;
}
}
- if (color == NULL) {
- newGC = None;
+ if (!color) {
+ newGC = 0;
} else {
gcValues.foreground = color->pixel;
- if (stipple != None) {
+ if (stipple) {
gcValues.stipple = stipple;
gcValues.fill_style = FillStippled;
mask = GCForeground|GCStipple|GCFillStyle;
@@ -522,7 +522,7 @@ ConfigureRectOval(
#endif
newGC = Tk_GetGC(tkwin, mask, &gcValues);
}
- if (rectOvalPtr->fillGC != None) {
+ if (rectOvalPtr->fillGC) {
Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->fillGC);
}
rectOvalPtr->fillGC = newGC;
@@ -577,25 +577,25 @@ DeleteRectOval(
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
Tk_DeleteOutline(display, &(rectOvalPtr->outline));
- if (rectOvalPtr->fillColor != NULL) {
+ if (rectOvalPtr->fillColor) {
Tk_FreeColor(rectOvalPtr->fillColor);
}
- if (rectOvalPtr->activeFillColor != NULL) {
+ if (rectOvalPtr->activeFillColor) {
Tk_FreeColor(rectOvalPtr->activeFillColor);
}
- if (rectOvalPtr->disabledFillColor != NULL) {
+ if (rectOvalPtr->disabledFillColor) {
Tk_FreeColor(rectOvalPtr->disabledFillColor);
}
- if (rectOvalPtr->fillStipple != None) {
+ if (rectOvalPtr->fillStipple) {
Tk_FreeBitmap(display, rectOvalPtr->fillStipple);
}
- if (rectOvalPtr->activeFillStipple != None) {
+ if (rectOvalPtr->activeFillStipple) {
Tk_FreeBitmap(display, rectOvalPtr->activeFillStipple);
}
- if (rectOvalPtr->disabledFillStipple != None) {
+ if (rectOvalPtr->disabledFillStipple) {
Tk_FreeBitmap(display, rectOvalPtr->disabledFillStipple);
}
- if (rectOvalPtr->fillGC != None) {
+ if (rectOvalPtr->fillGC) {
Tk_FreeGC(display, rectOvalPtr->fillGC);
}
}
@@ -664,7 +664,7 @@ ComputeRectOvalBbox(
rectOvalPtr->bbox[0] = tmpX;
}
- if (rectOvalPtr->outline.gc == None) {
+ if (!rectOvalPtr->outline.gc) {
/*
* The Win32 switch was added for 8.3 to solve a problem with ovals
* leaving traces on bottom and right of 1 pixel. This may not be the
@@ -869,17 +869,17 @@ DisplayRectOval(
}
fillStipple = rectOvalPtr->fillStipple;
if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) {
- if (rectOvalPtr->activeFillStipple != None) {
+ if (rectOvalPtr->activeFillStipple) {
fillStipple = rectOvalPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
- if (rectOvalPtr->disabledFillStipple != None) {
+ if (rectOvalPtr->disabledFillStipple) {
fillStipple = rectOvalPtr->disabledFillStipple;
}
}
- if (rectOvalPtr->fillGC != None) {
- if (fillStipple != None) {
+ if (rectOvalPtr->fillGC) {
+ if (fillStipple) {
Tk_TSOffset *tsoffset;
int w = 0, h = 0;
@@ -917,12 +917,12 @@ DisplayRectOval(
x1, y1, (unsigned) (x2-x1), (unsigned) (y2-y1),
0, 360*64);
}
- if (fillStipple != None) {
+ if (fillStipple) {
XSetTSOrigin(display, rectOvalPtr->fillGC, 0, 0);
}
}
- if (rectOvalPtr->outline.gc != None) {
+ if (rectOvalPtr->outline.gc) {
Tk_ChangeOutlineGC(canvas, itemPtr, &(rectOvalPtr->outline));
if (rectOvalPtr->header.typePtr == &tkRectangleType) {
XDrawRectangle(display, drawable, rectOvalPtr->outline.gc,
@@ -993,7 +993,7 @@ RectToPoint(
y1 = rectPtr->bbox[1];
x2 = rectPtr->bbox[2];
y2 = rectPtr->bbox[3];
- if (rectPtr->outline.gc != None) {
+ if (rectPtr->outline.gc) {
inc = width/2.0;
x1 -= inc;
y1 -= inc;
@@ -1009,7 +1009,7 @@ RectToPoint(
if ((pointPtr[0] >= x1) && (pointPtr[0] < x2)
&& (pointPtr[1] >= y1) && (pointPtr[1] < y2)) {
- if ((rectPtr->fillGC != None) || (rectPtr->outline.gc == None)) {
+ if (rectPtr->fillGC || !rectPtr->outline.gc) {
return 0.0;
}
xDiff = pointPtr[0] - x1;
@@ -1105,8 +1105,8 @@ OvalToPoint(
}
- filled = ovalPtr->fillGC != None;
- if (ovalPtr->outline.gc == None) {
+ filled = ovalPtr->fillGC != 0;
+ if (!ovalPtr->outline.gc) {
width = 0.0;
filled = 1;
}
@@ -1161,7 +1161,7 @@ RectToArea(
}
halfWidth = width/2.0;
- if (rectPtr->outline.gc == None) {
+ if (!rectPtr->outline.gc) {
halfWidth = 0.0;
}
@@ -1171,7 +1171,7 @@ RectToArea(
|| (areaPtr[1] >= (rectPtr->bbox[3] + halfWidth))) {
return -1;
}
- if ((rectPtr->fillGC == None) && (rectPtr->outline.gc != None)
+ if (!rectPtr->fillGC && rectPtr->outline.gc
&& (areaPtr[0] >= (rectPtr->bbox[0] + halfWidth))
&& (areaPtr[1] >= (rectPtr->bbox[1] + halfWidth))
&& (areaPtr[2] <= (rectPtr->bbox[2] - halfWidth))
@@ -1239,7 +1239,7 @@ OvalToArea(
*/
halfWidth = width/2.0;
- if (ovalPtr->outline.gc == None) {
+ if (!ovalPtr->outline.gc) {
halfWidth = 0.0;
}
oval[0] = ovalPtr->bbox[0] - halfWidth;
@@ -1256,8 +1256,8 @@ OvalToArea(
* return "outside".
*/
- if ((result == 0) && (ovalPtr->outline.gc != None)
- && (ovalPtr->fillGC == None)) {
+ if ((result == 0) && ovalPtr->outline.gc
+ && !ovalPtr->fillGC) {
double centerX, centerY, height;
double xDelta1, yDelta1, xDelta2, yDelta2;
@@ -1432,20 +1432,20 @@ RectOvalToPostscript(
if (rectOvalPtr->outline.activeColor!=NULL) {
color = rectOvalPtr->outline.activeColor;
}
- if (rectOvalPtr->activeFillColor!=NULL) {
+ if (rectOvalPtr->activeFillColor) {
fillColor = rectOvalPtr->activeFillColor;
}
- if (rectOvalPtr->activeFillStipple!=None) {
+ if (rectOvalPtr->activeFillStipple) {
fillStipple = rectOvalPtr->activeFillStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (rectOvalPtr->outline.disabledColor!=NULL) {
color = rectOvalPtr->outline.disabledColor;
}
- if (rectOvalPtr->disabledFillColor!=NULL) {
+ if (rectOvalPtr->disabledFillColor) {
fillColor = rectOvalPtr->disabledFillColor;
}
- if (rectOvalPtr->disabledFillStipple!=None) {
+ if (rectOvalPtr->disabledFillStipple) {
fillStipple = rectOvalPtr->disabledFillStipple;
}
}
@@ -1461,7 +1461,7 @@ RectOvalToPostscript(
* First draw the filled area of the rectangle.
*/
- if (fillColor != NULL) {
+ if (fillColor) {
Tcl_AppendObjToObj(psObj, pathObj);
Tcl_ResetResult(interp);
@@ -1470,7 +1470,7 @@ RectOvalToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (fillStipple != None) {
+ if (fillStipple) {
Tcl_AppendToObj(psObj, "clip ", -1);
Tcl_ResetResult(interp);
@@ -1490,7 +1490,7 @@ RectOvalToPostscript(
* Now draw the outline, if there is one.
*/
- if (color != NULL) {
+ if (color) {
Tcl_AppendObjToObj(psObj, pathObj);
Tcl_AppendToObj(psObj, "0 setlinejoin 2 setlinecap\n", -1);