diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.h | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 748280af6a..67cac41383 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -52,27 +52,61 @@ QT_FORWARD_DECLARE_CLASS(QCocoaWindow) -@interface QNSWindow : NSWindow +@class QNSWindowHelper; + +@protocol QNSWindowProtocol + +@property (nonatomic, readonly) QNSWindowHelper *helper; + +- (void)superSendEvent:(NSEvent *)theEvent; +- (void)closeAndRelease; + +@end + +typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow; + +@interface QNSWindowHelper : NSObject { - @public QCocoaWindow *m_cocoaPlatformWindow; + QCocoaNSWindow *_window; + QCocoaWindow *_platformWindow; + BOOL _grabbingMouse; + BOOL _releaseOnMouseUp; } + +@property (nonatomic, readonly) QCocoaNSWindow *window; +@property (nonatomic, readonly) QCocoaWindow *platformWindow; +@property (nonatomic) BOOL grabbingMouse; +@property (nonatomic) BOOL releaseOnMouseUp; + +- (id)initWithNSWindow:(QCocoaNSWindow *)window platformWindow:(QCocoaWindow *)platformWindow; +- (void)handleWindowEvent:(NSEvent *)theEvent; + +@end + +@interface QNSWindow : NSWindow<QNSWindowProtocol> +{ + QNSWindowHelper *_helper; +} + +@property (nonatomic, readonly) QNSWindowHelper *helper; + - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle qPlatformWindow:(QCocoaWindow *)qpw; -- (void)clearPlatformWindow; @end -@interface QNSPanel : NSPanel +@interface QNSPanel : NSPanel<QNSWindowProtocol> { - @public QCocoaWindow *m_cocoaPlatformWindow; + QNSWindowHelper *_helper; } +@property (nonatomic, readonly) QNSWindowHelper *helper; + - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle qPlatformWindow:(QCocoaWindow *)qpw; -- (void)clearPlatformWindow; @end @class QNSWindowDelegate; @@ -183,9 +217,8 @@ public: QWindow *childWindowAt(QPoint windowPoint); protected: void recreateWindow(const QPlatformWindow *parentWindow); - NSWindow *createNSWindow(); - void setNSWindow(NSWindow *window); - void clearNSWindow(NSWindow *window); + QCocoaNSWindow *createNSWindow(); + void setNSWindow(QCocoaNSWindow *window); bool shouldUseNSPanel(); @@ -202,7 +235,7 @@ public: // for QNSView NSView *m_contentView; QNSView *m_qtView; - NSWindow *m_nsWindow; + QCocoaNSWindow *m_nsWindow; QCocoaWindow *m_forwardWindow; // TODO merge to one variable if possible @@ -213,7 +246,6 @@ public: // for QNSView bool m_isNSWindowChild; // this window is a non-top level QWindow with a NSWindow. QList<QCocoaWindow *> m_childWindows; - QNSWindowDelegate *m_nsWindowDelegate; Qt::WindowFlags m_windowFlags; Qt::WindowState m_synchedWindowState; Qt::WindowModality m_windowModality; |