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.
dws/ui/ui_darwin.m

40 lines
952 B
Matlab

#import <Cocoa/Cocoa.h>
#import "AppDelegate.h"
#import "EventBridge.h"
7 years ago
#import "ui_darwin.h"
7 years ago
id defaultAutoreleasePool;
id appDelegate;
7 years ago
void initialize() {
defaultAutoreleasePool = [NSAutoreleasePool new];
7 years ago
[NSApplication sharedApplication];
7 years ago
[NSApp setDelegate: [[AppDelegate new] autorelease]];
7 years ago
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
}
7 years ago
int run() {
7 years ago
[NSApp run];
[defaultAutoreleasePool drain];
7 years ago
return 0;
}
7 years ago
void shutdown() {
[[NSApplication sharedApplication] terminate:nil];
}
void set_root(char *path) {
id listener = [[EventBridge shared] listener];
[listener serverDidSetRoot:[NSString stringWithUTF8String:path]];
}
7 years ago
void received_request(RequestMeta *meta) {
id listener = [[EventBridge shared] listener];
7 years ago
[listener serverDidReceiveRequest:meta];
}
7 years ago
void sent_response(ResponseMeta *meta) {
id listener = [[EventBridge shared] listener];
7 years ago
[listener serverDidWriteResponse:meta];
}