summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authordas <das@noemail.net>2007-05-30 06:39:36 (GMT)
committerdas <das@noemail.net>2007-05-30 06:39:36 (GMT)
commit5db9ddffd10f55389402bb9ad30106700b3447cd (patch)
treebbd79c7a2b425288ac6c592cd05b8613c3dbdfd7 /xlib
parent8896dd916b9a201fee4ff4a50b805cb31633c660 (diff)
downloadtk-5db9ddffd10f55389402bb9ad30106700b3447cd.zip
tk-5db9ddffd10f55389402bb9ad30106700b3447cd.tar.gz
tk-5db9ddffd10f55389402bb9ad30106700b3447cd.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: FossilOrigin-Name: 8d0ae0fd4d351d8dac44ccfa6439abf02339b89e
Diffstat (limited to 'xlib')
-rw-r--r--xlib/xgc.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 17a86c7..f2aeb2f 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -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;
}
/*