diff options
author | culler <culler> | 2018-12-20 14:24:15 (GMT) |
---|---|---|
committer | culler <culler> | 2018-12-20 14:24:15 (GMT) |
commit | a8e38d4f0a2001f03c453a3267e7785496f85359 (patch) | |
tree | 51eacb3dd005bb406b879b6ddadacb8cb74b2c37 /generic/tkCanvUtil.c | |
parent | f0ba2d7b3ec3c978c9433acfb4766978cbef6175 (diff) | |
parent | e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6 (diff) | |
download | tk-a8e38d4f0a2001f03c453a3267e7785496f85359.zip tk-a8e38d4f0a2001f03c453a3267e7785496f85359.tar.gz tk-a8e38d4f0a2001f03c453a3267e7785496f85359.tar.bz2 |
merge core-8-6-branch.
Diffstat (limited to 'generic/tkCanvUtil.c')
-rw-r--r-- | generic/tkCanvUtil.c | 82 |
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; |