sdl12-compat: macos: Subclass SDLMain from NSApplicationDelegate, move some stuff. (efd13)

From efd136625bcc51aa8c5450737e99aff2c2e681b0 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sat, 11 Dec 2021 14:08:39 -0500
Subject: [PATCH] macos: Subclass SDLMain from NSApplicationDelegate, move some
 stuff.

Reference Issue #106.
---
 src/SDLmain/macosx/SDLMain.h | 18 +++++++++++++++++-
 src/SDLmain/macosx/SDLMain.m |  5 -----
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/SDLmain/macosx/SDLMain.h b/src/SDLmain/macosx/SDLMain.h
index c56d90c..3dfee70 100644
--- a/src/SDLmain/macosx/SDLMain.h
+++ b/src/SDLmain/macosx/SDLMain.h
@@ -10,7 +10,23 @@
 
 #import <Cocoa/Cocoa.h>
 
-@interface SDLMain : NSObject
+/* Note that the following defines have not been changed in a long time and
+   it's likely going to need fixes if you try it. */
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define		SDL_USE_NIB_FILE	0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define		SDL_USE_CPS		1
+
+@interface SDLMain : NSApplicationDelegate
+- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender;
+- (void) setupWorkingDirectory:(BOOL)shouldChdir;
+- (BOOL) application:(NSApplication *)theApplication openFile:(NSString *)filename
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+#if SDL_USE_NIB_FILE
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+#endif
 @end
 
 #endif /* _SDLMain_h_ */
diff --git a/src/SDLmain/macosx/SDLMain.m b/src/SDLmain/macosx/SDLMain.m
index 677ccb0..7b48995 100644
--- a/src/SDLmain/macosx/SDLMain.m
+++ b/src/SDLmain/macosx/SDLMain.m
@@ -22,11 +22,6 @@ - (void)setAppleMenu:(NSMenu *)menu;
 /* Same deal with the NSCommandKeyMask... */
 #define EventModifierFlagCommand (1 << 20)
 
-/* Use this flag to determine whether we use SDLMain.nib or not */
-#define		SDL_USE_NIB_FILE	0
-
-/* Use this flag to determine whether we use CPS (docking) or not */
-#define		SDL_USE_CPS		1
 #ifdef SDL_USE_CPS
 /* Portions of CPS.h */
 typedef struct CPSProcessSerNum