summaryrefslogtreecommitdiff
path: root/src/video/cocoa/cocoa_wnd.h
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-31 18:58:23 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-13 22:21:17 +0100
commit42af13c141eb74f63e58827f8a33e7f66d7d829a (patch)
treed8c3862cfefa10991ad315608d6003026926867d /src/video/cocoa/cocoa_wnd.h
parent60f30036f1338b6fba8a0c23d7a8b70eab697644 (diff)
downloadopenttd-42af13c141eb74f63e58827f8a33e7f66d7d829a.tar.xz
Codechange: [OSX] Split drawing into its own subview.
This allows the drawing backend code to be independent of any event or command handling.
Diffstat (limited to 'src/video/cocoa/cocoa_wnd.h')
-rw-r--r--src/video/cocoa/cocoa_wnd.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/video/cocoa/cocoa_wnd.h b/src/video/cocoa/cocoa_wnd.h
index 96834d904..744a65786 100644
--- a/src/video/cocoa/cocoa_wnd.h
+++ b/src/video/cocoa/cocoa_wnd.h
@@ -22,31 +22,23 @@ extern NSString *OTTDMainLaunchGameEngine;
@end
/** Subclass of NSWindow to cater our special needs */
-@interface OTTD_CocoaWindow : NSWindow {
- VideoDriver_Cocoa *driver;
-}
-
-- (void)setDriver:(VideoDriver_Cocoa *)drv;
+@interface OTTD_CocoaWindow : NSWindow
+- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag driver:(VideoDriver_Cocoa *)drv;
- (void)miniaturize:(id)sender;
- (void)display;
- (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
- (void)appDidHide:(NSNotification*)note;
- (void)appDidUnhide:(NSNotification*)note;
-- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag;
@end
/** Subclass of NSView to fix Quartz rendering and mouse awareness */
-@interface OTTD_CocoaView : NSView <NSTextInputClient>
-{
+@interface OTTD_CocoaView : NSView <NSTextInputClient> {
VideoDriver_Cocoa *driver;
- NSTrackingRectTag trackingtag;
}
- (instancetype)initWithFrame:(NSRect)frameRect andDriver:(VideoDriver_Cocoa *)drv;
-- (void)drawRect:(NSRect)rect;
-- (BOOL)isOpaque;
+
- (BOOL)acceptsFirstResponder;
-- (BOOL)becomeFirstResponder;
- (void)setTrackingRect;
- (void)clearTrackingRect;
- (void)resetCursorRects;
@@ -58,9 +50,6 @@ extern NSString *OTTDMainLaunchGameEngine;
/** Delegate for our NSWindow to send ask for quit on close */
@interface OTTD_CocoaWindowDelegate : NSObject <NSWindowDelegate>
-{
- VideoDriver_Cocoa *driver;
-}
- (instancetype)initWithDriver:(VideoDriver_Cocoa *)drv;
- (BOOL)windowShouldClose:(id)sender;