-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.m
30 lines (21 loc) · 1.04 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
#import <Cocoa/Cocoa.h>
#import <InputMethodKit/InputMethodKit.h>
//Each input method needs a unique connection name.
//Note that periods and spaces are not allowed in the connection name.
const NSString* kConnectionName = @"Ridmik_Keyboard_Connection";
//let this be a global so our application controller delegate can access it easily
IMKServer* server;
int main(int argc, char *argv[])
{
NSString* identifier;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//find the bundle identifier and then initialize the input method server
identifier = [[NSBundle mainBundle] bundleIdentifier];
server = [[IMKServer alloc] initWithName:(NSString*)kConnectionName bundleIdentifier:[[NSBundle mainBundle] bundleIdentifier]];
//load the bundle explicitly because in this case the input method is a background only application
[NSBundle loadNibNamed:@"MainMenu" owner:[NSApplication sharedApplication]];
//finally run everything
[[NSApplication sharedApplication] run];
[pool release];
return 0;
}