diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXDraw.c | 16 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 22 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 4 |
3 files changed, 20 insertions, 22 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index f376591..bb1938a 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -148,7 +148,7 @@ BitmapRepFromDrawableRect( cg_image = CGBitmapContextCreateImage( (CGContextRef) cg_context); sub_cg_image = CGImageCreateWithImageInRect(cg_image, image_rect); if ( sub_cg_image ) { - /*This can be dealloc'ed prematurely if set for autorelease, causing crashes.*/ + /*This can be dealloc'ed prematurely if set for autorelease, causing crashes.*/ bitmap_rep = [NSBitmapImageRep alloc]; [bitmap_rep initWithCGImage:sub_cg_image]; } @@ -163,7 +163,7 @@ BitmapRepFromDrawableRect( width,height); if ( [view lockFocusIfCanDraw] ) { - /*This can be dealloc'ed prematurely if set for autorelease, causing crashes.*/ + /*This can be dealloc'ed prematurely if set for autorelease, causing crashes.*/ bitmap_rep = [NSBitmapImageRep alloc]; bitmap_rep = [bitmap_rep initWithFocusedViewRect:view_rect]; [view unlockFocus]; @@ -786,9 +786,6 @@ DrawCGImage( CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); #endif /* TK_MAC_DEBUG_IMAGE_DRAWING */ - /*if (CGImageIsMask(image)) { - CGContextRestoreGState(context); - }*/ if (subImage) { CFRelease(subImage); } @@ -875,7 +872,7 @@ XDrawLines( *---------------------------------------------------------------------- */ -void +int XDrawSegments( Display *display, Drawable d, @@ -889,7 +886,7 @@ XDrawSegments( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { double o = (lw % 2) ? .5 : 0; @@ -906,6 +903,7 @@ XDrawSegments( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -1828,7 +1826,7 @@ TkMacOSXGetClipRgn( { MacDrawable *macDraw = (MacDrawable *) drawable; HIShapeRef clipRgn = NULL; - + if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); #ifdef TK_MAC_DEBUG_DRAWING @@ -1905,7 +1903,7 @@ TkpClipDrawableToRect( { MacDrawable *macDraw = (MacDrawable *) d; NSView *view = TkMacOSXDrawableView(macDraw); - + if (macDraw->drawRgn) { CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index fce3801..75949ba 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -17,7 +17,7 @@ #include "tkMacOSXWm.h" #include "tkMacOSXEvent.h" #include "tkMacOSXDebug.h" - + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_EVENTS @@ -365,10 +365,10 @@ GenerateUpdates( event.xexpose.count = 0; Tk_HandleEvent(&event); - #ifdef TK_MAC_DEBUG_DRAWING +#ifdef TK_MAC_DEBUG_DRAWING NSLog(@"Expose %p {{%d, %d}, {%d, %d}}", event.xany.window, event.xexpose.x, event.xexpose.y, event.xexpose.width, event.xexpose.height); - #endif +#endif /* * Generate updates for the children of this window @@ -395,7 +395,7 @@ GenerateUpdates( /* * TODO: Here we should handle out of process embedding. */ - } + } return 1; } @@ -770,7 +770,7 @@ Tk_MacOSXIsAppInFront(void) /* * Custom content view for use in Tk NSWindows. - * + * * Since Tk handles all drawing of widgets, we only use the AppKit event loop * as a source of input events. To do this, we overload the NSView drawRect * method with a method which generates Expose events for Tk but does no @@ -812,7 +812,7 @@ ConfigureRestrictProc( { const NSRect *rectsBeingDrawn; NSInteger rectsBeingDrawnCount; - + [self getRectsBeingDrawn:&rectsBeingDrawn count:&rectsBeingDrawnCount]; #ifdef TK_MAC_DEBUG_DRAWING @@ -822,7 +822,7 @@ ConfigureRestrictProc( NSCompositeSourceOver); #endif - + CGFloat height = [self bounds].size.height; HIMutableShapeRef drawShape = HIShapeCreateMutable(); @@ -841,9 +841,9 @@ ConfigureRestrictProc( NSEventTrackingRunLoopMode, NSModalPanelRunLoopMode, nil]]; } - + CFRelease(drawShape); - + } -(void) setFrameSize: (NSSize)newsize @@ -863,13 +863,13 @@ ConfigureRestrictProc( * don't clobber the AutoreleasePool set up by the caller. */ [NSApp setPoolProtected:YES]; - + /* * Try to prevent flickers and flashes. */ [w disableFlushWindow]; NSDisableScreenUpdates(); - + /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index a16daa8..e928298 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -555,7 +555,7 @@ XClearWindow( } /* -void +int XDrawPoint( Display* display, Drawable d, @@ -565,7 +565,7 @@ XDrawPoint( { } -void +int XDrawPoints( Display* display, Drawable d, |