diff options
Diffstat (limited to 'xlib')
-rw-r--r-- | xlib/X11/X.h | 12 | ||||
-rw-r--r-- | xlib/xgc.c | 24 | ||||
-rw-r--r-- | xlib/ximage.c | 2 | ||||
-rw-r--r-- | xlib/xutil.c | 7 |
4 files changed, 23 insertions, 22 deletions
diff --git a/xlib/X11/X.h b/xlib/X11/X.h index 316683b..b43967e 100644 --- a/xlib/X11/X.h +++ b/xlib/X11/X.h @@ -73,7 +73,9 @@ typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs * RESERVED RESOURCE AND CONSTANT DEFINITIONS *****************************************************************/ -/* define None 0L See bug [9e31fd9449] and below */ +#ifndef _WIN32 +# define None 0L /* See bug [9e31fd9449] and below */ +#endif #define ParentRelative 1L /* background pixmap in CreateWindow and ChangeWindowAttributes */ @@ -179,7 +181,9 @@ are reserved in the protocol for errors and replies. */ #define ShiftMask (1<<0) #define LockMask (1<<1) -/* define ControlMask (1<<2) See bug [9e31fd9449] and below */ +#ifndef _WIN32 +# define ControlMask (1<<2) /* See bug [9e31fd9449] and below */ +#endif #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) #define Mod3Mask (1<<5) @@ -187,7 +191,9 @@ are reserved in the protocol for errors and replies. */ #define Mod5Mask (1<<7) /* See bug [9e31fd9449], this way prevents conflicts with Win32 headers */ +#ifdef _WIN32 enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) }; +#endif /* modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. These correspond to the @@ -297,7 +303,7 @@ enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) }; /* Used in SetInputFocus, GetInputFocus */ -#define RevertToNone 0 +#define RevertToNone (int)None #define RevertToPointerRoot (int)PointerRoot #define RevertToParent 2 @@ -50,7 +50,7 @@ static TkpClipMask *AllocClipMask(GC gc) { TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask; - if (!clip_mask) { + if (clip_mask == NULL) { clip_mask = ckalloc(sizeof(TkpClipMask)); gc->clip_mask = (Pixmap) clip_mask; #ifdef MAC_OSX_TK @@ -78,14 +78,14 @@ static TkpClipMask *AllocClipMask(GC gc) { */ static void FreeClipMask(GC gc) { - if (gc->clip_mask) { + if (gc->clip_mask != None) { #ifdef MAC_OSX_TK if (((TkpClipMask*) gc->clip_mask)->type == TKP_CLIP_REGION) { TkpReleaseRegion(((TkpClipMask*) gc->clip_mask)->value.region); } #endif ckfree(gc->clip_mask); - gc->clip_mask = 0; + gc->clip_mask = None; } } @@ -125,7 +125,7 @@ XCreateGC( gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize); if (!gp) { - return 0; + return NULL; } #define InitField(name,maskbit,default) \ @@ -144,11 +144,11 @@ XCreateGC( InitField(fill_style, GCFillStyle, FillSolid); InitField(fill_rule, GCFillRule, WindingRule); InitField(arc_mode, GCArcMode, ArcPieSlice); - InitField(tile, GCTile, 0); - InitField(stipple, GCStipple, 0); + InitField(tile, GCTile, None); + InitField(stipple, GCStipple, None); InitField(ts_x_origin, GCTileStipXOrigin, 0); InitField(ts_y_origin, GCTileStipYOrigin, 0); - InitField(font, GCFont, 0); + InitField(font, GCFont, None); InitField(subwindow_mode, GCSubwindowMode, ClipByChildren); InitField(graphics_exposures, GCGraphicsExposures, True); InitField(clip_x_origin, GCClipXOrigin, 0); @@ -157,7 +157,7 @@ XCreateGC( InitField(dashes, GCDashList, 4); (&(gp->dashes))[1] = 0; - gp->clip_mask = 0; + gp->clip_mask = None; if (mask & GCClipMask) { TkpClipMask *clip_mask = AllocClipMask(gp); @@ -268,7 +268,7 @@ int XFreeGC( Display *d, GC gc) { - if (gc) { + if (gc != NULL) { FreeClipMask(gc); TkpFreeGCCache(gc); ckfree(gc); @@ -464,8 +464,8 @@ TkSetRegion( GC gc, TkRegion r) { - if (!r) { - Tcl_Panic("must not pass None to TkSetRegion for compatibility with X11; use XSetClipMask instead"); + if (r == NULL) { + Tcl_Panic("must not pass NULL to TkSetRegion for compatibility with X11; use XSetClipMask instead"); } else { TkpClipMask *clip_mask = AllocClipMask(gc); @@ -483,7 +483,7 @@ XSetClipMask( GC gc, Pixmap pixmap) { - if (!pixmap) { + if (pixmap == None) { FreeClipMask(gc); } else { TkpClipMask *clip_mask = AllocClipMask(gc); diff --git a/xlib/ximage.c b/xlib/ximage.c index f7bf1cc..aaab946 100644 --- a/xlib/ximage.c +++ b/xlib/ximage.c @@ -47,7 +47,7 @@ XCreateBitmapFromData( pix = Tk_GetPixmap(display, d, (int) width, (int) height, 1); gc = XCreateGC(display, pix, 0, NULL); if (gc == NULL) { - return 0; + return None; } ximage = XCreateImage(display, NULL, 1, XYBitmap, 0, (char*) data, width, height, 8, (width + 7) / 8); diff --git a/xlib/xutil.c b/xlib/xutil.c index 7b69e18..1e81549 100644 --- a/xlib/xutil.c +++ b/xlib/xutil.c @@ -9,12 +9,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#include <stdlib.h> -#include <tk.h> - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xatom.h> +#include "tkInt.h" /* *---------------------------------------------------------------------- |