From 4f155b0535c69b895d044bbbbf9535a21dd57994 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 1 Jun 2014 14:35:04 +0200 Subject: Cocoa: Fix Qt-in-namespace build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap cocoa classes in namespace macros. Task-number: QTBUG-39382 Change-Id: Id840e666105afca21760fcb529b5765e0a534120 Reviewed-by: Morten Johan Sørvig --- src/gui/accessible/qaccessiblecache_mac.mm | 6 +++--- src/gui/accessible/qaccessiblecache_p.h | 8 ++++---- .../platforms/cocoa/qcocoaaccessibilityelement.h | 11 +++++++---- src/plugins/platforms/cocoa/qcocoawindow.h | 19 +++++++++++++------ src/plugins/platforms/cocoa/qnswindowdelegate.h | 4 +++- src/widgets/styles/qmacstyle_mac.mm | 3 ++- 6 files changed, 32 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gui/accessible/qaccessiblecache_mac.mm b/src/gui/accessible/qaccessiblecache_mac.mm index 861423af7d..6ed461d371 100644 --- a/src/gui/accessible/qaccessiblecache_mac.mm +++ b/src/gui/accessible/qaccessiblecache_mac.mm @@ -45,19 +45,19 @@ QT_BEGIN_NAMESPACE -void QAccessibleCache::insertElement(QAccessible::Id axid, QCocoaAccessibleElement *element) const +void QAccessibleCache::insertElement(QAccessible::Id axid, QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *element) const { cocoaElements[axid] = element; } void QAccessibleCache::removeCocoaElement(QAccessible::Id axid) { - QCocoaAccessibleElement *element = elementForId(axid); + QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *element = elementForId(axid); [element invalidate]; cocoaElements.remove(axid); } -QCocoaAccessibleElement *QAccessibleCache::elementForId(QAccessible::Id axid) const +QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *QAccessibleCache::elementForId(QAccessible::Id axid) const { return cocoaElements.value(axid); } diff --git a/src/gui/accessible/qaccessiblecache_p.h b/src/gui/accessible/qaccessiblecache_p.h index 30b023cfbd..933c6f7313 100644 --- a/src/gui/accessible/qaccessiblecache_p.h +++ b/src/gui/accessible/qaccessiblecache_p.h @@ -59,7 +59,7 @@ #include "qaccessible.h" -Q_FORWARD_DECLARE_OBJC_CLASS(QCocoaAccessibleElement); +Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaAccessibleElement)); QT_BEGIN_NAMESPACE @@ -74,8 +74,8 @@ public: void deleteInterface(QAccessible::Id id, QObject *obj = 0); #ifdef Q_OS_OSX - QCocoaAccessibleElement *elementForId(QAccessible::Id axid) const; - void insertElement(QAccessible::Id axid, QCocoaAccessibleElement *element) const; + QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *elementForId(QAccessible::Id axid) const; + void insertElement(QAccessible::Id axid, QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *element) const; #endif private Q_SLOTS: @@ -89,7 +89,7 @@ private: #ifdef Q_OS_OSX void removeCocoaElement(QAccessible::Id axid); - mutable QHash cocoaElements; + mutable QHash cocoaElements; #endif friend class QAccessible; diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h index babaab5ae2..9760f492ea 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h @@ -43,22 +43,25 @@ #include +#include "qt_mac_p.h" + #import #import #import -@class QCocoaAccessibleElement; +@class QT_MANGLE_NAMESPACE(QCocoaAccessibleElement); -@interface QCocoaAccessibleElement : NSObject { +@interface QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) : NSObject { NSString *role; QAccessible::Id axid; } - (id)initWithId:(QAccessible::Id)anId; -+ (QCocoaAccessibleElement *)elementWithId:(QAccessible::Id)anId; ++ (QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *)elementWithId:(QAccessible::Id)anId; @end -#endif +QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaAccessibleElement); +#endif diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index bb5c0c1974..33647a8cbd 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -49,14 +49,15 @@ #include "qcocoaglcontext.h" #include "qnsview.h" +#include "qt_mac_p.h" QT_FORWARD_DECLARE_CLASS(QCocoaWindow) -@class QNSWindowHelper; +@class QT_MANGLE_NAMESPACE(QNSWindowHelper); @protocol QNSWindowProtocol -@property (nonatomic, readonly) QNSWindowHelper *helper; +@property (nonatomic, readonly) QT_MANGLE_NAMESPACE(QNSWindowHelper) *helper; - (void)superSendEvent:(NSEvent *)theEvent; - (void)closeAndRelease; @@ -65,7 +66,7 @@ QT_FORWARD_DECLARE_CLASS(QCocoaWindow) typedef NSWindow QCocoaNSWindow; -@interface QNSWindowHelper : NSObject +@interface QT_MANGLE_NAMESPACE(QNSWindowHelper) : NSObject { QCocoaNSWindow *_window; QCocoaWindow *_platformWindow; @@ -84,7 +85,9 @@ typedef NSWindow QCocoaNSWindow; @end -@interface QNSWindow : NSWindow +QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowHelper); + +@interface QT_MANGLE_NAMESPACE(QNSWindow) : NSWindow { QNSWindowHelper *_helper; } @@ -97,7 +100,9 @@ typedef NSWindow QCocoaNSWindow; @end -@interface QNSPanel : NSPanel +QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindow); + +@interface QT_MANGLE_NAMESPACE(QNSPanel) : NSPanel { QNSWindowHelper *_helper; } @@ -110,7 +115,9 @@ typedef NSWindow QCocoaNSWindow; @end -@class QNSWindowDelegate; +QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanel); + +@class QT_MANGLE_NAMESPACE(QNSWindowDelegate); QT_BEGIN_NAMESPACE // QCocoaWindow diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h index 5717551cc3..083466861b 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.h +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h @@ -46,7 +46,7 @@ #include "qcocoawindow.h" -@interface QNSWindowDelegate : NSObject +@interface QT_MANGLE_NAMESPACE(QNSWindowDelegate) : NSObject { QCocoaWindow *m_cocoaWindow; } @@ -62,4 +62,6 @@ @end +QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowDelegate); + #endif // QNSWINDOWDELEGATE_H diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index d647acdacc..b3c0463bca 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -100,13 +100,14 @@ QT_USE_NAMESPACE -@interface NotificationReceiver : NSObject { +@interface QT_MANGLE_NAMESPACE(NotificationReceiver) : NSObject { QMacStylePrivate *mPrivate; } - (id)initWithPrivate:(QMacStylePrivate *)priv; - (void)scrollBarStyleDidChange:(NSNotification *)notification; @end +QT_NAMESPACE_ALIAS_OBJC_CLASS(NotificationReceiver); @implementation NotificationReceiver - (id)initWithPrivate:(QMacStylePrivate *)priv -- cgit v1.2.3