-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.m
59 lines (48 loc) · 1.22 KB
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* vim: set ft=objc ts=4 et sw=4 nowrap: */
#include <AppKit/AppKit.h>
#include <AppKit/NSHelpManager.h>
#include "AppController.h"
#include "ProjectWindowController.h"
@interface BurnApplication : NSApplication
{
}
- (void) keyDown: (NSEvent *) theEvent;
@end
@implementation BurnApplication
- (void) keyDown: (NSEvent *) theEvent
{
NSString *characters;
unichar character;
characters = [theEvent characters];
character = 0;
if ([characters length] > 0) {
character = [characters characterAtIndex: 0];
switch (character) {
case NSF1FunctionKey:
[self activateContextHelpMode: self];
return;
case NSDeleteFunctionKey:
case NSBackspaceCharacter:
case NSDeleteCharacter:
[[[[AppController appController] lastProjectWindowOnTop] delegate] deleteFile: self];
return;
}
}
[super keyDown: theEvent];
}
@end
/*
* Initialise and go!
*/
int main(int argc, const char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
AppController *controller;
[BurnApplication sharedApplication];
controller = [AppController appController];
[NSApp setDelegate:controller];
[[BurnApplication sharedApplication] run];
RELEASE(controller);
RELEASE(pool);
return 0;
}