From: Joe Wreschnig Date: Wed, 20 Mar 2013 20:55:49 +0000 (+0100) Subject: No more visible ivars. X-Git-Tag: version-1.1~5 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=7c9337b7789b0e940cc71f02c7cb7bd92dd2de70;p=enjoyable.git No more visible ivars. --- diff --git a/Classes/NJOutputViewController.h b/Classes/NJOutputViewController.h index a35c735..fe251cd 100644 --- a/Classes/NJOutputViewController.h +++ b/Classes/NJOutputViewController.h @@ -14,19 +14,19 @@ @protocol NJOutputViewControllerDelegate; -@interface NJOutputViewController : NSObject { - IBOutlet NJKeyInputField *keyInput; - IBOutlet NSMatrix *radioButtons; - IBOutlet NSSegmentedControl *mouseDirSelect; - IBOutlet NSSlider *mouseSpeedSlider; - IBOutlet NSSegmentedControl *mouseBtnSelect; - IBOutlet NSSegmentedControl *scrollDirSelect; - IBOutlet NSSlider *scrollSpeedSlider; - IBOutlet NSTextField *title; - IBOutlet NSPopUpButton *mappingPopup; - IBOutlet NSButton *smoothCheck; - IBOutlet NSButton *unknownMapping; -} +@interface NJOutputViewController : NSObject + +@property (nonatomic, strong) IBOutlet NJKeyInputField *keyInput; +@property (nonatomic, strong) IBOutlet NSMatrix *radioButtons; +@property (nonatomic, strong) IBOutlet NSSegmentedControl *mouseDirSelect; +@property (nonatomic, strong) IBOutlet NSSlider *mouseSpeedSlider; +@property (nonatomic, strong) IBOutlet NSSegmentedControl *mouseBtnSelect; +@property (nonatomic, strong) IBOutlet NSSegmentedControl *scrollDirSelect; +@property (nonatomic, strong) IBOutlet NSSlider *scrollSpeedSlider; +@property (nonatomic, strong) IBOutlet NSTextField *title; +@property (nonatomic, strong) IBOutlet NSPopUpButton *mappingPopup; +@property (nonatomic, strong) IBOutlet NSButton *smoothCheck; +@property (nonatomic, strong) IBOutlet NSButton *unknownMapping; @property (nonatomic, weak) IBOutlet id delegate; diff --git a/Classes/NJOutputViewController.m b/Classes/NJOutputViewController.m index ee5d260..0ca3938 100644 --- a/Classes/NJOutputViewController.m +++ b/Classes/NJOutputViewController.m @@ -39,127 +39,128 @@ } - (void)cleanUpInterface { - NSInteger row = radioButtons.selectedRow; + NSInteger row = self.radioButtons.selectedRow; if (row != 1) { - keyInput.keyCode = NJKeyInputFieldEmpty; - [keyInput resignIfFirstResponder]; + self.keyInput.keyCode = NJKeyInputFieldEmpty; + [self.keyInput resignIfFirstResponder]; } if (row != 2) { - [mappingPopup selectItemAtIndex:-1]; - [mappingPopup resignIfFirstResponder]; - unknownMapping.hidden = YES; + [self.mappingPopup selectItemAtIndex:-1]; + [self.mappingPopup resignIfFirstResponder]; + self.unknownMapping.hidden = YES; } if (row != 3) { - mouseDirSelect.selectedSegment = -1; - mouseSpeedSlider.floatValue = mouseSpeedSlider.minValue; - [mouseDirSelect resignIfFirstResponder]; + self.mouseDirSelect.selectedSegment = -1; + self.mouseSpeedSlider.floatValue = self.mouseSpeedSlider.minValue; + [self.mouseDirSelect resignIfFirstResponder]; } else { - if (mouseDirSelect.selectedSegment == -1) - mouseDirSelect.selectedSegment = 0; - if (!mouseSpeedSlider.floatValue) - mouseSpeedSlider.floatValue = 10; + if (self.mouseDirSelect.selectedSegment == -1) + self.mouseDirSelect.selectedSegment = 0; + if (!self.mouseSpeedSlider.floatValue) + self.mouseSpeedSlider.floatValue = 10; } if (row != 4) { - mouseBtnSelect.selectedSegment = -1; - [mouseBtnSelect resignIfFirstResponder]; - } else if (mouseBtnSelect.selectedSegment == -1) - mouseBtnSelect.selectedSegment = 0; + self.mouseBtnSelect.selectedSegment = -1; + [self.mouseBtnSelect resignIfFirstResponder]; + } else if (self.mouseBtnSelect.selectedSegment == -1) + self.mouseBtnSelect.selectedSegment = 0; if (row != 5) { - scrollDirSelect.selectedSegment = -1; - scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue; - smoothCheck.state = NSOffState; - [scrollDirSelect resignIfFirstResponder]; - [scrollSpeedSlider resignIfFirstResponder]; - [smoothCheck resignIfFirstResponder]; + self.scrollDirSelect.selectedSegment = -1; + self.scrollSpeedSlider.floatValue = self.scrollSpeedSlider.minValue; + self.smoothCheck.state = NSOffState; + [self.scrollDirSelect resignIfFirstResponder]; + [self.scrollSpeedSlider resignIfFirstResponder]; + [self.smoothCheck resignIfFirstResponder]; } else { - if (scrollDirSelect.selectedSegment == -1) - scrollDirSelect.selectedSegment = 0; + if (self.scrollDirSelect.selectedSegment == -1) + self.scrollDirSelect.selectedSegment = 0; } } - (IBAction)radioChanged:(NSView *)sender { [sender.window makeFirstResponder:sender]; - if (radioButtons.selectedRow == 1) - [keyInput.window makeFirstResponder:keyInput]; + if (self.radioButtons.selectedRow == 1) + [self.keyInput.window makeFirstResponder:self.keyInput]; [self commit]; } - (void)keyInputField:(NJKeyInputField *)keyInput didChangeKey:(CGKeyCode)keyCode { - [radioButtons selectCellAtRow:1 column:0]; - [radioButtons.window makeFirstResponder:radioButtons]; + [self.radioButtons selectCellAtRow:1 column:0]; + [self.radioButtons.window makeFirstResponder:self.radioButtons]; [self commit]; } - (void)keyInputFieldDidClear:(NJKeyInputField *)keyInput { - [radioButtons selectCellAtRow:0 column:0]; + [self.radioButtons selectCellAtRow:0 column:0]; [self commit]; } - (void)mappingChosen:(id)sender { - [radioButtons selectCellAtRow:2 column:0]; - [mappingPopup.window makeFirstResponder:mappingPopup]; - unknownMapping.hidden = YES; + [self.radioButtons selectCellAtRow:2 column:0]; + [self.mappingPopup.window makeFirstResponder:self.mappingPopup]; + self.unknownMapping.hidden = YES; [self commit]; } - (void)mdirChanged:(NSView *)sender { - [radioButtons selectCellAtRow:3 column:0]; + [self.radioButtons selectCellAtRow:3 column:0]; [sender.window makeFirstResponder:sender]; [self commit]; } - (void)mouseSpeedChanged:(NSSlider *)sender { - [radioButtons selectCellAtRow:3 column:0]; + [self.radioButtons selectCellAtRow:3 column:0]; [sender.window makeFirstResponder:sender]; [self commit]; } - (void)mbtnChanged:(NSView *)sender { - [radioButtons selectCellAtRow:4 column:0]; + [self.radioButtons selectCellAtRow:4 column:0]; [sender.window makeFirstResponder:sender]; [self commit]; } - (void)sdirChanged:(NSView *)sender { - [radioButtons selectCellAtRow:5 column:0]; + [self.radioButtons selectCellAtRow:5 column:0]; [sender.window makeFirstResponder:sender]; [self commit]; } - (void)scrollSpeedChanged:(NSSlider *)sender { - [radioButtons selectCellAtRow:5 column:0]; + [self.radioButtons selectCellAtRow:5 column:0]; [sender.window makeFirstResponder:sender]; [self commit]; } - (IBAction)scrollTypeChanged:(NSButton *)sender { - [radioButtons selectCellAtRow:5 column:0]; + [self.radioButtons selectCellAtRow:5 column:0]; [sender.window makeFirstResponder:sender]; if (sender.state == NSOnState) { - scrollSpeedSlider.floatValue = - scrollSpeedSlider.minValue + (scrollSpeedSlider.maxValue - scrollSpeedSlider.minValue) / 2; - scrollSpeedSlider.enabled = YES; + self.scrollSpeedSlider.floatValue = + self.scrollSpeedSlider.minValue + + (self.scrollSpeedSlider.maxValue - self.scrollSpeedSlider.minValue) / 2; + self.scrollSpeedSlider.enabled = YES; } else { - scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue; - scrollSpeedSlider.enabled = NO; + self.scrollSpeedSlider.floatValue = self.scrollSpeedSlider.minValue; + self.scrollSpeedSlider.enabled = NO; } [self commit]; } - (NJOutput *)makeOutput { - switch (radioButtons.selectedRow) { + switch (self.radioButtons.selectedRow) { case 0: return nil; case 1: - if (keyInput.hasKeyCode) { + if (self.keyInput.hasKeyCode) { NJOutputKeyPress *k = [[NJOutputKeyPress alloc] init]; - k.keyCode = keyInput.keyCode; + k.keyCode = self.keyInput.keyCode; return k; } else { return nil; @@ -168,25 +169,25 @@ case 2: { NJOutputMapping *c = [[NJOutputMapping alloc] init]; c.mapping = [self.delegate outputViewController:self - mappingForIndex:mappingPopup.indexOfSelectedItem]; + mappingForIndex:self.mappingPopup.indexOfSelectedItem]; return c; } case 3: { NJOutputMouseMove *mm = [[NJOutputMouseMove alloc] init]; - mm.axis = mouseDirSelect.selectedSegment; - mm.speed = mouseSpeedSlider.floatValue; + mm.axis = self.mouseDirSelect.selectedSegment; + mm.speed = self.mouseSpeedSlider.floatValue; return mm; } case 4: { NJOutputMouseButton *mb = [[NJOutputMouseButton alloc] init]; - mb.button = [mouseBtnSelect.cell tagForSegment:mouseBtnSelect.selectedSegment]; + mb.button = [self.mouseBtnSelect.cell tagForSegment:self.mouseBtnSelect.selectedSegment]; return mb; } case 5: { NJOutputMouseScroll *ms = [[NJOutputMouseScroll alloc] init]; - ms.direction = [scrollDirSelect.cell tagForSegment:scrollDirSelect.selectedSegment]; - ms.speed = scrollSpeedSlider.floatValue; - ms.smooth = smoothCheck.state == NSOnState; + ms.direction = [self.scrollDirSelect.cell tagForSegment:self.scrollDirSelect.selectedSegment]; + ms.speed = self.scrollSpeedSlider.floatValue; + ms.smooth = self.smoothCheck.state == NSOnState; return ms; } default: @@ -202,91 +203,92 @@ } - (BOOL)enabled { - return radioButtons.isEnabled; + return self.radioButtons.isEnabled; } - (void)setEnabled:(BOOL)enabled { - radioButtons.enabled = enabled; - keyInput.enabled = enabled; - mappingPopup.enabled = enabled; - mouseDirSelect.enabled = enabled; - mouseSpeedSlider.enabled = enabled; - mouseBtnSelect.enabled = enabled; - scrollDirSelect.enabled = enabled; - smoothCheck.enabled = enabled; - scrollSpeedSlider.enabled = enabled && smoothCheck.state; + self.radioButtons.enabled = enabled; + self.keyInput.enabled = enabled; + self.mappingPopup.enabled = enabled; + self.mouseDirSelect.enabled = enabled; + self.mouseSpeedSlider.enabled = enabled; + self.mouseBtnSelect.enabled = enabled; + self.scrollDirSelect.enabled = enabled; + self.smoothCheck.enabled = enabled; + self.scrollSpeedSlider.enabled = enabled && self.smoothCheck.state; if (!enabled) - unknownMapping.hidden = YES; + self.unknownMapping.hidden = YES; } - (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input { _input = input; if (!input) { [self setEnabled:NO]; - title.stringValue = @""; + self.title.stringValue = @""; } else { [self setEnabled:YES]; NSString *inpFullName = input.name; for (NJInputPathElement *cur = input.parent; cur; cur = cur.parent) { inpFullName = [[NSString alloc] initWithFormat:@"%@ ▸ %@", cur.name, inpFullName]; } - title.stringValue = inpFullName; + self.title.stringValue = inpFullName; } if ([output isKindOfClass:NJOutputKeyPress.class]) { - [radioButtons selectCellAtRow:1 column:0]; - keyInput.keyCode = [(NJOutputKeyPress*)output keyCode]; + [self.radioButtons selectCellAtRow:1 column:0]; + self.keyInput.keyCode = [(NJOutputKeyPress*)output keyCode]; } else if ([output isKindOfClass:NJOutputMapping.class]) { - [radioButtons selectCellAtRow:2 column:0]; - NSMenuItem *item = [mappingPopup itemWithIdenticalRepresentedObject:[(NJOutputMapping *)output mapping]]; - [mappingPopup selectItem:item]; - unknownMapping.hidden = !!item; - unknownMapping.title = [(NJOutputMapping *)output mappingName]; + [self.radioButtons selectCellAtRow:2 column:0]; + NSMenuItem *item = [self.mappingPopup itemWithIdenticalRepresentedObject: + [(NJOutputMapping *)output mapping]]; + [self.mappingPopup selectItem:item]; + self.unknownMapping.hidden = !!item; + self.unknownMapping.title = [(NJOutputMapping *)output mappingName]; } else if ([output isKindOfClass:NJOutputMouseMove.class]) { - [radioButtons selectCellAtRow:3 column:0]; - mouseDirSelect.selectedSegment = [(NJOutputMouseMove *)output axis]; - mouseSpeedSlider.floatValue = [(NJOutputMouseMove *)output speed]; + [self.radioButtons selectCellAtRow:3 column:0]; + self.mouseDirSelect.selectedSegment = [(NJOutputMouseMove *)output axis]; + self.mouseSpeedSlider.floatValue = [(NJOutputMouseMove *)output speed]; } else if ([output isKindOfClass:NJOutputMouseButton.class]) { - [radioButtons selectCellAtRow:4 column:0]; - [mouseBtnSelect selectSegmentWithTag:[(NJOutputMouseButton *)output button]]; + [self.radioButtons selectCellAtRow:4 column:0]; + [self.mouseBtnSelect selectSegmentWithTag:[(NJOutputMouseButton *)output button]]; } else if ([output isKindOfClass:NJOutputMouseScroll.class]) { - [radioButtons selectCellAtRow:5 column:0]; + [self.radioButtons selectCellAtRow:5 column:0]; int direction = [(NJOutputMouseScroll *)output direction]; float speed = [(NJOutputMouseScroll *)output speed]; BOOL smooth = [(NJOutputMouseScroll *)output smooth]; - [scrollDirSelect selectSegmentWithTag:direction]; - scrollSpeedSlider.floatValue = speed; - smoothCheck.state = smooth ? NSOnState : NSOffState; - scrollSpeedSlider.enabled = smooth; + [self.scrollDirSelect selectSegmentWithTag:direction]; + self.scrollSpeedSlider.floatValue = speed; + self.smoothCheck.state = smooth ? NSOnState : NSOffState; + self.scrollSpeedSlider.enabled = smooth; } else { - [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0]; + [self.radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0]; } [self cleanUpInterface]; } - (void)focusKey { - if (radioButtons.selectedRow <= 1) - [keyInput.window makeFirstResponder:keyInput]; + if (self.radioButtons.selectedRow <= 1) + [self.keyInput.window makeFirstResponder:self.keyInput]; else - [keyInput resignIfFirstResponder]; + [self.keyInput resignIfFirstResponder]; } - (void)mappingListDidChange:(NSNotification *)note { NSArray *mappings = note.userInfo[NJMappingListKey]; - NJMapping *current = mappingPopup.selectedItem.representedObject; - [mappingPopup.menu removeAllItems]; + NJMapping *current = self.mappingPopup.selectedItem.representedObject; + [self.mappingPopup.menu removeAllItems]; for (NJMapping *mapping in mappings) { NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name action:@selector(mappingChosen:) keyEquivalent:@""]; item.target = self; item.representedObject = mapping; - [mappingPopup.menu addItem:item]; + [self.mappingPopup.menu addItem:item]; } - [mappingPopup selectItemWithIdenticalRepresentedObject:current]; + [self.mappingPopup selectItemWithIdenticalRepresentedObject:current]; } @end diff --git a/Info.plist b/Info.plist index 8ad8cc0..64274c3 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 571 + 573 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright diff --git a/Resources/English.lproj/MainMenu.xib b/Resources/English.lproj/MainMenu.xib index 15e852a..7a2e668 100644 --- a/Resources/English.lproj/MainMenu.xib +++ b/Resources/English.lproj/MainMenu.xib @@ -488,7 +488,7 @@ {664, 323} - + 256 @@ -500,6 +500,7 @@ -2147483374 {{20, 20}, {194, 283}} + _NS:22 YES @@ -529,6 +530,7 @@ Lg 274 {{20, 20}, {194, 283}} + _NS:22 YES @@ -563,6 +565,7 @@ aW5nLg {232, 321} + YES NO @@ -658,6 +661,7 @@ aW5nLg {{1, 1}, {232, 321}} + @@ -668,6 +672,7 @@ aW5nLg -2147483392 {{1, 1}, {8, 298}} + NO @@ -679,6 +684,7 @@ aW5nLg -2147483392 {{-100, -100}, {473, 15}} + NO 1 @@ -689,6 +695,7 @@ aW5nLg {234, 323} + 150034 @@ -702,6 +709,7 @@ aW5nLg {234, 323} + _NS:9 NSView @@ -715,6 +723,7 @@ aW5nLg 268 {{197, 157}, {193, 21}} + _NS:9 YES @@ -739,6 +748,7 @@ aW5nLg 265 {{189, 117}, {224, 20}} + _NS:9 YES @@ -780,6 +790,7 @@ aW5nLg 268 {{343, 31}, {70, 18}} + _NS:9 YES @@ -810,6 +821,7 @@ aW5nLg 265 {{189, 33}, {150, 20}} + _NS:9 YES @@ -854,6 +866,7 @@ aW5nLg 265 {{191, 24}, {146, 16}} + _NS:9 YES @@ -879,6 +892,7 @@ aW5nLg 265 {{189, 70}, {224, 24}} + _NS:9 YES @@ -932,6 +946,7 @@ aW5nLg 265 {{191, 108}, {220, 16}} + _NS:9 YES @@ -957,6 +972,7 @@ aW5nLg 265 {{191, 196}, {220, 23}} + _NS:9 NJKeyInputField @@ -966,6 +982,7 @@ aW5nLg 265 {{188, 153}, {226, 26}} + YES @@ -998,6 +1015,7 @@ aW5nLg 268 {{24, 20}, {163, 250}} + NO 6 @@ -1128,6 +1146,7 @@ aW5nLg 266 {{9, 286}, {412, 17}} + YES @@ -1151,6 +1170,7 @@ aW5nLg 10 {{12, 276}, {406, 5}} + {0, 0} @@ -1177,12 +1197,15 @@ aW5nLg {{233, 0}, {431, 323}} + _NS:9 NSView {664, 323} + + {{0, 0}, {1440, 878}} @@ -1287,7 +1310,7 @@ aW5nLg YES - + 256 @@ -1303,6 +1326,7 @@ aW5nLg 256 {198, 198} + YES NO @@ -1360,6 +1384,7 @@ aW5nLg {{1, 1}, {198, 198}} + @@ -1370,6 +1395,7 @@ aW5nLg -2147483392 {{306, 1}, {15, 403}} + NO @@ -1381,6 +1407,7 @@ aW5nLg -2147483392 {{-100, -100}, {366, 16}} + NO 1 @@ -1391,6 +1418,7 @@ aW5nLg {{0, 20}, {200, 200}} + 150034 @@ -1406,6 +1434,7 @@ aW5nLg 268 {{66, -1}, {68, 23}} + _NS:22 YES @@ -1434,6 +1463,7 @@ aW5nLg 292 {{0, -1}, {34, 23}} + YES @@ -1460,6 +1490,7 @@ aW5nLg 292 {{166, -1}, {34, 23}} + YES 67108864 @@ -1481,6 +1512,7 @@ aW5nLg 292 {{133, -1}, {34, 23}} + YES @@ -1503,6 +1535,7 @@ aW5nLg 292 {{33, -1}, {34, 23}} + YES @@ -1526,6 +1559,8 @@ aW5nLg {200, 220} + + NSView @@ -3311,7 +3346,400 @@ aW5nLg 1037 - + + + + EnjoyableApplicationDelegate + NSObject + + id + id + id + NSButton + + + + exportMappingClicked: + id + + + importMappingClicked: + id + + + restoreToForeground: + id + + + simulatingEventsChanged: + NSButton + + + + NSMenu + NJDeviceViewController + NJInputController + NJMappingsViewController + NJOutputViewController + NSButton + NSMenu + NSWindow + + + + dockMenu + NSMenu + + + dvc + NJDeviceViewController + + + ic + NJInputController + + + mvc + NJMappingsViewController + + + oc + NJOutputViewController + + + simulatingEventsButton + NSButton + + + statusItemMenu + NSMenu + + + window + NSWindow + + + + IBProjectSource + ./Classes/EnjoyableApplicationDelegate.h + + + + NJDeviceViewController + NSObject + + id + NSView + NSOutlineView + NSView + + + + delegate + id + + + hidStoppedNotice + NSView + + + inputsTree + NSOutlineView + + + noDevicesNotice + NSView + + + + IBProjectSource + ./Classes/NJDeviceViewController.h + + + + NJInputController + NSObject + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + ./Classes/NJInputController.h + + + + NJKeyInputField + NSControl + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + ./Classes/NJKeyInputField.h + + + + NJMappingMenuController + NSObject + + id + NSMenuItem + NSMenu + + + + delegate + id + + + eventSimulationToggle + NSMenuItem + + + menu + NSMenu + + + + IBProjectSource + ./Classes/NJMappingMenuController.h + + + + NJMappingsViewController + NSViewController + + id + id + id + id + id + + + + addClicked: + id + + + mappingTriggerClicked: + id + + + moveDownClicked: + id + + + moveUpClicked: + id + + + removeClicked: + id + + + + id + NSTableView + NSPopover + NSButton + NSButton + NSButton + NSButton + + + + delegate + id + + + mappingList + NSTableView + + + mappingListPopover + NSPopover + + + mappingListTrigger + NSButton + + + moveDown + NSButton + + + moveUp + NSButton + + + removeMapping + NSButton + + + + IBProjectSource + ./Classes/NJMappingsViewController.h + + + + NJOutputViewController + NSObject + + id + id + id + id + id + id + id + + + + mbtnChanged: + id + + + mdirChanged: + id + + + mouseSpeedChanged: + id + + + radioChanged: + id + + + scrollSpeedChanged: + id + + + scrollTypeChanged: + id + + + sdirChanged: + id + + + + id + NJKeyInputField + NSPopUpButton + NSSegmentedControl + NSSegmentedControl + NSSlider + NSMatrix + NSSegmentedControl + NSSlider + NSButton + NSTextField + NSButton + + + + delegate + id + + + keyInput + NJKeyInputField + + + mappingPopup + NSPopUpButton + + + mouseBtnSelect + NSSegmentedControl + + + mouseDirSelect + NSSegmentedControl + + + mouseSpeedSlider + NSSlider + + + radioButtons + NSMatrix + + + scrollDirSelect + NSSegmentedControl + + + scrollSpeedSlider + NSSlider + + + smoothCheck + NSButton + + + title + NSTextField + + + unknownMapping + NSButton + + + + IBProjectSource + ./Classes/NJOutputViewController.h + + + + SUUpdater + NSObject + + checkForUpdates: + id + + + checkForUpdates: + + checkForUpdates: + id + + + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + ./Classes/SUUpdater.h + + + + 0 IBCocoaFramework YES