You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import "AppDelegate.h"
|
|
|
|
#import "EventBridge.h"
|
|
|
|
#import "ui_darwin.h"
|
|
|
|
|
|
|
|
id defaultAutoreleasePool;
|
|
|
|
id appDelegate;
|
|
|
|
|
|
|
|
void initialize() {
|
|
|
|
defaultAutoreleasePool = [NSAutoreleasePool new];
|
|
|
|
[NSApplication sharedApplication];
|
|
|
|
[NSApp setDelegate: [[AppDelegate new] autorelease]];
|
|
|
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
|
|
|
}
|
|
|
|
|
|
|
|
int run() {
|
|
|
|
[NSApp run];
|
|
|
|
[defaultAutoreleasePool drain];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void shutdown() {
|
|
|
|
[[NSApplication sharedApplication] terminate:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_root(char *path) {
|
|
|
|
id listener = [[EventBridge shared] listener];
|
|
|
|
[listener serverDidSetRoot:[NSString stringWithUTF8String:path]];
|
|
|
|
}
|
|
|
|
|
|
|
|
void begin_request(RequestMeta *meta) {
|
|
|
|
id listener = [[EventBridge shared] listener];
|
|
|
|
[listener serverDidBeginHandlingRequest:meta];
|
|
|
|
}
|
|
|
|
|
|
|
|
void end_request() {
|
|
|
|
id listener = [[EventBridge shared] listener];
|
|
|
|
[listener serverDidFinishHandlingRequest];
|
|
|
|
}
|