summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-06-23 12:42:32 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-06-23 12:44:08 (GMT)
commitf65ed7b51a573dd8429feecc19c7abe8a0a36114 (patch)
tree5ce70bc3ca67573b4a3b07c13e1a8a8be520f4bd /src/gui/kernel
parent3464a05a94c4e638d91b2151d6aad70f78ea3087 (diff)
downloadQt-f65ed7b51a573dd8429feecc19c7abe8a0a36114.zip
Qt-f65ed7b51a573dd8429feecc19c7abe8a0a36114.tar.gz
Qt-f65ed7b51a573dd8429feecc19c7abe8a0a36114.tar.bz2
Remove some warnings in the Cocoa build.
After discussing with some of the Objective-C people I have finally got a fair number of the warnings to disappear in both 10.5 and 10.6. I also took the opportunity to remove a bunch of other warnings. Reviewed by: Morten Sørvig
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm3
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac_p.h13
-rw-r--r--src/gui/kernel/qcocoapanel_mac.mm6
-rw-r--r--src/gui/kernel/qcocoawindow_mac.mm4
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac_p.h31
-rw-r--r--src/gui/kernel/qsound_mac.mm11
6 files changed, 50 insertions, 18 deletions
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 353d815..ab96d58 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -259,14 +259,13 @@ static void cleanupCocoaApplicationDelegate()
onApplicationChangedActivation(false);
}
-class QDesktopWidgetImplementation;
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
{
Q_UNUSED(notification);
QDesktopWidgetImplementation::instance()->onResize();
}
-- (void)setReflectionDelegate:(NSObject *)oldDelegate
+- (void)setReflectionDelegate:(NSObject <NSApplicationDelegate> *)oldDelegate
{
[oldDelegate retain];
[reflectionDelegate release];
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h b/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h
index 3931f16..5aa98df 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h
@@ -97,7 +97,14 @@ QT_FORWARD_DECLARE_CLASS(QApplicationPrivate);
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
-@protocol NSApplicationDelegate <NSObject> @end
+@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
@@ -106,7 +113,7 @@ QT_FORWARD_DECLARE_CLASS(QApplicationPrivate);
QApplicationPrivate *qtPrivate;
NSMenu *dockMenu;
QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader;
- id <NSApplicationDelegate> reflectionDelegate;
+ NSObject <NSApplicationDelegate> *reflectionDelegate;
bool inLaunch;
}
+ (QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate)*)sharedDelegate;
@@ -115,6 +122,6 @@ QT_FORWARD_DECLARE_CLASS(QApplicationPrivate);
- (QApplicationPrivate *)qAppPrivate;
- (void)setMenuLoader:(QT_MANGLE_NAMESPACE(QCocoaMenuLoader)*)menuLoader;
- (QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *)menuLoader;
-- (void)setReflectionDelegate:(NSObject *)oldDelegate;
+- (void)setReflectionDelegate:(NSObject <NSApplicationDelegate> *)oldDelegate;
@end
#endif
diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm
index 266cf88..bdc7ecb 100644
--- a/src/gui/kernel/qcocoapanel_mac.mm
+++ b/src/gui/kernel/qcocoapanel_mac.mm
@@ -55,6 +55,12 @@ extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.
QT_END_NAMESPACE
QT_USE_NAMESPACE
+
+@interface NSWindow (QtCoverForHackWithCategory)
++ (Class)frameViewClassForStyleMask:(NSUInteger)styleMask;
+@end
+
+
@implementation QT_MANGLE_NAMESPACE(QCocoaPanel)
- (BOOL)canBecomeKeyWindow
diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm
index 9c1dce5..7084416 100644
--- a/src/gui/kernel/qcocoawindow_mac.mm
+++ b/src/gui/kernel/qcocoawindow_mac.mm
@@ -58,6 +58,10 @@ extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.
QT_END_NAMESPACE
QT_USE_NAMESPACE
+@interface NSWindow (QtCoverForHackWithCategory)
++ (Class)frameViewClassForStyleMask:(NSUInteger)styleMask;
+@end
+
@implementation NSWindow (QT_MANGLE_NAMESPACE(QWidgetIntegration))
- (id)QT_MANGLE_NAMESPACE(qt_initWithQWidget):(QWidget*)widget contentRect:(NSRect)rect styleMask:(NSUInteger)mask;
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac_p.h b/src/gui/kernel/qcocoawindowdelegate_mac_p.h
index b171b47..1e1d668 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac_p.h
+++ b/src/gui/kernel/qcocoawindowdelegate_mac_p.h
@@ -63,15 +63,8 @@ QT_FORWARD_DECLARE_CLASS(QWidget)
QT_FORWARD_DECLARE_CLASS(QSize)
QT_FORWARD_DECLARE_CLASS(QWidgetData)
-@interface QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) : NSObject {
- QHash<NSWindow *, QWidget *> *m_windowHash;
- QHash<NSDrawer *, QWidget *> *m_drawerHash;
-}
-+ (QT_MANGLE_NAMESPACE(QCocoaWindowDelegate)*)sharedDelegate;
-- (void)becomeDelegteForWindow:(NSWindow *)window widget:(QWidget *)widget;
-- (void)resignDelegateForWindow:(NSWindow *)window;
-- (void)becomeDelegateForDrawer:(NSDrawer *)drawer widget:(QWidget *)widget;
-- (void)resignDelegateForDrawer:(NSDrawer *)drawer;
+#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;
@@ -83,6 +76,25 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData)
- (void)windowDidResignMain:(NSNotification*)notification;
- (void)windowDidBecomeKey:(NSNotification*)notification;
- (void)windowDidResignKey:(NSNotification*)notification;
+@end
+
+@protocol NSDrawerDelegate <NSObject>
+- (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:(NSSize)contentSize;
+@end
+
+#endif
+
+
+
+@interface QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) : NSObject<NSWindowDelegate, NSDrawerDelegate> {
+ QHash<NSWindow *, QWidget *> *m_windowHash;
+ QHash<NSDrawer *, QWidget *> *m_drawerHash;
+}
++ (QT_MANGLE_NAMESPACE(QCocoaWindowDelegate)*)sharedDelegate;
+- (void)becomeDelegteForWindow:(NSWindow *)window widget:(QWidget *)widget;
+- (void)resignDelegateForWindow:(NSWindow *)window;
+- (void)becomeDelegateForDrawer:(NSDrawer *)drawer widget:(QWidget *)widget;
+- (void)resignDelegateForDrawer:(NSDrawer *)drawer;
- (void)dumpMaximizedStateforWidget:(QWidget*)qwidget window:(NSWindow *)window;
- (void)syncSizeForWidget:(QWidget *)qwidget
toSize:(const QSize &)newSize
@@ -90,6 +102,5 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData)
- (NSSize)closestAcceptableSizeForWidget:(QWidget *)qwidget
window:(NSWindow *)window withNewSize:(NSSize)proposedSize;
- (QWidget *)qt_qwidgetForWindow:(NSWindow *)window;
-- (void)checkForMove:(const NSRect &)newRect forWidget:(QWidget *)qwidget;
@end
#endif
diff --git a/src/gui/kernel/qsound_mac.mm b/src/gui/kernel/qsound_mac.mm
index 43965d1..a8ee516 100644
--- a/src/gui/kernel/qsound_mac.mm
+++ b/src/gui/kernel/qsound_mac.mm
@@ -80,14 +80,19 @@ protected:
QT_END_NAMESPACE
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+@protocol NSSoundDelegate <NSObject>
+-(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool;
+@end
+#endif
+
QT_USE_NAMESPACE
-@interface QMacSoundDelegate : NSObject {
+@interface QMacSoundDelegate : NSObject<NSSoundDelegate> {
QSound *qSound; // may be null.
QAuServerMac* server;
-}
+}
-(id)initWithQSound:(QSound*)sound:(QAuServerMac*)server;
--(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool;
@end
@implementation QMacSoundDelegate