From e2a27b93bb684cf4b5fd050c154e0efc10706f9b Mon Sep 17 00:00:00 2001 From: Alun Bestor Date: Sun, 29 Apr 2018 13:00:23 -0400 Subject: [PATCH] Remove manual synthesis from Documentation panel --- .../BXDocumentationBrowser.h | 29 ++++--------------- .../BXDocumentationBrowser.m | 11 ------- .../BXDocumentationPanelController.h | 9 +----- .../BXDocumentationPanelController.m | 5 ---- 4 files changed, 7 insertions(+), 47 deletions(-) diff --git a/Boxer/Documentation Panel/BXDocumentationBrowser.h b/Boxer/Documentation Panel/BXDocumentationBrowser.h index fc5a344ac..13b8e61ae 100644 --- a/Boxer/Documentation Panel/BXDocumentationBrowser.h +++ b/Boxer/Documentation Panel/BXDocumentationBrowser.h @@ -16,17 +16,6 @@ /// BXDocumentationBrowser manages the list of documentation for the gamebox. @interface BXDocumentationBrowser : NSViewController -{ - NSArray *_documentationURLs; - NSIndexSet *_documentationSelectionIndexes; - - __weak NSScrollView *_documentationScrollView; - __weak BXDocumentationList *_documentationList; - __weak NSTextField *_titleLabel; - __weak NSTextField *_helpTextLabel; - - __weak id _delegate; -} #pragma mark - Properties @@ -34,16 +23,16 @@ @property (weak, nonatomic) IBOutlet id delegate; /// The scrolling wrapper in which our documenation list is displayed. -@property (weak, nonatomic) IBOutlet NSScrollView *documentationScrollView; +@property (strong, nonatomic) IBOutlet NSScrollView *documentationScrollView; /// The title at the top of the browser. -@property (weak, nonatomic) IBOutlet NSTextField *titleLabel; +@property (strong, nonatomic) IBOutlet NSTextField *titleLabel; /// The help text displayed at the bottom of the browser. -@property (weak, nonatomic) IBOutlet NSTextField *helpTextLabel; +@property (strong, nonatomic) IBOutlet NSTextField *helpTextLabel; /// The collection view in which our documentation will be displayed. -@property (weak, nonatomic) IBOutlet BXDocumentationList *documentationList; +@property (strong, nonatomic) IBOutlet BXDocumentationList *documentationList; /// An array of NSURLs for the documentation files included in this gamebox. /// This is mapped directly to the documentation URLs reported by the gamebox. @@ -52,7 +41,7 @@ /// An array of criteria for how the documentation files should be sorted in the UI. /// Documentation will be sorted by type and then by name, to group similar types /// of documentation files together. -@property (copy, readonly, nonatomic) NSArray *sortCriteria; +@property (readonly, nonatomic) NSArray *sortCriteria; /// The currently selected documentation items. Normally, only one item can be selected at a time. @property (strong, nonatomic) NSIndexSet *documentationSelectionIndexes; @@ -66,7 +55,7 @@ /// The text that will be displayed in the help text label at the foot of the view. /// Changes depending on how many documentation items there are and whether adding new documentation is possible. -@property (copy, readonly, nonatomic) NSString *helpText; +@property (readonly, nonatomic) NSString *helpText; /// Whether we are able to add or remove documentation from the gamebox. /// This is determined from the locked status of the gamebox, @@ -159,9 +148,6 @@ /// BXDocumentationItem manages each individual documentation file listed in the documentation popup. @interface BXDocumentationItem : BXCollectionItem -{ - NSImage *_icon; -} /// The icon for the documentation file. /// @@ -178,9 +164,6 @@ /// Custom appearance for documentation items. Highlights the background when selected. @interface BXDocumentationWrapper : BXCollectionItemView -{ - CGFloat _highlightStrength; -} @end diff --git a/Boxer/Documentation Panel/BXDocumentationBrowser.m b/Boxer/Documentation Panel/BXDocumentationBrowser.m index 2d13ab15e..d3e4e5db0 100644 --- a/Boxer/Documentation Panel/BXDocumentationBrowser.m +++ b/Boxer/Documentation Panel/BXDocumentationBrowser.m @@ -36,14 +36,6 @@ - (void) synchronizePreviewToSelection; @end @implementation BXDocumentationBrowser -@synthesize documentationScrollView = _documentationScrollView; -@synthesize documentationList = _documentationList; -@synthesize titleLabel = _titleLabel; -@synthesize helpTextLabel = _helpTextLabel; - -@synthesize documentationURLs = _documentationURLs; -@synthesize documentationSelectionIndexes = _documentationSelectionIndexes; -@synthesize delegate = _delegate; - (void) setDocumentationSelectionIndexes: (NSIndexSet *)indexes { @@ -654,7 +646,6 @@ + (id) previewItemWithURL: (NSURL *)URL; @end @implementation BXDocumentationBrowserPreviewItem -@synthesize originalURL = _originalURL; + (id) previewItemWithURL: (NSURL *)URL { @@ -793,7 +784,6 @@ - (void) _refreshIcon; @end @implementation BXDocumentationItem -@synthesize icon = _icon; - (void) viewDidLoad { @@ -887,7 +877,6 @@ @interface BXDocumentationWrapper () @end @implementation BXDocumentationWrapper -@synthesize highlightStrength = _highlightStrength; + (id) defaultAnimationForKey: (NSString *)key { diff --git a/Boxer/Documentation Panel/BXDocumentationPanelController.h b/Boxer/Documentation Panel/BXDocumentationPanelController.h index 30d34b0cd..3ec99589e 100644 --- a/Boxer/Documentation Panel/BXDocumentationPanelController.h +++ b/Boxer/Documentation Panel/BXDocumentationPanelController.h @@ -15,18 +15,11 @@ NS_ASSUME_NONNULL_BEGIN @class BXSession; @interface BXDocumentationPanelController : NSWindowController -{ - NSPopover *_popover; - BXDocumentationBrowser *_popoverBrowser; - BXDocumentationBrowser *_windowBrowser; - NSSize _maxPopoverSize; - - BXSession *_session; -} #pragma mark - Properties /// The session whose documents are being displayed in the panel. +// FIXME: This may be introducing a memory leak by holding a strong reference @property (strong, nonatomic, nullable) BXSession *session; /// Whether the panel is currently visible, either as a popover or as a window. diff --git a/Boxer/Documentation Panel/BXDocumentationPanelController.m b/Boxer/Documentation Panel/BXDocumentationPanelController.m index 265ce7216..3b3c941fc 100644 --- a/Boxer/Documentation Panel/BXDocumentationPanelController.m +++ b/Boxer/Documentation Panel/BXDocumentationPanelController.m @@ -31,11 +31,6 @@ - (void) _sizePopoverToFitNumberOfItems: (NSUInteger)numItems; @end @implementation BXDocumentationPanelController -@synthesize session = _session; -@synthesize popover = _popover; -@synthesize windowBrowser = _windowBrowser; -@synthesize popoverBrowser = _popoverBrowser; -@synthesize maxPopoverSize = _maxPopoverSize; #pragma mark - Initialization and deallocation