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.
41 lines
970 B
Matlab
41 lines
970 B
Matlab
8 years ago
|
#import <Cocoa/Cocoa.h>
|
||
|
#import "AppDelegate.h"
|
||
|
#import "EventBridge.h"
|
||
8 years ago
|
#import "ui.h"
|
||
8 years ago
|
|
||
8 years ago
|
id defaultAutoreleasePool;
|
||
|
id appDelegate;
|
||
|
|
||
8 years ago
|
void ui_init() {
|
||
8 years ago
|
defaultAutoreleasePool = [NSAutoreleasePool new];
|
||
8 years ago
|
[NSApplication sharedApplication];
|
||
8 years ago
|
[NSApp setDelegate: [[AppDelegate new] autorelease]];
|
||
8 years ago
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||
|
}
|
||
|
|
||
8 years ago
|
int ui_run() {
|
||
8 years ago
|
[NSApp run];
|
||
8 years ago
|
[defaultAutoreleasePool drain];
|
||
8 years ago
|
return 0;
|
||
|
}
|
||
8 years ago
|
|
||
8 years ago
|
void bg_shutdown() {
|
||
8 years ago
|
[[NSApplication sharedApplication] terminate:nil];
|
||
|
}
|
||
8 years ago
|
|
||
8 years ago
|
void bg_set_root(char *path) {
|
||
8 years ago
|
id listener = [[EventBridge shared] listener];
|
||
|
[listener serverDidSetRoot:[NSString stringWithUTF8String:path]];
|
||
8 years ago
|
free(path);
|
||
8 years ago
|
}
|
||
8 years ago
|
|
||
8 years ago
|
void bg_received_request(RequestMeta *meta) {
|
||
8 years ago
|
id listener = [[EventBridge shared] listener];
|
||
8 years ago
|
[listener serverDidReceiveRequest:meta];
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
void bg_sent_response(ResponseMeta *meta) {
|
||
8 years ago
|
id listener = [[EventBridge shared] listener];
|
||
8 years ago
|
[listener serverDidWriteResponse:meta];
|
||
8 years ago
|
}
|