summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvUtil.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/tkCanvUtil.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/tkCanvUtil.c')
-rw-r--r--generic/tkCanvUtil.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index 09ce98c..9cd7f84 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 = None;
+ outline->gc = 0;
outline->width = 1.0;
outline->activeWidth = 0.0;
outline->disabledWidth = 0.0;
@@ -975,9 +975,9 @@ Tk_CreateOutline(
outline->color = NULL;
outline->activeColor = NULL;
outline->disabledColor = NULL;
- outline->stipple = None;
- outline->activeStipple = None;
- outline->disabledStipple = None;
+ outline->stipple = 0;
+ outline->activeStipple = 0;
+ outline->disabledStipple = 0;
}
/*
@@ -1002,7 +1002,7 @@ Tk_DeleteOutline(
Display *display, /* Display containing window. */
Tk_Outline *outline)
{
- if (outline->gc != None) {
+ if (outline->gc) {
Tk_FreeGC(display, outline->gc);
}
if ((unsigned) ABS(outline->dash.number) > sizeof(char *)) {
@@ -1014,22 +1014,22 @@ Tk_DeleteOutline(
if ((unsigned) ABS(outline->disabledDash.number) > sizeof(char *)) {
ckfree(outline->disabledDash.pattern.pt);
}
- if (outline->color != NULL) {
+ if (outline->color) {
Tk_FreeColor(outline->color);
}
- if (outline->activeColor != NULL) {
+ if (outline->activeColor) {
Tk_FreeColor(outline->activeColor);
}
- if (outline->disabledColor != NULL) {
+ if (outline->disabledColor) {
Tk_FreeColor(outline->disabledColor);
}
- if (outline->stipple != None) {
+ if (outline->stipple) {
Tk_FreeBitmap(display, outline->stipple);
}
- if (outline->activeStipple != None) {
+ if (outline->activeStipple) {
Tk_FreeBitmap(display, outline->activeStipple);
}
- if (outline->disabledStipple != None) {
+ if (outline->disabledStipple) {
Tk_FreeBitmap(display, outline->disabledStipple);
}
}
@@ -1095,26 +1095,26 @@ Tk_ConfigOutlineGC(
if (outline->activeWidth>width) {
width = outline->activeWidth;
}
- if (outline->activeDash.number != 0) {
+ if (outline->activeDash.number) {
dash = &(outline->activeDash);
}
- if (outline->activeColor!=NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple!=None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth>0) {
width = outline->disabledWidth;
}
- if (outline->disabledDash.number != 0) {
+ if (outline->disabledDash.number) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor!=NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple!=None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
@@ -1127,18 +1127,18 @@ Tk_ConfigOutlineGC(
if (color != NULL) {
gcValues->foreground = color->pixel;
mask = GCForeground|GCLineWidth;
- if (stipple != None) {
+ if (stipple) {
gcValues->stipple = stipple;
gcValues->fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
}
}
- if (mask && (dash->number != 0)) {
+ if (mask && dash->number) {
gcValues->line_style = LineOnOffDash;
gcValues->dash_offset = outline->offset;
if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
gcValues->dashes = dash->pattern.pt[0];
- } else if (dash->number != 0) {
+ } else if (dash->number) {
gcValues->dashes = dash->pattern.array[0];
} else {
gcValues->dashes = (char) (4 * width + 0.5);
@@ -1193,30 +1193,30 @@ Tk_ChangeOutlineGC(
if (outline->activeWidth > width) {
width = outline->activeWidth;
}
- if (outline->activeDash.number != 0) {
+ if (outline->activeDash.number) {
dash = &(outline->activeDash);
}
- if (outline->activeColor != NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple != None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth > width) {
width = outline->disabledWidth;
}
- if (outline->disabledDash.number != 0) {
+ if (outline->disabledDash.number) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor != NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple != None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
- if (color==NULL) {
+ if (!color) {
return 0;
}
@@ -1237,7 +1237,7 @@ Tk_ChangeOutlineGC(
XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset, p,
dash->number);
}
- if (stipple!=None) {
+ if (stipple) {
int w = 0; int h = 0;
Tk_TSOffset *tsoffset = &outline->tsoffset;
int flags = tsoffset->flags;
@@ -1312,26 +1312,26 @@ Tk_ResetOutlineGC(
if (outline->activeWidth>width) {
width = outline->activeWidth;
}
- if (outline->activeDash.number != 0) {
+ if (outline->activeDash.number) {
dash = &(outline->activeDash);
}
- if (outline->activeColor!=NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple!=None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth>width) {
width = outline->disabledWidth;
}
- if (outline->disabledDash.number != 0) {
+ if (outline->disabledDash.number) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor!=NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple!=None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
@@ -1344,7 +1344,7 @@ Tk_ResetOutlineGC(
((dash->number == -1) && (dash->pattern.array[0] != ','))) {
if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
dashList = dash->pattern.pt[0];
- } else if (dash->number != 0) {
+ } else if (dash->number) {
dashList = dash->pattern.array[0];
} else {
dashList = (char) (4 * width + 0.5);
@@ -1352,7 +1352,7 @@ Tk_ResetOutlineGC(
XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset,
&dashList , 1);
}
- if (stipple != None) {
+ if (stipple) {
XSetTSOrigin(Canvas(canvas)->display, outline->gc, 0, 0);
return 1;
}
@@ -1405,10 +1405,10 @@ Tk_CanvasPsOutline(
if (outline->activeDash.number > 0) {
dash = &outline->activeDash;
}
- if (outline->activeColor != NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple != None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
@@ -1418,10 +1418,10 @@ Tk_CanvasPsOutline(
if (outline->disabledDash.number > 0) {
dash = &outline->disabledDash;
}
- if (outline->disabledColor != NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple != None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
@@ -1477,7 +1477,7 @@ Tk_CanvasPsOutline(
* Note that psObj might hold an invalid reference now.
*/
- if (stipple != None) {
+ if (stipple) {
Tcl_AppendToObj(GetPostscriptBuffer(interp), "StrokeClip ", -1);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;