diff options
author | das <das> | 2007-05-30 06:39:37 (GMT) |
---|---|---|
committer | das <das> | 2007-05-30 06:39:37 (GMT) |
commit | f9656da6bd51578a98cba4bf11a42bd9cdcc30e9 (patch) | |
tree | bbd79c7a2b425288ac6c592cd05b8613c3dbdfd7 /xlib/xgc.c | |
parent | 7ccdafdd8fa2e11c218474b7186c9d14142c40a0 (diff) | |
download | tk-f9656da6bd51578a98cba4bf11a42bd9cdcc30e9.zip tk-f9656da6bd51578a98cba4bf11a42bd9cdcc30e9.tar.gz tk-f9656da6bd51578a98cba4bf11a42bd9cdcc30e9.tar.bz2 |
* macosx/tkMacOSXMenu.c (DrawMenuSeparator): use DrawingContext API.
* macosx/tkMacOSXWindowEvent.c (ClearPort): clip to updateRgn.
* macosx/tkMacOSXDebug.c: factor out debug region flashing.
* macosx/tkMacOSXDebug.h:
* macosx/tkMacOSXDraw.c:
* macosx/tkMacOSXSubwindows.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXEvent.c: cleanup whitespace and formatting.
* macosx/tkMacOSXFont.c:
* macosx/tkMacOSXRegion.c:
* macosx/tkMacOSXSubwindows.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
* macosx/tkMacOSXXStubs.c:
* xlib/xgc.c:
Diffstat (limited to 'xlib/xgc.c')
-rw-r--r-- | xlib/xgc.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xgc.c,v 1.6.2.2 2005/11/27 02:44:26 das Exp $ + * RCS: @(#) $Id: xgc.c,v 1.6.2.3 2007/05/30 06:39:39 das Exp $ */ #include <tkInt.h> @@ -338,10 +338,10 @@ XSetClipOrigin(display, gc, clip_x_origin, clip_y_origin) * * Sets the clipping region/pixmap for a GC. * - * Note that unlike the Xlib equivalent, it is not safe to delete - * the region after setting it into the GC. The only use of - * TkSetRegion is currently in ImgPhotoDisplay, which uses the GC - * immediately. + * Note that unlike the Xlib equivalent, it is not safe to delete the + * region after setting it into the GC. The only uses of TkSetRegion + * are currently in DisplayFrame and in ImgPhotoDisplay, which use the + * GC immediately. * * Results: * None. @@ -358,6 +358,8 @@ TkSetRegion(display, gc, r) GC gc; TkRegion r; { + TkpClipMask *clip_mask; + if (r == None) { if (gc->clip_mask) { ckfree((char*) gc->clip_mask); @@ -369,8 +371,9 @@ TkSetRegion(display, gc, r) if (gc->clip_mask == None) { gc->clip_mask = (Pixmap)ckalloc(sizeof(TkpClipMask)); } - ((TkpClipMask*)gc->clip_mask)->type = TKP_CLIP_REGION; - ((TkpClipMask*)gc->clip_mask)->value.region = r; + clip_mask = (TkpClipMask*) gc->clip_mask; + clip_mask->type = TKP_CLIP_REGION; + clip_mask->value.region = r; } void @@ -379,6 +382,8 @@ XSetClipMask(display, gc, pixmap) GC gc; Pixmap pixmap; { + TkpClipMask *clip_mask; + if (pixmap == None) { if (gc->clip_mask) { ckfree((char*) gc->clip_mask); @@ -390,8 +395,9 @@ XSetClipMask(display, gc, pixmap) if (gc->clip_mask == None) { gc->clip_mask = (Pixmap)ckalloc(sizeof(TkpClipMask)); } - ((TkpClipMask*)gc->clip_mask)->type = TKP_CLIP_PIXMAP; - ((TkpClipMask*)gc->clip_mask)->value.pixmap = pixmap; + clip_mask = (TkpClipMask*) gc->clip_mask; + clip_mask->type = TKP_CLIP_PIXMAP; + clip_mask->value.pixmap = pixmap; } /* |