Cocoa: Fix Qt-in-namespace build.

Wrap cocoa classes in namespace macros.

Task-number: QTBUG-39382
Change-Id: Id840e666105afca21760fcb529b5765e0a534120
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Tim Blechmann 2014-06-01 14:35:04 +02:00 committed by Morten Johan Sørvig
parent 62f1aa7ca7
commit 4f155b0535
6 changed files with 32 additions and 19 deletions

View File

@ -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);
}

View File

@ -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<QAccessible::Id, QCocoaAccessibleElement *> cocoaElements;
mutable QHash<QAccessible::Id, QT_MANGLE_NAMESPACE(QCocoaAccessibleElement) *> cocoaElements;
#endif
friend class QAccessible;

View File

@ -43,22 +43,25 @@
#include <QtCore/qglobal.h>
#include "qt_mac_p.h"
#import <Cocoa/Cocoa.h>
#import <AppKit/NSAccessibility.h>
#import <qaccessible.h>
@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

View File

@ -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<QNSWindowProtocol> QCocoaNSWindow;
@interface QNSWindowHelper : NSObject
@interface QT_MANGLE_NAMESPACE(QNSWindowHelper) : NSObject
{
QCocoaNSWindow *_window;
QCocoaWindow *_platformWindow;
@ -84,7 +85,9 @@ typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow;
@end
@interface QNSWindow : NSWindow<QNSWindowProtocol>
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowHelper);
@interface QT_MANGLE_NAMESPACE(QNSWindow) : NSWindow<QNSWindowProtocol>
{
QNSWindowHelper *_helper;
}
@ -97,7 +100,9 @@ typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow;
@end
@interface QNSPanel : NSPanel<QNSWindowProtocol>
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindow);
@interface QT_MANGLE_NAMESPACE(QNSPanel) : NSPanel<QNSWindowProtocol>
{
QNSWindowHelper *_helper;
}
@ -110,7 +115,9 @@ typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow;
@end
@class QNSWindowDelegate;
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanel);
@class QT_MANGLE_NAMESPACE(QNSWindowDelegate);
QT_BEGIN_NAMESPACE
// QCocoaWindow

View File

@ -46,7 +46,7 @@
#include "qcocoawindow.h"
@interface QNSWindowDelegate : NSObject <NSWindowDelegate>
@interface QT_MANGLE_NAMESPACE(QNSWindowDelegate) : NSObject <NSWindowDelegate>
{
QCocoaWindow *m_cocoaWindow;
}
@ -62,4 +62,6 @@
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowDelegate);
#endif // QNSWINDOWDELEGATE_H

View File

@ -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