diff options
Diffstat (limited to 'generic/tkCanvText.c')
-rw-r--r-- | generic/tkCanvText.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 7f5f23d..279e548 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -256,9 +256,9 @@ CreateText( textPtr->disabledColor = NULL; textPtr->tkfont = NULL; textPtr->justify = TK_JUSTIFY_LEFT; - textPtr->stipple = 0; - textPtr->activeStipple = 0; - textPtr->disabledStipple = 0; + textPtr->stipple = None; + textPtr->activeStipple = None; + textPtr->disabledStipple = None; textPtr->text = NULL; textPtr->width = 0; textPtr->underline = -1; @@ -269,9 +269,9 @@ CreateText( textPtr->textLayout = NULL; textPtr->actualWidth = 0; textPtr->drawOrigin[0] = textPtr->drawOrigin[1] = 0.0; - textPtr->gc = 0; - textPtr->selTextGC = 0; - textPtr->cursorOffGC = 0; + textPtr->gc = NULL; + textPtr->selTextGC = NULL; + textPtr->cursorOffGC = NULL; textPtr->sine = 0.0; textPtr->cosine = 1.0; @@ -419,7 +419,7 @@ ConfigureText( state = itemPtr->state; - if (textPtr->activeColor || textPtr->activeStipple) { + if (textPtr->activeColor != NULL || textPtr->activeStipple != None) { itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT; } else { itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT; @@ -435,26 +435,26 @@ ConfigureText( if (textPtr->activeColor != NULL) { color = textPtr->activeColor; } - if (textPtr->activeStipple) { + if (textPtr->activeStipple != None) { stipple = textPtr->activeStipple; } } else if (state == TK_STATE_DISABLED) { if (textPtr->disabledColor != NULL) { color = textPtr->disabledColor; } - if (textPtr->disabledStipple) { + if (textPtr->disabledStipple != None) { stipple = textPtr->disabledStipple; } } - newGC = newSelGC = 0; - if (textPtr->tkfont) { + newGC = newSelGC = NULL; + if (textPtr->tkfont != NULL) { gcValues.font = Tk_FontId(textPtr->tkfont); mask = GCFont; - if (color) { + if (color != NULL) { gcValues.foreground = color->pixel; mask |= GCForeground; - if (stipple) { + if (stipple != None) { gcValues.stipple = stipple; gcValues.fill_style = FillStippled; mask |= GCStipple|GCFillStyle; @@ -462,7 +462,7 @@ ConfigureText( newGC = Tk_GetGC(tkwin, mask, &gcValues); } mask &= ~(GCTile|GCFillStyle|GCStipple); - if (stipple) { + if (stipple != None) { gcValues.stipple = stipple; gcValues.fill_style = FillStippled; mask |= GCStipple|GCFillStyle; @@ -472,11 +472,11 @@ ConfigureText( } newSelGC = Tk_GetGC(tkwin, mask|GCForeground, &gcValues); } - if (textPtr->gc) { + if (textPtr->gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), textPtr->gc); } textPtr->gc = newGC; - if (textPtr->selTextGC) { + if (textPtr->selTextGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), textPtr->selTextGC); } textPtr->selTextGC = newSelGC; @@ -491,9 +491,9 @@ ConfigureText( } newGC = Tk_GetGC(tkwin, GCForeground, &gcValues); } else { - newGC = 0; + newGC = NULL; } - if (textPtr->cursorOffGC) { + if (textPtr->cursorOffGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC); } textPtr->cursorOffGC = newGC; @@ -568,37 +568,37 @@ DeleteText( { TextItem *textPtr = (TextItem *) itemPtr; - if (textPtr->color) { + if (textPtr->color != NULL) { Tk_FreeColor(textPtr->color); } - if (textPtr->activeColor) { + if (textPtr->activeColor != NULL) { Tk_FreeColor(textPtr->activeColor); } - if (textPtr->disabledColor) { + if (textPtr->disabledColor != NULL) { Tk_FreeColor(textPtr->disabledColor); } Tk_FreeFont(textPtr->tkfont); - if (textPtr->stipple) { + if (textPtr->stipple != None) { Tk_FreeBitmap(display, textPtr->stipple); } - if (textPtr->activeStipple) { + if (textPtr->activeStipple != None) { Tk_FreeBitmap(display, textPtr->activeStipple); } - if (textPtr->disabledStipple) { + if (textPtr->disabledStipple != None) { Tk_FreeBitmap(display, textPtr->disabledStipple); } - if (textPtr->text) { + if (textPtr->text != NULL) { ckfree(textPtr->text); } Tk_FreeTextLayout(textPtr->textLayout); - if (textPtr->gc) { + if (textPtr->gc != NULL) { Tk_FreeGC(display, textPtr->gc); } - if (textPtr->selTextGC) { + if (textPtr->selTextGC != NULL) { Tk_FreeGC(display, textPtr->selTextGC); } - if (textPtr->cursorOffGC) { + if (textPtr->cursorOffGC != NULL) { Tk_FreeGC(display, textPtr->cursorOffGC); } } @@ -811,16 +811,16 @@ DisplayCanvText( } stipple = textPtr->stipple; if (Canvas(canvas)->currentItemPtr == itemPtr) { - if (textPtr->activeStipple) { + if (textPtr->activeStipple != None) { stipple = textPtr->activeStipple; } } else if (state == TK_STATE_DISABLED) { - if (textPtr->disabledStipple) { + if (textPtr->disabledStipple != None) { stipple = textPtr->disabledStipple; } } - if (!textPtr->gc) { + if (textPtr->gc == NULL) { return; } @@ -830,7 +830,7 @@ DisplayCanvText( * read-only. */ - if (stipple) { + if (stipple != None) { Tk_CanvasSetOffset(canvas, textPtr->gc, &textPtr->tsoffset); } @@ -932,7 +932,7 @@ DisplayCanvText( Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable, textInfoPtr->insertBorder, points, 4, textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED); - } else if (textPtr->cursorOffGC) { + } else if (textPtr->cursorOffGC != NULL) { /* * Redraw the background over the area of the cursor, even * though the cursor is turned off. This guarantees that the @@ -975,7 +975,7 @@ DisplayCanvText( textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->underline); - if (stipple) { + if (stipple != None) { XSetTSOrigin(display, textPtr->gc, 0, 0); } } @@ -1559,14 +1559,14 @@ TextToPostscript( if (textPtr->activeColor != NULL) { color = textPtr->activeColor; } - if (textPtr->activeStipple) { + if (textPtr->activeStipple != None) { stipple = textPtr->activeStipple; } } else if (state == TK_STATE_DISABLED) { if (textPtr->disabledColor != NULL) { color = textPtr->disabledColor; } - if (textPtr->disabledStipple) { + if (textPtr->disabledStipple != None) { stipple = textPtr->disabledStipple; } } @@ -1598,7 +1598,7 @@ TextToPostscript( } Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); - if (stipple) { + if (stipple != None) { Tcl_ResetResult(interp); Tk_CanvasPsStipple(interp, canvas, stipple); Tcl_AppendPrintfToObj(psObj, "/StippleText {\n %s} bind def\n", @@ -1633,7 +1633,7 @@ TextToPostscript( Tcl_AppendPrintfToObj(psObj, "] %d %g %g %s %s DrawText\n", fm.linespace, x / -2.0, y / 2.0, justify, - (stipple ? "true" : "false")); + ((stipple == None) ? "false" : "true")); /* * Plug the accumulated postscript back into the result. |