-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathCandidates.m
41 lines (32 loc) · 1.07 KB
/
Candidates.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
//
// AvroKeyboard
//
// Created by Rifat Nabi on 6/21/12.
// Copyright (c) 2012 OmicronLab. All rights reserved.
//
#import "Candidates.h"
static Candidates *_sharedInstance = nil;
static IMKServer *_server = nil;
@implementation Candidates
+ (void)allocateSharedInstanceWithServer:(IMKServer *)server {
if (_sharedInstance == nil) {
_server = server;
_sharedInstance = [[self alloc] initWithServer:server panelType:[[NSUserDefaults standardUserDefaults] integerForKey:@"CandidatePanelType"]];
[_sharedInstance setAttributes:[NSDictionary
dictionaryWithObject:[NSNumber numberWithBool:YES]
forKey:IMKCandidatesSendServerKeyEventFirst]];
[_sharedInstance setDismissesAutomatically:NO];
}
}
+ (void)deallocateSharedInstance {
[_sharedInstance release];
}
+ (Candidates *)sharedInstance; {
return _sharedInstance;
}
+ (void)reallocate {
[_sharedInstance release];
_sharedInstance = nil;
[self allocateSharedInstanceWithServer:_server];
}
@end