From df00d3b046ee7b88eaf068b802411814ac97dfd2 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 29 Jun 2016 12:00:16 -0700 Subject: Going to have to continue to use the old MAC web-container-based UI on Macs prior to 10.10 even when the new UI comes out, and the new UI is not ready yet anyway, so resurrect this. --- .../src/MacGap/WindowController.m | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/WindowController.m (limited to 'ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/WindowController.m') diff --git a/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/WindowController.m b/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/WindowController.m new file mode 100644 index 00000000..2765a2e3 --- /dev/null +++ b/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/WindowController.m @@ -0,0 +1,54 @@ +#import "WindowController.h" + + +@interface WindowController() { + +} + +-(void) notificationCenter; + +@end + +@implementation WindowController + +@synthesize contentView, url; + +- (id) initWithURL:(NSString *) relativeURL{ + self = [super initWithWindowNibName:@"Window"]; + self.url = [NSURL URLWithString:relativeURL relativeToURL:[[NSBundle mainBundle] resourceURL]]; + + [self.window setFrameAutosaveName:@"MacGapWindow"]; + [self notificationCenter]; + + return self; +} + +-(id) initWithRequest: (NSURLRequest *)request{ + self = [super initWithWindowNibName:@"Window"]; + [self notificationCenter]; + [[self.contentView.webView mainFrame] loadRequest:request]; + + return self; +} + +-(void) notificationCenter{ + [[NSNotificationCenter defaultCenter] addObserver:self.contentView + selector:@selector(windowResized:) + name:NSWindowDidResizeNotification + object:[self window]]; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + + if (self.url != nil) { + [self.contentView.webView setMainFrameURL:[self.url absoluteString]]; + } + + + // Implement this method to handle any initialization after your + // window controller's window has been loaded from its nib file. +} + +@end -- cgit v1.2.3