Updates to work with 10.11 (El Capitan) and newer.

There are still a couple minor UI degradations

eg: mame cheat sheet, recent disk images window, auto complete window.

Squashed commit of the following:

commit fb115024f805da38b747fd1905573fabb7bff24e
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 18:00:13 2021 -0400

    ?

commit 8405f4df95ae8f5bc5dc33598dc0b3f8972b32cd
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 17:59:43 2021 -0400

    tintColor not present before 10.14

commit 86a6102cee4f30cac2972259ef55fda3c32b8f9a
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 17:59:19 2021 -0400

    [menu setItemArray:] apparently has problems before 10.14

commit 65227a00743fbf143c623af8a76698d57bdc4573
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 17:58:15 2021 -0400

    NSCache doesn't like null objects.

commit 8a4c3a4662647d5ee0b609bde9f3aaa5c0d99776
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 16:00:05 2021 -0400

    organize copy bundle resources.

    multiple-sized png images are converted to a single tiff (with multiple sizes).
    This is fine BUT EL capitan grabs the first image so if the @3x image is first, it will be used.

commit 44b94cdfd47117864b6529214b1c91a0c2e41327
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 15:57:37 2021 -0400

    add NewSlotViewController.m to Ample Lite.

commit 2fa1b7418783e48ca625ab3490e43cbff9e5619a
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 13:57:19 2021 -0400

    Ample Lite was missing reference to New Slot View nib.

commit 65f268e77a65f8c57019702d8f0c2b66577c5ee7
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 13:56:04 2021 -0400

    based on testing, 10.11 still has public.file-url, which is kUTTypeFileURL.  10.13 added NSURLPBoardType as a synonym.

commit cde123b16eb336b7695b444931b9e9bb9802d772
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun May 30 13:54:02 2021 -0400

    set everything to 10.11

commit e7a670efd3
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sat May 29 23:33:31 2021 -0400

    script to download SDL2.Framework

commit 9f38f2972a
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sat May 29 22:15:32 2021 -0400

    WKWebView apparently has a bug prior to 10.12 so it can't be created via a nib.

commit e18aea7249
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sat May 29 22:14:38 2021 -0400

    version checks for features not present in 10.11

commit 07dcf30f52
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri May 28 21:30:53 2021 -0400

    lower target to 10.11
This commit is contained in:
Kelvin Sherlock 2021-05-30 18:00:34 -04:00
parent bfbac2cc20
commit 1b7faf3ac4
13 changed files with 158 additions and 83 deletions

View File

