From 846651d2407c299e26b9503e19b7fbee035dcbf5 Mon Sep 17 00:00:00 2001 From: Scott Harrison Date: Sat, 4 Mar 2023 23:36:05 -0600 Subject: [PATCH 1/5] MacOS Sim: Allow for dragging main.lua file on Sim --- external/remdebug-1.0/src/controller.lua | 2 +- platform/apple/CoronaResources-Info.plist | 2 +- platform/mac/AppDelegate.mm | 16 +++++++- .../CoronaConsole/CoronaConsole/Info.plist | 2 +- platform/mac/CoronaWindowController.h | 2 +- platform/mac/CoronaWindowController.mm | 39 +++++++++++++++++++ platform/mac/Credits.rtfd/TXT.rtf | 9 +++-- platform/mac/Info.plist | 2 +- platform/mac/Rtt_MacSimulator.mm | 1 + .../mac/ratatouille.xcodeproj/project.pbxproj | 18 ++++----- 10 files changed, 73 insertions(+), 20 deletions(-) diff --git a/external/remdebug-1.0/src/controller.lua b/external/remdebug-1.0/src/controller.lua index f25991749..0e13d5f84 100644 --- a/external/remdebug-1.0/src/controller.lua +++ b/external/remdebug-1.0/src/controller.lua @@ -482,7 +482,7 @@ while true do print("") print("Corona Debugger") print("version 1.1") - print("Copyright © 2008-2021 Solar2D. All rights reserved.") + print("Copyright © 2008-2023 Solar2D. All rights reserved.") print("") print("Portions contain:") print(" Lua, Copyright © 1994-2008 Lua.org, PUC-Rio.") diff --git a/platform/apple/CoronaResources-Info.plist b/platform/apple/CoronaResources-Info.plist index c6d17d4cf..f45f8e20c 100644 --- a/platform/apple/CoronaResources-Info.plist +++ b/platform/apple/CoronaResources-Info.plist @@ -39,6 +39,6 @@ CFPlugInUnloadFunction NSHumanReadableCopyright - Copyright © 2020-2021 Solar2D. All rights reserved. + Copyright © 2020-2023 Solar2D. All rights reserved. diff --git a/platform/mac/AppDelegate.mm b/platform/mac/AppDelegate.mm index 4a124ff09..2db214dca 100755 --- a/platform/mac/AppDelegate.mm +++ b/platform/mac/AppDelegate.mm @@ -138,6 +138,7 @@ @interface ExtensionParams : NSObject @property (nonatomic, readonly) bool showWindowTitle; @property (nonatomic, readwrite, retain) CoronaWindowController *view; + - (id) initParams:(NSString *)title path:(NSString *)path width:(int)w height:(int)h resizable:(bool) resizable showWindowTitle:(bool) showWindowTitle; @end @@ -1073,6 +1074,12 @@ -(void)applicationDidFinishLaunching:(NSNotification*)aNotification } } + //Allow for Dragging Main.lua file on Sim + if (@available(macOS 10.13, *)) { + [[fHomeScreen window] registerForDraggedTypes:@[NSPasteboardTypeFileURL]]; + } + + // Calling this makes the Welcome window fail to appear (the subsequent call seems to work without it) //[[NSProcessInfo processInfo] setAutomaticTerminationSupportEnabled:YES]; [[NSProcessInfo processInfo] disableSuddenTermination]; @@ -1322,7 +1329,6 @@ - (void) runExtension:(NSString *) extName NSMenuItem *windowMenuItem = [appMenu itemWithTitle:kWindowMenuItemName]; NSMenu *windowMenu = [windowMenuItem submenu]; long welcomeItemIdx = [windowMenu indexOfItemWithTitle:@"Welcome to Solar2D"]; - if (welcomeItemIdx == -1) { // for some reason we can't find the Welcome menuitem, bail @@ -1393,6 +1399,8 @@ -(void)applicationWillFinishLaunching:(NSNotification*)aNotification #endif } + + - (void) startDebugAndOpenPanel { using namespace Rtt; @@ -1646,7 +1654,6 @@ -(BOOL)isRelaunchable -(BOOL) isRunning { NSWindow *mainWindow = [NSApp mainWindow]; - if (nil != mainWindow) { if (mainWindow == [fHomeScreen window]) @@ -3879,10 +3886,15 @@ - (void)applicationWillBecomeActive:(NSNotification *)aNotification [self consoleMenuitem:nil]; } + // ----------------------------------------------------------------------------- // END: Simulator UI // ----------------------------------------------------------------------------- + + + + @end // diff --git a/platform/mac/CoronaConsole/CoronaConsole/Info.plist b/platform/mac/CoronaConsole/CoronaConsole/Info.plist index 3bd194b7f..3f167acbf 100644 --- a/platform/mac/CoronaConsole/CoronaConsole/Info.plist +++ b/platform/mac/CoronaConsole/CoronaConsole/Info.plist @@ -27,7 +27,7 @@ LSUIElement NSHumanReadableCopyright - Copyright © 2020-2021 Solar2D. All rights reserved. + Copyright © 2020-2023 Solar2D. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/platform/mac/CoronaWindowController.h b/platform/mac/CoronaWindowController.h index 4bd448cd1..ac4c74d66 100644 --- a/platform/mac/CoronaWindowController.h +++ b/platform/mac/CoronaWindowController.h @@ -28,7 +28,7 @@ namespace Rtt //typedef void (^windowCloseCompletionBlock)(void); -@interface CoronaWindowController : NSWindowController< CoronaViewControllerDelegate +@interface CoronaWindowController : NSWindowController< NSDraggingDestination,CoronaViewControllerDelegate #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 , CAAnimationDelegate #endif diff --git a/platform/mac/CoronaWindowController.mm b/platform/mac/CoronaWindowController.mm index 5012f8b71..f0c78c8b7 100644 --- a/platform/mac/CoronaWindowController.mm +++ b/platform/mac/CoronaWindowController.mm @@ -26,8 +26,10 @@ #include "Rtt_LuaContext.h" #include "Rtt_Runtime.h" #include "Rtt_RuntimeDelegate.h" +#include "Rtt_MacSimulatorServices.h" #include "HomeScreenRuntimeDelegate.h" + // ---------------------------------------------------------------------------- #define ENABLE_WINDOW_FADE_ANIMATIONS 1 @@ -780,6 +782,43 @@ - (void)windowDidChangeOcclusionState:(NSNotification *)notification } } + +//Support Dragging main.lua for Sim Only projects only at the moment +#if Rtt_AUTHORING_SIMULATOR +- (NSDragOperation)draggingEntered:(id )sender { + NSPasteboard *pboard; + pboard = [sender draggingPasteboard]; + if (@available(macOS 10.13, *)) { + if ( [[pboard types] containsObject:NSPasteboardTypeFileURL] ) { + NSString *fileURL = [[NSURL URLFromPasteboard:pboard] path]; + NSArray *splitPath = [fileURL componentsSeparatedByString:@"/"]; + if([splitPath.lastObject isEqualToString:@"main.lua"] ){ + return NSDragOperationLink; + } + + } + } + return NSDragOperationNone; +} +//Support for Drag a main.lua on to Welcome Screen +- (BOOL)performDragOperation:(id )sender { + NSPasteboard *pboard; + pboard = [sender draggingPasteboard]; + if (@available(macOS 10.13, *)) { + if ( [[pboard types] containsObject:NSPasteboardTypeFileURL] ) { + NSString *fileURL = [[NSURL URLFromPasteboard:pboard] path]; + NSArray *splitPath = [fileURL componentsSeparatedByString:@"/"]; + + if([splitPath.lastObject isEqualToString:@"main.lua"] ){ + AppDelegate * appDelegate = (AppDelegate*)[NSApp delegate]; + Rtt::MacSimulatorServices * simulatorServices = new Rtt::MacSimulatorServices(appDelegate, (CoronaWindowController *)self, nil); + simulatorServices->OpenProject( [[fileURL stringByReplacingOccurrencesOfString:@"main.lua" withString:@""] UTF8String] ); + } + } + } + return YES; +} +#endif @end // ---------------------------------------------------------------------------- diff --git a/platform/mac/Credits.rtfd/TXT.rtf b/platform/mac/Credits.rtfd/TXT.rtf index c61f4e999..748dfeab7 100644 --- a/platform/mac/Credits.rtfd/TXT.rtf +++ b/platform/mac/Credits.rtfd/TXT.rtf @@ -1,8 +1,9 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470 -{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} +{\rtf1\ansi\ansicpg1252\cocoartf2708 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue-Bold;} {\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} \margl1440\margr1440\vieww12600\viewh10200\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc\partightenfactor0 -\f0\b\fs24 \cf0 Copyright \'a9 2020-2021 Solar2D.\ -All rights reserved.} +\f0\b\fs24 \cf0 Copyright \'a9 2020-2023 Solar2D.\ +All rights reserved.} \ No newline at end of file diff --git a/platform/mac/Info.plist b/platform/mac/Info.plist index 1d768859b..ae63d2d58 100644 --- a/platform/mac/Info.plist +++ b/platform/mac/Info.plist @@ -76,7 +76,7 @@ NSHighResolutionCapable NSHumanReadableCopyright - Copyright © 2020-2021 Solar2D. All rights reserved. + Copyright © 2020-2023 Solar2D. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/platform/mac/Rtt_MacSimulator.mm b/platform/mac/Rtt_MacSimulator.mm index 102be7f8c..15299e453 100644 --- a/platform/mac/Rtt_MacSimulator.mm +++ b/platform/mac/Rtt_MacSimulator.mm @@ -345,6 +345,7 @@ NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:instanceWindow]; [instanceWindow setDelegate:(id )windowController]; + fWindow = instanceWindow; fWindowController = windowController; diff --git a/platform/mac/ratatouille.xcodeproj/project.pbxproj b/platform/mac/ratatouille.xcodeproj/project.pbxproj index 5cac3d8f7..297bb6ede 100644 --- a/platform/mac/ratatouille.xcodeproj/project.pbxproj +++ b/platform/mac/ratatouille.xcodeproj/project.pbxproj @@ -8359,12 +8359,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_ENTITLEMENTS = CoronaSimulator.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_RESOURCE_RULES_PATH = ""; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = NO; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = BG2J43EA88; + DEVELOPMENT_TEAM = A6QFRGXX8S; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -8703,12 +8703,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_ENTITLEMENTS = CoronaSimulator.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_RESOURCE_RULES_PATH = ""; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = NO; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = BG2J43EA88; + DEVELOPMENT_TEAM = A6QFRGXX8S; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -8763,12 +8763,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_ENTITLEMENTS = CoronaSimulator.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_RESOURCE_RULES_PATH = ""; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = NO; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = BG2J43EA88; + DEVELOPMENT_TEAM = A6QFRGXX8S; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", From d5936062cd71b6b33e2aa3bba354f7949b8ea2e0 Mon Sep 17 00:00:00 2001 From: Scott Harrison Date: Sun, 5 Mar 2023 00:55:59 -0600 Subject: [PATCH 2/5] Bug Fix Drag options available when welcome menu reappears(i.e hit welcome button from menu bar) --- platform/mac/AppDelegate.mm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/mac/AppDelegate.mm b/platform/mac/AppDelegate.mm index 2db214dca..bf40010ba 100755 --- a/platform/mac/AppDelegate.mm +++ b/platform/mac/AppDelegate.mm @@ -1074,11 +1074,6 @@ -(void)applicationDidFinishLaunching:(NSNotification*)aNotification } } - //Allow for Dragging Main.lua file on Sim - if (@available(macOS 10.13, *)) { - [[fHomeScreen window] registerForDraggedTypes:@[NSPasteboardTypeFileURL]]; - } - // Calling this makes the Welcome window fail to appear (the subsequent call seems to work without it) //[[NSProcessInfo processInfo] setAutomaticTerminationSupportEnabled:YES]; @@ -1284,6 +1279,10 @@ - (void) loadExtension:(ExtensionParams *) extParams if ([extParams.path hasSuffix:[builtinExtDirectory stringByAppendingPathComponent:@"welcome"]]) { fHomeScreen = extView; + //Allow for Dragging Main.lua file on Sim + if (@available(macOS 10.13, *)) { + [[fHomeScreen window] registerForDraggedTypes:@[NSPasteboardTypeFileURL]]; + } } // Save the fact that this extension is running in the user's defaults From cc0bd9fdef1b6fa333ea99ae4c7d6229cf0b7e06 Mon Sep 17 00:00:00 2001 From: Scott Harrison Date: Tue, 23 May 2023 12:17:34 -0500 Subject: [PATCH 3/5] Clean Up --- external/remdebug-1.0/src/controller.lua | 2 +- platform/apple/CoronaResources-Info.plist | 2 +- .../CoronaConsole/CoronaConsole/Info.plist | 2 +- platform/mac/CoronaWindowController.h | 2 +- platform/mac/CoronaWindowController.mm | 39 ------------------- platform/mac/Credits.rtfd/TXT.rtf | 9 ++--- platform/mac/Info.plist | 2 +- platform/mac/Rtt_MacSimulator.mm | 1 - 8 files changed, 9 insertions(+), 50 deletions(-) diff --git a/external/remdebug-1.0/src/controller.lua b/external/remdebug-1.0/src/controller.lua index 0e13d5f84..f25991749 100644 --- a/external/remdebug-1.0/src/controller.lua +++ b/external/remdebug-1.0/src/controller.lua @@ -482,7 +482,7 @@ while true do print("") print("Corona Debugger") print("version 1.1") - print("Copyright © 2008-2023 Solar2D. All rights reserved.") + print("Copyright © 2008-2021 Solar2D. All rights reserved.") print("") print("Portions contain:") print(" Lua, Copyright © 1994-2008 Lua.org, PUC-Rio.") diff --git a/platform/apple/CoronaResources-Info.plist b/platform/apple/CoronaResources-Info.plist index f45f8e20c..c6d17d4cf 100644 --- a/platform/apple/CoronaResources-Info.plist +++ b/platform/apple/CoronaResources-Info.plist @@ -39,6 +39,6 @@ CFPlugInUnloadFunction NSHumanReadableCopyright - Copyright © 2020-2023 Solar2D. All rights reserved. + Copyright © 2020-2021 Solar2D. All rights reserved. diff --git a/platform/mac/CoronaConsole/CoronaConsole/Info.plist b/platform/mac/CoronaConsole/CoronaConsole/Info.plist index 3f167acbf..3bd194b7f 100644 --- a/platform/mac/CoronaConsole/CoronaConsole/Info.plist +++ b/platform/mac/CoronaConsole/CoronaConsole/Info.plist @@ -27,7 +27,7 @@ LSUIElement NSHumanReadableCopyright - Copyright © 2020-2023 Solar2D. All rights reserved. + Copyright © 2020-2021 Solar2D. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/platform/mac/CoronaWindowController.h b/platform/mac/CoronaWindowController.h index ac4c74d66..4bd448cd1 100644 --- a/platform/mac/CoronaWindowController.h +++ b/platform/mac/CoronaWindowController.h @@ -28,7 +28,7 @@ namespace Rtt //typedef void (^windowCloseCompletionBlock)(void); -@interface CoronaWindowController : NSWindowController< NSDraggingDestination,CoronaViewControllerDelegate +@interface CoronaWindowController : NSWindowController< CoronaViewControllerDelegate #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 , CAAnimationDelegate #endif diff --git a/platform/mac/CoronaWindowController.mm b/platform/mac/CoronaWindowController.mm index f0c78c8b7..5012f8b71 100644 --- a/platform/mac/CoronaWindowController.mm +++ b/platform/mac/CoronaWindowController.mm @@ -26,10 +26,8 @@ #include "Rtt_LuaContext.h" #include "Rtt_Runtime.h" #include "Rtt_RuntimeDelegate.h" -#include "Rtt_MacSimulatorServices.h" #include "HomeScreenRuntimeDelegate.h" - // ---------------------------------------------------------------------------- #define ENABLE_WINDOW_FADE_ANIMATIONS 1 @@ -782,43 +780,6 @@ - (void)windowDidChangeOcclusionState:(NSNotification *)notification } } - -//Support Dragging main.lua for Sim Only projects only at the moment -#if Rtt_AUTHORING_SIMULATOR -- (NSDragOperation)draggingEntered:(id )sender { - NSPasteboard *pboard; - pboard = [sender draggingPasteboard]; - if (@available(macOS 10.13, *)) { - if ( [[pboard types] containsObject:NSPasteboardTypeFileURL] ) { - NSString *fileURL = [[NSURL URLFromPasteboard:pboard] path]; - NSArray *splitPath = [fileURL componentsSeparatedByString:@"/"]; - if([splitPath.lastObject isEqualToString:@"main.lua"] ){ - return NSDragOperationLink; - } - - } - } - return NSDragOperationNone; -} -//Support for Drag a main.lua on to Welcome Screen -- (BOOL)performDragOperation:(id )sender { - NSPasteboard *pboard; - pboard = [sender draggingPasteboard]; - if (@available(macOS 10.13, *)) { - if ( [[pboard types] containsObject:NSPasteboardTypeFileURL] ) { - NSString *fileURL = [[NSURL URLFromPasteboard:pboard] path]; - NSArray *splitPath = [fileURL componentsSeparatedByString:@"/"]; - - if([splitPath.lastObject isEqualToString:@"main.lua"] ){ - AppDelegate * appDelegate = (AppDelegate*)[NSApp delegate]; - Rtt::MacSimulatorServices * simulatorServices = new Rtt::MacSimulatorServices(appDelegate, (CoronaWindowController *)self, nil); - simulatorServices->OpenProject( [[fileURL stringByReplacingOccurrencesOfString:@"main.lua" withString:@""] UTF8String] ); - } - } - } - return YES; -} -#endif @end // ---------------------------------------------------------------------------- diff --git a/platform/mac/Credits.rtfd/TXT.rtf b/platform/mac/Credits.rtfd/TXT.rtf index 748dfeab7..c61f4e999 100644 --- a/platform/mac/Credits.rtfd/TXT.rtf +++ b/platform/mac/Credits.rtfd/TXT.rtf @@ -1,9 +1,8 @@ -{\rtf1\ansi\ansicpg1252\cocoartf2708 -\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue-Bold;} +{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470 +{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} -{\*\expandedcolortbl;;} \margl1440\margr1440\vieww12600\viewh10200\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc\partightenfactor0 -\f0\b\fs24 \cf0 Copyright \'a9 2020-2023 Solar2D.\ -All rights reserved.} \ No newline at end of file +\f0\b\fs24 \cf0 Copyright \'a9 2020-2021 Solar2D.\ +All rights reserved.} diff --git a/platform/mac/Info.plist b/platform/mac/Info.plist index ae63d2d58..1d768859b 100644 --- a/platform/mac/Info.plist +++ b/platform/mac/Info.plist @@ -76,7 +76,7 @@ NSHighResolutionCapable NSHumanReadableCopyright - Copyright © 2020-2023 Solar2D. All rights reserved. + Copyright © 2020-2021 Solar2D. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/platform/mac/Rtt_MacSimulator.mm b/platform/mac/Rtt_MacSimulator.mm index 15299e453..102be7f8c 100644 --- a/platform/mac/Rtt_MacSimulator.mm +++ b/platform/mac/Rtt_MacSimulator.mm @@ -345,7 +345,6 @@ NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:instanceWindow]; [instanceWindow setDelegate:(id )windowController]; - fWindow = instanceWindow; fWindowController = windowController; From 578306a43802aaf814ae26d02be7a494ea10ccde Mon Sep 17 00:00:00 2001 From: Scott Harrison Date: Tue, 23 May 2023 12:23:25 -0500 Subject: [PATCH 4/5] Revert "Clean Up" This reverts commit cc0bd9fdef1b6fa333ea99ae4c7d6229cf0b7e06. --- external/remdebug-1.0/src/controller.lua | 2 +- platform/apple/CoronaResources-Info.plist | 2 +- .../CoronaConsole/CoronaConsole/Info.plist | 2 +- platform/mac/CoronaWindowController.h | 2 +- platform/mac/CoronaWindowController.mm | 39 +++++++++++++++++++ platform/mac/Credits.rtfd/TXT.rtf | 9 +++-- platform/mac/Info.plist | 2 +- platform/mac/Rtt_MacSimulator.mm | 1 + 8 files changed, 50 insertions(+), 9 deletions(-) diff --git a/external/remdebug-1.0/src/controller.lua b/external/remdebug-1.0/src/controller.lua index f25991749..0e13d5f84 100644 --- a/external/remdebug-1.0/src/controller.lua +++ b/external/remdebug-1.0/src/controller.lua @@ -482,7 +482,7 @@ while true do print("") print("Corona Debugger") print("version 1.1") - print("Copyright © 2008-2021 Solar2D. All rights reserved.") + print("Copyright © 2008-2023 Solar2D. All rights reserved.") print("") print("Portions contain:") print(" Lua, Copyright © 1994-2008 Lua.org, PUC-Rio.") diff --git a/platform/apple/CoronaResources-Info.plist b/platform/apple/CoronaResources-Info.plist index c6d17d4cf..f45f8e20c 100644 --- a/platform/apple/CoronaResources-Info.plist +++ b/platform/apple/CoronaResources-Info.plist @@ -39,6 +39,6 @@ CFPlugInUnloadFunction NSHumanReadableCopyright - Copyright © 2020-2021 Solar2D. All rights reserved. + Copyright © 2020-2023 Solar2D. All rights reserved. diff --git a/platform/mac/CoronaConsole/CoronaConsole/Info.plist b/platform/mac/CoronaConsole/CoronaConsole/Info.plist index 3bd194b7f..3f167acbf 100644 --- a/platform/mac/CoronaConsole/CoronaConsole/Info.plist +++ b/platform/mac/CoronaConsole/CoronaConsole/Info.plist @@ -27,7 +27,7 @@ LSUIElement NSHumanReadableCopyright - Copyright © 2020-2021 Solar2D. All rights reserved. + Copyright © 2020-2023 Solar2D. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/platform/mac/CoronaWindowController.h b/platform/mac/CoronaWindowController.h index 4bd448cd1..ac4c74d66 100644 --- a/platform/mac/CoronaWindowController.h +++ b/platform/mac/CoronaWindowController.h @@ -28,7 +28,7 @@ namespace Rtt //typedef void (^windowCloseCompletionBlock)(void); -@interface CoronaWindowController : NSWindowController< CoronaViewControllerDelegate +@interface CoronaWindowController : NSWindowController< NSDraggingDestination,CoronaViewControllerDelegate #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 , CAAnimationDelegate #endif diff --git a/platform/mac/CoronaWindowController.mm b/platform/mac/CoronaWindowController.mm index 5012f8b71..f0c78c8b7 100644 --- a/platform/mac/CoronaWindowController.mm +++ b/platform/mac/CoronaWindowController.mm @@ -26,8 +26,10 @@ #include "Rtt_LuaContext.h" #include "Rtt_Runtime.h" #include "Rtt_RuntimeDelegate.h" +#include "Rtt_MacSimulatorServices.h" #include "HomeScreenRuntimeDelegate.h" + // ---------------------------------------------------------------------------- #define ENABLE_WINDOW_FADE_ANIMATIONS 1 @@ -780,6 +782,43 @@ - (void)windowDidChangeOcclusionState:(NSNotification *)notification } } + +//Support Dragging main.lua for Sim Only projects only at the moment +#if Rtt_AUTHORING_SIMULATOR +- (NSDragOperation)draggingEntered:(id )sender { + NSPasteboard *pboard; + pboard = [sender draggingPasteboard]; + if (@available(macOS 10.13, *)) { + if ( [[pboard types] containsObject:NSPasteboardTypeFileURL] ) { + NSString *fileURL = [[NSURL URLFromPasteboard:pboard] path]; + NSArray *splitPath = [fileURL componentsSeparatedByString:@"/"]; + if([splitPath.lastObject isEqualToString:@"main.lua"] ){ + return NSDragOperationLink; + } + + } + } + return NSDragOperationNone; +} +//Support for Drag a main.lua on to Welcome Screen +- (BOOL)performDragOperation:(id )sender { + NSPasteboard *pboard; + pboard = [sender draggingPasteboard]; + if (@available(macOS 10.13, *)) { + if ( [[pboard types] containsObject:NSPasteboardTypeFileURL] ) { + NSString *fileURL = [[NSURL URLFromPasteboard:pboard] path]; + NSArray *splitPath = [fileURL componentsSeparatedByString:@"/"]; + + if([splitPath.lastObject isEqualToString:@"main.lua"] ){ + AppDelegate * appDelegate = (AppDelegate*)[NSApp delegate]; + Rtt::MacSimulatorServices * simulatorServices = new Rtt::MacSimulatorServices(appDelegate, (CoronaWindowController *)self, nil); + simulatorServices->OpenProject( [[fileURL stringByReplacingOccurrencesOfString:@"main.lua" withString:@""] UTF8String] ); + } + } + } + return YES; +} +#endif @end // ---------------------------------------------------------------------------- diff --git a/platform/mac/Credits.rtfd/TXT.rtf b/platform/mac/Credits.rtfd/TXT.rtf index c61f4e999..748dfeab7 100644 --- a/platform/mac/Credits.rtfd/TXT.rtf +++ b/platform/mac/Credits.rtfd/TXT.rtf @@ -1,8 +1,9 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470 -{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} +{\rtf1\ansi\ansicpg1252\cocoartf2708 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue-Bold;} {\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} \margl1440\margr1440\vieww12600\viewh10200\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc\partightenfactor0 -\f0\b\fs24 \cf0 Copyright \'a9 2020-2021 Solar2D.\ -All rights reserved.} +\f0\b\fs24 \cf0 Copyright \'a9 2020-2023 Solar2D.\ +All rights reserved.} \ No newline at end of file diff --git a/platform/mac/Info.plist b/platform/mac/Info.plist index 1d768859b..ae63d2d58 100644 --- a/platform/mac/Info.plist +++ b/platform/mac/Info.plist @@ -76,7 +76,7 @@ NSHighResolutionCapable NSHumanReadableCopyright - Copyright © 2020-2021 Solar2D. All rights reserved. + Copyright © 2020-2023 Solar2D. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/platform/mac/Rtt_MacSimulator.mm b/platform/mac/Rtt_MacSimulator.mm index 102be7f8c..15299e453 100644 --- a/platform/mac/Rtt_MacSimulator.mm +++ b/platform/mac/Rtt_MacSimulator.mm @@ -345,6 +345,7 @@ NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:instanceWindow]; [instanceWindow setDelegate:(id )windowController]; + fWindow = instanceWindow; fWindowController = windowController; From 7c0084c1f9d9e4048ea93c5cac74be50ff8de3d8 Mon Sep 17 00:00:00 2001 From: Scott Harrison Date: Tue, 23 May 2023 12:25:02 -0500 Subject: [PATCH 5/5] Fixes --- .../mac/ratatouille.xcodeproj/project.pbxproj | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/mac/ratatouille.xcodeproj/project.pbxproj b/platform/mac/ratatouille.xcodeproj/project.pbxproj index 297bb6ede..5cac3d8f7 100644 --- a/platform/mac/ratatouille.xcodeproj/project.pbxproj +++ b/platform/mac/ratatouille.xcodeproj/project.pbxproj @@ -8359,12 +8359,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_ENTITLEMENTS = CoronaSimulator.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_RESOURCE_RULES_PATH = ""; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = NO; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = A6QFRGXX8S; + DEVELOPMENT_TEAM = BG2J43EA88; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -8703,12 +8703,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_ENTITLEMENTS = CoronaSimulator.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_RESOURCE_RULES_PATH = ""; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = NO; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = A6QFRGXX8S; + DEVELOPMENT_TEAM = BG2J43EA88; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -8763,12 +8763,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CODE_SIGN_ENTITLEMENTS = CoronaSimulator.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_RESOURCE_RULES_PATH = ""; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = NO; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = A6QFRGXX8S; + DEVELOPMENT_TEAM = BG2J43EA88; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)",