diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-12-20 10:04:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-12-20 10:04:14 (GMT) |
commit | 817f7f1fbb4cc882e93f71e1a8fe89943751c251 (patch) | |
tree | d088e71d9858fda58cb6194369fd6fc71b994415 /generic/tkCanvArc.c | |
parent | cbafe2dbb8d093c916fbb25532281807d1ea22f8 (diff) | |
parent | e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6 (diff) | |
download | tk-817f7f1fbb4cc882e93f71e1a8fe89943751c251.zip tk-817f7f1fbb4cc882e93f71e1a8fe89943751c251.tar.gz tk-817f7f1fbb4cc882e93f71e1a8fe89943751c251.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic/tkCanvArc.c')
-rw-r--r-- | generic/tkCanvArc.c | 118 |
1 files changed, 58 insertions, 60 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index 85a0bab..8bc1781 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -295,11 +295,11 @@ CreateArc( arcPtr->fillColor = NULL; arcPtr->activeFillColor = NULL; arcPtr->disabledFillColor = NULL; - arcPtr->fillStipple = None; - arcPtr->activeFillStipple = None; - arcPtr->disabledFillStipple = None; + arcPtr->fillStipple = 0; + arcPtr->activeFillStipple = 0; + arcPtr->disabledFillStipple = 0; arcPtr->style = PIESLICE_STYLE; - arcPtr->fillGC = None; + arcPtr->fillGC = 0; arcPtr->height = 0; /* @@ -458,11 +458,11 @@ ConfigureArc( */ if (arcPtr->outline.activeWidth > arcPtr->outline.width || - arcPtr->outline.activeDash.number != 0 || - arcPtr->outline.activeColor != NULL || - arcPtr->outline.activeStipple != None || - arcPtr->activeFillColor != NULL || - arcPtr->activeFillStipple != None) { + arcPtr->outline.activeDash.number || + arcPtr->outline.activeColor || + arcPtr->outline.activeStipple || + arcPtr->activeFillColor || + arcPtr->activeFillStipple) { itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT; } else { itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT; @@ -508,9 +508,9 @@ ConfigureArc( mask |= GCCapStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = 0; } - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc) { Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc); } arcPtr->outline.gc = newGC; @@ -526,25 +526,23 @@ ConfigureArc( color = arcPtr->fillColor; stipple = arcPtr->fillStipple; if (Canvas(canvas)->currentItemPtr == itemPtr) { - if (arcPtr->activeFillColor!=NULL) { + if (arcPtr->activeFillColor) { color = arcPtr->activeFillColor; } - if (arcPtr->activeFillStipple!=None) { + if (arcPtr->activeFillStipple) { stipple = arcPtr->activeFillStipple; } } else if (state==TK_STATE_DISABLED) { - if (arcPtr->disabledFillColor!=NULL) { + if (arcPtr->disabledFillColor) { color = arcPtr->disabledFillColor; } - if (arcPtr->disabledFillStipple!=None) { + if (arcPtr->disabledFillStipple) { stipple = arcPtr->disabledFillStipple; } } - if (arcPtr->style == ARC_STYLE) { - newGC = None; - } else if (color == NULL) { - newGC = None; + if ((arcPtr->style == ARC_STYLE) || !color) { + newGC = 0; } else { gcValues.foreground = color->pixel; if (arcPtr->style == CHORD_STYLE) { @@ -553,14 +551,14 @@ ConfigureArc( gcValues.arc_mode = ArcPieSlice; } mask = GCForeground|GCArcMode; - if (stipple != None) { + if (stipple) { gcValues.stipple = stipple; gcValues.fill_style = FillStippled; mask |= GCStipple|GCFillStyle; } newGC = Tk_GetGC(tkwin, mask, &gcValues); } - if (arcPtr->fillGC != None) { + if (arcPtr->fillGC) { Tk_FreeGC(Tk_Display(tkwin), arcPtr->fillGC); } arcPtr->fillGC = newGC; @@ -699,25 +697,25 @@ DeleteArc( if (arcPtr->numOutlinePoints != 0) { ckfree(arcPtr->outlinePtr); } - if (arcPtr->fillColor != NULL) { + if (arcPtr->fillColor) { Tk_FreeColor(arcPtr->fillColor); } - if (arcPtr->activeFillColor != NULL) { + if (arcPtr->activeFillColor) { Tk_FreeColor(arcPtr->activeFillColor); } - if (arcPtr->disabledFillColor != NULL) { + if (arcPtr->disabledFillColor) { Tk_FreeColor(arcPtr->disabledFillColor); } - if (arcPtr->fillStipple != None) { + if (arcPtr->fillStipple) { Tk_FreeBitmap(display, arcPtr->fillStipple); } - if (arcPtr->activeFillStipple != None) { + if (arcPtr->activeFillStipple) { Tk_FreeBitmap(display, arcPtr->activeFillStipple); } - if (arcPtr->disabledFillStipple != None) { + if (arcPtr->disabledFillStipple) { Tk_FreeBitmap(display, arcPtr->disabledFillStipple); } - if (arcPtr->fillGC != None) { + if (arcPtr->fillGC) { Tk_FreeGC(display, arcPtr->fillGC); } } @@ -848,7 +846,7 @@ ComputeArcBbox( * drawn) and add one extra pixel just for safety. */ - if (arcPtr->outline.gc == None) { + if (!arcPtr->outline.gc) { tmp = 1; } else { tmp = (int) ((width + 1.0)/2.0 + 1); @@ -905,20 +903,20 @@ DisplayArc( if (arcPtr->outline.activeWidth>lineWidth) { lineWidth = arcPtr->outline.activeWidth; } - if (arcPtr->outline.activeDash.number != 0) { + if (arcPtr->outline.activeDash.number) { dashnumber = arcPtr->outline.activeDash.number; } - if (arcPtr->activeFillStipple != None) { + if (arcPtr->activeFillStipple) { stipple = arcPtr->activeFillStipple; } } else if (state == TK_STATE_DISABLED) { if (arcPtr->outline.disabledWidth > 0) { lineWidth = arcPtr->outline.disabledWidth; } - if (arcPtr->outline.disabledDash.number != 0) { + if (arcPtr->outline.disabledDash.number) { dashnumber = arcPtr->outline.disabledDash.number; } - if (arcPtr->disabledFillStipple != None) { + if (arcPtr->disabledFillStipple) { stipple = arcPtr->disabledFillStipple; } } @@ -947,8 +945,8 @@ DisplayArc( * window servers to crash and should be a no-op anyway. */ - if ((arcPtr->fillGC != None) && (extent != 0)) { - if (stipple != None) { + if ((arcPtr->fillGC) && (extent != 0)) { + if (stipple) { int w = 0; int h = 0; Tk_TSOffset *tsoffset = &arcPtr->tsoffset; @@ -977,14 +975,14 @@ DisplayArc( } XFillArc(display, drawable, arcPtr->fillGC, x1, y1, (unsigned) (x2-x1), (unsigned) (y2-y1), start, extent); - if (stipple != None) { + if (stipple) { XSetTSOrigin(display, arcPtr->fillGC, 0, 0); } } - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc) { Tk_ChangeOutlineGC(canvas, itemPtr, &(arcPtr->outline)); - if (extent != 0) { + if (extent) { XDrawArc(display, drawable, arcPtr->outline.gc, x1, y1, (unsigned) (x2-x1), (unsigned) (y2-y1), start, extent); } @@ -996,7 +994,7 @@ DisplayArc( * outline is dashed, because then polygons don't work. */ - if (lineWidth < 1.5 || dashnumber != 0) { + if (lineWidth < 1.5 || dashnumber) { Tk_CanvasDrawableCoords(canvas, arcPtr->center1[0], arcPtr->center1[1], &x1, &y1); Tk_CanvasDrawableCoords(canvas, arcPtr->center2[0], @@ -1019,13 +1017,13 @@ DisplayArc( } else { if (arcPtr->style == CHORD_STYLE) { TkFillPolygon(canvas, arcPtr->outlinePtr, CHORD_OUTLINE_PTS, - display, drawable, arcPtr->outline.gc, None); + display, drawable, arcPtr->outline.gc, 0); } else if (arcPtr->style == PIESLICE_STYLE) { TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS, - display, drawable, arcPtr->outline.gc, None); + display, drawable, arcPtr->outline.gc, 0); TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS, PIE_OUTLINE2_PTS, display, drawable, - arcPtr->outline.gc, None); + arcPtr->outline.gc, 0); } } @@ -1131,12 +1129,12 @@ ArcToPoint( return dist; } - if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) { + if (arcPtr->fillGC || !arcPtr->outline.gc) { filled = 1; } else { filled = 0; } - if (arcPtr->outline.gc == None) { + if (!arcPtr->outline.gc) { width = 0.0; } @@ -1258,12 +1256,12 @@ ArcToArea( } } - if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) { + if ((arcPtr->fillGC) || !arcPtr->outline.gc) { filled = 1; } else { filled = 0; } - if (arcPtr->outline.gc == None) { + if (!arcPtr->outline.gc) { width = 0.0; } @@ -1958,29 +1956,29 @@ ArcToPostscript( fillColor = arcPtr->fillColor; fillStipple = arcPtr->fillStipple; if (Canvas(canvas)->currentItemPtr == itemPtr) { - if (arcPtr->outline.activeColor!=NULL) { + if (arcPtr->outline.activeColor) { color = arcPtr->outline.activeColor; } - if (arcPtr->outline.activeStipple!=None) { + if (arcPtr->outline.activeStipple) { stipple = arcPtr->outline.activeStipple; } - if (arcPtr->activeFillColor!=NULL) { + if (arcPtr->activeFillColor) { fillColor = arcPtr->activeFillColor; } - if (arcPtr->activeFillStipple!=None) { + if (arcPtr->activeFillStipple) { fillStipple = arcPtr->activeFillStipple; } } else if (state == TK_STATE_DISABLED) { - if (arcPtr->outline.disabledColor!=NULL) { + if (arcPtr->outline.disabledColor) { color = arcPtr->outline.disabledColor; } - if (arcPtr->outline.disabledStipple!=None) { + if (arcPtr->outline.disabledStipple) { stipple = arcPtr->outline.disabledStipple; } - if (arcPtr->disabledFillColor!=NULL) { + if (arcPtr->disabledFillColor) { fillColor = arcPtr->disabledFillColor; } - if (arcPtr->disabledFillStipple!=None) { + if (arcPtr->disabledFillStipple) { fillStipple = arcPtr->disabledFillStipple; } } @@ -1997,7 +1995,7 @@ ArcToPostscript( * arc. */ - if (arcPtr->fillGC != None) { + if (arcPtr->fillGC) { Tcl_AppendPrintfToObj(psObj, "matrix currentmatrix\n" "%.15g %.15g translate %.15g %.15g scale\n", @@ -2017,7 +2015,7 @@ ArcToPostscript( } Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); - if (fillStipple != None) { + if (fillStipple) { Tcl_AppendToObj(psObj, "clip ", -1); Tcl_ResetResult(interp); @@ -2026,7 +2024,7 @@ ArcToPostscript( } Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc) { Tcl_AppendToObj(psObj, "grestore gsave\n", -1); } } else { @@ -2038,7 +2036,7 @@ ArcToPostscript( * If there's an outline for the arc, draw it. */ - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc) { Tcl_AppendPrintfToObj(psObj, "matrix currentmatrix\n" "%.15g %.15g translate %.15g %.15g scale\n", @@ -2069,7 +2067,7 @@ ArcToPostscript( } Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); - if (stipple != None) { + if (stipple) { Tcl_AppendToObj(psObj, "clip ", -1); Tcl_ResetResult(interp); @@ -2092,7 +2090,7 @@ ArcToPostscript( } Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); - if (stipple != None) { + if (stipple) { Tcl_AppendToObj(psObj, "clip ", -1); Tcl_ResetResult(interp); |