@ -62,6 +62,8 @@
B6152B5725F4549F00605E6E /* Slot.m in Sources */ = {isa = PBXBuildFile; fileRef = B6152B5525F4549F00605E6E /* Slot.m */; };
B6152B5A25F5B57E00605E6E /* Media.m in Sources */ = {isa = PBXBuildFile; fileRef = B6152B5925F5B57E00605E6E /* Media.m */; };
B6152B5B25F5B57E00605E6E /* Media.m in Sources */ = {isa = PBXBuildFile; fileRef = B6152B5925F5B57E00605E6E /* Media.m */; };
B615A99F26640940001FBF99 /* NewSlotView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B6E9A18125088B36005E7525 /* NewSlotView.xib */; };
B615A9A026640A70001FBF99 /* NewSlotViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E9A17F25088B1B005E7525 /* NewSlotViewController.m */; };
B6374AC4260EBBCF0045CA16 /* pty_shell.c in Sources */ = {isa = PBXBuildFile; fileRef = B6374AB6260EBB970045CA16 /* pty_shell.c */; };
B6374AC5260EBC5A0045CA16 /* pty_shell in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6374ABD260EBBC90045CA16 /* pty_shell */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
B6374AD1260ECB400045CA16 /* macclas2.plist in Resources */ = {isa = PBXBuildFile; fileRef = B6374AC9260ECB3F0045CA16 /* macclas2.plist */; };
@ -892,6 +894,29 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B6DDECD62505A86E0093587A /* eject-16x16.png in Resources */,
B6DDECCC2505A86E0093587A /* eject-16x16@2x.png in Resources */,
B6DDECCE2505A86E0093587A /* eject-16x16@3x.png in Resources */,
B6DDECD02505A86E0093587A /* eject-hover-16x16.png in Resources */,
B6DDECD22505A86E0093587A /* eject-hover-16x16@2x.png in Resources */,
B6DDECD42505A86E0093587A /* eject-hover-16x16@3x.png in Resources */,
B6DE323826044C1100418375 /* caution.png in Resources */,
B6DE323626044C1100418375 /* caution@2x.png in Resources */,
B6DE323B26044DB800418375 /* caution@3x.png in Resources */,
B6DDECC025057A550093587A /* drag-handle-4x10.png in Resources */,
B6DDECC225057A550093587A /* drag-handle-4x10@2x.png in Resources */,
B6DDECC425057A550093587A /* drag-handle-4x10@3x.png in Resources */,
B6BA258224E99BEB005FB8FF /* Assets.xcassets in Resources */,
B6D6DE3E24FADF8B00661A5F /* LaunchWindow.xib in Resources */,
B6004DF124FB05D600D38596 /* LogWindow.xib in Resources */,
B6BA258524E99BEB005FB8FF /* MainMenu.xib in Resources */,
B6665C1C265C639A00254939 /* Autocomplete.xib in Resources */,
B64AF1EE250EC35B00A09B9B /* DiskImages.xib in Resources */,
B63C1B9625008A2700511A71 /* DownloadWindow.xib in Resources */,
B61099E824F5F231005CB652 /* MediaView.xib in Resources */,
B6E9A18325088B36005E7525 /* NewSlotView.xib in Resources */,
B6D6DE3924FAC8B500661A5F /* Preferences.xib in Resources */,
B63C1F0B25B143C50016A611 /* CheatSheet.xib in Resources */,
B6109A3324F5F377005CB652 /* apple2eeuk.plist in Resources */,
B6374ADB260ECB400045CA16 /* maciix.plist in Resources */,
B6109A2424F5F377005CB652 /* las128ex.plist in Resources */,
@ -901,24 +926,18 @@
B6374AD9260ECB400045CA16 /* maciicx.plist in Resources */,
B6109A3F24F5F377005CB652 /* agat9.plist in Resources */,
B63C1B9D250192D800511A71 /* cece.plist in Resources */,
B6D6DE3E24FADF8B00661A5F /* LaunchWindow.xib in Resources */,
B6109A3124F5F377005CB652 /* apple1.plist in Resources */,
B6374AD3260ECB400045CA16 /* macii.plist in Resources */,
B6109A3524F5F377005CB652 /* ace100.plist in Resources */,
B65085BB25B616AC00354EC9 /* maclc3.plist in Resources */,
B6109A3424F5F377005CB652 /* am64.plist in Resources */,
B6DDECCC2505A86E0093587A /* eject-16x16@2x.png in Resources */,
B6DE32462605482500418375 /* macclasc.plist in Resources */,
B6004DF124FB05D600D38596 /* LogWindow.xib in Resources */,
B6DE32502605482500418375 /* macse.plist in Resources */,
B6BA258224E99BEB005FB8FF /* Assets.xcassets in Resources */,
B6109A1724F5F377005CB652 /* apple2e.plist in Resources */,
B6109A3C24F5F377005CB652 /* am100.plist in Resources */,
B6DDECD02505A86E0093587A /* eject-hover-16x16.png in Resources */,
B6109A2524F5F377005CB652 /* laser2c.plist in Resources */,
B6109A3D24F5F377005CB652 /* laser128.plist in Resources */,
B6109A2824F5F377005CB652 /* apple2ep.plist in Resources */,
B6DDECC225057A550093587A /* drag-handle-4x10@2x.png in Resources */,
B6109A1924F5F377005CB652 /* apple2ees.plist in Resources */,
B6DE32482605482500418375 /* mac512ke.plist in Resources */,
B6109A3924F5F377005CB652 /* prav8c.plist in Resources */,
@ -930,65 +949,48 @@
B6109A2E24F5F377005CB652 /* apple2eefr.plist in Resources */,
B6109A2C24F5F377005CB652 /* spectred.plist in Resources */,
B6109A4124F5F377005CB652 /* apple2cp.plist in Resources */,
B6BA258524E99BEB005FB8FF /* MainMenu.xib in Resources */,
B6109A3A24F5F377005CB652 /* prav82.plist in Resources */,
B6DD1FE825B407E7004A3242 /* maclc.plist in Resources */,
B6109A2024F5F377005CB652 /* apple2euk.plist in Resources */,
B6DE324C2605482500418375 /* macplus.plist in Resources */,
B6DE323826044C1100418375 /* caution.png in Resources */,
B6109A2F24F5F377005CB652 /* uniap2ti.plist in Resources */,
B6DDECD42505A86E0093587A /* eject-hover-16x16@3x.png in Resources */,
B6DDECD62505A86E0093587A /* eject-16x16.png in Resources */,
B6109A1E24F5F377005CB652 /* apple2c.plist in Resources */,
B6109A1A24F5F377005CB652 /* microeng.plist in Resources */,
B6374AD5260ECB400045CA16 /* maciisi.plist in Resources */,
B6109A3E24F5F377005CB652 /* albert.plist in Resources */,
B6665C1C265C639A00254939 /* Autocomplete.xib in Resources */,
B66236C124FDB7A6006CABD7 /* Credits.rtf in Resources */,
B6109A4224F5F377005CB652 /* apple2p.plist in Resources */,
B65085B925B616AC00354EC9 /* maclc2.plist in Resources */,
B6109A1824F5F377005CB652 /* hkc8800a.plist in Resources */,
B6109A2324F5F377005CB652 /* apple2gsr0.plist in Resources */,
B63C1BA1250192D800511A71 /* cecg.plist in Resources */,
B6DE323626044C1100418375 /* caution@2x.png in Resources */,
B63C1BA3250192D800511A71 /* cec2000.plist in Resources */,
B6109A2624F5F377005CB652 /* mprof3.plist in Resources */,
B63C1B9F250192D800511A71 /* ceci.plist in Resources */,
B6109A3224F5F377005CB652 /* basis108.plist in Resources */,
B6DE323B26044DB800418375 /* caution@3x.png in Resources */,
B6109A4324F5F377005CB652 /* agat7.plist in Resources */,
B6DE324E2605482500418375 /* mac512k.plist in Resources */,
B6DDECC425057A550093587A /* drag-handle-4x10@3x.png in Resources */,
B6109A2B24F5F377005CB652 /* elppa.plist in Resources */,
B63C1B8E25004C6D00511A71 /* mame-data.tgz in Resources */,
B6DDECCE2505A86E0093587A /* eject-16x16@3x.png in Resources */,
B64AF1EE250EC35B00A09B9B /* DiskImages.xib in Resources */,
B6109A3B24F5F377005CB652 /* apple2gsr1.plist in Resources */,
B65085BD25B616AC00354EC9 /* maciici.plist in Resources */,
B6374AE3260ECDDD0045CA16 /* maciihmu.plist in Resources */,
B6374ADF260ECB400045CA16 /* macse30.plist in Resources */,
B63C1F1225B147E10016A611 /* CheatSheet.html in Resources */,
B63C1B9625008A2700511A71 /* DownloadWindow.xib in Resources */,
B6D6DE3B24FACF4F00661A5F /* Defaults.plist in Resources */,
B6109A2224F5F377005CB652 /* models.plist in Resources */,
B6109A4024F5F377005CB652 /* craft2p.plist in Resources */,
B6109A1B24F5F377005CB652 /* uniap2pt.plist in Resources */,
B6109A3724F5F377005CB652 /* las128e2.plist in Resources */,
B61099E824F5F231005CB652 /* MediaView.xib in Resources */,
B6374AE5260ECDDD0045CA16 /* mac2fdhd.plist in Resources */,
B63C1B90250088DD00511A71 /* roms.plist in Resources */,
B6109A2724F5F377005CB652 /* uniap2en.plist in Resources */,
B6109A2A24F5F377005CB652 /* apple3.plist in Resources */,
B6109A2124F5F377005CB652 /* apple2ee.plist in Resources */,
B63C1BA5250192D800511A71 /* cecm.plist in Resources */,
B6E9A18325088B36005E7525 /* NewSlotView.xib in Resources */,
B6DDECC025057A550093587A /* drag-handle-4x10.png in Resources */,
B6DDECD22505A86E0093587A /* eject-hover-16x16@2x.png in Resources */,
B6109A3624F5F377005CB652 /* dodo.plist in Resources */,
B6D6DE3924FAC8B500661A5F /* Preferences.xib in Resources */,
B6109A2924F5F377005CB652 /* apple2gs.plist in Resources */,
B6109A1F24F5F377005CB652 /* apple2jp.plist in Resources */,
B63C1F0B25B143C50016A611 /* CheatSheet.xib in Resources */,
B6374AD7260ECB400045CA16 /* maciivi.plist in Resources */,
B6374AD1260ECB400045CA16 /* macclas2.plist in Resources */,
B6DE324A2605482500418375 /* macsefd.plist in Resources */,
@ -1001,7 +1003,18 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B6DDECD72505A86E0093587A /* eject-16x16.png in Resources */,
B6DDECCD2505A86E0093587A /* eject-16x16@2x.png in Resources */,
B6DDECCF2505A86E0093587A /* eject-16x16@3x.png in Resources */,
B6DDECD12505A86E0093587A /* eject-hover-16x16.png in Resources */,
B6DDECD32505A86E0093587A /* eject-hover-16x16@2x.png in Resources */,
B6DDECD52505A86E0093587A /* eject-hover-16x16@3x.png in Resources */,
B6DE323926044C1100418375 /* caution.png in Resources */,
B6DE323726044C1100418375 /* caution@2x.png in Resources */,
B6DE323C26044DB800418375 /* caution@3x.png in Resources */,
B6DDECC125057A550093587A /* drag-handle-4x10.png in Resources */,
B6DDECC325057A550093587A /* drag-handle-4x10@2x.png in Resources */,
B6DDECC525057A550093587A /* drag-handle-4x10@3x.png in Resources */,
B6374AE6260ECDDD0045CA16 /* mac2fdhd.plist in Resources */,
B6374ADC260ECB400045CA16 /* maciix.plist in Resources */,
B6E4B5BC24FDE2670094A35C /* apple2eeuk.plist in Resources */,
@ -1013,7 +1026,6 @@
B6E4B5BF24FDE2670094A35C /* agat9.plist in Resources */,
B6E4B5C024FDE2670094A35C /* LaunchWindow.xib in Resources */,
B6665C1D265C639A00254939 /* Autocomplete.xib in Resources */,
B6DE323726044C1100418375 /* caution@2x.png in Resources */,
B6E4B5C124FDE2670094A35C /* apple1.plist in Resources */,
B6E4B5C224FDE2670094A35C /* ace100.plist in Resources */,
B6374AD6260ECB400045CA16 /* maciisi.plist in Resources */,
@ -1028,20 +1040,18 @@
B6E4B5C724FDE2670094A35C /* am100.plist in Resources */,
B6E4B5C824FDE2670094A35C /* laser2c.plist in Resources */,
B6374ADA260ECB400045CA16 /* maciicx.plist in Resources */,
B6DDECC125057A550093587A /* drag-handle-4x10.png in Resources */,
B615A99F26640940001FBF99 /* NewSlotView.xib in Resources */,
B63C1F0C25B143C50016A611 /* CheatSheet.xib in Resources */,
B6374AE0260ECB400045CA16 /* macse30.plist in Resources */,
B6E4B5C924FDE2670094A35C /* laser128.plist in Resources */,
B646D10C263A5DF30014C586 /* ace1000.plist in Resources */,
B6E4B5CA24FDE2670094A35C /* apple2ep.plist in Resources */,
B6DDECCD2505A86E0093587A /* eject-16x16@2x.png in Resources */,
B6E4B5CB24FDE2670094A35C /* apple2ees.plist in Resources */,
B6E4B5CC24FDE2670094A35C /* prav8c.plist in Resources */,
B6E4B5CD24FDE2670094A35C /* ivelultr.plist in Resources */,
B6E4B5CE24FDE2670094A35C /* maxxi.plist in Resources */,
B6DE324B2605482500418375 /* macsefd.plist in Resources */,
B6E4B5CF24FDE2670094A35C /* apple2eefr.plist in Resources */,
B6DE323926044C1100418375 /* caution.png in Resources */,
B6374AD8260ECB400045CA16 /* maciivi.plist in Resources */,
B6E4B5D124FDE2670094A35C /* spectred.plist in Resources */,
B63C1B9725008A2700511A71 /* DownloadWindow.xib in Resources */,
@ -1056,22 +1066,17 @@
B6E4B5D924FDE2670094A35C /* albert.plist in Resources */,
B6E4B5DA24FDE2670094A35C /* Credits.rtf in Resources */,
B6E4B5DB24FDE2670094A35C /* apple2p.plist in Resources */,
B6DDECD12505A86E0093587A /* eject-hover-16x16.png in Resources */,
B65085BE25B616AC00354EC9 /* maciici.plist in Resources */,
B6DE32512605482500418375 /* macse.plist in Resources */,
B65085BC25B616AC00354EC9 /* maclc3.plist in Resources */,
B6DE32492605482500418375 /* mac512ke.plist in Resources */,
B6DE32452605482500418375 /* mac128k.plist in Resources */,
B63C1BA4250192D800511A71 /* cec2000.plist in Resources */,
B6DDECD32505A86E0093587A /* eject-hover-16x16@2x.png in Resources */,
B6E4B5DC24FDE2670094A35C /* hkc8800a.plist in Resources */,
B6374AE4260ECDDD0045CA16 /* maciihmu.plist in Resources */,
B6DDECC525057A550093587A /* drag-handle-4x10@3x.png in Resources */,
B6E4B5DD24FDE2670094A35C /* apple2gsr0.plist in Resources */,
B6DE323C26044DB800418375 /* caution@3x.png in Resources */,
B6E4B5DE24FDE2670094A35C /* mprof3.plist in Resources */,
B6E4B5DF24FDE2670094A35C /* basis108.plist in Resources */,
B6DDECD52505A86E0093587A /* eject-hover-16x16@3x.png in Resources */,
B6DD1FE925B407E7004A3242 /* maclc.plist in Resources */,
B6E4B5E024FDE2670094A35C /* agat7.plist in Resources */,
B6E4B5E124FDE2670094A35C /* elppa.plist in Resources */,
@ -1093,11 +1098,9 @@
B6DE324D2605482500418375 /* macplus.plist in Resources */,
B6E4B5ED24FDE2670094A35C /* Preferences.xib in Resources */,
B6374ADE260ECB400045CA16 /* maciivx.plist in Resources */,
B6DDECD72505A86E0093587A /* eject-16x16.png in Resources */,
B6E4B5EF24FDE2670094A35C /* apple2gs.plist in Resources */,
B6E4B5F024FDE2670094A35C /* apple2jp.plist in Resources */,
B6E4B5F124FDE2670094A35C /* apple2.plist in Resources */,
B6DDECC325057A550093587A /* drag-handle-4x10@2x.png in Resources */,
B6E4B5F224FDE2670094A35C /* prav8m.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -1190,6 +1193,7 @@
B6E4B5B324FDE2670094A35C /* MediaViewController.m in Sources */,
B64AF1F7250ED5E400A09B9B /* TableCellView.m in Sources */,
B6E4B5B424FDE2670094A35C /* FlippedView.m in Sources */,
B615A9A026640A70001FBF99 /* NewSlotViewController.m in Sources */,
B6665C15265A0E3E00254939 /* AutocompleteControl.m in Sources */,
B6E4B5B524FDE2670094A35C /* AppDelegate.m in Sources */,
B66D0FE82611386C000902F1 /* SoftwareList.m in Sources */,
@ -1373,7 +1377,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -1425,7 +1429,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;

