Files
atom/Cocoa/Classes/AtomApp.m
2011-09-05 10:26:30 -07:00

40 lines
1.0 KiB
Objective-C

#import "AtomApp.h"
#import "AtomWindowController.h"
#import "JSCocoa.h"
@implementation AtomApp
- (void)sendEvent:(NSEvent *)event {
switch ([event type]) {
case NSKeyDown:
case NSFlagsChanged:
{
AtomWindowController *controller = (AtomWindowController *)[[self keyWindow] windowController];
BOOL handeled = [controller handleKeyEvent:event];
if (!handeled) {
[super sendEvent:event];
}
}
break;
default:
[super sendEvent:event];
break;
}
}
// AppDelegate
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
NSDictionary *defaults = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], @"WebKitDeveloperExtras",
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
id c = [[AtomWindowController alloc] initWithWindowNibName:@"AtomWindow"];
[c window];
}
@end