summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvText.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/tkCanvText.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/tkCanvText.c')
-rw-r--r--generic/tkCanvText.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index eb8dfe3..7f5f23d 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 = None;
- textPtr->activeStipple = None;
- textPtr->disabledStipple = None;
+ textPtr->stipple = 0;
+ textPtr->activeStipple = 0;
+ textPtr->disabledStipple = 0;
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 = None;
- textPtr->selTextGC = None;
- textPtr->cursorOffGC = None;
+ textPtr->gc = 0;
+ textPtr->selTextGC = 0;
+ textPtr->cursorOffGC = 0;
textPtr->sine = 0.0;
textPtr->cosine = 1.0;
@@ -419,7 +419,7 @@ ConfigureText(
state = itemPtr->state;
- if (textPtr->activeColor != NULL || textPtr->activeStipple != None) {
+ if (textPtr->activeColor || textPtr->activeStipple) {
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 != None) {
+ if (textPtr->activeStipple) {
stipple = textPtr->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (textPtr->disabledColor != NULL) {
color = textPtr->disabledColor;
}
- if (textPtr->disabledStipple != None) {
+ if (textPtr->disabledStipple) {
stipple = textPtr->disabledStipple;
}
}
- newGC = newSelGC = None;
- if (textPtr->tkfont != NULL) {
+ newGC = newSelGC = 0;
+ if (textPtr->tkfont) {
gcValues.font = Tk_FontId(textPtr->tkfont);
mask = GCFont;
- if (color != NULL) {
+ if (color) {
gcValues.foreground = color->pixel;
mask |= GCForeground;
- if (stipple != None) {
+ if (stipple) {
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 != None) {
+ if (stipple) {
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 != None) {
+ if (textPtr->gc) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->gc);
}
textPtr->gc = newGC;
- if (textPtr->selTextGC != None) {
+ if (textPtr->selTextGC) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->selTextGC);
}
textPtr->selTextGC = newSelGC;
@@ -491,9 +491,9 @@ ConfigureText(
}
newGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
} else {
- newGC = None;
+ newGC = 0;
}
- if (textPtr->cursorOffGC != None) {
+ if (textPtr->cursorOffGC) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC);
}
textPtr->cursorOffGC = newGC;
@@ -568,37 +568,37 @@ DeleteText(
{
TextItem *textPtr = (TextItem *) itemPtr;
- if (textPtr->color != NULL) {
+ if (textPtr->color) {
Tk_FreeColor(textPtr->color);
}
- if (textPtr->activeColor != NULL) {
+ if (textPtr->activeColor) {
Tk_FreeColor(textPtr->activeColor);
}
- if (textPtr->disabledColor != NULL) {
+ if (textPtr->disabledColor) {
Tk_FreeColor(textPtr->disabledColor);
}
Tk_FreeFont(textPtr->tkfont);
- if (textPtr->stipple != None) {
+ if (textPtr->stipple) {
Tk_FreeBitmap(display, textPtr->stipple);
}
- if (textPtr->activeStipple != None) {
+ if (textPtr->activeStipple) {
Tk_FreeBitmap(display, textPtr->activeStipple);
}
- if (textPtr->disabledStipple != None) {
+ if (textPtr->disabledStipple) {
Tk_FreeBitmap(display, textPtr->disabledStipple);
}
- if (textPtr->text != NULL) {
+ if (textPtr->text) {
ckfree(textPtr->text);
}
Tk_FreeTextLayout(textPtr->textLayout);
- if (textPtr->gc != None) {
+ if (textPtr->gc) {
Tk_FreeGC(display, textPtr->gc);
}
- if (textPtr->selTextGC != None) {
+ if (textPtr->selTextGC) {
Tk_FreeGC(display, textPtr->selTextGC);
}
- if (textPtr->cursorOffGC != None) {
+ if (textPtr->cursorOffGC) {
Tk_FreeGC(display, textPtr->cursorOffGC);
}
}
@@ -811,16 +811,16 @@ DisplayCanvText(
}
stipple = textPtr->stipple;
if (Canvas(canvas)->currentItemPtr == itemPtr) {
- if (textPtr->activeStipple != None) {
+ if (textPtr->activeStipple) {
stipple = textPtr->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
- if (textPtr->disabledStipple != None) {
+ if (textPtr->disabledStipple) {
stipple = textPtr->disabledStipple;
}
}
- if (textPtr->gc == None) {
+ if (!textPtr->gc) {
return;
}
@@ -830,7 +830,7 @@ DisplayCanvText(
* read-only.
*/
- if (stipple != None) {
+ if (stipple) {
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 != None) {
+ } else if (textPtr->cursorOffGC) {
/*
* 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 != None) {
+ if (stipple) {
XSetTSOrigin(display, textPtr->gc, 0, 0);
}
}
@@ -1559,14 +1559,14 @@ TextToPostscript(
if (textPtr->activeColor != NULL) {
color = textPtr->activeColor;
}
- if (textPtr->activeStipple != None) {
+ if (textPtr->activeStipple) {
stipple = textPtr->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (textPtr->disabledColor != NULL) {
color = textPtr->disabledColor;
}
- if (textPtr->disabledStipple != None) {
+ if (textPtr->disabledStipple) {
stipple = textPtr->disabledStipple;
}
}
@@ -1598,7 +1598,7 @@ TextToPostscript(
}
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
- if (stipple != None) {
+ if (stipple) {
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 == None) ? "false" : "true"));
+ (stipple ? "true" : "false"));
/*
* Plug the accumulated postscript back into the result.