diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-08-11 14:08:07 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-08-11 14:08:07 (GMT) |
commit | 2f0e2bae061937b0df9e7706be7e265b3fa0b3b0 (patch) | |
tree | 3a76df5f90cc1bd242bf4dc68f2dbcc3b81d5319 | |
parent | 57ad1cd7057d0a9bd8ba4ca1465a9bc44e5b20e4 (diff) | |
parent | acb6f7b259137644e34ba799e20432a0ced9be0a (diff) | |
download | tk-2f0e2bae061937b0df9e7706be7e265b3fa0b3b0.zip tk-2f0e2bae061937b0df9e7706be7e265b3fa0b3b0.tar.gz tk-2f0e2bae061937b0df9e7706be7e265b3fa0b3b0.tar.bz2 |
Fix typo's, debug statements, C++-comment.
-rw-r--r-- | macosx/tkMacOSXDraw.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXRegion.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 6631b4f..3a3e288 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -18,7 +18,6 @@ #include "tkMacOSXDebug.h" #include "xbytes.h" - /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_DRAWING @@ -146,7 +145,7 @@ BitmapRepFromDrawableRect( NSBitmapImageRep *bitmap_rep=NULL; NSView *view=NULL; if ( mac_drawable->flags & TK_IS_PIXMAP ) { - /* + /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view field is NULL. It's context field should point to a CGImage. */ @@ -1480,7 +1479,7 @@ TkScrollWindow( TkRegion damageRgn) /* Region to accumulate damage in. */ { Drawable drawable = Tk_WindowId(tkwin); - MacDrawable *macDraw = (MacDrawable *) drawable; + MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect visRect, srcRect, dstRect, scroll_src, scroll_dst; HIShapeRef dmgRgn = NULL; @@ -1491,7 +1490,7 @@ TkScrollWindow( /* Get the scroll area in NSView coordinates (origin at bottom left). */ bounds = [view bounds]; scroll_src = CGRectMake( - macDraw->xOff + x, + macDraw->xOff + x, bounds.size.height - height - (macDraw->yOff + y), width, height); scroll_dst = CGRectOffset(scroll_src, dx, -dy); @@ -1537,7 +1536,7 @@ TkScrollWindow( * them as damaged. Use Tk coordinates, shifted to account for the * future scrolling. */ - + for (NSView *subview in [view subviews] ) { NSRect frame = [subview frame]; CGRect subviewRect = CGRectMake( @@ -1555,15 +1554,12 @@ TkScrollWindow( CFRelease(dstRgn); } } - } } - if ( dmgRgn == NULL ) { dmgRgn = HIShapeCreateEmpty(); } - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; CFRelease(dmgRgn); diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c index c716ab7..0f2a74a 100644 --- a/macosx/tkMacOSXRegion.c +++ b/macosx/tkMacOSXRegion.c @@ -207,7 +207,7 @@ TkRectInRegion( if ( TkMacOSXIsEmptyRegion(region) ) { return RectangleOut; } - else { + else { const CGRect r = CGRectMake(x, y, width, height); return HIShapeIntersectsRect((HIShapeRef) region, &r) ? RectanglePart : RectangleOut; diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 9ba7100..1a71746 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -651,7 +651,7 @@ XConfigureWindow( * * TkMacOSXUpdateClipRgn -- * - * This function updates the cliping regions for a given window and all of + * This function updates the clipping regions for a given window and all of * its children. Once updated the TK_CLIP_INVALID flag in the subwindow * data structure is unset. The TK_CLIP_INVALID flag should always be * unset before any drawing is attempted. @@ -818,7 +818,7 @@ TkMacOSXUpdateClipRgn( * * TkMacOSXVisableClipRgn -- * - * This function returns the Macintosh cliping region for the given + * This function returns the Macintosh clipping region for the given * window. The caller is responsible for disposing of the returned * region via TkDestroyRegion(). * @@ -913,7 +913,7 @@ TkMacOSXInvalidateWindow( * TK_PARENT_WINDOW */ { #ifdef TK_MAC_DEBUG_CLIP_REGIONS - TkMacOSXDbgMsg("%s", winPtr->pathName); + TkMacOSXDbgMsg("%s", macWin->winPtr->pathName); #endif if (macWin->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macWin->winPtr); @@ -1071,7 +1071,7 @@ TkMacOSXGetRootControl( * None. * * Side effects: - * The cliping regions for the window and its children are mark invalid. + * The clipping regions for the window and its children are marked invalid. * (Make sure they are valid before drawing.) * *---------------------------------------------------------------------- @@ -1090,6 +1090,10 @@ TkMacOSXInvalClipRgns( * be marked. */ +#ifdef TK_MAC_DEBUG_CLIP_REGIONS + TkMacOSXDbgMsg("%s", winPtr->pathName); +#endif + if (!macWin || macWin->flags & TK_CLIP_INVALID) { return; } diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index c0f7c7c..b16b582 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -884,7 +884,7 @@ XGetImage( bitmap_rep = BitmapRepFromDrawableRect(d, x, y,width, height); if ( bitmap_rep == Nil || - [bitmap_rep bitmapFormat] != 0 || + [bitmap_rep bitmapFormat] != 0 || [bitmap_rep samplesPerPixel] != 4 || [bitmap_rep isPlanar] != 0 ) { TkMacOSXDbgMsg("XGetImage: Failed to construct NSBitmapRep"); @@ -894,7 +894,7 @@ XGetImage( NSSize image_size = NSMakeSize(width, height); NSImage* ns_image = [[NSImage alloc]initWithSize:image_size]; [ns_image addRepresentation:bitmap_rep]; - + /* Assume premultiplied nonplanar data with 4 bytes per pixel and alpha last.*/ if ( [bitmap_rep bitmapFormat] == 0 && [bitmap_rep isPlanar ] == 0 && |