summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXSubwindows.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 /macosx/tkMacOSXSubwindows.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 'macosx/tkMacOSXSubwindows.c')
-rw-r--r--macosx/tkMacOSXSubwindows.c75
1 files changed, 27 insertions, 48 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index f909800..7ff515c 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.18 2007/05/09 12:55:16 das Exp $
+ * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.19 2007/05/30 06:35:55 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -200,7 +200,8 @@ XMapWindow(
if ((macWin->winPtr->wmInfoPtr->macClass == kSheetWindowClass)
&& (macWin->winPtr->wmInfoPtr->master != None)) {
ShowSheetWindow(wRef,
- GetWindowFromPort(TkMacOSXGetDrawablePort(macWin->winPtr->wmInfoPtr->master)));
+ GetWindowFromPort(TkMacOSXGetDrawablePort(
+ macWin->winPtr->wmInfoPtr->master)));
} else {
ShowWindow(wRef);
}
@@ -806,17 +807,16 @@ void
TkMacOSXUpdateClipRgn(
TkWindow *winPtr)
{
- RgnHandle rgn;
- int x, y;
- TkWindow *win2Ptr;
-
if (winPtr == NULL) {
return;
}
if (winPtr->privatePtr && winPtr->privatePtr->flags & TK_CLIP_INVALID) {
+ TkWindow *win2Ptr;
+
if (Tk_IsMapped(winPtr)) {
- rgn = winPtr->privatePtr->aboveClipRgn;
+ int x, y;
+ RgnHandle rgn = winPtr->privatePtr->aboveClipRgn;
/*
* Start with a region defined by the window bounds.
@@ -825,7 +825,7 @@ TkMacOSXUpdateClipRgn(
x = winPtr->privatePtr->xOff;
y = winPtr->privatePtr->yOff;
SetRectRgn(rgn, (short) x, (short) y,
- (short) (winPtr->changes.width + x),
+ (short) (winPtr->changes.width + x),
(short) (winPtr->changes.height + y));
/*
@@ -845,14 +845,12 @@ TkMacOSXUpdateClipRgn(
TkMacOSXUpdateClipRgn(winPtr->parentPtr);
TkMacOSXCheckTmpRgnEmpty(1);
if (winPtr->parentPtr) {
- SectRgn(rgn,
- winPtr->parentPtr->privatePtr->aboveClipRgn, rgn);
+ SectRgn(rgn, winPtr->parentPtr->privatePtr->aboveClipRgn,
+ rgn);
}
-
- win2Ptr = winPtr->nextPtr;
- while (win2Ptr != NULL) {
+ win2Ptr = winPtr;
+ while ((win2Ptr = win2Ptr->nextPtr)) {
if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
- win2Ptr = win2Ptr->nextPtr;
continue;
}
x = win2Ptr->privatePtr->xOff;
@@ -861,17 +859,13 @@ TkMacOSXUpdateClipRgn(
(short) (win2Ptr->changes.width + x),
(short) (win2Ptr->changes.height + y));
DiffRgn(rgn, tkMacOSXtmpRgn1, rgn);
-
- win2Ptr = win2Ptr->nextPtr;
}
} else if (Tk_IsEmbedded(winPtr)) {
- TkWindow *contWinPtr = TkpGetOtherWindow(winPtr);
-
- if (contWinPtr != NULL) {
- TkMacOSXUpdateClipRgn(contWinPtr);
+ win2Ptr = TkpGetOtherWindow(winPtr);
+ if (win2Ptr) {
+ TkMacOSXUpdateClipRgn(win2Ptr);
TkMacOSXCheckTmpRgnEmpty(1);
- SectRgn(rgn,
- contWinPtr->privatePtr->aboveClipRgn, rgn);
+ SectRgn(rgn, win2Ptr->privatePtr->aboveClipRgn, rgn);
} else if (tkMacOSXEmbedHandler != NULL) {
TkMacOSXCheckTmpRgnEmpty(1);
tkMacOSXEmbedHandler->getClipProc((Tk_Window) winPtr,
@@ -882,21 +876,19 @@ TkMacOSXUpdateClipRgn(
/*
* NOTE: Here we should handle out of process embedding.
*/
-
}
/*
* The final clip region is the aboveClip region (or visible
* region) minus all the children of this window.
- * Alternatively, if the window is a container, we must also
- * subtract the region of the embedded window.
+ * If the window is a container, we must also subtract the region
+ * of the embedded window.
*/
rgn = winPtr->privatePtr->clipRgn;
CopyRgn(winPtr->privatePtr->aboveClipRgn, rgn);
-
win2Ptr = winPtr->childList;
- while (win2Ptr != NULL) {
+ while (win2Ptr) {
if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
win2Ptr = win2Ptr->nextPtr;
continue;
@@ -907,13 +899,12 @@ TkMacOSXUpdateClipRgn(
(short) (win2Ptr->changes.width + x),
(short) (win2Ptr->changes.height + y));
DiffRgn(rgn, tkMacOSXtmpRgn1, rgn);
-
win2Ptr = win2Ptr->nextPtr;
}
if (Tk_IsContainer(winPtr)) {
win2Ptr = TkpGetOtherWindow(winPtr);
- if (win2Ptr != NULL) {
+ if (win2Ptr) {
if (Tk_IsMapped(win2Ptr)) {
x = win2Ptr->privatePtr->xOff;
y = win2Ptr->privatePtr->yOff;
@@ -940,27 +931,20 @@ TkMacOSXUpdateClipRgn(
if (!Tk_IsTopLevel(winPtr)) {
TkMacOSXUpdateClipRgn(winPtr->parentPtr);
} else if (Tk_IsEmbedded(winPtr)) {
- TkWindow *contWinPtr = TkpGetOtherWindow(winPtr);
-
- if (contWinPtr != NULL) {
- TkMacOSXUpdateClipRgn(contWinPtr);
+ win2Ptr = TkpGetOtherWindow(winPtr);
+ if (win2Ptr) {
+ TkMacOSXUpdateClipRgn(win2Ptr);
}
}
SetEmptyRgn(winPtr->privatePtr->aboveClipRgn);
SetEmptyRgn(winPtr->privatePtr->clipRgn);
}
-
winPtr->privatePtr->flags &= ~TK_CLIP_INVALID;
#ifdef TK_MAC_DEBUG_CLIP_REGIONS
- TkMacOSXInitNamedDebugSymbol(HIToolbox, int, QDDebugFlashRegion,
- CGrafPtr port, RgnHandle region);
- if (QDDebugFlashRegion) {
- MacDrawable *macDraw = (MacDrawable *) winPtr->privatePtr;
- CGrafPtr grafPtr = TkMacOSXGetDrawablePort((Drawable) macDraw);
- /* Carbon-internal region flashing SPI (c.f. Technote 2124) */
- QDDebugFlashRegion(grafPtr, macDraw->clipRgn);
- }
+ TkMacOSXDebugFlashRegion(TkMacOSXGetDrawablePort(
+ (Drawable) winPtr->privatePtr),
+ ((MacDrawable*) winPtr->privatePtr)->clipRgn);
#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
}
@@ -1034,12 +1018,7 @@ TkMacOSXInvalidateWindow(
}
#ifdef TK_MAC_DEBUG_CLIP_REGIONS
- TkMacOSXInitNamedDebugSymbol(HIToolbox, int, QDDebugFlashRegion,
- CGrafPtr port, RgnHandle region);
- if (QDDebugFlashRegion) {
- /* Carbon-internal region flashing SPI (c.f. Technote 2124) */
- QDDebugFlashRegion(grafPtr, macWin->aboveClipRgn);
- }
+ TkMacOSXDebugFlashRegion(grafPtr, macWin->aboveClipRgn);
#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
}