summaryrefslogtreecommitdiffstats
path: root/generic/tkMenuDraw.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-31 15:36:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-31 15:36:56 (GMT)
commitf2b5a87d6dc6d3468828d48929583d950690a40b (patch)
tree22ec58572e255d6081163199ca2f2d60365c7b6c /generic/tkMenuDraw.c
parentb68e469c6fcec04a86935ae2e8853197213f40db (diff)
downloadtk-f2b5a87d6dc6d3468828d48929583d950690a40b.zip
tk-f2b5a87d6dc6d3468828d48929583d950690a40b.tar.gz
tk-f2b5a87d6dc6d3468828d48929583d950690a40b.tar.bz2
As requested by Christian Werner/François Vogel and others: Undo many None -> 0 changes, in order to reduce the probability of merge conflicts with other branches.
Remark: Many usages of "None" in Tk are wrong, "NULL" should be used in many places where pointers are referenced in stead of XID's. Those places are corrected.
Diffstat (limited to 'generic/tkMenuDraw.c')
-rw-r--r--generic/tkMenuDraw.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index d26f83b..11faa0a 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -43,12 +43,12 @@ void
TkMenuInitializeDrawingFields(
TkMenu *menuPtr) /* The menu we are initializing. */
{
- menuPtr->textGC = 0;
- menuPtr->gray = 0;
- menuPtr->disabledGC = 0;
- menuPtr->activeGC = 0;
- menuPtr->indicatorGC = 0;
- menuPtr->disabledImageGC = 0;
+ menuPtr->textGC = NULL;
+ menuPtr->gray = None;
+ menuPtr->disabledGC = NULL;
+ menuPtr->activeGC = NULL;
+ menuPtr->indicatorGC = NULL;
+ menuPtr->disabledImageGC = NULL;
menuPtr->totalWidth = menuPtr->totalHeight = 0;
}
@@ -79,10 +79,10 @@ TkMenuInitializeEntryDrawingFields(
mePtr->y = 0;
mePtr->indicatorSpace = 0;
mePtr->labelWidth = 0;
- mePtr->textGC = 0;
- mePtr->activeGC = 0;
- mePtr->disabledGC = 0;
- mePtr->indicatorGC = 0;
+ mePtr->textGC = NULL;
+ mePtr->activeGC = NULL;
+ mePtr->disabledGC = NULL;
+ mePtr->indicatorGC = NULL;
}
/*
@@ -106,22 +106,22 @@ void
TkMenuFreeDrawOptions(
TkMenu *menuPtr)
{
- if (menuPtr->textGC) {
+ if (menuPtr->textGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->textGC);
}
- if (menuPtr->disabledImageGC) {
+ if (menuPtr->disabledImageGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->disabledImageGC);
}
- if (menuPtr->gray) {
+ if (menuPtr->gray != None) {
Tk_FreeBitmap(menuPtr->display, menuPtr->gray);
}
- if (menuPtr->disabledGC) {
+ if (menuPtr->disabledGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->disabledGC);
}
- if (menuPtr->activeGC) {
+ if (menuPtr->activeGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->activeGC);
}
- if (menuPtr->indicatorGC) {
+ if (menuPtr->indicatorGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->indicatorGC);
}
}
@@ -147,16 +147,16 @@ void
TkMenuEntryFreeDrawOptions(
TkMenuEntry *mePtr)
{
- if (mePtr->textGC) {
+ if (mePtr->textGC != None) {
Tk_FreeGC(mePtr->menuPtr->display, mePtr->textGC);
}
- if (mePtr->disabledGC) {
+ if (mePtr->disabledGC != None) {
Tk_FreeGC(mePtr->menuPtr->display, mePtr->disabledGC);
}
- if (mePtr->activeGC) {
+ if (mePtr->activeGC != None) {
Tk_FreeGC(mePtr->menuPtr->display, mePtr->activeGC);
}
- if (mePtr->indicatorGC) {
+ if (mePtr->indicatorGC != None) {
Tk_FreeGC(mePtr->menuPtr->display, mePtr->indicatorGC);
}
}
@@ -205,7 +205,7 @@ TkMenuConfigureDrawOptions(
gcValues.background = Tk_3DBorderColor(border)->pixel;
newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont,
&gcValues);
- if (menuPtr->textGC) {
+ if (menuPtr->textGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->textGC);
}
menuPtr->textGC = newGC;
@@ -222,34 +222,34 @@ TkMenuConfigureDrawOptions(
} else {
gcValues.foreground = gcValues.background;
mask = GCForeground;
- if (!menuPtr->gray) {
+ if (menuPtr->gray == None) {
menuPtr->gray = Tk_GetBitmap(menuPtr->interp, menuPtr->tkwin,
"gray50");
}
- if (menuPtr->gray) {
+ if (menuPtr->gray != None) {
gcValues.fill_style = FillStippled;
gcValues.stipple = menuPtr->gray;
mask = GCForeground|GCFillStyle|GCStipple;
}
}
newGC = Tk_GetGC(menuPtr->tkwin, mask, &gcValues);
- if (menuPtr->disabledGC) {
+ if (menuPtr->disabledGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->disabledGC);
}
menuPtr->disabledGC = newGC;
gcValues.foreground = Tk_3DBorderColor(border)->pixel;
- if (!menuPtr->gray) {
+ if (menuPtr->gray == None) {
menuPtr->gray = Tk_GetBitmap(menuPtr->interp, menuPtr->tkwin,
"gray50");
}
- if (menuPtr->gray) {
+ if (menuPtr->gray != None) {
gcValues.fill_style = FillStippled;
gcValues.stipple = menuPtr->gray;
newGC = Tk_GetGC(menuPtr->tkwin,
GCForeground|GCFillStyle|GCStipple, &gcValues);
}
- if (menuPtr->disabledImageGC) {
+ if (menuPtr->disabledImageGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->disabledImageGC);
}
menuPtr->disabledImageGC = newGC;
@@ -262,7 +262,7 @@ TkMenuConfigureDrawOptions(
gcValues.background = Tk_3DBorderColor(activeBorder)->pixel;
newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont,
&gcValues);
- if (menuPtr->activeGC) {
+ if (menuPtr->activeGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->activeGC);
}
menuPtr->activeGC = newGC;
@@ -273,7 +273,7 @@ TkMenuConfigureDrawOptions(
gcValues.background = Tk_3DBorderColor(border)->pixel;
newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont,
&gcValues);
- if (menuPtr->indicatorGC) {
+ if (menuPtr->indicatorGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->indicatorGC);
}
menuPtr->indicatorGC = newGC;
@@ -385,24 +385,24 @@ TkMenuConfigureEntryDrawOptions(
GCForeground|GCBackground|GCFont|GCGraphicsExposures,
&gcValues);
} else {
- newGC = 0;
- newActiveGC = 0;
- newDisabledGC = 0;
- newIndicatorGC = 0;
+ newGC = NULL;
+ newActiveGC = NULL;
+ newDisabledGC = NULL;
+ newIndicatorGC = NULL;
}
- if (mePtr->textGC) {
+ if (mePtr->textGC != None) {
Tk_FreeGC(menuPtr->display, mePtr->textGC);
}
mePtr->textGC = newGC;
- if (mePtr->activeGC) {
+ if (mePtr->activeGC != None) {
Tk_FreeGC(menuPtr->display, mePtr->activeGC);
}
mePtr->activeGC = newActiveGC;
- if (mePtr->disabledGC) {
+ if (mePtr->disabledGC != None) {
Tk_FreeGC(menuPtr->display, mePtr->disabledGC);
}
mePtr->disabledGC = newDisabledGC;
- if (mePtr->indicatorGC) {
+ if (mePtr->indicatorGC != None) {
Tk_FreeGC(menuPtr->display, mePtr->indicatorGC);
}
mePtr->indicatorGC = newIndicatorGC;