|
| 1 | +From 0707260a4f8e64dfadf1df5f935e74cabb7c7d27 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Jake Petroules < [email protected]> |
| 3 | +Date: Sun, 1 Oct 2017 21:48:17 -0700 |
| 4 | +Subject: [PATCH] Fix build error with macOS 10.13 SDK |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=utf8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +Several of these variables/macros are no longer defined. We didn't |
| 10 | +validate the preconditions on iOS, tvOS, or watchOS, so no |
| 11 | +need to bother validating them on macOS either. Nor did we check the |
| 12 | +OSStatus result on any platform anyways. |
| 13 | + |
| 14 | +Task-number: QTBUG-63401 |
| 15 | +Change-Id: Ife64dff767cf6d3f4b839fc53ec486181c176bf3 |
| 16 | +(cherry-picked from 861544583511d4e6f7745d2339b26ff1cd44132b) |
| 17 | +Reviewed-by: Timur Pocheptsov < [email protected]> |
| 18 | +Reviewed-by: Tor Arne Vestbø < [email protected]> |
| 19 | +--- |
| 20 | + src/plugins/platforms/cocoa/qcocoahelpers.h | 2 +- |
| 21 | + src/plugins/platforms/cocoa/qcocoahelpers.mm | 13 +------------ |
| 22 | + 2 files changed, 2 insertions(+), 13 deletions(-) |
| 23 | + |
| 24 | +diff --git old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h |
| 25 | +index bbb3793..74371d5 100644 |
| 26 | +--- old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h |
| 27 | ++++ new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h |
| 28 | +@@ -80,7 +80,7 @@ QColor qt_mac_toQColor(CGColorRef color); |
| 29 | + // Creates a mutable shape, it's the caller's responsibility to release. |
| 30 | + HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion ®ion); |
| 31 | + |
| 32 | +-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage); |
| 33 | ++void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage); |
| 34 | + |
| 35 | + NSDragOperation qt_mac_mapDropAction(Qt::DropAction action); |
| 36 | + NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions); |
| 37 | +diff --git old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm |
| 38 | +index cd73148..3f8429e 100644 |
| 39 | +--- old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm |
| 40 | ++++ new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm |
| 41 | +@@ -544,15 +544,8 @@ NSRect qt_mac_flipRect(const QRect &rect) |
| 42 | + return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height()); |
| 43 | + } |
| 44 | + |
| 45 | +-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage) |
| 46 | ++void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage) |
| 47 | + { |
| 48 | +- // Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev) |
| 49 | +- OSStatus err = noErr; |
| 50 | +- |
| 51 | +- require_action(inContext != NULL, InvalidContext, err = paramErr); |
| 52 | +- require_action(inBounds != NULL, InvalidBounds, err = paramErr); |
| 53 | +- require_action(inImage != NULL, InvalidImage, err = paramErr); |
| 54 | +- |
| 55 | + CGContextSaveGState( inContext ); |
| 56 | + CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds)); |
| 57 | + CGContextScaleCTM(inContext, 1, -1); |
| 58 | +@@ -560,10 +553,6 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm |
| 59 | + CGContextDrawImage(inContext, *inBounds, inImage); |
| 60 | + |
| 61 | + CGContextRestoreGState(inContext); |
| 62 | +-InvalidImage: |
| 63 | +-InvalidBounds: |
| 64 | +-InvalidContext: |
| 65 | +- return err; |
| 66 | + } |
| 67 | + |
| 68 | + Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum) |
| 69 | +-- |
| 70 | +2.7.4 |
0 commit comments