summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWindowEvent.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2007-06-29 03:20:00 (GMT)
committerdas <das@noemail.net>2007-06-29 03:20:00 (GMT)
commitd0079d8b5ed83f1d0aea3c323cea253ca9db36b9 (patch)
tree05f288d4eecbd4785ba86178ba73ebfc79a81895 /macosx/tkMacOSXWindowEvent.c
parentd2bf9b13713b22870c1e99ceef117825fb2feda2 (diff)
downloadtk-d0079d8b5ed83f1d0aea3c323cea253ca9db36b9.zip
tk-d0079d8b5ed83f1d0aea3c323cea253ca9db36b9.tar.gz
tk-d0079d8b5ed83f1d0aea3c323cea253ca9db36b9.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 respect it for ATSUI font drawing. * 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: * macosx/ttkMacOSXTheme.c: FossilOrigin-Name: dd992cbcc9ea6f7a80d3476198ad6da1478ec96d
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r--macosx/tkMacOSXWindowEvent.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 1b71cad..fb53c81 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.26 2007/06/09 17:09:41 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.27 2007/06/29 03:20: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);
}