diff options
author | das <das> | 2007-06-29 03:22:00 (GMT) |
---|---|---|
committer | das <das> | 2007-06-29 03:22:00 (GMT) |
commit | ee37ce0c65271d0a9fc3ea750b0087b9116329b4 (patch) | |
tree | c06cbd1a38889e6a8b8630f5eceab1c1b9d60f13 /macosx/tkMacOSXWindowEvent.c | |
parent | bebeb7fa1104cbd7384ebb725235542228b06b21 (diff) | |
download | tk-ee37ce0c65271d0a9fc3ea750b0087b9116329b4.zip tk-ee37ce0c65271d0a9fc3ea750b0087b9116329b4.tar.gz tk-ee37ce0c65271d0a9fc3ea750b0087b9116329b4.tar.bz2 |
* macosx/tkMacOSXScrlbr.c: correct int <-> dobule conversion issues
that could lead to Carbon getting confused about scrollbar thumb size.
* macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage) use
TkMacOSX{Setup,Restore}DrawingContext() to setup/restore clip & colors.
(TkMacOSXSetupDrawingContext, TkMacOSXRestoreDrawingContext): add save
and restore of QD port clip region; factor out clip region code common
to CG and QD branches; check for port and context validity; handle
tkPictureIsOpen flag during QD port setup.
(TkScrollWindow): remove unnecessary scroll region manipulation
* macosx/tkMacOSXDraw.c: remove second global QD temp region
* macosx/tkMacOSXInt.h: (no longer necessary) and rename
* macosx/tkMacOSXRegion.c: remaining global QD temp region.
* macosx/tkMacOSXSubwindows.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXDraw.c: make useCGDrawing variable MODULE_SCOPE
* macosx/tkMacOSXFont.c: and sync formatting with HEAD.
* macosx/tkMacOSXButton.c: reduce reliance on current QD port
* macosx/tkMacOSXColor.c: setting and remove unnecessary
* macosx/tkMacOSXDebug.c: references to a drawable's QD port,
* macosx/tkMacOSXDebug.h: notably replace GetWindowFromPort(
* macosx/tkMacOSXDialog.c: TkMacOSXGetDrawablePort()) idiom by new
* macosx/tkMacOSXDraw.c: TkMacOSXDrawableWindow() and change
* macosx/tkMacOSXKeyEvent.c: TkMacOSXSetColorInPort() to take a port
* macosx/tkMacOSXMenu.c: argument.
* macosx/tkMacOSXMenubutton.c:
* macosx/tkMacOSXMouseEvent.c:
* macosx/tkMacOSXScale.c:
* macosx/tkMacOSXScrlbr.c:
* macosx/tkMacOSXSubwindows.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
* macosx/tkMacOSXInt.h: factor out macros, declarations
* macosx/tkMacOSXPrivate.h (new): and prototypes that are purely
internal and private to the 'macosx' sources into a new internal header
file that does _not_ get installed into Tk.framework/PrivateHeaders.
* macosx/tkMacOSXButton.c: #include new tkMacOSXPrivate.h
* macosx/tkMacOSXCarbonEvents.c: instead of tkMacOSXInt.h.
* macosx/tkMacOSXClipboard.c:
* macosx/tkMacOSXColor.c:
* macosx/tkMacOSXCursor.c:
* macosx/tkMacOSXDebug.c:
* macosx/tkMacOSXDialog.c:
* macosx/tkMacOSXDraw.c:
* macosx/tkMacOSXEntry.c:
* macosx/tkMacOSXEvent.c:
* macosx/tkMacOSXFont.c:
* macosx/tkMacOSXHLEvents.c:
* macosx/tkMacOSXInit.c:
* macosx/tkMacOSXKeyEvent.c:
* macosx/tkMacOSXMenu.c:
* macosx/tkMacOSXMenubutton.c:
* macosx/tkMacOSXMenus.c:
* macosx/tkMacOSXMouseEvent.c:
* macosx/tkMacOSXNotify.c:
* macosx/tkMacOSXRegion.c:
* macosx/tkMacOSXScale.c:
* macosx/tkMacOSXScrlbr.c:
* macosx/tkMacOSXSubwindows.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
* macosx/tkMacOSXXStubs.c:
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index d177191..37139f3 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -54,10 +54,10 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.3.2.23 2007/06/09 17:10:22 das Exp $ + * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.3.2.24 2007/06/29 03:22:02 das Exp $ */ -#include "tkMacOSXInt.h" +#include "tkMacOSXPrivate.h" #include "tkMacOSXWm.h" #include "tkMacOSXEvent.h" #include "tkMacOSXDebug.h" @@ -445,7 +445,7 @@ GenerateUpdateEvent(Window window) TkDisplay *dispPtr; TkWindow *winPtr; int result = 0; - Rect updateBounds; + Rect updateBounds, bounds; dispPtr = TkGetDisplayList(); winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window); @@ -453,23 +453,24 @@ GenerateUpdateEvent(Window window) if (winPtr ==NULL ){ return result; } - TkMacOSXCheckTmpRgnEmpty(1); + TkMacOSXCheckTmpQdRgnEmpty(); destPort = TkMacOSXGetDrawablePort(window); macWindow = GetWindowFromPort(destPort); - ChkErr(GetWindowRegion, macWindow, kWindowUpdateRgn, tkMacOSXtmpRgn1); - QDGlobalToLocalRegion(destPort, tkMacOSXtmpRgn1); - SectRegionWithPortVisibleRegion(destPort, tkMacOSXtmpRgn1); - GetRegionBounds(tkMacOSXtmpRgn1, &updateBounds); + ChkErr(GetWindowRegion, macWindow, kWindowUpdateRgn, tkMacOSXtmpQdRgn); + ChkErr(GetWindowBounds, macWindow, kWindowContentRgn, &bounds); + OffsetRgn(tkMacOSXtmpQdRgn, -bounds.left, -bounds.top); + SectRegionWithPortVisibleRegion(destPort, tkMacOSXtmpQdRgn); + GetRegionBounds(tkMacOSXtmpQdRgn, &updateBounds); #ifdef TK_MAC_DEBUG_CLIP_REGIONS - TkMacOSXDebugFlashRegion(destPort, tkMacOSXtmpRgn1); + TkMacOSXDebugFlashRegion(window, tkMacOSXtmpQdRgn); #endif /* TK_MAC_DEBUG_CLIP_REGIONS */ BeginUpdate(macWindow); if (winPtr->wmInfoPtr->flags & WM_TRANSPARENT) { - ClearPort(destPort, tkMacOSXtmpRgn1); + ClearPort(destPort, tkMacOSXtmpQdRgn); } - result = GenerateUpdates(tkMacOSXtmpRgn1, &updateBounds, winPtr); + result = GenerateUpdates(tkMacOSXtmpQdRgn, &updateBounds, winPtr); EndUpdate(macWindow); - SetEmptyRgn(tkMacOSXtmpRgn1); + SetEmptyRgn(tkMacOSXtmpQdRgn); if (result) { /* * Ensure there are no pending idle-time redraws that could prevent @@ -531,7 +532,6 @@ GenerateUpdates( } RectRgn(damageRgn, &bounds); SectRgn(damageRgn, updateRgn, damageRgn); - OffsetRgn(damageRgn, -bounds.left, -bounds.top); GetRegionBounds(damageRgn, &damageBounds); RectRgn(damageRgn, &bounds); UnionRgn(damageRgn, updateRgn, updateRgn); @@ -543,10 +543,10 @@ GenerateUpdates( event.xany.window = Tk_WindowId(winPtr); event.xany.display = Tk_Display(winPtr); event.type = Expose; - event.xexpose.x = damageBounds.left; - event.xexpose.y = damageBounds.top; - event.xexpose.width = damageBounds.right-damageBounds.left; - event.xexpose.height = damageBounds.bottom-damageBounds.top; + event.xexpose.x = damageBounds.left - bounds.left; + event.xexpose.y = damageBounds.top - bounds.top; + event.xexpose.width = damageBounds.right - damageBounds.left; + event.xexpose.height = damageBounds.bottom - damageBounds.top; event.xexpose.count = 0; Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); @@ -954,6 +954,9 @@ ClearPort( GetPortBounds(port, &bounds); QDBeginCGContext(port, &context); + SyncCGContextOriginWithPort(context, port); + CGContextConcatCTM(context, CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, + bounds.bottom - bounds.top)); if (updateRgn) { ClipCGContextToRegion(context, &bounds, updateRgn); } |