diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-13 21:31:56 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-13 21:31:56 +0000 |
| commit | de50d760fd03a7eed9a614a3d4a701f2097c88d9 (patch) | |
| tree | abd27fe9c76372b7b819670dd15ec859de94e164 /macosx/HotkeyController.m | |
| parent | 56d5b481986072f06ac516f43b68ec1d5b3aac1b (diff) | |
| download | pcsxr-de50d760fd03a7eed9a614a3d4a701f2097c88d9.tar.gz | |
Changing a few Objective C classes to have their ivars hidden.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87167 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/HotkeyController.m')
| -rwxr-xr-x | macosx/HotkeyController.m | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/macosx/HotkeyController.m b/macosx/HotkeyController.m index d705762f..502105dc 100755 --- a/macosx/HotkeyController.m +++ b/macosx/HotkeyController.m @@ -11,17 +11,29 @@ #define INPUT_HOLD_TIME 0.1 +@interface HotkeyController () +@property (strong) NSButton *lastConfigButton; +@property (strong) NSMutableDictionary *hotkeysList; +@property (strong) NSDictionary *keyNameTable; +@property (strong) NSMutableDictionary *hotkeyOutlets; +@end + @implementation HotkeyController -@synthesize configInput; +@synthesize FastForward; +@synthesize FrameLimit; +@synthesize LoadState; +@synthesize NextState; +@synthesize PrevState; +@synthesize SaveState; - (void)initialize { - lastConfigButton = nil; - configInput = 0; - hotkeysList = [[NSMutableDictionary alloc] initWithCapacity:16]; - keyNameTable = [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"KeyNames" ofType:@"plist"]]; - hotkeyOutlets = [[NSMutableDictionary alloc] initWithCapacity:8]; + self.lastConfigButton = nil; + self.configInput = 0; + self.hotkeysList = [[NSMutableDictionary alloc] initWithCapacity:16]; + self.keyNameTable = [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"KeyNames" ofType:@"plist"]]; + self.hotkeyOutlets = [[NSMutableDictionary alloc] initWithCapacity:8]; [self mapOutletToIdentifier:FastForward forIdentifier:@"FastForward"]; [self mapOutletToIdentifier:SaveState forIdentifier:@"SaveState"]; @@ -36,16 +48,16 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (void)mapOutletToIdentifier:(id)outlet forIdentifier:(NSString*)identifier +- (void)mapOutletToIdentifier:(id)outlet forIdentifier:(NSString*)identifier1 { - hotkeyOutlets[identifier] = outlet; - [self setHotkeyDisplay:identifier]; + (self.hotkeyOutlets)[identifier1] = outlet; + [self setHotkeyDisplay:identifier1]; } - (void)setHotkeyDisplay:(NSString*)keyIdent { NSString *label = [self parseMappingDisplayString:keyIdent]; - NSTextField *displayField = hotkeyOutlets[keyIdent]; + NSTextField *displayField = (self.hotkeyOutlets)[keyIdent]; if(displayField) { [[displayField cell] setStringValue:label]; @@ -96,7 +108,7 @@ - (BOOL) handleMouseDown:(NSEvent *)mouseEvent { - if (configInput != 0) + if (self.configInput != 0) { [self hotkeyCancel]; } @@ -107,12 +119,12 @@ - (void)keyDown:(NSEvent *)theEvent { NSString *keyCode = [NSString stringWithFormat:@"%d", [theEvent keyCode]]; - NSString *keyLabel = (NSString *)[keyNameTable valueForKey:keyCode]; + NSString *keyLabel = (NSString *) (self.keyNameTable)[keyCode]; - if (configInput != 0) + if (self.configInput != 0) { // Save input - NSString *ident = [lastConfigButton identifier]; + NSString *ident = [self.lastConfigButton identifier]; [self saveHotkey:ident device:@"NSEventKeyboard" deviceLabel:@"Keyboard" code:keyCode label:keyLabel]; [self setHotkeyDisplay:ident]; [self hotkeyCancel]; @@ -152,16 +164,16 @@ { NSButton *theButton = (NSButton *)sender; - if (configInput && lastConfigButton != theButton) + if (self.configInput && self.lastConfigButton != theButton) { - [lastConfigButton setState:NSOffState]; + [self.lastConfigButton setState:NSOffState]; } if ([theButton state] == NSOnState) { - lastConfigButton = theButton; - [hotkeysList removeAllObjects]; - configInput = [theButton tag]; + self.lastConfigButton = theButton; + [self.hotkeysList removeAllObjects]; + self.configInput = [theButton tag]; } else { @@ -172,13 +184,13 @@ - (void) hotkeyCancel { - if (lastConfigButton != nil) + if (self.lastConfigButton != nil) { - [lastConfigButton setState:NSOffState]; - lastConfigButton = nil; + [self.lastConfigButton setState:NSOffState]; + self.lastConfigButton = nil; } - configInput = 0; + self.configInput = 0; } - (BOOL)acceptsFirstResponder |
