OpenTTD Source 20260415-master-g3f4984ebaa
OTTD_CocoaWindowDelegate Class Reference

Delegate for our NSWindow to send ask for quit on close. More...

#include <cocoa_wnd.h>

Inheritance diagram for OTTD_CocoaWindowDelegate:

Instance Methods

(instancetype) - initWithDriver:
 Initialize the video driver.
(BOOL) - windowShouldClose:
 Handle closure requests.
(void) - windowDidEnterFullScreen:
 Window entered fullscreen mode (10.7).
(void) - windowDidChangeBackingProperties:
 Screen the window is on changed.
(NSApplicationPresentationOptions) - window:willUseFullScreenPresentationOptions:
 Presentation options to use for full screen mode.

Detailed Description

Delegate for our NSWindow to send ask for quit on close.

Definition at line 51 of file cocoa_wnd.h.

Method Documentation

◆ initWithDriver:

- (instancetype) initWithDriver: (VideoDriver_Cocoa *) drv
Initial value:

Initialize the video driver.

Parameters
drvInstance of the video driver.
Returns
The new instance, or nullptr.

Definition at line 1457 of file cocoa_wnd.mm.

◆ window:willUseFullScreenPresentationOptions:

- (NSApplicationPresentationOptions) window: (NSWindow *) window
willUseFullScreenPresentationOptions: (NSApplicationPresentationOptions) proposedOptions 

Presentation options to use for full screen mode.

Parameters
windowThe window to get the presentation options for.
proposedOptionsA proposed set of options.
Returns
The actual options we want.

Definition at line 1511 of file cocoa_wnd.mm.

◆ windowDidChangeBackingProperties:

- (void) windowDidChangeBackingProperties: (NSNotification *) notification

Screen the window is on changed.

Parameters
notificationNotification containing the window object. Exists because the API requires it.

Definition at line 1495 of file cocoa_wnd.mm.

References AdjustGUIZoom(), and ReInitAllWindows().

◆ windowDidEnterFullScreen:

- (void) windowDidEnterFullScreen: (NSNotification *) aNotification

Window entered fullscreen mode (10.7).

Parameters
aNotificationNotification containing the window object.

Definition at line 1479 of file cocoa_wnd.mm.

◆ windowShouldClose:

- (BOOL) windowShouldClose: (id) sender

Handle closure requests.

Parameters
senderWhere the event comes from.
Returns
NO as we want to ask the user whether to quit.

Definition at line 1469 of file cocoa_wnd.mm.


The documentation for this class was generated from the following files: