From 1f516d41ebc65dec5c58185a7c5524c230d65c9a Mon Sep 17 00:00:00 2001 From: Ashish Kulkarni Date: Tue, 27 May 2014 20:13:00 +0530 Subject: fix compilation errors with OS X 10.7 SDK or later for the Carbon flavor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some deprecated functions have been removed from the the 10.7 SDK, but the symbols are still exported by the 32-bit libraries. Change-Id: I5e7843db02f9fdb6288425ce32574b43087958ce Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qt_mac_p.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/gui/kernel/qt_mac_p.h b/src/gui/kernel/qt_mac_p.h index eced3a3..9234bdd 100644 --- a/src/gui/kernel/qt_mac_p.h +++ b/src/gui/kernel/qt_mac_p.h @@ -75,6 +75,62 @@ #include +#if !defined(QT_MAC_USE_COCOA) && defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + // Some deprecated functions have been removed from the the 10.7 SDK, but the symbols are + // still exported by the 32-bit QD.framework (a subframework of ApplicationServices). + extern "C" { + // from QuickdrawAPI.h + // https://developer.apple.com/legacy/library/documentation/Carbon/reference/QuickDraw_Ref/QuickDraw_Ref.pdf + void CopyBits(const BitMap *srcBits, const BitMap *dstBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn); + void CopyRgn(RgnHandle srcRgn, RgnHandle dstRgn); + void DisposeRgn(RgnHandle rgn); + GDHandle GetMainDevice(void); + const BitMap *GetPortBitMapForCopyBits(CGrafPtr port); + Rect *GetRegionBounds(RgnHandle region, Rect *bounds); + RgnHandle NewRgn(void); + OSStatus QDRegionToRects(RgnHandle rgn, QDRegionParseDirection dir, RegionToRectsUPP proc, void *userData); + void SetEmptyRgn(RgnHandle rgn); + void SetRect(Rect* r, short left, short top, short right, short bottom); + void SetRectRgn(RgnHandle rgn, short left, short top, short right, short bottom); + void UnionRgn(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn); + enum { + kQDRegionToRectsMsgInit = 1, + kQDRegionToRectsMsgParse = 2, + kQDRegionToRectsMsgTerminate = 3 + }; + enum { + kQDParseRegionFromTop = (1 << 0), + kQDParseRegionFromBottom = (1 << 1), + kQDParseRegionFromLeft = (1 << 2), + kQDParseRegionFromRight = (1 << 3), + kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft, + kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight + }; + + // from Fonts.h + // https://developer.apple.com/legacy/library/documentation/Carbon/reference/Font_Manager/fm_reference.pdf + OSStatus FMCreateFontIterator(const FMFilter *iFilter, void *iRefCon, OptionBits iOptions, FMFontIterator *ioIterator); + OSStatus FMDisposeFontIterator(FMFontIterator *ioIterator); + ATSFontFamilyRef FMGetATSFontFamilyRefFromFont(FMFontFamily iFamily); + ATSFontFamilyRef FMGetATSFontFamilyRefFromFontFamily(FMFontFamily iFamily); + ATSFontRef FMGetATSFontRefFromFont(FMFont iFont); + OSStatus FMGetFontFamilyInstanceFromFont(FMFont iFont, FMFontFamily *oFontFamily, FMFontStyle *oStyle); + FMFontFamily FMGetFontFamilyFromATSFontFamilyRef(ATSFontFamilyRef iFamily); + FMFont FMGetFontFromATSFontRef(ATSFontRef iFont); + OSStatus FMGetFontFromFontFamilyInstance(FMFontFamily iFontFamily, FMFontStyle iStyle, FMFont *oFont, FMFontStyle *oIntrinsicStyle); + OSStatus FMGetNextFont(FMFontIterator *ioIterator, FMFont *oFont); + enum { + kFMUseGlobalScopeOption = 0x00000001 + }; + enum { + commandMark = 17, + checkMark = 18, + diamondMark = 19, + appleMark = 20 + }; + } +#endif + QT_BEGIN_NAMESPACE class QWidget; class QDragMoveEvent; -- cgit v0.12