summaryrefslogtreecommitdiffstats
path: root/xlib/xgc.c
diff options
context:
space:
mode:
authordas <das>2007-05-30 06:35:54 (GMT)
committerdas <das>2007-05-30 06:35:54 (GMT)
commite37ef892e06f50859941c35f85b7f07ce98d756e (patch)
treed698fa040408e94632aa7a89b0599efb12078dfb /xlib/xgc.c
parenteea3d8a589c007592691cf767336a06b0f600c50 (diff)
downloadtk-e37ef892e06f50859941c35f85b7f07ce98d756e.zip
tk-e37ef892e06f50859941c35f85b7f07ce98d756e.tar.gz
tk-e37ef892e06f50859941c35f85b7f07ce98d756e.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: * macosx/Wish.xcodeproj/project.pbxproj: delete references to removed * macosx/Wish.xcodeproj/default.pbxuser: ttk files.
Diffstat (limited to 'xlib/xgc.c')
-rw-r--r--xlib/xgc.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 307617f..6f96df8 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -9,19 +9,19 @@
* 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.11 2007/01/03 08:22:08 das Exp $
+ * RCS: @(#) $Id: xgc.c,v 1.12 2007/05/30 06:35:55 das Exp $
*/
#include <tkInt.h>
#if !defined(MAC_OSX_TK)
-# include <X11/Xlib.h>
+# include <X11/Xlib.h>
#endif
#ifdef MAC_OSX_TK
-# include <X11/Xlib.h>
-# include <X11/X.h>
-# define Cursor XCursor
-# define Region XRegion
+# include <X11/Xlib.h>
+# include <X11/X.h>
+# define Cursor XCursor
+# define Region XRegion
#endif
/*
@@ -342,8 +342,9 @@ XSetClipOrigin(
* 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.
+ * 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.
@@ -360,6 +361,8 @@ TkSetRegion(
GC gc,
TkRegion r)
{
+ TkpClipMask *clip_mask;
+
if (r == None) {
if (gc->clip_mask) {
ckfree((char*) gc->clip_mask);
@@ -371,8 +374,9 @@ TkSetRegion(
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
@@ -381,6 +385,8 @@ XSetClipMask(
GC gc,
Pixmap pixmap)
{
+ TkpClipMask *clip_mask;
+
if (pixmap == None) {
if (gc->clip_mask) {
ckfree((char*) gc->clip_mask);
@@ -392,8 +398,9 @@ XSetClipMask(
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;
}
/*