Skip to content
Permalink
Browse files

Fix build error with macOS 10.13 SDK

Several of these variables/macros are no longer defined. We didn't
validate the preconditions on iOS, tvOS, or watchOS, so no
need to bother validating them on macOS either. Nor did we check the
OSStatus result on any platform anyways.

Task-number: QTBUG-63401
Change-Id: Ife64dff767cf6d3f4b839fc53ec486181c176bf3
(cherry-picked from 8615445)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
  • Loading branch information...
jakepetroules authored and Jani Heikkinen committed Oct 2, 2017
1 parent acfcf14 commit 0707260a4f8e64dfadf1df5f935e74cabb7c7d27
Showing with 2 additions and 13 deletions.
  1. +1 −1 src/plugins/platforms/cocoa/qcocoahelpers.h
  2. +1 −12 src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -80,7 +80,7 @@ QColor qt_mac_toQColor(CGColorRef color);
// Creates a mutable shape, it's the caller's responsibility to release.
HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion &region);

OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);

NSDragOperation qt_mac_mapDropAction(Qt::DropAction action);
NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions);
@@ -544,26 +544,15 @@ NSRect qt_mac_flipRect(const QRect &rect)
return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height());
}

OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
{
// Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
OSStatus err = noErr;

require_action(inContext != NULL, InvalidContext, err = paramErr);
require_action(inBounds != NULL, InvalidBounds, err = paramErr);
require_action(inImage != NULL, InvalidImage, err = paramErr);

CGContextSaveGState( inContext );
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
CGContextScaleCTM(inContext, 1, -1);

CGContextDrawImage(inContext, *inBounds, inImage);

CGContextRestoreGState(inContext);
InvalidImage:
InvalidBounds:
InvalidContext:
return err;
}

Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)

0 comments on commit 0707260

Please sign in to comment.
You can’t perform that action at this time.