View File

@ -96,10 +96,15 @@
@"xfz",
path
];
[task setExecutableURL: [NSURL fileURLWithPath: @"/usr/bin/tar"]];
if (@available(macOS 10.13, *)) {
[task setExecutableURL: [NSURL fileURLWithPath: @"/usr/bin/tar"]];
[task setCurrentDirectoryURL: sd];
} else {
[task setLaunchPath: @"/usr/bin/tar"];
[task setCurrentDirectoryPath: SupportDirectoryPath()];
}
[task setArguments: argv];
[task setCurrentDirectoryURL: sd];
dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC));
[task setTerminationHandler: ^(NSTask *task){

View File

@ -411,8 +411,11 @@ Todo --
-(void)_init {
_backgroundColor = [NSColor windowBackgroundColor];
_selectedColor = [NSColor selectedContentBackgroundColor];
if (@available(macOS 10.14, *)) {
_selectedColor = [NSColor selectedContentBackgroundColor];
} else {
_selectedColor = [NSColor selectedTextBackgroundColor];
}
NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveInActiveApp;
_trackingArea = [[NSTrackingArea alloc] initWithRect: NSZeroRect
options: options

View File

@ -1,16 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="15705"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="CheatSheetWindowController">
<connections>
<outlet property="_webView" destination="Yc9-xA-jWX" id="rsd-1e-HPk"/>
<outlet property="webView" destination="Yc9-xA-jWX" id="EE3-gk-f71"/>
<outlet property="window" destination="QvC-M9-y7g" id="U2v-sN-OzH"/>
</connections>
</customObject>
@ -23,19 +19,6 @@
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="640" height="640"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<wkWebView hidden="YES" wantsLayer="YES" fixedFrame="YES" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yc9-xA-jWX">
<rect key="frame" x="0.0" y="0.0" width="640" height="640"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="NO"/>
</wkWebViewConfiguration>
<connections>
<outlet property="navigationDelegate" destination="-2" id="1WW-1B-FdZ"/>
</connections>
</wkWebView>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="u4H-aq-RE2"/>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>

View File

@ -27,6 +27,20 @@
- (void)windowDidLoad {
[super windowDidLoad];
if (!_webView) {
WKWebView *webView;
NSWindow *window = [self window];
CGRect frame = [[window contentView] frame];
webView = [WKWebView new];
[webView setFrame: frame];
[webView setNavigationDelegate: self];
[[window contentView]addSubview: webView];
_webView = webView;
}
[_webView setHidden: YES];
NSBundle *bundle = [NSBundle mainBundle];
NSURL *url = [bundle URLForResource: @"CheatSheet" withExtension: @"html"];

View File

@ -67,8 +67,11 @@
[window setRestorable: YES];
[window setRestorationClass: [self class]];
[_tableView registerForDraggedTypes: @[NSPasteboardTypeFileURL]];
if (@available(macOS 10.13, *)) {
[_tableView registerForDraggedTypes: @[NSPasteboardTypeFileURL]];
} else {
[_tableView registerForDraggedTypes: @[ (NSString *)kUTTypeFileURL ]];
}
[_tableView setDraggingSourceOperationMask: NSDragOperationCopy forLocal: NO]; // enable drag/drop to othr apps.
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
@ -95,6 +98,11 @@
[nc addObserver: self selector: @selector(willTerminate:) name: NSApplicationWillTerminateNotification object: nil];
}
-(void)timerCallback: (NSTimer *)timer {
_timer = nil;
[self saveFile];
}
-(void)diskImageAdded: (NSNotification *)notification {
NSURL *url = [notification object];
@ -105,11 +113,15 @@
-(void)markDirty {
_dirty = YES;
if (_timer) [_timer invalidate];
_timer = [NSTimer scheduledTimerWithTimeInterval: 5 * 60 target: self selector: @selector(timerCallback:) userInfo: nil repeats: NO];
#if 0
// 10.12+
_timer = [NSTimer scheduledTimerWithTimeInterval: 5 * 60 repeats: NO block: ^(NSTimer *t) {
self->_timer = nil;
[self saveFile];
}];
#endif
}
-(void)saveFile {
@ -306,11 +318,16 @@
for (NSPasteboardItem *item in [pb pasteboardItems]) {
// need to convert from a string to a url back to a file in case it's a file id url?
NSString *s = [item stringForType: NSPasteboardTypeFileURL];
NSString *s;
if (@available(macOS 10.13, *)) {
s = [item stringForType: NSPasteboardTypeFileURL];
} else {
// El Capitan still has kUTTypeFileURL aka public.file-url but doesn't have NSPasteboardTypeFileURL
s = [item stringForType: (NSString *)kUTTypeFileURL];
}
if (!s) continue;
NSURL *url = [NSURL URLWithString: s];
if (!url) continue;
ok |= [self addFile: url];
}
return ok;

View File

@ -53,9 +53,16 @@ static NSMutableSet *LogWindows;
}
NSTask *task = [NSTask new];
[task setExecutableURL: url];
if (@available(macOS 10.13, *)) {
[task setExecutableURL: url];
[task setCurrentDirectoryURL: MameWorkingDirectory()];
} else {
[task setLaunchPath: MamePath()];
[task setCurrentDirectoryPath: MameWorkingDirectoryPath()];
}
[task setArguments: args];
[task setCurrentDirectoryURL: MameWorkingDirectory()];
return [LogWindowController controllerForTask: task];
}
@ -84,20 +91,39 @@ static NSMutableSet *LogWindows;
if (_task) return nil;
NSError *error = nil;
NSPipe *pipe = [NSPipe pipe];
// window not yet loaded until [self window] called.
const char *path = [[task executableURL] fileSystemRepresentation];
// if (cp) [self appendString: [NSString stringWithFormat: @"MAME path: %s", cp]];
const char *wd = [[task currentDirectoryURL] fileSystemRepresentation];
// if (cp) [self appendString: [NSString stringWithFormat: @"Working Directory: %s", cp]];
const char *path = nil;
const char *wd = nil;
[task setStandardError: pipe];
[task setStandardOutput: pipe];
[task launchAndReturnError: &error];
if (@available(macOS 10.13, *)) {
NSError *error = nil;
path = [[task executableURL] fileSystemRepresentation];
wd = [[task currentDirectoryURL] fileSystemRepresentation];
[task launchAndReturnError: &error];
if (error) {
NSLog(@"NSTask error. Path = %s error = %@", path, error);
}
return error;
} else {
path = [[task launchPath] fileSystemRepresentation];
wd = [[task currentDirectoryPath] fileSystemRepresentation];
@try {
[task launch];
} @catch (NSException *exception) {
NSLog(@"NSTask exception. Path = %s exception = %@", path, exception);
return nil; // ?
}
}
#if 0
if (error) {
// NSURL *url = [task executableURL];
// NSString *path = [NSString stringWithCString: [url fileSystemRepresentation] encoding: NSUTF8StringEncoding];
@ -106,6 +132,7 @@ static NSMutableSet *LogWindows;
// [self appendString: [error description]];
return error;
}
#endif
_task = task;
NSString *title = [NSString stringWithFormat: @"Ample Log - %u", [task processIdentifier]];
[[self window] setTitle: title];

View File

@ -222,15 +222,20 @@
[pc bind: @"enabled" toObject: self withKeyPath: @"valid" options: options];
[button unbind: @"enabled"];
[button unbind: @"contentTintColor"];
t = [NSValueTransformer valueTransformerForName: NSIsNotNilTransformerName];
options = @{ NSValueTransformerBindingOption: t};
[button bind: @"enabled" toObject: self withKeyPath: @"url" options: options];
t = [NSValueTransformer valueTransformerForName: @"ValidColorTransformer"];
options = @{ NSValueTransformerBindingOption: t};
[button bind: @"contentTintColor" toObject: self withKeyPath: @"valid" options: options];
if (@available(macOS 10.14, *)) {
[button unbind: @"contentTintColor"];
t = [NSValueTransformer valueTransformerForName: @"ValidColorTransformer"];
options = @{ NSValueTransformerBindingOption: t};
[button bind: @"contentTintColor" toObject: self withKeyPath: @"valid" options: options];
} else {
// El Capitan TODO...
}
#if 0
NSColor *tintColor = nil;
if (!_valid) tintColor = [NSColor systemRedColor];

View File

@ -323,12 +323,15 @@ static NSDictionary *IndexMap = nil;
[button unbind: @"selectedIndex"];
NSMenu *menu = [button menu];
NSArray *menuItems = [self menuItems];
// [menu setItemArray: ] doesn't work prior to 10.14, apparently.
[menu removeAllItems];
if (_index == kSMARTPORT) {
[menu setItemArray: @[]];
//[menu setItemArray: @[]];
[button setHidden: YES];
} else {
[menu setItemArray: menuItems];
//[menu setItemArray: menuItems];
for (NSMenuItem *x in menuItems) [menu addItem: x];
[button bind: @"selectedIndex" toObject: self withKeyPath: @"selectedIndex" options: nil];
[button setHidden: NO];
}

View File

@ -367,7 +367,7 @@ NSArray<SoftwareList *> *SoftwareListForMachine(NSString *machine) {
NSLog(@"SoftwareListForMachine: %@ %@: %@", machine, xml, error);
continue;
}
[cache setObject: sw forKey: xml];
if (sw) [cache setObject: sw forKey: xml];
}
if (filter) {
sw = [sw filter: filter];
@ -479,7 +479,7 @@ NSArray<SoftwareList *> *SoftwareListForMachine(NSString *machine) {
NSLog(@"SoftwareListForMachine: %@ %@: %@", machine, xml, error);
continue;
}
[cache setObject: sw forKey: xml];
if (sw) [cache setObject: sw forKey: xml];
}
if (filter) {
sw = [sw filter: filter];

16
embedded/download-sdl.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
DMG=SDL2-2.0.14.dmg
URL=https://www.libsdl.org/release/SDL2-2.0.14.dmg
FRAMEWORK=SDL2.framework
if [ -e $FRAMEWORK ] ; then exit 0 ; fi
if [ ! -e $DMG ] ; then curl -OL $URL ; fi
hdiutil attach $DMG -noverify -nobrowse -mountpoint /Volumes/sdl_disk_image
# cp -r /sdl_disk_image/$FRAMEWORK ./
ditto /Volumes/sdl_disk_image/$FRAMEWORK $FRAMEWORK
hdiutil detach /Volumes/sdl_disk_image