OpenTTD Source  1.11.0-beta1
cocoa_wnd.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef COCOA_WND_H
11 #define COCOA_WND_H
12 
13 #import <Cocoa/Cocoa.h>
14 
15 class CocoaSubdriver;
16 
17 extern NSString *OTTDMainLaunchGameEngine;
18 
21 + (NSCursor *) clearCocoaCursor;
22 @end
23 
25 @interface OTTD_CocoaWindow : NSWindow {
26  CocoaSubdriver *driver;
27 }
28 
29 - (void)setDriver:(CocoaSubdriver*)drv;
30 
31 - (void)miniaturize:(id)sender;
32 - (void)display;
33 - (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
34 - (void)appDidHide:(NSNotification*)note;
35 - (void)appDidUnhide:(NSNotification*)note;
36 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag;
37 @end
38 
40 @interface OTTD_CocoaView : NSView <NSTextInputClient>
41 {
42  CocoaSubdriver *driver;
43  NSTrackingRectTag trackingtag;
44 }
45 - (void)setDriver:(CocoaSubdriver*)drv;
46 - (void)drawRect:(NSRect)rect;
47 - (BOOL)isOpaque;
48 - (BOOL)acceptsFirstResponder;
49 - (BOOL)becomeFirstResponder;
50 - (void)setTrackingRect;
51 - (void)clearTrackingRect;
52 - (void)resetCursorRects;
53 - (void)viewWillMoveToWindow:(NSWindow *)win;
54 - (void)viewDidMoveToWindow;
55 - (void)mouseEntered:(NSEvent *)theEvent;
56 - (void)mouseExited:(NSEvent *)theEvent;
57 @end
58 
60 @interface OTTD_CocoaWindowDelegate : NSObject <NSWindowDelegate>
61 {
62  CocoaSubdriver *driver;
63 }
64 
65 - (void)setDriver:(CocoaSubdriver*)drv;
66 
67 - (BOOL)windowShouldClose:(id)sender;
68 - (void)windowDidEnterFullScreen:(NSNotification *)aNotification;
69 - (void)windowDidChangeScreenProfile:(NSNotification *)aNotification;
70 - (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions;
71 @end
72 
73 
74 bool CocoaSetupApplication();
75 void CocoaExitApplication();
76 
77 #endif /* COCOA_WND_H */
CocoaSubdriver
Generic display driver for cocoa On grounds to not duplicate some code, it contains a few variables w...
Definition: cocoa_v.h:94
OTTD_CocoaWindowDelegate
Delegate for our NSWindow to send ask for quit on close.
Definition: cocoa_wnd.h:61
OTTD_CocoaView
Subclass of NSView to fix Quartz rendering and mouse awareness.
Definition: cocoa_wnd.h:40
NSCursor(OTTD_QuickdrawCursor)
Category of NSCursor to allow cursor showing/hiding.
Definition: cocoa_wnd.h:20
OTTD_CocoaWindow
Subclass of NSWindow to cater our special needs.
Definition: cocoa_wnd.h:25