mirror of
https://github.com/ksherlock/ample.git
synced 2025-06-19 15:23:45 +00:00
Compare commits
4 Commits
hardened_r
...
10.11
Author | SHA1 | Date | |
---|---|---|---|
e7a670efd3 | |||
9f38f2972a | |||
e18aea7249 | |||
07dcf30f52 |
@ -1446,6 +1446,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
MARKETING_VERSION = 0.232;
|
MARKETING_VERSION = 0.232;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.ksherlock.ample;
|
PRODUCT_BUNDLE_IDENTIFIER = com.ksherlock.ample;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@ -1466,6 +1467,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
MARKETING_VERSION = 0.232;
|
MARKETING_VERSION = 0.232;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.ksherlock.ample;
|
PRODUCT_BUNDLE_IDENTIFIER = com.ksherlock.ample;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
@ -96,10 +96,15 @@
|
|||||||
@"xfz",
|
@"xfz",
|
||||||
path
|
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 setArguments: argv];
|
||||||
[task setCurrentDirectoryURL: sd];
|
|
||||||
|
|
||||||
|
|
||||||
dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC));
|
dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC));
|
||||||
[task setTerminationHandler: ^(NSTask *task){
|
[task setTerminationHandler: ^(NSTask *task){
|
||||||
|
@ -411,8 +411,11 @@ Todo --
|
|||||||
|
|
||||||
-(void)_init {
|
-(void)_init {
|
||||||
_backgroundColor = [NSColor windowBackgroundColor];
|
_backgroundColor = [NSColor windowBackgroundColor];
|
||||||
_selectedColor = [NSColor selectedContentBackgroundColor];
|
if (@available(macOS 10.14, *)) {
|
||||||
|
_selectedColor = [NSColor selectedContentBackgroundColor];
|
||||||
|
} else {
|
||||||
|
_selectedColor = [NSColor selectedTextBackgroundColor];
|
||||||
|
}
|
||||||
NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveInActiveApp;
|
NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveInActiveApp;
|
||||||
_trackingArea = [[NSTrackingArea alloc] initWithRect: NSZeroRect
|
_trackingArea = [[NSTrackingArea alloc] initWithRect: NSZeroRect
|
||||||
options: options
|
options: options
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
|
<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"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="CheatSheetWindowController">
|
<customObject id="-2" userLabel="File's Owner" customClass="CheatSheetWindowController">
|
||||||
<connections>
|
<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"/>
|
<outlet property="window" destination="QvC-M9-y7g" id="U2v-sN-OzH"/>
|
||||||
</connections>
|
</connections>
|
||||||
</customObject>
|
</customObject>
|
||||||
@ -23,19 +19,6 @@
|
|||||||
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
|
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="640" height="640"/>
|
<rect key="frame" x="0.0" y="0.0" width="640" height="640"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<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>
|
</view>
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="delegate" destination="-2" id="u4H-aq-RE2"/>
|
<outlet property="delegate" destination="-2" id="u4H-aq-RE2"/>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -27,6 +27,20 @@
|
|||||||
- (void)windowDidLoad {
|
- (void)windowDidLoad {
|
||||||
[super 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];
|
[_webView setHidden: YES];
|
||||||
NSBundle *bundle = [NSBundle mainBundle];
|
NSBundle *bundle = [NSBundle mainBundle];
|
||||||
NSURL *url = [bundle URLForResource: @"CheatSheet" withExtension: @"html"];
|
NSURL *url = [bundle URLForResource: @"CheatSheet" withExtension: @"html"];
|
||||||
|
@ -67,8 +67,11 @@
|
|||||||
[window setRestorable: YES];
|
[window setRestorable: YES];
|
||||||
[window setRestorationClass: [self class]];
|
[window setRestorationClass: [self class]];
|
||||||
|
|
||||||
|
if (@available(macOS 10.13, *)) {
|
||||||
[_tableView registerForDraggedTypes: @[NSPasteboardTypeFileURL]];
|
[_tableView registerForDraggedTypes: @[NSPasteboardTypeFileURL]];
|
||||||
|
} else {
|
||||||
|
[_tableView registerForDraggedTypes: @[NSURLPboardType]];
|
||||||
|
}
|
||||||
[_tableView setDraggingSourceOperationMask: NSDragOperationCopy forLocal: NO]; // enable drag/drop to othr apps.
|
[_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.
|
// 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];
|
[nc addObserver: self selector: @selector(willTerminate:) name: NSApplicationWillTerminateNotification object: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)timerCallback: (NSTimer *)timer {
|
||||||
|
_timer = nil;
|
||||||
|
[self saveFile];
|
||||||
|
}
|
||||||
|
|
||||||
-(void)diskImageAdded: (NSNotification *)notification {
|
-(void)diskImageAdded: (NSNotification *)notification {
|
||||||
|
|
||||||
NSURL *url = [notification object];
|
NSURL *url = [notification object];
|
||||||
@ -105,11 +113,15 @@
|
|||||||
-(void)markDirty {
|
-(void)markDirty {
|
||||||
_dirty = YES;
|
_dirty = YES;
|
||||||
if (_timer) [_timer invalidate];
|
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) {
|
_timer = [NSTimer scheduledTimerWithTimeInterval: 5 * 60 repeats: NO block: ^(NSTimer *t) {
|
||||||
|
|
||||||
self->_timer = nil;
|
self->_timer = nil;
|
||||||
[self saveFile];
|
[self saveFile];
|
||||||
}];
|
}];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)saveFile {
|
-(void)saveFile {
|
||||||
@ -306,11 +318,15 @@
|
|||||||
for (NSPasteboardItem *item in [pb pasteboardItems]) {
|
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?
|
// 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 {
|
||||||
|
s = [item stringForType: NSURLPboardType];
|
||||||
|
}
|
||||||
if (!s) continue;
|
if (!s) continue;
|
||||||
NSURL *url = [NSURL URLWithString: s];
|
NSURL *url = [NSURL URLWithString: s];
|
||||||
if (!url) continue;
|
if (!url) continue;
|
||||||
|
|
||||||
ok |= [self addFile: url];
|
ok |= [self addFile: url];
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
|
@ -53,9 +53,16 @@ static NSMutableSet *LogWindows;
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSTask *task = [NSTask new];
|
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 setArguments: args];
|
||||||
[task setCurrentDirectoryURL: MameWorkingDirectory()];
|
|
||||||
|
|
||||||
return [LogWindowController controllerForTask: task];
|
return [LogWindowController controllerForTask: task];
|
||||||
}
|
}
|
||||||
@ -84,20 +91,39 @@ static NSMutableSet *LogWindows;
|
|||||||
|
|
||||||
if (_task) return nil;
|
if (_task) return nil;
|
||||||
|
|
||||||
NSError *error = nil;
|
|
||||||
NSPipe *pipe = [NSPipe pipe];
|
NSPipe *pipe = [NSPipe pipe];
|
||||||
|
|
||||||
// window not yet loaded until [self window] called.
|
// 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 *path = nil;
|
||||||
const char *wd = [[task currentDirectoryURL] fileSystemRepresentation];
|
const char *wd = nil;
|
||||||
// if (cp) [self appendString: [NSString stringWithFormat: @"Working Directory: %s", cp]];
|
|
||||||
|
|
||||||
[task setStandardError: pipe];
|
[task setStandardError: pipe];
|
||||||
[task setStandardOutput: 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) {
|
if (error) {
|
||||||
// NSURL *url = [task executableURL];
|
// NSURL *url = [task executableURL];
|
||||||
// NSString *path = [NSString stringWithCString: [url fileSystemRepresentation] encoding: NSUTF8StringEncoding];
|
// NSString *path = [NSString stringWithCString: [url fileSystemRepresentation] encoding: NSUTF8StringEncoding];
|
||||||
@ -106,6 +132,7 @@ static NSMutableSet *LogWindows;
|
|||||||
// [self appendString: [error description]];
|
// [self appendString: [error description]];
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
_task = task;
|
_task = task;
|
||||||
NSString *title = [NSString stringWithFormat: @"Ample Log - %u", [task processIdentifier]];
|
NSString *title = [NSString stringWithFormat: @"Ample Log - %u", [task processIdentifier]];
|
||||||
[[self window] setTitle: title];
|
[[self window] setTitle: title];
|
||||||
|
16
embedded/download-sdl.sh
Normal file
16
embedded/download-sdl.sh
Normal 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
|
Reference in New Issue
Block a user