Remove ifdefs for supporting Mac OS <= 10.5
Qt5 requires Mac OS 10.6, so we can remove checks such as if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 Change-Id: Iea21727a277291148704ecf9677ed0b68c24920f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
468d010fdf
commit
0768920dbd
@ -83,11 +83,7 @@
|
|||||||
|
|
||||||
#define QT_OPEN_LARGEFILE 0
|
#define QT_OPEN_LARGEFILE 0
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
|
|
||||||
#define QT_SOCKLEN_T socklen_t
|
#define QT_SOCKLEN_T socklen_t
|
||||||
#else
|
|
||||||
#define QT_SOCKLEN_T int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QT_SIGNAL_IGNORE (void (*)(int))1
|
#define QT_SIGNAL_IGNORE (void (*)(int))1
|
||||||
|
|
||||||
|
@ -85,11 +85,7 @@
|
|||||||
|
|
||||||
#define QT_OPEN_LARGEFILE 0
|
#define QT_OPEN_LARGEFILE 0
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
|
|
||||||
#define QT_SOCKLEN_T socklen_t
|
#define QT_SOCKLEN_T socklen_t
|
||||||
#else
|
|
||||||
#define QT_SOCKLEN_T int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QT_SIGNAL_IGNORE (void (*)(int))1
|
#define QT_SIGNAL_IGNORE (void (*)(int))1
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@
|
|||||||
# ifdef MAC_OS_X_VERSION_MIN_REQUIRED
|
# ifdef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
# undef MAC_OS_X_VERSION_MIN_REQUIRED
|
# undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
# endif
|
# endif
|
||||||
# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
|
# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||||
# include <AvailabilityMacros.h>
|
# include <AvailabilityMacros.h>
|
||||||
# if !defined(MAC_OS_X_VERSION_10_3)
|
# if !defined(MAC_OS_X_VERSION_10_3)
|
||||||
# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
|
# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
|
||||||
|
@ -272,8 +272,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
|
|||||||
// Attributes
|
// Attributes
|
||||||
entryFlags |= QFileSystemMetaData::ExistsAttribute;
|
entryFlags |= QFileSystemMetaData::ExistsAttribute;
|
||||||
size_ = statBuffer.st_size;
|
size_ = statBuffer.st_size;
|
||||||
#if defined (Q_OS_MAC) && !defined(Q_OS_IOS) \
|
#if defined (Q_OS_MAC) && !defined(Q_OS_IOS)
|
||||||
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
||||||
if (statBuffer.st_flags & UF_HIDDEN) {
|
if (statBuffer.st_flags & UF_HIDDEN) {
|
||||||
entryFlags |= QFileSystemMetaData::HiddenAttribute;
|
entryFlags |= QFileSystemMetaData::HiddenAttribute;
|
||||||
knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
|
knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
|
||||||
|
@ -360,12 +360,10 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
|
|||||||
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
|
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
|
||||||
what |= QFileSystemMetaData::DirectoryType;
|
what |= QFileSystemMetaData::DirectoryType;
|
||||||
}
|
}
|
||||||
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
||||||
if (what & QFileSystemMetaData::HiddenAttribute) {
|
if (what & QFileSystemMetaData::HiddenAttribute) {
|
||||||
// Mac OS >= 10.5: st_flags & UF_HIDDEN
|
// Mac OS >= 10.5: st_flags & UF_HIDDEN
|
||||||
what |= QFileSystemMetaData::PosixStatFlags;
|
what |= QFileSystemMetaData::PosixStatFlags;
|
||||||
}
|
}
|
||||||
# endif // MAC_OS_X_VERSION_MAX_ALLOWED...
|
|
||||||
#endif // defined(Q_OS_MAC) && !defined(Q_OS_IOS)
|
#endif // defined(Q_OS_MAC) && !defined(Q_OS_IOS)
|
||||||
|
|
||||||
if (what & QFileSystemMetaData::PosixStatFlags)
|
if (what & QFileSystemMetaData::PosixStatFlags)
|
||||||
|
@ -136,14 +136,4 @@ private:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
|
|
||||||
#ifndef __LP64__
|
|
||||||
typedef float CGFloat;
|
|
||||||
typedef int NSInteger;
|
|
||||||
typedef unsigned int NSUInteger;
|
|
||||||
#define SRefCon SInt32
|
|
||||||
#define URefCon UInt32
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // QCORE_MAC_P_H
|
#endif // QCORE_MAC_P_H
|
||||||
|
@ -345,7 +345,6 @@ static QString macFormatCurrency(const QSystemLocale::CurrencyToStringArgument &
|
|||||||
|
|
||||||
static QVariant macQuoteString(QSystemLocale::QueryType type, const QStringRef &str)
|
static QVariant macQuoteString(QSystemLocale::QueryType type, const QStringRef &str)
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_6)
|
if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_6)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
@ -363,7 +362,6 @@ static QVariant macQuoteString(QSystemLocale::QueryType type, const QStringRef &
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
#endif //QT_NO_SYSTEMLOCALE
|
#endif //QT_NO_SYSTEMLOCALE
|
||||||
|
@ -231,7 +231,6 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
|
|||||||
// PAC is enabled
|
// PAC is enabled
|
||||||
CFStringRef cfPacLocation = (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString);
|
CFStringRef cfPacLocation = (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString);
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
||||||
QCFType<CFDataRef> pacData;
|
QCFType<CFDataRef> pacData;
|
||||||
QCFType<CFURLRef> pacUrl = CFURLCreateWithString(kCFAllocatorDefault, cfPacLocation, NULL);
|
QCFType<CFURLRef> pacUrl = CFURLCreateWithString(kCFAllocatorDefault, cfPacLocation, NULL);
|
||||||
@ -275,9 +274,7 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
|
|||||||
result << proxyFromDictionary(proxy);
|
result << proxyFromDictionary(proxy);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
QString pacLocation = QCFString::toQString(cfPacLocation);
|
QString pacLocation = QCFString::toQString(cfPacLocation);
|
||||||
qWarning("Mac system proxy: PAC script at \"%s\" not handled", qPrintable(pacLocation));
|
qWarning("Mac system proxy: PAC script at \"%s\" not handled", qPrintable(pacLocation));
|
||||||
}
|
}
|
||||||
|
@ -176,18 +176,10 @@ init_context:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool addExpiredCerts = true;
|
|
||||||
#if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5)
|
|
||||||
//On Leopard SSL does not work if we add the expired certificates.
|
|
||||||
if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_5)
|
|
||||||
addExpiredCerts = false;
|
|
||||||
#endif
|
|
||||||
// now add the expired certs
|
// now add the expired certs
|
||||||
if (addExpiredCerts) {
|
|
||||||
foreach (const QSslCertificate &caCertificate, expiredCerts) {
|
foreach (const QSslCertificate &caCertificate, expiredCerts) {
|
||||||
q_X509_STORE_add_cert(sslContext->ctx->cert_store, reinterpret_cast<X509 *>(caCertificate.handle()));
|
q_X509_STORE_add_cert(sslContext->ctx->cert_store, reinterpret_cast<X509 *>(caCertificate.handle()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
|
if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
|
||||||
// tell OpenSSL the directories where to look up the root certs on demand
|
// tell OpenSSL the directories where to look up the root certs on demand
|
||||||
|
@ -1504,18 +1504,10 @@ QList<QSslError> QSslSocketBackendPrivate::verify(QList<QSslCertificate> certifi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool addExpiredCerts = true;
|
|
||||||
#if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5)
|
|
||||||
//On Leopard SSL does not work if we add the expired certificates.
|
|
||||||
if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_5)
|
|
||||||
addExpiredCerts = false;
|
|
||||||
#endif
|
|
||||||
// now add the expired certs
|
// now add the expired certs
|
||||||
if (addExpiredCerts) {
|
|
||||||
foreach (const QSslCertificate &caCertificate, expiredCerts) {
|
foreach (const QSslCertificate &caCertificate, expiredCerts) {
|
||||||
q_X509_STORE_add_cert(certStore, reinterpret_cast<X509 *>(caCertificate.handle()));
|
q_X509_STORE_add_cert(certStore, reinterpret_cast<X509 *>(caCertificate.handle()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
|
QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
|
||||||
|
|
||||||
|
@ -46,8 +46,6 @@
|
|||||||
|
|
||||||
#include <private/qimage_p.h>
|
#include <private/qimage_p.h>
|
||||||
|
|
||||||
#if !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
static float SYNTHETIC_ITALIC_SKEW = tanf(14 * acosf(0) / 90);
|
static float SYNTHETIC_ITALIC_SKEW = tanf(14 * acosf(0) / 90);
|
||||||
@ -650,6 +648,3 @@ bool QCoreTextFontEngine::supportsTransformation(const QTransform &transform) co
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
|
|
||||||
|
@ -52,8 +52,6 @@
|
|||||||
#include <CoreGraphics/CoreGraphics.h>
|
#include <CoreGraphics/CoreGraphics.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QRawFontPrivate;
|
class QRawFontPrivate;
|
||||||
@ -142,6 +140,4 @@ CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef);
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
|
|
||||||
#endif // QFONTENGINE_CORETEXT_P_H
|
#endif // QFONTENGINE_CORETEXT_P_H
|
||||||
|
@ -93,19 +93,6 @@
|
|||||||
|
|
||||||
@class QT_MANGLE_NAMESPACE(QCocoaMenuLoader);
|
@class QT_MANGLE_NAMESPACE(QCocoaMenuLoader);
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
|
|
||||||
|
|
||||||
@protocol NSApplicationDelegate <NSObject>
|
|
||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
|
|
||||||
- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames;
|
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender;
|
|
||||||
- (void)applicationDidBecomeActive:(NSNotification *)notification;
|
|
||||||
- (void)applicationDidResignActive:(NSNotification *)notification;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) : NSObject <NSApplicationDelegate> {
|
@interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) : NSObject <NSApplicationDelegate> {
|
||||||
bool startedQuit;
|
bool startedQuit;
|
||||||
NSMenu *dockMenu;
|
NSMenu *dockMenu;
|
||||||
|
@ -490,14 +490,12 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
|
|||||||
case NSOtherMouseUp:
|
case NSOtherMouseUp:
|
||||||
case NSOtherMouseDragged:
|
case NSOtherMouseDragged:
|
||||||
#ifndef QT_NO_GESTURES
|
#ifndef QT_NO_GESTURES
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
case NSEventTypeGesture: // touch events
|
case NSEventTypeGesture: // touch events
|
||||||
case NSEventTypeMagnify:
|
case NSEventTypeMagnify:
|
||||||
case NSEventTypeSwipe:
|
case NSEventTypeSwipe:
|
||||||
case NSEventTypeRotate:
|
case NSEventTypeRotate:
|
||||||
case NSEventTypeBeginGesture:
|
case NSEventTypeBeginGesture:
|
||||||
case NSEventTypeEndGesture:
|
case NSEventTypeEndGesture:
|
||||||
#endif
|
|
||||||
#endif // QT_NO_GESTURES
|
#endif // QT_NO_GESTURES
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
break;
|
||||||
|
@ -77,11 +77,7 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
|
|||||||
@class QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate);
|
@class QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate);
|
||||||
|
|
||||||
@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
|
@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
: NSObject<NSOpenSavePanelDelegate>
|
: NSObject<NSOpenSavePanelDelegate>
|
||||||
#else
|
|
||||||
: NSObject
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
@public
|
@public
|
||||||
NSOpenPanel *mOpenPanel;
|
NSOpenPanel *mOpenPanel;
|
||||||
|
@ -475,11 +475,9 @@ CGColorSpaceRef qt_mac_genericColorSpace()
|
|||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if (!m_genericColorSpace) {
|
if (!m_genericColorSpace) {
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
||||||
m_genericColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
m_genericColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
m_genericColorSpace = CGColorSpaceCreateDeviceRGB();
|
m_genericColorSpace = CGColorSpaceCreateDeviceRGB();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,6 @@ void qt_cocoa_change_implementation(Class baseClass, SEL originalSel, Class prox
|
|||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5)
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
||||||
// The following code replaces the _implementation_ for the selector we want to hack
|
// The following code replaces the _implementation_ for the selector we want to hack
|
||||||
// (originalSel) with the implementation found in proxyClass. Then it creates
|
// (originalSel) with the implementation found in proxyClass. Then it creates
|
||||||
// a new 'backup' method inside baseClass containing the old, original,
|
// a new 'backup' method inside baseClass containing the old, original,
|
||||||
@ -104,7 +103,6 @@ void qt_cocoa_change_implementation(Class baseClass, SEL originalSel, Class prox
|
|||||||
Method backupMethod = class_getInstanceMethod(proxyClass, backupSel);
|
Method backupMethod = class_getInstanceMethod(proxyClass, backupSel);
|
||||||
class_addMethod(baseClass, backupSel, originalImp, method_getTypeEncoding(backupMethod));
|
class_addMethod(baseClass, backupSel, originalImp, method_getTypeEncoding(backupMethod));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,11 +112,9 @@ void qt_cocoa_change_back_implementation(Class baseClass, SEL originalSel, SEL b
|
|||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5)
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
||||||
Method originalMethod = class_getInstanceMethod(baseClass, originalSel);
|
Method originalMethod = class_getInstanceMethod(baseClass, originalSel);
|
||||||
Method backupMethodInBaseClass = class_getInstanceMethod(baseClass, backupSel);
|
Method backupMethodInBaseClass = class_getInstanceMethod(baseClass, backupSel);
|
||||||
method_setImplementation(originalMethod, method_getImplementation(backupMethodInBaseClass));
|
method_setImplementation(originalMethod, method_getImplementation(backupMethodInBaseClass));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,6 @@
|
|||||||
#include "qmultitouch_mac_p.h"
|
#include "qmultitouch_mac_p.h"
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QHash<qint64, QCocoaTouch*> QCocoaTouch::_currentTouches;
|
QHash<qint64, QCocoaTouch*> QCocoaTouch::_currentTouches;
|
||||||
@ -214,6 +212,3 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
|
|
||||||
|
@ -61,8 +61,6 @@
|
|||||||
#include <qhash.h>
|
#include <qhash.h>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QCocoaTouch
|
class QCocoaTouch
|
||||||
@ -92,7 +90,5 @@ class QCocoaTouch
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
|
|
||||||
#endif // QMULTITOUCH_MAC_P_H
|
#endif // QMULTITOUCH_MAC_P_H
|
||||||
|
|
||||||
|
@ -46,26 +46,6 @@
|
|||||||
|
|
||||||
#include "qcocoawindow.h"
|
#include "qcocoawindow.h"
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
|
|
||||||
@protocol NSWindowDelegate <NSObject>
|
|
||||||
//- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
|
|
||||||
//- (void)windowDidMiniaturize:(NSNotification*)notification;
|
|
||||||
- (void)windowDidResize:(NSNotification *)notification;
|
|
||||||
- (void)windowWillClose:(NSNotification *)notification;
|
|
||||||
//- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)defaultFrame;
|
|
||||||
- (void)windowDidMove:(NSNotification *)notification;
|
|
||||||
//- (BOOL)windowShouldClose:(id)window;
|
|
||||||
//- (void)windowDidDeminiaturize:(NSNotification *)notification;
|
|
||||||
//- (void)windowDidBecomeMain:(NSNotification*)notification;
|
|
||||||
//- (void)windowDidResignMain:(NSNotification*)notification;
|
|
||||||
//- (void)windowDidBecomeKey:(NSNotification*)notification;
|
|
||||||
//- (void)windowDidResignKey:(NSNotification*)notification;
|
|
||||||
//- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu;
|
|
||||||
//- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard;
|
|
||||||
//- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
|
|
||||||
@end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface QNSWindowDelegate : NSObject <NSWindowDelegate>
|
@interface QNSWindowDelegate : NSObject <NSWindowDelegate>
|
||||||
{
|
{
|
||||||
QCocoaWindow *m_cocoaWindow;
|
QCocoaWindow *m_cocoaWindow;
|
||||||
|
@ -90,14 +90,11 @@ void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig
|
|||||||
if (rgn.isEmpty()) {
|
if (rgn.isEmpty()) {
|
||||||
CGContextAddRect(hd, CGRectMake(0, 0, 0, 0));
|
CGContextAddRect(hd, CGRectMake(0, 0, 0, 0));
|
||||||
} else {
|
} else {
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
||||||
QCFType<HIMutableShapeRef> shape = qt_mac_QRegionToHIMutableShape(rgn);
|
QCFType<HIMutableShapeRef> shape = qt_mac_QRegionToHIMutableShape(rgn);
|
||||||
Q_ASSERT(!HIShapeIsEmpty(shape));
|
Q_ASSERT(!HIShapeIsEmpty(shape));
|
||||||
HIShapeReplacePathInCGContext(shape, hd);
|
HIShapeReplacePathInCGContext(shape, hd);
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
QVector<QRect> rects = rgn.rects();
|
QVector<QRect> rects = rgn.rects();
|
||||||
const int count = rects.size();
|
const int count = rects.size();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
@ -338,11 +335,9 @@ CGColorSpaceRef QCoreGraphicsPaintEngine::macGenericColorSpace()
|
|||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if (!m_genericColorSpace) {
|
if (!m_genericColorSpace) {
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
||||||
m_genericColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
m_genericColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
m_genericColorSpace = CGColorSpaceCreateDeviceRGB();
|
m_genericColorSpace = CGColorSpaceCreateDeviceRGB();
|
||||||
}
|
}
|
||||||
@ -1185,7 +1180,6 @@ extern "C" {
|
|||||||
void
|
void
|
||||||
QCoreGraphicsPaintEngine::updateCompositionMode(QPainter::CompositionMode mode)
|
QCoreGraphicsPaintEngine::updateCompositionMode(QPainter::CompositionMode mode)
|
||||||
{
|
{
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
||||||
int cg_mode = kCGBlendModeNormal;
|
int cg_mode = kCGBlendModeNormal;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
@ -1267,11 +1261,9 @@ QCoreGraphicsPaintEngine::updateCompositionMode(QPainter::CompositionMode mode)
|
|||||||
if (cg_mode > -1) {
|
if (cg_mode > -1) {
|
||||||
CGContextSetBlendMode(d_func()->hd, CGBlendMode(cg_mode));
|
CGContextSetBlendMode(d_func()->hd, CGBlendMode(cg_mode));
|
||||||
}
|
}
|
||||||
} else
|
} else if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_3
|
||||||
#endif
|
|
||||||
// The standard porter duff ops.
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_3
|
|
||||||
&& mode <= QPainter::CompositionMode_Xor) {
|
&& mode <= QPainter::CompositionMode_Xor) {
|
||||||
|
// The standard porter duff ops.
|
||||||
int cg_mode = kCGCompositeModeCopy;
|
int cg_mode = kCGCompositeModeCopy;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case QPainter::CompositionMode_SourceOver:
|
case QPainter::CompositionMode_SourceOver:
|
||||||
@ -1317,7 +1309,6 @@ QCoreGraphicsPaintEngine::updateCompositionMode(QPainter::CompositionMode mode)
|
|||||||
if (cg_mode > -1)
|
if (cg_mode > -1)
|
||||||
CGContextSetCompositeOperation(d_func()->hd, CGCompositeMode(cg_mode));
|
CGContextSetCompositeOperation(d_func()->hd, CGCompositeMode(cg_mode));
|
||||||
} else {
|
} else {
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
|
|
||||||
bool needPrivateAPI = false;
|
bool needPrivateAPI = false;
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
||||||
int cg_mode = kCGBlendModeNormal;
|
int cg_mode = kCGBlendModeNormal;
|
||||||
@ -1367,7 +1358,6 @@ QCoreGraphicsPaintEngine::updateCompositionMode(QPainter::CompositionMode mode)
|
|||||||
else
|
else
|
||||||
CGContextSetCompositeOperation(d_func()->hd, CGCompositeMode(cg_mode));
|
CGContextSetCompositeOperation(d_func()->hd, CGCompositeMode(cg_mode));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,23 +190,7 @@ QList<QVariant> QMacPrintEnginePrivate::supportedResolutions() const
|
|||||||
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) {
|
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) {
|
||||||
PMResolution res;
|
PMResolution res;
|
||||||
OSStatus status = PMPrinterGetPrinterResolutionCount(printer, &resCount);
|
OSStatus status = PMPrinterGetPrinterResolutionCount(printer, &resCount);
|
||||||
if (status == kPMNotImplemented) {
|
if (status == noErr) {
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
|
|
||||||
// *Sigh* we have to use the non-indexed version.
|
|
||||||
if (PMPrinterGetPrinterResolution(printer, kPMMinSquareResolution, &res) == noErr)
|
|
||||||
resolutions.append(int(res.hRes));
|
|
||||||
if (PMPrinterGetPrinterResolution(printer, kPMMaxSquareResolution, &res) == noErr) {
|
|
||||||
QVariant var(int(res.hRes));
|
|
||||||
if (!resolutions.contains(var))
|
|
||||||
resolutions.append(var);
|
|
||||||
}
|
|
||||||
if (PMPrinterGetPrinterResolution(printer, kPMDefaultResolution, &res) == noErr) {
|
|
||||||
QVariant var(int(res.hRes));
|
|
||||||
if (!resolutions.contains(var))
|
|
||||||
resolutions.append(var);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else if (status == noErr) {
|
|
||||||
// According to the docs, index start at 1.
|
// According to the docs, index start at 1.
|
||||||
for (UInt32 i = 1; i <= resCount; ++i) {
|
for (UInt32 i = 1; i <= resCount; ++i) {
|
||||||
if (PMPrinterGetIndexedPrinterResolution(printer, i, &res) == noErr)
|
if (PMPrinterGetIndexedPrinterResolution(printer, i, &res) == noErr)
|
||||||
|
@ -586,11 +586,9 @@ CGColorSpaceRef qt_mac_genericColorSpace()
|
|||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if (!m_genericColorSpace) {
|
if (!m_genericColorSpace) {
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
|
||||||
m_genericColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
m_genericColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
m_genericColorSpace = CGColorSpaceCreateDeviceRGB();
|
m_genericColorSpace = CGColorSpaceCreateDeviceRGB();
|
||||||
}
|
}
|
||||||
@ -4912,10 +4910,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||||||
} else {
|
} else {
|
||||||
if (!(slider->subControls & SC_SliderHandle))
|
if (!(slider->subControls & SC_SliderHandle))
|
||||||
tdi.attributes &= ~kThemeTrackShowThumb;
|
tdi.attributes &= ~kThemeTrackShowThumb;
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
||||||
if (!(slider->subControls & SC_SliderGroove))
|
if (!(slider->subControls & SC_SliderGroove))
|
||||||
tdi.attributes |= kThemeTrackHideTrack;
|
tdi.attributes |= kThemeTrackHideTrack;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||||
|
@ -80,7 +80,7 @@ inline static bool verticalTabs(QTabBar::Shape shape)
|
|||||||
|
|
||||||
void QTabBarPrivate::updateMacBorderMetrics()
|
void QTabBarPrivate::updateMacBorderMetrics()
|
||||||
{
|
{
|
||||||
#if (defined Q_WS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
#if defined(Q_WS_MAC)
|
||||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
|
||||||
Q_Q(QTabBar);
|
Q_Q(QTabBar);
|
||||||
::HIContentBorderMetrics metrics;
|
::HIContentBorderMetrics metrics;
|
||||||
|
@ -391,11 +391,6 @@ void tst_QScroller::scrollTo()
|
|||||||
|
|
||||||
void tst_QScroller::scroll()
|
void tst_QScroller::scroll()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
|
|
||||||
QSKIP("Mac OS X < 10.6 does not support QTouchEvents");
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef QT_NO_GESTURES
|
#ifndef QT_NO_GESTURES
|
||||||
// -- good case. normal scroll
|
// -- good case. normal scroll
|
||||||
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
|
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
|
||||||
@ -438,11 +433,6 @@ void tst_QScroller::scroll()
|
|||||||
|
|
||||||
void tst_QScroller::overshoot()
|
void tst_QScroller::overshoot()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
|
|
||||||
QSKIP("Mac OS X < 10.6 does not support QTouchEvents");
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef QT_NO_GESTURES
|
#ifndef QT_NO_GESTURES
|
||||||
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
|
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
|
||||||
sw->scrollArea = QRectF(0, 0, 1000, 1000);
|
sw->scrollArea = QRectF(0, 0, 1000, 1000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user