X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=JoystickController.m;h=97ca74b6e10e7e42d86264d70ae50f66e2408c5a;hp=13db938c8d33febd60669a0dd10104111314230d;hb=60710a84810cfbfa39ada9a9e44f61ceb2f144c5;hpb=cc2c6ed12ca38c56a4263d95af75692d6cf716a5 diff --git a/JoystickController.m b/JoystickController.m index 13db938..97ca74b 100644 --- a/JoystickController.m +++ b/JoystickController.m @@ -20,15 +20,9 @@ NSMutableArray *runningTargets; } -@synthesize joysticks; -@synthesize selectedAction; -@synthesize frontWindowOnly; -@synthesize mouseLoc; -@synthesize sendingRealEvents; - - (id)init { if ((self = [super init])) { - joysticks = [[NSMutableArray alloc] initWithCapacity:16]; + _joysticks = [[NSMutableArray alloc] initWithCapacity:16]; runningTargets = [[NSMutableArray alloc] initWithCapacity:32]; } return self; @@ -112,7 +106,7 @@ static void add_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDDevi } - (Joystick *)findJoystickByRef:(IOHIDDeviceRef)device { - for (Joystick *js in joysticks) + for (Joystick *js in _joysticks) if (js.device == device) return js; return nil; @@ -133,7 +127,6 @@ static void remove_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDD for (Target *target in [runningTargets copy]) { if (![target update:self]) { [runningTargets removeObject:target]; - NSLog(@"Removing action, now running %lu.", runningTargets.count); } } if (!runningTargets.count) { @@ -183,7 +176,7 @@ static void remove_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDD } - (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { - return item ? [[item children] count] : [joysticks count]; + return item ? [[item children] count] : _joysticks.count; } - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { @@ -191,7 +184,7 @@ static void remove_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDD } - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { - return item ? [item children][index] : joysticks[index]; + return item ? [item children][index] : _joysticks[index]; } - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { @@ -200,9 +193,8 @@ static void remove_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDD return [item name]; } -- (void)outlineViewSelectionDidChange: (NSNotification*) notification { - [targetController reset]; - [targetController load]; +- (void)outlineViewSelectionDidChange:(NSNotification *)notification { + [targetController loadCurrent]; } @end