mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Kind of starting from scratch.
Recreated the project as an xcode 4 project. Key Bindings are working and reloading. Got rid of everything that wasn't being used right now.
This commit is contained in:
48
Atom/Classes/AtomApp.m
Normal file
48
Atom/Classes/AtomApp.m
Normal file
@@ -0,0 +1,48 @@
|
||||
#import "AtomApp.h"
|
||||
#import "AtomController.h"
|
||||
#import "JSCocoa.h"
|
||||
|
||||
@implementation AtomApp
|
||||
|
||||
@synthesize controllers;
|
||||
|
||||
- (AtomController *)createController {
|
||||
AtomController *controller = [[AtomController alloc] initWithWindowNibName:@"AtomWindow"];
|
||||
[controllers addObject:controller];
|
||||
return controller;
|
||||
}
|
||||
|
||||
- (void)removeController:(AtomController *)controller {
|
||||
[controllers removeObject:controller];
|
||||
}
|
||||
|
||||
// Overridden
|
||||
- (void)sendEvent:(NSEvent *)event {
|
||||
if ([event type] == NSKeyDown) {
|
||||
BOOL handeled = NO;
|
||||
id controller = [[self keyWindow] windowController];
|
||||
|
||||
// The keyWindow could be a Cocoa Dialog or something, ignore that.
|
||||
if ([controller isKindOfClass:[AtomController class]]) {
|
||||
handeled = [controller handleKeyEvent:event];
|
||||
}
|
||||
|
||||
if (!handeled) [super sendEvent:event];
|
||||
}
|
||||
else {
|
||||
[super sendEvent:event];
|
||||
}
|
||||
}
|
||||
|
||||
// AppDelegate
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
|
||||
NSDictionary *defaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"WebKitDeveloperExtras", nil];
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
AtomController *controller = [self createController];
|
||||
[controller window];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user