diff --git a/Boxer/Application Delegate/BXAppController+BXGamesFolder.m b/Boxer/Application Delegate/BXAppController+BXGamesFolder.m index c551e97f..71badba3 100644 --- a/Boxer/Application Delegate/BXAppController+BXGamesFolder.m +++ b/Boxer/Application Delegate/BXAppController+BXGamesFolder.m @@ -142,7 +142,6 @@ - (NSURL *) shelfArtworkURL { BOOL useRetinaAssets = NO; //10.7 and up - if ([[NSScreen mainScreen] respondsToSelector: @selector(convertRectToBacking:)]) { NSRect backingPixel = [[NSScreen mainScreen] convertRectToBacking: NSMakeRect(0, 0, 1, 1)]; useRetinaAssets = (backingPixel.size.width >= 2.0); diff --git a/Boxer/BXImportWindowController.m b/Boxer/BXImportWindowController.m index 01852424..2dd384ee 100644 --- a/Boxer/BXImportWindowController.m +++ b/Boxer/BXImportWindowController.m @@ -25,8 +25,7 @@ - (void) windowDidLoad self.currentPanel = self.dropzonePanel; //Disable window restoration. - if ([self.window respondsToSelector: @selector(setRestorable:)]) - self.window.restorable = NO; + self.window.restorable = NO; //Observe ourselves for changes to the document or its import stage, //so we can sync the active panel. @@ -148,7 +147,6 @@ - (void) handOffToController: (NSWindowController *)controller //Suppress the default Lion window animations... NSWindowAnimationBehavior oldToBehavior = NSWindowAnimationBehaviorDefault, oldFromBehavior = NSWindowAnimationBehaviorDefault; - if ([toWindow respondsToSelector: @selector(setAnimationBehavior:)]) { oldToBehavior = toWindow.animationBehavior; oldFromBehavior = fromWindow.animationBehavior; @@ -165,7 +163,6 @@ - (void) handOffToController: (NSWindowController *)controller [fromWindow orderOut: self]; //...and then turn the Lion animations back on after the transition is complete. - if ([toWindow respondsToSelector: @selector(setAnimationBehavior:)]) { toWindow.animationBehavior = oldToBehavior; fromWindow.animationBehavior = oldFromBehavior; @@ -195,7 +192,6 @@ - (void) pickUpFromController: (NSWindowController *)controller //Suppress the default Lion window animations... NSWindowAnimationBehavior oldToBehavior = NSWindowAnimationBehaviorDefault, oldFromBehavior = NSWindowAnimationBehaviorDefault; - if ([toWindow respondsToSelector: @selector(setAnimationBehavior:)]) { oldToBehavior = toWindow.animationBehavior; oldFromBehavior = fromWindow.animationBehavior; @@ -215,7 +211,6 @@ - (void) pickUpFromController: (NSWindowController *)controller [fromWindow orderOut: self]; //...and then turn them back on after the transition is complete. - if ([toWindow respondsToSelector: @selector(setAnimationBehavior:)]) { toWindow.animationBehavior = oldToBehavior; fromWindow.animationBehavior = oldFromBehavior; diff --git a/Boxer/BXScroller.m b/Boxer/BXScroller.m index 4c307292..72eb57df 100644 --- a/Boxer/BXScroller.m +++ b/Boxer/BXScroller.m @@ -29,7 +29,7 @@ - (BOOL) isVertical - (NSSize) knobMargin { - if ([self respondsToSelector: @selector(scrollerStyle)] && [self scrollerStyle] == NSScrollerStyleOverlay) + if ([self scrollerStyle] == NSScrollerStyleOverlay) { return NSMakeSize(2.0f, 3.0f); } @@ -41,7 +41,7 @@ - (NSSize) knobMargin - (NSSize) slotMargin { - if ([self respondsToSelector: @selector(scrollerStyle)] && [self scrollerStyle] == NSScrollerStyleOverlay) + if ([self scrollerStyle] == NSScrollerStyleOverlay) { return NSMakeSize(1.0f, 2.0f); } @@ -88,17 +88,7 @@ - (BOOL) isOpaque { return NO; } - (void) drawRect: (NSRect)dirtyRect { //On 10.7 and above, the regular NSScroller class should handle drawing - if ([self respondsToSelector: @selector(scrollerStyle)]) - { - [super drawRect: dirtyRect]; - } - //On 10.6 and below, we wish to override drawing to avoid drawing the 'caps' - //on the end of the standard scroller. - else - { - [self drawKnobSlotInRect: [self rectForPart: NSScrollerKnobSlot] highlight: NO]; - [self drawKnob]; - } + [super drawRect: dirtyRect]; } - (void) drawKnob @@ -186,7 +176,7 @@ @implementation BXHUDScroller - (NSSize) knobMargin { - if ([self respondsToSelector: @selector(scrollerStyle)] && [self scrollerStyle] == NSScrollerStyleOverlay) + if ([self scrollerStyle] == NSScrollerStyleOverlay) { return NSMakeSize(2.0f, 2.0f); } @@ -198,7 +188,7 @@ - (NSSize) knobMargin - (NSSize) slotMargin { - if ([self respondsToSelector: @selector(scrollerStyle)] && [self scrollerStyle] == NSScrollerStyleOverlay) + if ([self scrollerStyle] == NSScrollerStyleOverlay) { return NSMakeSize(1.0f, 1.0f); } diff --git a/Boxer/BXShelfArt.m b/Boxer/BXShelfArt.m index e5188093..24322d1f 100644 --- a/Boxer/BXShelfArt.m +++ b/Boxer/BXShelfArt.m @@ -64,7 +64,6 @@ - (NSImage *) tiledImageWithPixelSize: (NSSize)pixelSize NSSize logicalSize = pixelSize; //TODO: ask our drawing context to do the conversion itself - if ([[NSScreen mainScreen] respondsToSelector: @selector(convertRectFromBacking:)]) { NSRect pixelFrame = NSMakeRect(0, 0, pixelSize.width, pixelSize.height); logicalSize = [[NSScreen mainScreen] convertRectFromBacking: pixelFrame].size; diff --git a/Boxer/DOS window/BXDOSWindowController.m b/Boxer/DOS window/BXDOSWindowController.m index 72ed2943..8579ac0a 100644 --- a/Boxer/DOS window/BXDOSWindowController.m +++ b/Boxer/DOS window/BXDOSWindowController.m @@ -171,8 +171,7 @@ - (void) windowDidLoad self.window.acceptsMouseMovedEvents = YES; //Disable window restoration. - if ([self.window respondsToSelector: @selector(setRestorable:)]) - self.window.restorable = NO; + self.window.restorable = NO; //Adjust the window's initial dimensions to suit the current aspect-ratio correction settings. BOOL aspectCorrectText = [[NSUserDefaults standardUserDefaults] boolForKey: @"aspectCorrectedText"]; diff --git a/Boxer/DOS window/BXLaunchPanelController.m b/Boxer/DOS window/BXLaunchPanelController.m index ff6bae59..17d94401 100644 --- a/Boxer/DOS window/BXLaunchPanelController.m +++ b/Boxer/DOS window/BXLaunchPanelController.m @@ -62,14 +62,11 @@ - (void) viewDidLoad { [super viewDidLoad]; //These attributes are unsupported in 10.6 and so cannot be defined in the XIB. - if ([self.launcherScrollView respondsToSelector: @selector(setScrollerKnobStyle:)]) - self.launcherScrollView.scrollerKnobStyle = NSScrollerKnobStyleLight; + self.launcherScrollView.scrollerKnobStyle = NSScrollerKnobStyleLight; - if ([self.launcherScrollView respondsToSelector: @selector(setUsesPredominantAxisScrolling:)]) - self.launcherScrollView.usesPredominantAxisScrolling = YES; + self.launcherScrollView.usesPredominantAxisScrolling = YES; - if ([self.launcherScrollView respondsToSelector: @selector(setHorizontalScrollElasticity:)]) - self.launcherScrollView.horizontalScrollElasticity = NSScrollElasticityNone; + self.launcherScrollView.horizontalScrollElasticity = NSScrollElasticityNone; } - (void) setRepresentedObject: (id)representedObject diff --git a/Boxer/DOS window/BXProgramPanelController.m b/Boxer/DOS window/BXProgramPanelController.m index dd23301b..03c4c56e 100644 --- a/Boxer/DOS window/BXProgramPanelController.m +++ b/Boxer/DOS window/BXProgramPanelController.m @@ -110,10 +110,7 @@ - (void) awakeFromNib { //Disable vertical scrolling on 10.7: while we can only scroll horizontally, it's still otherwise //possible for the user to pull on the content vertically, and this causes ugly redraw errors. - if ([[self programScroller] respondsToSelector: @selector(setVerticalScrollElasticity:)]) - { - [[self programScroller] setVerticalScrollElasticity: NSScrollElasticityNone]; - } + [[self programScroller] setVerticalScrollElasticity: NSScrollElasticityNone]; } - (void) syncActivePanel diff --git a/Boxer/Documentation Panel/BXDocumentationBrowser.m b/Boxer/Documentation Panel/BXDocumentationBrowser.m index 9ef5d912..e0369bda 100644 --- a/Boxer/Documentation Panel/BXDocumentationBrowser.m +++ b/Boxer/Documentation Panel/BXDocumentationBrowser.m @@ -87,11 +87,9 @@ - (void) setRepresentedObject: (id)representedObject - (void) awakeFromNib { - if ([self.documentationScrollView respondsToSelector: @selector(setUsesPredominantAxisScrolling:)]) - self.documentationScrollView.usesPredominantAxisScrolling = YES; + self.documentationScrollView.usesPredominantAxisScrolling = YES; - if ([self.documentationScrollView respondsToSelector: @selector(setHorizontalScrollElasticity:)]) - self.documentationScrollView.horizontalScrollElasticity = NSScrollElasticityNone; + self.documentationScrollView.horizontalScrollElasticity = NSScrollElasticityNone; [self.view registerForDraggedTypes: @[NSPasteboardTypeFileURL]]; //Allow documentation files to be dragged out of the documentation list to other applications, @@ -195,8 +193,7 @@ - (void) _syncDocumentationURLs [self.delegate documentationBrowser: self didUpdateFromURLs: oldURLs toURLs: newURLs]; //Flash the scrollbars (if any) to indicate that the content of the scroller has changed. - if ([self.documentationScrollView respondsToSelector: @selector(flashScrollers)]) - [self.documentationScrollView flashScrollers]; + [self.documentationScrollView flashScrollers]; } } @@ -837,8 +834,7 @@ - (void) _refreshIcon //Meanwhile, load in a quicklook preview for this file in the background. //Take retina displays into account when calculating the appropriate preview size. NSSize thumbnailSize = self.view.bounds.size; - if ([self.view respondsToSelector: @selector(convertSizeToBacking:)]) - thumbnailSize = [self.view convertSizeToBacking: thumbnailSize]; + thumbnailSize = [self.view convertSizeToBacking: thumbnailSize]; //We perform this in an asynchronous block, because it can take a while //to prepare the thumbnail.