From df51dbcf4810638884cae08f265077ceaf23850b Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 10 Oct 2015 13:20:17 -0600 Subject: [PATCH] Convert more interfaces to use properties. Use DEPRECATED_ATTRIBUTE to mark functions deprecated in the comments. --- ...AdvancedWorkingDirectoryWindowController.m | 2 +- sources/AsyncHostLookupController.m | 2 +- sources/Autocomplete.m | 2 +- sources/BounceTrigger.m | 4 +-- ...lkCopyProfilePreferencesWindowController.m | 2 +- sources/CharacterRun.m | 2 +- sources/CommandHistory.m | 2 +- sources/CommandHistoryEntry.m | 2 +- sources/CommandHistoryPopup.m | 2 +- sources/ContextMenuActionPrefsController.m | 2 +- sources/Coprocess.m | 2 +- sources/DVR.m | 2 +- sources/DVRBuffer.m | 2 +- sources/DVRDecoder.m | 2 +- sources/DVREncoder.m | 2 +- sources/DirectoriesPopup.m | 2 +- sources/EquivalenceClassSet.m | 2 +- sources/FakeWindow.m | 2 +- sources/FileTransferManager.m | 2 +- sources/FindContext.m | 2 +- sources/FindView.m | 2 +- sources/FindViewController.m | 10 +++---- sources/FontSizeEstimator.m | 2 +- sources/GTMCarbonEvent.m | 10 +++---- sources/GeneralPreferencesViewController.m | 2 +- sources/GlobalSearch.m | 10 +++---- sources/HighlightTrigger.m | 4 +-- sources/ITAddressBookMgr.m | 2 +- sources/IntervalMap.m | 2 +- sources/IntervalTree.m | 10 +++---- sources/MarkTrigger.m | 4 +-- sources/MovePaneController.m | 2 +- sources/MovingAverage.m | 2 +- sources/PTYNoteView.m | 2 +- sources/PTYScrollView.h | 2 +- sources/PTYScrollView.m | 2 +- sources/PTYSession.m | 6 ++-- sources/PTYTab.h | 9 ++---- sources/PTYTab.m | 4 +-- sources/PTYTabView.m | 2 +- sources/PTYTask.h | 29 +++++++++---------- sources/PTYTask.m | 2 +- sources/PTYTextView.h | 2 +- sources/PTYTextView.m | 4 +-- sources/PTYWindow.h | 4 +-- sources/PasswordTrigger.m | 6 ++-- sources/PasteContext.h | 2 +- sources/PasteContext.m | 2 +- sources/PasteViewController.m | 2 +- sources/PasteboardHistory.m | 4 +-- sources/Popup.m | 2 +- sources/PopupEntry.m | 2 +- sources/PopupModel.m | 4 +-- sources/PopupWindow.m | 2 +- sources/PreferenceInfo.m | 2 +- sources/PreferencePanel.m | 2 +- sources/ProcessCache.m | 2 +- sources/ProfileListView.m | 4 +-- sources/ProfileModelWrapper.h | 2 +- sources/ProfileModelWrapper.m | 2 +- sources/ProfilePreferencesViewController.m | 2 +- sources/ProfileTableRow.m | 2 +- sources/ProfileTagsView.m | 2 +- sources/PseudoTerminal.h | 4 +-- sources/PseudoTerminal.m | 6 ++-- sources/RoundedRectView.m | 2 +- sources/SCPFile.m | 2 +- sources/ScreenChar.h | 2 +- sources/SearchResult.h | 2 +- sources/SessionTitleView.m | 2 +- sources/SessionView.h | 2 +- sources/SessionView.m | 4 +-- sources/SolidColorView.h | 5 ++-- sources/SolidColorView.m | 9 ++---- sources/SplitPanel.m | 2 +- sources/SplitSelectionView.h | 6 ++-- sources/SplitSelectionView.m | 4 +-- sources/TSVParser.m | 2 +- sources/TaskNotifier.h | 2 +- sources/TaskNotifier.m | 2 +- sources/TemporaryNumberAllocator.m | 2 +- sources/TerminalFile.h | 2 +- sources/TerminalFile.m | 2 +- sources/ThreeFingerTapGestureRecognizer.h | 2 +- sources/ThreeFingerTapGestureRecognizer.m | 2 +- sources/TmuxController.h | 22 +++++++------- sources/TmuxController.m | 18 ++++++------ sources/TmuxControllerRegistry.h | 6 ++-- sources/TmuxControllerRegistry.m | 4 +-- sources/TmuxDashboardController.h | 2 +- sources/TmuxDashboardController.m | 2 +- sources/TmuxGateway.h | 6 ++-- sources/TmuxGateway.m | 2 +- sources/TmuxHistoryParser.h | 4 +-- sources/TmuxLayoutParser.h | 2 +- sources/TmuxSessionsTable.h | 2 +- sources/TmuxSessionsTable.m | 2 +- sources/TmuxWindowOpener.m | 2 +- sources/TmuxWindowsTable.h | 2 +- sources/TmuxWindowsTable.m | 2 +- sources/ToolCapturedOutputView.m | 2 +- sources/ToolCommandHistoryView.h | 2 +- sources/ToolCommandHistoryView.m | 2 +- sources/ToolDirectoriesView.m | 2 +- sources/ToolJobs.m | 4 +-- sources/ToolNotes.m | 2 +- sources/ToolPasteHistory.h | 2 +- sources/ToolPasteHistory.m | 2 +- sources/ToolProfiles.h | 2 +- sources/ToolProfiles.m | 2 +- sources/TransferrableFile.m | 2 +- sources/TransferrableFileMenuItemView.m | 2 +- .../TransferrableFileMenuItemViewController.h | 2 +- .../TransferrableFileMenuItemViewController.m | 2 +- sources/Trigger.h | 8 ++--- sources/Trigger.m | 10 +++---- sources/TriggerController.m | 2 +- sources/VT100ControlParser.m | 2 +- sources/VT100DCSParser.m | 2 +- sources/VT100Grid.h | 2 +- sources/VT100Grid.m | 2 +- sources/VT100LineInfo.h | 2 +- sources/VT100LineInfo.m | 2 +- sources/VT100Output.m | 2 +- sources/VT100Parser.m | 2 +- sources/VT100Screen.h | 2 +- sources/VT100Screen.m | 2 +- sources/VT100Terminal.m | 2 +- sources/iTermAnnouncementView.m | 2 +- sources/iTermApplicationDelegate.m | 2 +- sources/iTermColorMap.m | 2 +- sources/iTermController.m | 2 +- sources/iTermDirectoriesModel.m | 6 ++-- sources/iTermEditKeyActionWindowController.m | 2 +- sources/iTermExpose.m | 2 +- sources/iTermExposeGridView.m | 2 +- sources/iTermExposeTabView.h | 2 +- sources/iTermExposeTabView.m | 2 +- sources/iTermExposeView.m | 2 +- sources/iTermFindCursorView.m | 4 +-- sources/iTermFindOnPageHelper.m | 2 +- sources/iTermGrowlDelegate.m | 2 +- sources/iTermInstantReplayWindowController.m | 2 +- sources/iTermKeyMappingViewController.m | 2 +- sources/iTermMouseCursor.m | 2 +- sources/iTermNSKeyBindingEmulator.m | 2 +- sources/iTermObjectPool.h | 2 +- sources/iTermObjectPool.m | 6 ++-- sources/iTermOpenQuicklyItem.m | 2 +- sources/iTermOpenQuicklyWindowController.m | 2 +- .../iTermPasswordManagerWindowController.m | 2 +- sources/iTermPasteHelper.m | 2 +- sources/iTermPreferencesBaseViewController.m | 2 +- sources/iTermProfilesWindowController.m | 4 +-- sources/iTermSelection.m | 2 +- sources/iTermSizeRememberingView.m | 2 +- sources/iTermTextExtractor.m | 2 +- sources/iTermTipCardActionButton.m | 2 +- sources/iTermToolWrapper.h | 2 +- sources/iTermToolWrapper.m | 2 +- sources/iTermToolbeltView.m | 2 +- sources/iTermURLSchemeController.m | 2 +- 162 files changed, 254 insertions(+), 262 deletions(-) diff --git a/sources/AdvancedWorkingDirectoryWindowController.m b/sources/AdvancedWorkingDirectoryWindowController.m index c243dbf890..469b7745b4 100644 --- a/sources/AdvancedWorkingDirectoryWindowController.m +++ b/sources/AdvancedWorkingDirectoryWindowController.m @@ -24,7 +24,7 @@ @implementation AdvancedWorkingDirectoryWindowController { IBOutlet NSTextField* _paneDirectory; } -- (id)init { +- (instancetype)init { return [super initWithWindowNibName:@"AdvancedWorkingDirectoryWindow"]; } diff --git a/sources/AsyncHostLookupController.m b/sources/AsyncHostLookupController.m index 8714c39671..b79af5d639 100644 --- a/sources/AsyncHostLookupController.m +++ b/sources/AsyncHostLookupController.m @@ -31,7 +31,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _queue = dispatch_queue_create("AsyncHostLookupControllerQueue", NULL); diff --git a/sources/Autocomplete.m b/sources/Autocomplete.m index 0139a91c57..2adba0156d 100644 --- a/sources/Autocomplete.m +++ b/sources/Autocomplete.m @@ -70,7 +70,7 @@ + (int)maxOptions return [iTermAdvancedSettingsModel autocompleteMaxOptions]; } -- (id)init +- (instancetype)init { const int kMaxOptions = [AutocompleteView maxOptions]; self = [super initWithWindowNibName:@"Autocomplete" diff --git a/sources/BounceTrigger.m b/sources/BounceTrigger.m index 6d5d01f0b6..5445da14c8 100644 --- a/sources/BounceTrigger.m +++ b/sources/BounceTrigger.m @@ -35,7 +35,7 @@ - (BOOL)paramIsPopupButton return YES; } -- (int)indexOfTag:(int)theTag +- (NSInteger)indexOfTag:(NSInteger)theTag { int i = 0; for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) { @@ -47,7 +47,7 @@ - (int)indexOfTag:(int)theTag return -1; } -- (int)tagAtIndex:(int)index +- (NSInteger)tagAtIndex:(NSInteger)index { int i = 0; diff --git a/sources/BulkCopyProfilePreferencesWindowController.m b/sources/BulkCopyProfilePreferencesWindowController.m index e392441700..6a247dbe4c 100644 --- a/sources/BulkCopyProfilePreferencesWindowController.m +++ b/sources/BulkCopyProfilePreferencesWindowController.m @@ -37,7 +37,7 @@ @implementation BulkCopyProfilePreferencesWindowController { IBOutlet NSButton *_copyButton; } -- (id)init { +- (instancetype)init { return [super initWithWindowNibName:@"BulkCopyProfilePreferences"]; } diff --git a/sources/CharacterRun.m b/sources/CharacterRun.m index 830e3370e5..a997a8c81a 100644 --- a/sources/CharacterRun.m +++ b/sources/CharacterRun.m @@ -15,7 +15,7 @@ + (CRunStorage *)cRunStorageWithCapacity:(int)capacity { return [[[CRunStorage alloc] initWithCapacity:capacity] autorelease]; } -- (id)initWithCapacity:(int)capacity { +- (instancetype)initWithCapacity:(int)capacity { self = [super init]; if (self) { capacity = MAX(capacity, 1); diff --git a/sources/CommandHistory.m b/sources/CommandHistory.m index e097c81929..ee80513821 100644 --- a/sources/CommandHistory.m +++ b/sources/CommandHistory.m @@ -40,7 +40,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _hosts = [[NSMutableDictionary alloc] init]; diff --git a/sources/CommandHistoryEntry.m b/sources/CommandHistoryEntry.m index 70bea42ca5..a240a5a1bd 100644 --- a/sources/CommandHistoryEntry.m +++ b/sources/CommandHistoryEntry.m @@ -39,7 +39,7 @@ + (instancetype)entryWithDictionary:(NSDictionary *)dict { return entry; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _commandUses = [[NSMutableArray alloc] init]; diff --git a/sources/CommandHistoryPopup.m b/sources/CommandHistoryPopup.m index 0440296a16..42adf0e927 100644 --- a/sources/CommandHistoryPopup.m +++ b/sources/CommandHistoryPopup.m @@ -27,7 +27,7 @@ @implementation CommandHistoryPopupWindowController { int _partialCommandLength; } -- (id)init +- (instancetype)init { self = [super initWithWindowNibName:@"CommandHistoryPopup" tablePtr:nil diff --git a/sources/ContextMenuActionPrefsController.m b/sources/ContextMenuActionPrefsController.m index 436f704f90..3c215f1f4b 100644 --- a/sources/ContextMenuActionPrefsController.m +++ b/sources/ContextMenuActionPrefsController.m @@ -20,7 +20,7 @@ @implementation ContextMenuActionPrefsController @synthesize delegate = delegate_; @synthesize hasSelection = hasSelection_; -- (id)initWithWindow:(NSWindow *)window +- (instancetype)initWithWindow:(NSWindow *)window { self = [super initWithWindow:window]; if (self) { diff --git a/sources/Coprocess.m b/sources/Coprocess.m index 4f62afb790..9426b41971 100644 --- a/sources/Coprocess.m +++ b/sources/Coprocess.m @@ -121,7 +121,7 @@ + (Coprocess *)coprocessWithPid:(pid_t)pid return result; } -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/DVR.m b/sources/DVR.m index 2e6d4da54d..7d764ceb9f 100755 --- a/sources/DVR.m +++ b/sources/DVR.m @@ -33,7 +33,7 @@ @implementation DVR -- (id)initWithBufferCapacity:(int)bytes +- (instancetype)initWithBufferCapacity:(int)bytes { self = [super init]; if (self) { diff --git a/sources/DVRBuffer.m b/sources/DVRBuffer.m index 0ce0ed7ad6..bf6cef9c59 100755 --- a/sources/DVRBuffer.m +++ b/sources/DVRBuffer.m @@ -31,7 +31,7 @@ @implementation DVRBuffer -- (id)initWithBufferCapacity:(long long)maxsize +- (instancetype)initWithBufferCapacity:(long long)maxsize { self = [super init]; if (self) { diff --git a/sources/DVRDecoder.m b/sources/DVRDecoder.m index a51dc0e3e2..00ec9ec482 100755 --- a/sources/DVRDecoder.m +++ b/sources/DVRDecoder.m @@ -44,7 +44,7 @@ - (void)_loadDiffFrameWithKey:(long long)key; @implementation DVRDecoder -- (id)initWithBuffer:(DVRBuffer*)buffer +- (instancetype)initWithBuffer:(DVRBuffer*)buffer { self = [super init]; if (self) { diff --git a/sources/DVREncoder.m b/sources/DVREncoder.m index dbacff36b9..fd80e762a7 100755 --- a/sources/DVREncoder.m +++ b/sources/DVREncoder.m @@ -63,7 +63,7 @@ - (int)_computeDiff:(NSArray *)frameLines length:(int)length dest:(char*)scratch @implementation DVREncoder -- (id)initWithBuffer:(DVRBuffer*)buffer +- (instancetype)initWithBuffer:(DVRBuffer*)buffer { self = [super init]; if (self) { diff --git a/sources/DirectoriesPopup.m b/sources/DirectoriesPopup.m index 42aa383015..3f31595ad2 100644 --- a/sources/DirectoriesPopup.m +++ b/sources/DirectoriesPopup.m @@ -25,7 +25,7 @@ @implementation DirectoriesPopupWindowController { IBOutlet NSTableColumn *_mainColumn; } -- (id)init { +- (instancetype)init { self = [super initWithWindowNibName:@"DirectoriesPopup" tablePtr:nil model:[[[PopupModel alloc] init] autorelease]]; diff --git a/sources/EquivalenceClassSet.m b/sources/EquivalenceClassSet.m index c8fd2ff738..9d7a2082ca 100644 --- a/sources/EquivalenceClassSet.m +++ b/sources/EquivalenceClassSet.m @@ -2,7 +2,7 @@ @implementation EquivalenceClassSet -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/FakeWindow.m b/sources/FakeWindow.m index f3ca4d5526..6a74aea3b0 100644 --- a/sources/FakeWindow.m +++ b/sources/FakeWindow.m @@ -32,7 +32,7 @@ @implementation FakeWindow -- (id)initFromRealWindow:(NSWindowController *)aTerm +- (instancetype)initFromRealWindow:(NSWindowController *)aTerm session:(PTYSession*)aSession { self = [super init]; diff --git a/sources/FileTransferManager.m b/sources/FileTransferManager.m index 8e1bd967f7..0717351042 100644 --- a/sources/FileTransferManager.m +++ b/sources/FileTransferManager.m @@ -32,7 +32,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _files = [[NSMutableArray alloc] init]; diff --git a/sources/FindContext.m b/sources/FindContext.m index bf78d2db92..c2138c32ba 100644 --- a/sources/FindContext.m +++ b/sources/FindContext.m @@ -25,7 +25,7 @@ @implementation FindContext @synthesize hasWrapped = hasWrapped_; @synthesize maxTime = maxTime_; -- (id)init { +- (instancetype)init { self = [super init]; if (self) { maxTime_ = kDefaultMaxTime; diff --git a/sources/FindView.m b/sources/FindView.m index 7bb4afe77c..bf17f38873 100644 --- a/sources/FindView.m +++ b/sources/FindView.m @@ -31,7 +31,7 @@ @implementation FindView -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code here. diff --git a/sources/FindViewController.m b/sources/FindViewController.m index 9907bcad05..1259a21ea8 100644 --- a/sources/FindViewController.m +++ b/sources/FindViewController.m @@ -55,7 +55,7 @@ @implementation iTermSearchFieldCell { BOOL _needsAnimation; } -- (id)initTextCell:(NSString *)aString { +- (instancetype)initTextCell:(NSString *)aString { self = [super initTextCell:aString]; if (self) { _alphaMultiplier = 1; @@ -63,7 +63,7 @@ - (id)initTextCell:(NSString *)aString { return self; } -- (id)initWithCoder:(NSCoder *)aDecoder { +- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { _alphaMultiplier = 1; @@ -71,7 +71,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder { return self; } -- (id)initImageCell:(NSImage *)image { +- (instancetype)initImageCell:(NSImage *)image { self = [super initImageCell:image]; if (self) { _alphaMultiplier = 1; @@ -268,7 +268,7 @@ @interface FindState : NSObject @implementation FindState -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _string = [@"" retain]; @@ -332,7 +332,7 @@ + (void)initialize gDefaultRegex = [[NSUserDefaults standardUserDefaults] boolForKey:@"findRegex_iTerm"]; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { previousFindString_ = [[NSMutableString alloc] init]; diff --git a/sources/FontSizeEstimator.m b/sources/FontSizeEstimator.m index af24959a9f..a13c9ae50c 100644 --- a/sources/FontSizeEstimator.m +++ b/sources/FontSizeEstimator.m @@ -33,7 +33,7 @@ @implementation FontSizeEstimator @synthesize size; @synthesize baseline; -- (id)initWithSize:(NSSize)s baseline:(double)b +- (instancetype)initWithSize:(NSSize)s baseline:(double)b { self = [super init]; if (self) { diff --git a/sources/GTMCarbonEvent.m b/sources/GTMCarbonEvent.m index 3e095ef0d5..428bff041d 100644 --- a/sources/GTMCarbonEvent.m +++ b/sources/GTMCarbonEvent.m @@ -35,7 +35,7 @@ @interface GTMCarbonHotKey () // whenPressed - do we do it on key down or key up? // Returns: // a hotkey record, or nil on failure -- (id)initWithHotKey:(EventHotKeyID)keyID +- (instancetype)initWithHotKey:(EventHotKeyID)keyID target:(id)target action:(SEL)selector userInfo:(id)userInfo @@ -93,7 +93,7 @@ + (id)currentEvent { // Returns: // GTMCarbonEvent // -- (id)initWithClass:(UInt32)inClass kind:(UInt32)kind { +- (instancetype)initWithClass:(UInt32)inClass kind:(UInt32)kind { if ((self = [super init])) { verify_noerr(CreateEvent(kCFAllocatorDefault, inClass, kind, 0, kEventAttributeNone, &event_)); @@ -107,7 +107,7 @@ - (id)initWithClass:(UInt32)inClass kind:(UInt32)kind { // Returns: // GTMCarbonEvent // -- (id)initWithEvent:(EventRef)event { +- (instancetype)initWithEvent:(EventRef)event { if ((self = [super init])) { if (event) { event_ = RetainEvent(event); @@ -519,7 +519,7 @@ @implementation GTMCarbonEventDispatcherHandler // to keep track of the hotkeys and commands that we handle. // Returns: // GTMCarbonApplication or nil on failure -- (id)init { +- (instancetype)init { if ((self = [super init])) { static EventTypeSpec events[] = { { kEventClassKeyboard, kEventHotKeyPressed }, @@ -668,7 +668,7 @@ @implementation GTMCarbonHotKey // whenPressed - do we do it on key down or key up? // Returns: // a hotkey record, or nil on failure -- (id)initWithHotKey:(EventHotKeyID)keyID +- (instancetype)initWithHotKey:(EventHotKeyID)keyID target:(id)target action:(SEL)selector userInfo:(id)userInfo diff --git a/sources/GeneralPreferencesViewController.m b/sources/GeneralPreferencesViewController.m index 32796bd01d..424ac5c416 100644 --- a/sources/GeneralPreferencesViewController.m +++ b/sources/GeneralPreferencesViewController.m @@ -108,7 +108,7 @@ @implementation GeneralPreferencesViewController { IBOutlet NSButton *_autoHideTmuxClientSession; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/sources/GlobalSearch.m b/sources/GlobalSearch.m index 7b165cf722..40a030e8c6 100644 --- a/sources/GlobalSearch.m +++ b/sources/GlobalSearch.m @@ -61,7 +61,7 @@ @interface GlobalSearchInstance : NSObject NSMutableSet* matchLocations_; } -- (id)initWithSession:(PTYSession *)session +- (instancetype)initWithSession:(PTYSession *)session findString:(NSString*)findString label:(NSString*)label; - (BOOL)more; @@ -83,7 +83,7 @@ @interface GlobalSearchResult : NSObject long long absEndY_; } -- (id)initWithInstance:(GlobalSearchInstance*)instance context:(NSString*)theContext x:(int)x absY:(long long)absY endX:(int)endX y:(long long)absEndY findString:(NSString*)findString; +- (instancetype)initWithInstance:(GlobalSearchInstance*)instance context:(NSString*)theContext x:(int)x absY:(long long)absY endX:(int)endX y:(long long)absEndY findString:(NSString*)findString; - (NSString*)context; - (NSString*)findString; - (GlobalSearchInstance*)instance; @@ -99,7 +99,7 @@ - (int)endY; @implementation GlobalSearchResult -- (id)initWithInstance:(GlobalSearchInstance*)instance +- (instancetype)initWithInstance:(GlobalSearchInstance*)instance context:(NSString*)theContext x:(int)x absY:(long long)absY @@ -180,7 +180,7 @@ - (int)endY @implementation GlobalSearchInstance -- (id)initWithSession:(PTYSession *)session +- (instancetype)initWithSession:(PTYSession *)session findString:(NSString*)findString label:(NSString*)label { @@ -354,7 +354,7 @@ - (void)awakeFromNib } } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { diff --git a/sources/HighlightTrigger.m b/sources/HighlightTrigger.m index de25037b84..0763566e29 100644 --- a/sources/HighlightTrigger.m +++ b/sources/HighlightTrigger.m @@ -174,7 +174,7 @@ - (NSArray *)groupedMenuItemsForPopupButton { return [NSArray arrayWithObjects:fgbg, fg, bg, nil]; } -- (int)indexOfTag:(int)theTag +- (NSInteger)indexOfTag:(NSInteger)theTag { int i = 0; BOOL isFirst = YES; @@ -193,7 +193,7 @@ - (int)indexOfTag:(int)theTag return -1; } -- (int)tagAtIndex:(int)theIndex +- (NSInteger)tagAtIndex:(NSInteger)theIndex { int i = 0; BOOL isFirst = YES; diff --git a/sources/ITAddressBookMgr.m b/sources/ITAddressBookMgr.m index a95a276991..eb55ff563b 100644 --- a/sources/ITAddressBookMgr.m +++ b/sources/ITAddressBookMgr.m @@ -63,7 +63,7 @@ + (id)sharedInstance return shared; } -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/IntervalMap.m b/sources/IntervalMap.m index 1a073bf230..64c049ecca 100644 --- a/sources/IntervalMap.m +++ b/sources/IntervalMap.m @@ -123,7 +123,7 @@ - (NSString *)description @implementation IntervalMap -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/IntervalTree.m b/sources/IntervalTree.m index 23e479865e..e71319772c 100644 --- a/sources/IntervalTree.m +++ b/sources/IntervalTree.m @@ -21,7 +21,7 @@ @interface IntervalTreeForwardLimitEnumerator : NSEnumerator { @implementation IntervalTreeForwardLimitEnumerator @synthesize previousLimit = previousLimit_; -- (id)initWithTree:(IntervalTree *)tree { +- (instancetype)initWithTree:(IntervalTree *)tree { self = [super init]; if (self) { tree_ = [tree retain]; @@ -75,7 +75,7 @@ @implementation IntervalTreeReverseLimitEnumerator @synthesize previousLimit = previousLimit_; -- (id)initWithTree:(IntervalTree *)tree { +- (instancetype)initWithTree:(IntervalTree *)tree { self = [super init]; if (self) { tree_ = [tree retain]; @@ -130,7 +130,7 @@ @implementation IntervalTreeReverseEnumerator @synthesize previousLocation = previousLocation_; -- (id)initWithTree:(IntervalTree *)tree { +- (instancetype)initWithTree:(IntervalTree *)tree { self = [super init]; if (self) { tree_ = [tree retain]; @@ -275,7 +275,7 @@ - (NSString *)description { entriesString]; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _entries = [[NSMutableArray alloc] init]; @@ -329,7 +329,7 @@ - (instancetype)initWithDictionary:(NSDictionary *)dict { return self; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _tree = [[AATree alloc] initWithKeyComparator:^(NSNumber *key1, NSNumber *key2) { diff --git a/sources/MarkTrigger.m b/sources/MarkTrigger.m index cb96b40075..148ea4941a 100644 --- a/sources/MarkTrigger.m +++ b/sources/MarkTrigger.m @@ -34,7 +34,7 @@ - (BOOL)paramIsPopupButton { return YES; } -- (int)indexOfTag:(int)theTag { +- (NSInteger)indexOfTag:(NSInteger)theTag { int i = 0; for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) { if ([n intValue] == theTag) { @@ -45,7 +45,7 @@ - (int)indexOfTag:(int)theTag { return -1; } -- (int)tagAtIndex:(int)index { +- (NSInteger)tagAtIndex:(NSInteger)index { int i = 0; for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) { diff --git a/sources/MovePaneController.m b/sources/MovePaneController.m index e64b08f950..f7e1b55be2 100644 --- a/sources/MovePaneController.m +++ b/sources/MovePaneController.m @@ -30,7 +30,7 @@ + (MovePaneController *)sharedInstance return inst; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { isMove_ = YES; diff --git a/sources/MovingAverage.m b/sources/MovingAverage.m index be87f9b3e8..9e596b8fb5 100644 --- a/sources/MovingAverage.m +++ b/sources/MovingAverage.m @@ -13,7 +13,7 @@ @implementation MovingAverage @synthesize alpha = _alpha; @synthesize value = _value; -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _alpha = 0.5; diff --git a/sources/PTYNoteView.m b/sources/PTYNoteView.m index 6f75800b58..03953bc770 100644 --- a/sources/PTYNoteView.m +++ b/sources/PTYNoteView.m @@ -35,7 +35,7 @@ @implementation PTYNoteView @synthesize delegate = delegate_; @synthesize backgroundColor = backgroundColor_; -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { backgroundColor_ = [[self defaultBackgroundColor] retain]; diff --git a/sources/PTYScrollView.h b/sources/PTYScrollView.h index 1f5e00fc04..d461af7945 100644 --- a/sources/PTYScrollView.h +++ b/sources/PTYScrollView.h @@ -42,7 +42,7 @@ @interface PTYScrollView : NSScrollView -- (id)initWithFrame:(NSRect)frame hasVerticalScroller:(BOOL)hasVerticalScroller; +- (instancetype)initWithFrame:(NSRect)frame hasVerticalScroller:(BOOL)hasVerticalScroller; - (void)scrollWheel:(NSEvent *)theEvent; - (void)detectUserScroll; - (BOOL)isLegacyScroller; diff --git a/sources/PTYScrollView.m b/sources/PTYScrollView.m index 1a5fd33d48..78f5dac88f 100644 --- a/sources/PTYScrollView.m +++ b/sources/PTYScrollView.m @@ -92,7 +92,7 @@ @implementation PTYScrollView { NSTimer *timer_; } -- (id)initWithFrame:(NSRect)frame hasVerticalScroller:(BOOL)hasVerticalScroller { +- (instancetype)initWithFrame:(NSRect)frame hasVerticalScroller:(BOOL)hasVerticalScroller { self = [super initWithFrame:frame]; if (self) { [self setHasVerticalScroller:hasVerticalScroller inInit:YES]; diff --git a/sources/PTYSession.m b/sources/PTYSession.m index 3cb581165b..842aa79c13 100644 --- a/sources/PTYSession.m +++ b/sources/PTYSession.m @@ -362,7 +362,7 @@ + (void)removeAllRegisteredSessions { [gRegisteredSessionContents removeAllObjects]; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _triggerLineNumber = -1; @@ -4380,14 +4380,14 @@ - (NSSize)tmuxBookmarkSize [[dict objectForKey:KEY_ROWS] intValue]); } -- (int)tmuxNumHistoryLinesInBookmark +- (NSInteger)tmuxNumHistoryLinesInBookmark { NSDictionary *dict = [PTYTab tmuxBookmark]; if ([[dict objectForKey:KEY_UNLIMITED_SCROLLBACK] boolValue]) { // 10M is close enough to infinity to be indistinguishable. return 10 * 1000 * 1000; } else { - return [[dict objectForKey:KEY_SCROLLBACK_LINES] intValue]; + return [[dict objectForKey:KEY_SCROLLBACK_LINES] integerValue]; } } diff --git a/sources/PTYTab.h b/sources/PTYTab.h index bc19fe44eb..8c6a74aedf 100644 --- a/sources/PTYTab.h +++ b/sources/PTYTab.h @@ -45,10 +45,8 @@ - (void)setRoot:(NSSplitView *)newRoot; - (NSRect)absoluteFrame; -- (PTYSession*)activeSession; -- (void)setActiveSession:(PTYSession*)session; -- (NSTabViewItem *)tabViewItem; -- (void)setTabViewItem:(NSTabViewItem *)theTabViewItem; +@property (retain) PTYSession *activeSession; +@property (retain) NSTabViewItem *tabViewItem; - (void)previousSession; - (void)nextSession; - (int)indexOfSessionView:(SessionView*)sessionView; @@ -85,8 +83,7 @@ // Tab number for display @property int objectCount; // Icon to display in tab -- (NSImage *)icon; -- (void)setIcon:(NSImage *)anIcon; +@property (retain) NSImage *icon; // Should show busy indicator in tab? - (BOOL)isProcessing; - (BOOL)realIsProcessing; diff --git a/sources/PTYTab.m b/sources/PTYTab.m index 381b276e43..0f4179f2e5 100644 --- a/sources/PTYTab.m +++ b/sources/PTYTab.m @@ -218,7 +218,7 @@ - (void)numberOfSessionsDidChange } // init/dealloc -- (id)initWithSession:(PTYSession*)session { +- (instancetype)initWithSession:(PTYSession*)session { self = [super init]; PtyLog(@"PTYTab initWithSession %p", self); if (self) { @@ -276,7 +276,7 @@ - (int)uniqueId { // This is used when restoring a window arrangement. A tree of splits and // sessionviews is passed in but the sessionviews don't have sessions yet. -- (id)initWithRoot:(NSSplitView*)root +- (instancetype)initWithRoot:(NSSplitView*)root { self = [super init]; PtyLog(@"PTYTab initWithRoot %p", self); diff --git a/sources/PTYTabView.m b/sources/PTYTabView.m index 65abc4eb55..3fd71c21f8 100644 --- a/sources/PTYTabView.m +++ b/sources/PTYTabView.m @@ -47,7 +47,7 @@ @implementation PTYTabView { @dynamic delegate; -- (id)initWithFrame:(NSRect)aRect { +- (instancetype)initWithFrame:(NSRect)aRect { self = [super initWithFrame:aRect]; if (self) { _tabViewItemsInMRUOrder = [[NSMutableArray alloc] init]; diff --git a/sources/PTYTask.h b/sources/PTYTask.h index c0035b1d65..5461ff8208 100644 --- a/sources/PTYTask.h +++ b/sources/PTYTask.h @@ -53,29 +53,28 @@ extern NSString *kCoprocessStatusChangeNotification; - (void)setWidth:(int)width height:(int)height; - (void)stop; -- (int)fd; -- (pid_t)pid; -- (int)status; -- (NSString*)tty; -- (NSString*)path; -- (NSString*)getWorkingDirectory; -- (NSString*)description; +@property (readonly) int fd; +@property (readonly) pid_t pid; +@property (readonly) int status; +@property (readonly, copy) NSString *tty; +@property (readonly, copy) NSString *path; +@property (readonly, copy) NSString *getWorkingDirectory; +@property (readonly, copy) NSString *description; - (BOOL)startLoggingToFileWithPath:(NSString*)path shouldAppend:(BOOL)shouldAppend; - (void)stopLogging; -- (BOOL)logging; -- (BOOL)hasOutput; +@property (readonly) BOOL logging; +@property (readonly) BOOL hasOutput; -- (BOOL)wantsRead; -- (BOOL)wantsWrite; +@property (readonly) BOOL wantsRead; +@property (readonly) BOOL wantsWrite; - (void)brokenPipe; - (void)processRead; - (void)processWrite; -- (void)setCoprocess:(Coprocess *)coprocess; -- (Coprocess *)coprocess; -- (BOOL)writeBufferHasRoom; -- (BOOL)hasCoprocess; +@property (retain) Coprocess *coprocess; +@property (readonly) BOOL writeBufferHasRoom; +@property (readonly) BOOL hasCoprocess; - (void)stopCoprocess; - (void)logData:(const char *)buffer length:(int)length; diff --git a/sources/PTYTask.m b/sources/PTYTask.m index 1826f3006b..ed128203c9 100644 --- a/sources/PTYTask.m +++ b/sources/PTYTask.m @@ -114,7 +114,7 @@ @implementation PTYTask { int _socketFd; // File descriptor for unix domain socket connected to server. Only safe to close after server is dead. } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _serverPid = (pid_t)-1; diff --git a/sources/PTYTextView.h b/sources/PTYTextView.h index fda39d46ce..374f2def2b 100644 --- a/sources/PTYTextView.h +++ b/sources/PTYTextView.h @@ -269,7 +269,7 @@ typedef void (^PTYTextViewDrawingHookBlock)(iTermTextDrawingHelper *); // This is the designated initializer. The color map should have the // basic colors plus the 8-bit ansi colors set shortly after this is // called. -- (id)initWithFrame:(NSRect)frame colorMap:(iTermColorMap *)colorMap; +- (instancetype)initWithFrame:(NSRect)frame colorMap:(iTermColorMap *)colorMap; // Sets the "changed since last Exposé" flag to NO and returns its original value. - (BOOL)getAndResetChangedSinceLastExpose; diff --git a/sources/PTYTextView.m b/sources/PTYTextView.m index 928be7233f..46d203ad52 100644 --- a/sources/PTYTextView.m +++ b/sources/PTYTextView.m @@ -216,12 +216,12 @@ + (void)initialize { [iTermNSKeyBindingEmulator sharedInstance]; // Load and parse DefaultKeyBindings.dict if needed. } -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { // Must call initWithFrame:colorMap:. assert(false); } -- (id)initWithFrame:(NSRect)aRect colorMap:(iTermColorMap *)colorMap { +- (instancetype)initWithFrame:(NSRect)aRect colorMap:(iTermColorMap *)colorMap { self = [super initWithFrame:aRect]; if (self) { _drawingHelper = [[iTermTextDrawingHelper alloc] init]; diff --git a/sources/PTYWindow.h b/sources/PTYWindow.h index 4ab772e31a..e2564037f9 100644 --- a/sources/PTYWindow.h +++ b/sources/PTYWindow.h @@ -42,8 +42,8 @@ - (void)enableBlur:(double)radius; - (void)disableBlur; -- (int)screenNumber; -- (BOOL)isTogglingLionFullScreen; +@property (readonly) int screenNumber; +@property (readonly, getter=isTogglingLionFullScreen) BOOL togglingLionFullScreen; - (void)setRestoreState:(NSObject *)restoreState; diff --git a/sources/PasswordTrigger.m b/sources/PasswordTrigger.m index c59d123024..a9ed6d14e9 100644 --- a/sources/PasswordTrigger.m +++ b/sources/PasswordTrigger.m @@ -20,7 +20,7 @@ + (NSString *)title { return @"Open Password Manager…"; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { [self reloadData]; @@ -57,7 +57,7 @@ - (NSArray *)sortedAccountNames { return [_accountNames sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; } -- (int)indexForObject:(id)object { +- (NSInteger)indexForObject:(id)object { NSUInteger index = [[self sortedAccountNames] indexOfObject:object]; if (index == NSNotFound) { @@ -67,7 +67,7 @@ - (int)indexForObject:(id)object { } } -- (id)objectAtIndex:(int)index { +- (id)objectAtIndex:(NSInteger)index { if (index < 0 || index >= _accountNames.count) { return nil; } diff --git a/sources/PasteContext.h b/sources/PasteContext.h index ac993889d0..9033228745 100644 --- a/sources/PasteContext.h +++ b/sources/PasteContext.h @@ -10,7 +10,7 @@ @interface PasteContext : NSObject -- (id)initWithBytesPerCallPrefKey:(NSString*)bytesPerCallKey +- (instancetype)initWithBytesPerCallPrefKey:(NSString*)bytesPerCallKey defaultValue:(int)bytesPerCallDefault delayBetweenCallsPrefKey:(NSString*)delayBetweenCallsKey defaultValue:(float)delayBetweenCallsDefault; diff --git a/sources/PasteContext.m b/sources/PasteContext.m index 59e321a02f..113adeaf28 100644 --- a/sources/PasteContext.m +++ b/sources/PasteContext.m @@ -16,7 +16,7 @@ @implementation PasteContext { float delayBetweenCalls_; } -- (id)initWithBytesPerCallPrefKey:(NSString*)bytesPerCallKey +- (instancetype)initWithBytesPerCallPrefKey:(NSString*)bytesPerCallKey defaultValue:(int)bytesPerCallDefault delayBetweenCallsPrefKey:(NSString*)delayBetweenCallsKey defaultValue:(float)delayBetweenCallsDefault diff --git a/sources/PasteViewController.m b/sources/PasteViewController.m index ed12ca3178..bd9061c116 100644 --- a/sources/PasteViewController.m +++ b/sources/PasteViewController.m @@ -21,7 +21,7 @@ @implementation PasteViewController { @synthesize delegate = delegate_; @synthesize remainingLength = remainingLength_; -- (id)initWithContext:(PasteContext *)pasteContext +- (instancetype)initWithContext:(PasteContext *)pasteContext length:(int)length { self = [super initWithNibName:@"PasteView" bundle:nil]; if (self) { diff --git a/sources/PasteboardHistory.m b/sources/PasteboardHistory.m index 1a356586a3..aa3a10cec1 100644 --- a/sources/PasteboardHistory.m +++ b/sources/PasteboardHistory.m @@ -81,7 +81,7 @@ + (PasteboardHistory*)sharedInstance return instance; } -- (id)initWithMaxEntries:(int)maxEntries +- (instancetype)initWithMaxEntries:(int)maxEntries { self = [super init]; if (self) { @@ -203,7 +203,7 @@ - (void)save:(NSString*)value @implementation PasteboardHistoryWindowController -- (id)init +- (instancetype)init { self = [super initWithWindowNibName:@"PasteboardHistory" tablePtr:nil model:[[[PopupModel alloc] init] autorelease]]; if (!self) { diff --git a/sources/Popup.m b/sources/Popup.m index e2c76d36b6..437eb987e5 100644 --- a/sources/Popup.m +++ b/sources/Popup.m @@ -43,7 +43,7 @@ @implementation Popup { BOOL reloading_; } -- (id)initWithWindowNibName:(NSString*)nibName tablePtr:(NSTableView**)table model:(PopupModel*)model +- (instancetype)initWithWindowNibName:(NSString*)nibName tablePtr:(NSTableView**)table model:(PopupModel*)model { self = [super initWithWindowNibName:nibName]; if (self) { diff --git a/sources/PopupEntry.m b/sources/PopupEntry.m index 4fd6e2473f..b6f0eead57 100644 --- a/sources/PopupEntry.m +++ b/sources/PopupEntry.m @@ -19,7 +19,7 @@ @implementation PopupEntry @synthesize score = score_; @synthesize prefix = prefix_; -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/PopupModel.m b/sources/PopupModel.m index 16f1c5b27a..673eced714 100644 --- a/sources/PopupModel.m +++ b/sources/PopupModel.m @@ -17,7 +17,7 @@ @implementation PopupModel { int maxEntries_; } -- (id)init +- (instancetype)init { self = [super init]; if (self) { @@ -27,7 +27,7 @@ - (id)init return self; } -- (id)initWithMaxEntries:(int)maxEntries +- (instancetype)initWithMaxEntries:(int)maxEntries { self = [super init]; if (self) { diff --git a/sources/PopupWindow.m b/sources/PopupWindow.m index 0072e8279d..7b8cc8d9f7 100644 --- a/sources/PopupWindow.m +++ b/sources/PopupWindow.m @@ -14,7 +14,7 @@ @implementation PopupWindow { BOOL shutdown_; } -- (id)initWithContentRect:(NSRect)contentRect +- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag diff --git a/sources/PreferenceInfo.m b/sources/PreferenceInfo.m index 3436fcf8b7..e9376f9b9c 100644 --- a/sources/PreferenceInfo.m +++ b/sources/PreferenceInfo.m @@ -20,7 +20,7 @@ + (instancetype)infoForPreferenceWithKey:(NSString *)key return info; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _range = NSMakeRange(0, INT_MAX); diff --git a/sources/PreferencePanel.m b/sources/PreferencePanel.m index bd09317895..58454fbd18 100644 --- a/sources/PreferencePanel.m +++ b/sources/PreferencePanel.m @@ -159,7 +159,7 @@ + (instancetype)sessionsInstance { return instance; } -- (id)initWithProfileModel:(ProfileModel*)model +- (instancetype)initWithProfileModel:(ProfileModel*)model editCurrentSessionMode:(BOOL)editCurrentSessionMode { self = [super initWithWindowNibName:@"PreferencePanel"]; if (self) { diff --git a/sources/ProcessCache.m b/sources/ProcessCache.m index c6a83f4baf..b6fee52b8a 100644 --- a/sources/ProcessCache.m +++ b/sources/ProcessCache.m @@ -86,7 +86,7 @@ + (void)initialize // The analyzer flags this as a leak but it's really just a singleton. } -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/ProfileListView.m b/sources/ProfileListView.m index c68e21221e..a2831b4db0 100644 --- a/sources/ProfileListView.m +++ b/sources/ProfileListView.m @@ -62,13 +62,13 @@ @implementation ProfileListView { CGFloat lastTagsWidth_; } -- (id)initWithFrame:(NSRect)frameRect +- (instancetype)initWithFrame:(NSRect)frameRect { return [self initWithFrame:frameRect model:[ProfileModel sharedInstance]]; } // This is the designated initializer. -- (id)initWithFrame:(NSRect)frameRect model:(ProfileModel*)dataSource +- (instancetype)initWithFrame:(NSRect)frameRect model:(ProfileModel*)dataSource { self = [super initWithFrame:frameRect]; if (self) { diff --git a/sources/ProfileModelWrapper.h b/sources/ProfileModelWrapper.h index 5ae9d0411e..4a6ca5ed2c 100644 --- a/sources/ProfileModelWrapper.h +++ b/sources/ProfileModelWrapper.h @@ -25,7 +25,7 @@ // This guid will always appear in the model even if it doesn't match the filter. @property(nonatomic, copy) NSString *lockedGuid; -- (id)initWithModel:(ProfileModel*)model; +- (instancetype)initWithModel:(ProfileModel*)model; @property (copy) NSArray *sortDescriptors; // Cause the underlying model to have the visible bookmarks in the same order as diff --git a/sources/ProfileModelWrapper.m b/sources/ProfileModelWrapper.m index 4449552268..72ba958113 100644 --- a/sources/ProfileModelWrapper.m +++ b/sources/ProfileModelWrapper.m @@ -9,7 +9,7 @@ @implementation ProfileModelWrapper -- (id)initWithModel:(ProfileModel*)model +- (instancetype)initWithModel:(ProfileModel*)model { self = [super init]; if (self) { diff --git a/sources/ProfilePreferencesViewController.m b/sources/ProfilePreferencesViewController.m index ae4bfabc52..1268d58201 100644 --- a/sources/ProfilePreferencesViewController.m +++ b/sources/ProfilePreferencesViewController.m @@ -96,7 +96,7 @@ @implementation ProfilePreferencesViewController { CGFloat _minWidth; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/sources/ProfileTableRow.m b/sources/ProfileTableRow.m index a434e8c45a..138f99298f 100644 --- a/sources/ProfileTableRow.m +++ b/sources/ProfileTableRow.m @@ -10,7 +10,7 @@ @implementation ProfileTableRow -- (id)initWithBookmark:(Profile*)bookmark underlyingModel:(ProfileModel*)newUnderlyingModel +- (instancetype)initWithBookmark:(Profile*)bookmark underlyingModel:(ProfileModel*)newUnderlyingModel { self = [super init]; if (self) { diff --git a/sources/ProfileTagsView.m b/sources/ProfileTagsView.m index 8cdb5422a8..a1fa67c86a 100644 --- a/sources/ProfileTagsView.m +++ b/sources/ProfileTagsView.m @@ -21,7 +21,7 @@ @interface ProfileTagsView () @implementation ProfileTagsView -- (id)initWithFrame:(NSRect)frame +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { diff --git a/sources/PseudoTerminal.h b/sources/PseudoTerminal.h index 20a4744215..1116fc5c45 100644 --- a/sources/PseudoTerminal.h +++ b/sources/PseudoTerminal.h @@ -100,14 +100,14 @@ extern NSString *const kPseudoTerminalStateRestorationWindowArrangementKey; // windowType: Describes constraints on the window's initial frame and border, and more. // screen: An index into [NSScreen screens], or -1 to let the system pick a // screen. -- (id)initWithSmartLayout:(BOOL)smartLayout +- (instancetype)initWithSmartLayout:(BOOL)smartLayout windowType:(iTermWindowType)windowType savedWindowType:(iTermWindowType)savedWindowType screen:(int)screenIndex; // isHotkey indicates if this is a hotkey window, which recieves special // treatment and must be unique. -- (id)initWithSmartLayout:(BOOL)smartLayout +- (instancetype)initWithSmartLayout:(BOOL)smartLayout windowType:(iTermWindowType)windowType savedWindowType:(iTermWindowType)savedWindowType screen:(int)screenNumber diff --git a/sources/PseudoTerminal.m b/sources/PseudoTerminal.m index 25ba9e03c1..fb93fe7c69 100644 --- a/sources/PseudoTerminal.m +++ b/sources/PseudoTerminal.m @@ -344,7 +344,7 @@ + (NSInteger)styleMaskForWindowType:(iTermWindowType)windowType { } } -- (id)initWithWindowNibName:(NSString *)windowNibName { +- (instancetype)initWithWindowNibName:(NSString *)windowNibName { self = [super initWithWindowNibName:windowNibName]; if (self) { self.autoCommandHistorySessionGuid = nil; @@ -352,7 +352,7 @@ - (id)initWithWindowNibName:(NSString *)windowNibName { return self; } -- (id)initWithSmartLayout:(BOOL)smartLayout +- (instancetype)initWithSmartLayout:(BOOL)smartLayout windowType:(iTermWindowType)windowType savedWindowType:(iTermWindowType)savedWindowType screen:(int)screenNumber { @@ -363,7 +363,7 @@ - (id)initWithSmartLayout:(BOOL)smartLayout isHotkey:NO]; } -- (id)initWithSmartLayout:(BOOL)smartLayout +- (instancetype)initWithSmartLayout:(BOOL)smartLayout windowType:(iTermWindowType)windowType savedWindowType:(iTermWindowType)savedWindowType screen:(int)screenNumber diff --git a/sources/RoundedRectView.m b/sources/RoundedRectView.m index 2705f34641..57d9da30b4 100644 --- a/sources/RoundedRectView.m +++ b/sources/RoundedRectView.m @@ -10,7 +10,7 @@ @implementation RoundedRectView -- (id)initWithFrame:(NSRect)frame +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { diff --git a/sources/SCPFile.m b/sources/SCPFile.m index e7c8a3e192..09d57dbe7c 100644 --- a/sources/SCPFile.m +++ b/sources/SCPFile.m @@ -44,7 +44,7 @@ @implementation SCPFile { NSString *_hostName; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _queue = dispatch_queue_create("com.googlecode.iterm2.SCPFile", NULL); diff --git a/sources/ScreenChar.h b/sources/ScreenChar.h index 066f332a0a..ebe3c6570f 100644 --- a/sources/ScreenChar.h +++ b/sources/ScreenChar.h @@ -291,7 +291,7 @@ static inline BOOL ScreenCharHasDefaultAttributesAndColors(const screen_char_t s // This is not how you'd normally construct a string line, since it's supposed to come from screen // characters. It's useful if you need a string line that doesn't represent actual characters on // the screen, though. -+ (iTermStringLine *)stringLineWithString:(NSString *)string; ++ (instancetype)stringLineWithString:(NSString *)string; - (instancetype)initWithScreenChars:(screen_char_t *)screenChars length:(NSInteger)length; diff --git a/sources/SearchResult.h b/sources/SearchResult.h index a316b3ef47..3f28b7306c 100644 --- a/sources/SearchResult.h +++ b/sources/SearchResult.h @@ -10,7 +10,7 @@ long long absStartY, absEndY; } -+ (SearchResult *)searchResultFromX:(int)x y:(long long)y toX:(int)endX y:(long long)endY; ++ (instancetype)searchResultFromX:(int)x y:(long long)y toX:(int)endX y:(long long)endY; - (BOOL)isEqualToSearchResult:(SearchResult *)other; @end diff --git a/sources/SessionTitleView.m b/sources/SessionTitleView.m index ea9d21ac2e..008f6f797a 100644 --- a/sources/SessionTitleView.m +++ b/sources/SessionTitleView.m @@ -41,7 +41,7 @@ @implementation SessionTitleView { @synthesize delegate = delegate_; @synthesize dimmingAmount = dimmingAmount_; -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { const double kMargin = 5; diff --git a/sources/SessionView.h b/sources/SessionView.h index 78a8c59fdf..37e2dd6ed3 100644 --- a/sources/SessionView.h +++ b/sources/SessionView.h @@ -47,7 +47,7 @@ + (double)titleHeight; + (NSDate*)lastResizeDate; + (void)windowDidResize; -- (id)initWithFrame:(NSRect)frame session:(PTYSession*)session; +- (instancetype)initWithFrame:(NSRect)frame session:(PTYSession*)session; - (void)setDimmed:(BOOL)isDimmed; - (FindViewController*)findViewController; - (void)setBackgroundDimmed:(BOOL)backgroundDimmed; diff --git a/sources/SessionView.m b/sources/SessionView.m index 70e3452429..01affe84ff 100644 --- a/sources/SessionView.m +++ b/sources/SessionView.m @@ -65,7 +65,7 @@ - (void)_initCommon { _announcements = [[NSMutableArray alloc] init]; } -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [self _initCommon]; @@ -80,7 +80,7 @@ - (id)initWithFrame:(NSRect)frame { return self; } -- (id)initWithFrame:(NSRect)frame session:(PTYSession*)session { +- (instancetype)initWithFrame:(NSRect)frame session:(PTYSession*)session { self = [self initWithFrame:frame]; if (self) { [self _initCommon]; diff --git a/sources/SolidColorView.h b/sources/SolidColorView.h index 5f1e4426f4..0925dfbd00 100644 --- a/sources/SolidColorView.h +++ b/sources/SolidColorView.h @@ -13,10 +13,9 @@ BOOL isFlipped_; } -- (id)initWithFrame:(NSRect)frame color:(NSColor*)color; +- (instancetype)initWithFrame:(NSRect)frame color:(NSColor*)color; - (void)drawRect:(NSRect)dirtyRect; -- (void)setColor:(NSColor*)color; -- (NSColor*)color; +@property (nonatomic, retain) NSColor *color; - (void)setFlipped:(BOOL)value; @end diff --git a/sources/SolidColorView.m b/sources/SolidColorView.m index 05528c8e31..9091096022 100644 --- a/sources/SolidColorView.m +++ b/sources/SolidColorView.m @@ -8,7 +8,9 @@ #import "SolidColorView.h" @implementation SolidColorView -- (id)initWithFrame:(NSRect)frame color:(NSColor*)color +@synthesize color = color_; + +- (instancetype)initWithFrame:(NSRect)frame color:(NSColor*)color { self = [super initWithFrame:frame]; if (self) { @@ -36,11 +38,6 @@ - (void)setColor:(NSColor*)color [self setNeedsDisplay:YES]; } -- (NSColor*)color -{ - return color_; -} - - (BOOL)isFlipped { return isFlipped_; diff --git a/sources/SplitPanel.m b/sources/SplitPanel.m index e0a5578df5..36ca5432e9 100644 --- a/sources/SplitPanel.m +++ b/sources/SplitPanel.m @@ -45,7 +45,7 @@ + (NSString *)showPanelWithParent:(NSWindowController *)parent isVertical:(BOOL) } } -- (id)initWithWindowNibName:(NSString *)windowNibName +- (instancetype)initWithWindowNibName:(NSString *)windowNibName { self = [super initWithWindowNibName:windowNibName]; if (self) { diff --git a/sources/SplitSelectionView.h b/sources/SplitSelectionView.h index eaeb28fc00..97a3c9db23 100644 --- a/sources/SplitSelectionView.h +++ b/sources/SplitSelectionView.h @@ -10,14 +10,14 @@ #import -typedef enum { +typedef NS_ENUM(NSInteger, SplitSessionHalf) { kNoHalf, kNorthHalf, kSouthHalf, kEastHalf, kWestHalf, kFullPane -} SplitSessionHalf; +}; @class PTYSession; @@ -44,7 +44,7 @@ typedef enum { // frame is the frame fo the parent view. // session is the session we overlay. // the delegate gets called when a selection is made. -- (id)initAsCancelOnly:(BOOL)cancelOnly +- (instancetype)initAsCancelOnly:(BOOL)cancelOnly withFrame:(NSRect)frame withSession:(PTYSession *)session delegate:(id)delegate diff --git a/sources/SplitSelectionView.m b/sources/SplitSelectionView.m index a2f9c78308..e550c1c27a 100644 --- a/sources/SplitSelectionView.m +++ b/sources/SplitSelectionView.m @@ -19,7 +19,7 @@ @implementation SplitSelectionView { @synthesize cancelOnly = cancelOnly_; -- (id)initWithFrame:(NSRect)frameRect +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { @@ -30,7 +30,7 @@ - (id)initWithFrame:(NSRect)frameRect return self; } -- (id)initAsCancelOnly:(BOOL)cancelOnly +- (instancetype)initAsCancelOnly:(BOOL)cancelOnly withFrame:(NSRect)frame withSession:(PTYSession *)session delegate:(id)delegate diff --git a/sources/TSVParser.m b/sources/TSVParser.m index 06285994ab..29931213bf 100644 --- a/sources/TSVParser.m +++ b/sources/TSVParser.m @@ -13,7 +13,7 @@ @implementation TSVDocument @synthesize columns = columns_; @synthesize records = records_; -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/TaskNotifier.h b/sources/TaskNotifier.h index f03dd067d0..5fbb22b979 100644 --- a/sources/TaskNotifier.h +++ b/sources/TaskNotifier.h @@ -9,7 +9,7 @@ extern NSString *const kTaskNotifierDidSpin; @interface TaskNotifier : NSObject -+ (TaskNotifier*)sharedInstance; ++ (instancetype)sharedInstance; - (instancetype)init; diff --git a/sources/TaskNotifier.m b/sources/TaskNotifier.m index b83d3c9f46..a76c3daae8 100644 --- a/sources/TaskNotifier.m +++ b/sources/TaskNotifier.m @@ -43,7 +43,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/TemporaryNumberAllocator.m b/sources/TemporaryNumberAllocator.m index 0cf006323a..5f4fe8686f 100644 --- a/sources/TemporaryNumberAllocator.m +++ b/sources/TemporaryNumberAllocator.m @@ -21,7 +21,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _numbers = [[NSMutableSet alloc] init]; diff --git a/sources/TerminalFile.h b/sources/TerminalFile.h index 633c2d8145..d023c8d735 100644 --- a/sources/TerminalFile.h +++ b/sources/TerminalFile.h @@ -19,7 +19,7 @@ NSString *const kTerminalFileShouldStopNotification; // You must call -download after initWithName:size: to enter starting status. // A nil name opens a save panel. // A size of -1 means the size is unknown. -- (id)initWithName:(NSString *)name size:(int)size; +- (instancetype)initWithName:(NSString *)name size:(int)size; // Appends data to a file in transferring status. Enters transferring status. - (void)appendData:(NSString *)data; diff --git a/sources/TerminalFile.m b/sources/TerminalFile.m index bc32c56ad8..60bd41f832 100644 --- a/sources/TerminalFile.m +++ b/sources/TerminalFile.m @@ -22,7 +22,7 @@ @interface TerminalFile () @implementation TerminalFile -- (id)initWithName:(NSString *)name size:(int)size { +- (instancetype)initWithName:(NSString *)name size:(int)size { self = [super init]; if (self) { if (!name) { diff --git a/sources/ThreeFingerTapGestureRecognizer.h b/sources/ThreeFingerTapGestureRecognizer.h index 8ea4275687..482e6a2fd7 100644 --- a/sources/ThreeFingerTapGestureRecognizer.h +++ b/sources/ThreeFingerTapGestureRecognizer.h @@ -13,7 +13,7 @@ // This is the designated initializer. On a three-finger tap, the selector will be performed on // target. The target is not retained. The selector will take one argument, an NSEvent corresponding // to the last touch ending. -- (id)initWithTarget:(NSView *)target selector:(SEL)selector; +- (instancetype)initWithTarget:(NSView *)target selector:(SEL)selector; // Target must call this in its dealloc method. - (void)disconnectTarget; diff --git a/sources/ThreeFingerTapGestureRecognizer.m b/sources/ThreeFingerTapGestureRecognizer.m index 85f923e9db..1de27a63e7 100644 --- a/sources/ThreeFingerTapGestureRecognizer.m +++ b/sources/ThreeFingerTapGestureRecognizer.m @@ -19,7 +19,7 @@ @implementation ThreeFingerTapGestureRecognizer { BOOL fired_; // True if we just faked a three-finger click and future mouse clicks should be ignored. } -- (id)initWithTarget:(NSView *)target selector:(SEL)selector { +- (instancetype)initWithTarget:(NSView *)target selector:(SEL)selector { self = [super init]; if (self) { target_ = target; diff --git a/sources/TmuxController.h b/sources/TmuxController.h index 57e9ac3d74..84e0859c02 100644 --- a/sources/TmuxController.h +++ b/sources/TmuxController.h @@ -15,21 +15,21 @@ @class EquivalenceClassSet; // Posted when sessions change (names, addition, deletion) -extern NSString *kTmuxControllerSessionsDidChange; +extern NSString *const kTmuxControllerSessionsDidChange; // Posted after detaching -extern NSString *kTmuxControllerDetachedNotification; +extern NSString *const kTmuxControllerDetachedNotification; // Posted when a window changes. -extern NSString *kTmuxControllerWindowsChangeNotification; +extern NSString *const kTmuxControllerWindowsChangeNotification; // Posted when a window changes name -extern NSString *kTmuxControllerWindowWasRenamed; +extern NSString *const kTmuxControllerWindowWasRenamed; // Posted when a window opens -extern NSString *kTmuxControllerWindowDidOpen; +extern NSString *const kTmuxControllerWindowDidOpen; // Posted when a window closes -extern NSString *kTmuxControllerWindowDidClose; +extern NSString *const kTmuxControllerWindowDidClose; // Posted when the attached session changes -extern NSString *kTmuxControllerAttachedSessionDidChange; +extern NSString *const kTmuxControllerAttachedSessionDidChange; // Posted when a session changes name -extern NSString *kTmuxControllerSessionWasRenamed; +extern NSString *const kTmuxControllerSessionWasRenamed; @interface TmuxController : NSObject @@ -41,7 +41,7 @@ extern NSString *kTmuxControllerSessionWasRenamed; @property(nonatomic, readonly) NSString *clientName; @property(nonatomic, readonly) int sessionId; -- (id)initWithGateway:(TmuxGateway *)gateway clientName:(NSString *)clientName; +- (instancetype)initWithGateway:(TmuxGateway *)gateway clientName:(NSString *)clientName; - (void)openWindowsInitial; - (void)openWindowWithId:(int)windowId intentional:(BOOL)intentional; @@ -73,7 +73,7 @@ extern NSString *kTmuxControllerSessionWasRenamed; - (void)fitLayoutToWindows; - (void)validateOptions; - (void)setClientSize:(NSSize)size; -- (BOOL)hasOutstandingWindowResize; +@property (readonly) BOOL hasOutstandingWindowResize; - (void)windowPane:(int)wp resizedBy:(int)amount horizontally:(BOOL)wasHorizontal; @@ -95,7 +95,7 @@ extern NSString *kTmuxControllerSessionWasRenamed; - (void)killWindowPane:(int)windowPane; - (void)killWindow:(int)window; - (void)unlinkWindowWithId:(int)windowId inSession:(NSString *)sessionName; -- (BOOL)isAttached; +@property (readonly, getter=isAttached) BOOL attached; - (void)requestDetach; - (void)renameWindowWithId:(int)windowId inSession:(NSString *)sessionName toName:(NSString *)newName; - (void)linkWindowId:(int)windowId diff --git a/sources/TmuxController.m b/sources/TmuxController.m index 0f328169a7..361abb4fc8 100644 --- a/sources/TmuxController.m +++ b/sources/TmuxController.m @@ -22,14 +22,14 @@ #import "TmuxWindowOpener.h" #import "TSVParser.h" -NSString *kTmuxControllerSessionsDidChange = @"kTmuxControllerSessionsDidChange"; -NSString *kTmuxControllerDetachedNotification = @"kTmuxControllerDetachedNotification"; -NSString *kTmuxControllerWindowsChangeNotification = @"kTmuxControllerWindowsChangeNotification"; -NSString *kTmuxControllerWindowWasRenamed = @"kTmuxControllerWindowWasRenamed"; -NSString *kTmuxControllerWindowDidOpen = @"kTmuxControllerWindowDidOpen"; -NSString *kTmuxControllerAttachedSessionDidChange = @"kTmuxControllerAttachedSessionDidChange"; -NSString *kTmuxControllerWindowDidClose = @"kTmuxControllerWindowDidClose"; -NSString *kTmuxControllerSessionWasRenamed = @"kTmuxControllerSessionWasRenamed"; +NSString *const kTmuxControllerSessionsDidChange = @"kTmuxControllerSessionsDidChange"; +NSString *const kTmuxControllerDetachedNotification = @"kTmuxControllerDetachedNotification"; +NSString *const kTmuxControllerWindowsChangeNotification = @"kTmuxControllerWindowsChangeNotification"; +NSString *const kTmuxControllerWindowWasRenamed = @"kTmuxControllerWindowWasRenamed"; +NSString *const kTmuxControllerWindowDidOpen = @"kTmuxControllerWindowDidOpen"; +NSString *const kTmuxControllerAttachedSessionDidChange = @"kTmuxControllerAttachedSessionDidChange"; +NSString *const kTmuxControllerWindowDidClose = @"kTmuxControllerWindowDidClose"; +NSString *const kTmuxControllerSessionWasRenamed = @"kTmuxControllerSessionWasRenamed"; // Unsupported global options: static NSString *const kAggressiveResize = @"aggressive-resize"; @@ -85,7 +85,7 @@ @implementation TmuxController { @synthesize ambiguousIsDoubleWidth = ambiguousIsDoubleWidth_; @synthesize sessionId = sessionId_; -- (id)initWithGateway:(TmuxGateway *)gateway clientName:(NSString *)clientName +- (instancetype)initWithGateway:(TmuxGateway *)gateway clientName:(NSString *)clientName { self = [super init]; if (self) { diff --git a/sources/TmuxControllerRegistry.h b/sources/TmuxControllerRegistry.h index 9358c847f3..f35906ddc0 100644 --- a/sources/TmuxControllerRegistry.h +++ b/sources/TmuxControllerRegistry.h @@ -16,11 +16,11 @@ extern NSString *const kTmuxControllerRegistryDidChange; NSMutableDictionary *controllers_; // client -> controller } -+ (TmuxControllerRegistry *)sharedInstance; ++ (instancetype)sharedInstance; - (TmuxController *)controllerForClient:(NSString *)client; - (void)setController:(TmuxController *)controller forClient:(NSString *)client; -- (int)numberOfClients; +@property (readonly) NSInteger numberOfClients; - (NSString *)uniqueClientNameBasedOn:(NSString *)preferredName; -- (NSArray *)clientNames; +@property (readonly, copy) NSArray *clientNames; @end diff --git a/sources/TmuxControllerRegistry.m b/sources/TmuxControllerRegistry.m index 014145c8af..029ba5dac6 100644 --- a/sources/TmuxControllerRegistry.m +++ b/sources/TmuxControllerRegistry.m @@ -21,7 +21,7 @@ + (TmuxControllerRegistry *)sharedInstance return instance; } -- (id)init +- (instancetype)init { self = [super init]; if (self) { @@ -56,7 +56,7 @@ - (void)setController:(TmuxController *)controller forClient:(NSString *)client object:client]; } -- (int)numberOfClients { +- (NSInteger)numberOfClients { return controllers_.count; } diff --git a/sources/TmuxDashboardController.h b/sources/TmuxDashboardController.h index 91bdf04de8..a2ee524763 100644 --- a/sources/TmuxDashboardController.h +++ b/sources/TmuxDashboardController.h @@ -18,6 +18,6 @@ IBOutlet NSPopUpButton *connectionsButton_; } -+ (TmuxDashboardController *)sharedInstance; ++ (instancetype)sharedInstance; @end diff --git a/sources/TmuxDashboardController.m b/sources/TmuxDashboardController.m index e3d60ce5b5..4ad5cb8da1 100644 --- a/sources/TmuxDashboardController.m +++ b/sources/TmuxDashboardController.m @@ -32,7 +32,7 @@ + (TmuxDashboardController *)sharedInstance return instance; } -- (id)init +- (instancetype)init { self = [super initWithWindowNibName:@"TmuxDashboard"]; if (self) { diff --git a/sources/TmuxGateway.h b/sources/TmuxGateway.h index 30165fa8d6..62ede06493 100644 --- a/sources/TmuxGateway.h +++ b/sources/TmuxGateway.h @@ -38,7 +38,7 @@ extern NSString * const kTmuxGatewayErrorDomain; - (void)tmuxWindowsDidChange; - (void)tmuxSession:(int)sessionId renamed:(NSString *)newName; - (NSSize)tmuxBookmarkSize; // rows, cols -- (int)tmuxNumHistoryLinesInBookmark; +- (NSInteger)tmuxNumHistoryLinesInBookmark; - (void)tmuxSetSecureLogging:(BOOL)secureLogging; - (void)tmuxPrintLine:(NSString *)line; - (NSWindowController *)tmuxGatewayWindow; @@ -72,7 +72,7 @@ typedef NS_ENUM(NSInteger, ControlCommand) { @property(nonatomic, assign) BOOL tmuxLogging; @property(nonatomic, readonly) NSWindowController *window; -- (id)initWithDelegate:(id)delegate; +- (instancetype)initWithDelegate:(id)delegate; // Returns any unconsumed data if tmux mode is exited. // The token must be TMUX_xxx. @@ -106,6 +106,6 @@ typedef NS_ENUM(NSInteger, ControlCommand) { - (void)sendKeys:(NSData *)data toWindowPane:(int)windowPane; - (void)detach; -- (id)delegate; +@property (readonly, assign) id delegate; @end diff --git a/sources/TmuxGateway.m b/sources/TmuxGateway.m index 43a70867c7..39040b3502 100644 --- a/sources/TmuxGateway.m +++ b/sources/TmuxGateway.m @@ -42,7 +42,7 @@ @implementation TmuxGateway { BOOL disconnected_; } -- (id)initWithDelegate:(id)delegate +- (instancetype)initWithDelegate:(id)delegate { self = [super init]; if (self) { diff --git a/sources/TmuxHistoryParser.h b/sources/TmuxHistoryParser.h index 0442bae501..f82fe6ec1a 100644 --- a/sources/TmuxHistoryParser.h +++ b/sources/TmuxHistoryParser.h @@ -9,8 +9,8 @@ @interface TmuxHistoryParser : NSObject -+ (TmuxHistoryParser *)sharedInstance; -- (NSArray *)parseDumpHistoryResponse:(NSString *)response ++ (instancetype)sharedInstance; +- (NSArray *)parseDumpHistoryResponse:(NSString *)response ambiguousIsDoubleWidth:(BOOL)ambiguousIsDoubleWidth; @end diff --git a/sources/TmuxLayoutParser.h b/sources/TmuxLayoutParser.h index dae4752e7c..9fa6e2a09a 100644 --- a/sources/TmuxLayoutParser.h +++ b/sources/TmuxLayoutParser.h @@ -36,7 +36,7 @@ typedef NS_ENUM(NSInteger, LayoutNodeType) { @interface TmuxLayoutParser : NSObject -+ (TmuxLayoutParser *)sharedInstance; ++ (instancetype)sharedInstance; - (NSMutableDictionary *)parsedLayoutFromString:(NSString *)layout; - (NSMutableDictionary *)windowPane:(int)windowPane inParseTree:(NSMutableDictionary *)parseTree; diff --git a/sources/TmuxSessionsTable.h b/sources/TmuxSessionsTable.h index bbc8913092..a84376727d 100644 --- a/sources/TmuxSessionsTable.h +++ b/sources/TmuxSessionsTable.h @@ -41,7 +41,7 @@ @property (nonatomic, assign) id delegate; - (void)setSessions:(NSArray *)names; -- (NSString *)selectedSessionName; +@property (readonly, copy) NSString *selectedSessionName; - (void)selectSessionWithName:(NSString *)name; #pragma mark Interface Builder actions diff --git a/sources/TmuxSessionsTable.m b/sources/TmuxSessionsTable.m index 71058520d4..62dfa43c09 100644 --- a/sources/TmuxSessionsTable.m +++ b/sources/TmuxSessionsTable.m @@ -15,7 +15,7 @@ @implementation TmuxSessionsTable @synthesize delegate = delegate_; -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/TmuxWindowOpener.m b/sources/TmuxWindowOpener.m index ca2cc36535..73d7a325c8 100644 --- a/sources/TmuxWindowOpener.m +++ b/sources/TmuxWindowOpener.m @@ -58,7 +58,7 @@ + (TmuxWindowOpener *)windowOpener return [[[TmuxWindowOpener alloc] init] autorelease]; } -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/TmuxWindowsTable.h b/sources/TmuxWindowsTable.h index 59f5ff29b8..52e6a058e2 100644 --- a/sources/TmuxWindowsTable.h +++ b/sources/TmuxWindowsTable.h @@ -44,7 +44,7 @@ extern NSString *kWindowPasteboardType; - (void)setWindows:(NSArray *)windows; - (void)setNameOfWindowWithId:(int)wid to:(NSString *)newName; -- (NSArray *)names; +- (NSArray *)names; - (void)updateEnabledStateOfButtons; - (void)reloadData; diff --git a/sources/TmuxWindowsTable.m b/sources/TmuxWindowsTable.m index fbe384f1b6..ff007bc7be 100644 --- a/sources/TmuxWindowsTable.m +++ b/sources/TmuxWindowsTable.m @@ -27,7 +27,7 @@ @implementation TmuxWindowsTable @synthesize delegate = delegate_; -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/ToolCapturedOutputView.m b/sources/ToolCapturedOutputView.m index 1bf4c7e0c5..54e69809e1 100644 --- a/sources/ToolCapturedOutputView.m +++ b/sources/ToolCapturedOutputView.m @@ -42,7 +42,7 @@ @implementation ToolCapturedOutputView { @synthesize tableView = tableView_; -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { spareCell_ = [[self cell] retain]; diff --git a/sources/ToolCommandHistoryView.h b/sources/ToolCommandHistoryView.h index f887004b62..599fcc9081 100644 --- a/sources/ToolCommandHistoryView.h +++ b/sources/ToolCommandHistoryView.h @@ -21,7 +21,7 @@ // For testing @property(nonatomic, readonly) NSTableView *tableView; -- (id)initWithFrame:(NSRect)frame; +- (instancetype)initWithFrame:(NSRect)frame; - (void)shutdown; - (void)updateCommands; - (CommandUse *)selectedCommandUse; diff --git a/sources/ToolCommandHistoryView.m b/sources/ToolCommandHistoryView.m index 5741ad88fe..c5f22bfaf5 100644 --- a/sources/ToolCommandHistoryView.m +++ b/sources/ToolCommandHistoryView.m @@ -35,7 +35,7 @@ @implementation ToolCommandHistoryView { @synthesize tableView = tableView_; -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { _paragraphStyle = [[NSMutableParagraphStyle alloc] init]; diff --git a/sources/ToolDirectoriesView.m b/sources/ToolDirectoriesView.m index 570a404eca..85f5c3456f 100644 --- a/sources/ToolDirectoriesView.m +++ b/sources/ToolDirectoriesView.m @@ -37,7 +37,7 @@ @implementation ToolDirectoriesView { @synthesize tableView = tableView_; -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { searchField_ = [[iTermSearchField alloc] initWithFrame:NSMakeRect(0, 0, frame.size.width, 1)]; diff --git a/sources/ToolJobs.m b/sources/ToolJobs.m index 0bc026af47..4bd26d2d03 100644 --- a/sources/ToolJobs.m +++ b/sources/ToolJobs.m @@ -65,7 +65,7 @@ + (int)signalForName:(NSString*)signalName { } } -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { [self setIntValue:kDefaultSignal]; @@ -175,7 +175,7 @@ - (void)updateTimer:(id)sender; @implementation ToolJobs -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { names_ = [[NSMutableArray alloc] init]; diff --git a/sources/ToolNotes.m b/sources/ToolNotes.m index 8bf4331282..a3cfc5446d 100644 --- a/sources/ToolNotes.m +++ b/sources/ToolNotes.m @@ -17,7 +17,7 @@ - (NSString *)filename; @implementation ToolNotes -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { filemanager_ = [[NSFileManager alloc] init]; diff --git a/sources/ToolPasteHistory.h b/sources/ToolPasteHistory.h index ab6f0d6887..0a42db1922 100644 --- a/sources/ToolPasteHistory.h +++ b/sources/ToolPasteHistory.h @@ -13,7 +13,7 @@ @interface ToolPasteHistory : NSView -- (id)initWithFrame:(NSRect)frame; +- (instancetype)initWithFrame:(NSRect)frame; - (void)shutdown; @end diff --git a/sources/ToolPasteHistory.m b/sources/ToolPasteHistory.m index d2e6cbaefa..39388e823d 100644 --- a/sources/ToolPasteHistory.m +++ b/sources/ToolPasteHistory.m @@ -25,7 +25,7 @@ @implementation ToolPasteHistory { BOOL shutdown_; } -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { clear_ = [[NSButton alloc] initWithFrame:NSMakeRect(0, frame.size.height - kButtonHeight, frame.size.width, kButtonHeight)]; diff --git a/sources/ToolProfiles.h b/sources/ToolProfiles.h index 4fe6932d11..4d4c520a30 100644 --- a/sources/ToolProfiles.h +++ b/sources/ToolProfiles.h @@ -16,6 +16,6 @@ NSPopUpButton *popup_; } -- (id)initWithFrame:(NSRect)frame; +- (instancetype)initWithFrame:(NSRect)frame; @end diff --git a/sources/ToolProfiles.m b/sources/ToolProfiles.m index af94070714..6a97f95ab9 100644 --- a/sources/ToolProfiles.m +++ b/sources/ToolProfiles.m @@ -17,7 +17,7 @@ @implementation ToolProfiles -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { listView_ = [[ProfileListView alloc] initWithFrame:NSMakeRect(kMargin, 0, frame.size.width - kMargin * 2, frame.size.height - kPopupHeight - kVerticalMargin)]; diff --git a/sources/TransferrableFile.m b/sources/TransferrableFile.m index 26557fb6c9..e06fae0c5d 100644 --- a/sources/TransferrableFile.m +++ b/sources/TransferrableFile.m @@ -15,7 +15,7 @@ @implementation TransferrableFile { TransferrableFile *_successor; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _status = kTransferrableFileStatusUnstarted; diff --git a/sources/TransferrableFileMenuItemView.m b/sources/TransferrableFileMenuItemView.m index b70aded22a..fe7f89435c 100644 --- a/sources/TransferrableFileMenuItemView.m +++ b/sources/TransferrableFileMenuItemView.m @@ -18,7 +18,7 @@ @interface TransferrableFileMenuItemView () @implementation TransferrableFileMenuItemView -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { _progressIndicator = [[iTermProgressIndicator alloc] initWithFrame:NSMakeRect(5, diff --git a/sources/TransferrableFileMenuItemViewController.h b/sources/TransferrableFileMenuItemViewController.h index c06024ae2b..ff5fe84d1d 100644 --- a/sources/TransferrableFileMenuItemViewController.h +++ b/sources/TransferrableFileMenuItemViewController.h @@ -17,7 +17,7 @@ @property(nonatomic, retain) NSMenuItem *removeFromListSubItem; @property(nonatomic, retain) NSMenuItem *openSubItem; -- (id)initWithTransferrableFile:(TransferrableFile *)transferrableFile; +- (instancetype)initWithTransferrableFile:(TransferrableFile *)transferrableFile; - (void)update; - (void)itemSelected:(id)sender; - (NSTimeInterval)timeSinceLastStatusChange; diff --git a/sources/TransferrableFileMenuItemViewController.m b/sources/TransferrableFileMenuItemViewController.m index d05d1b0bf2..26c446a291 100644 --- a/sources/TransferrableFileMenuItemViewController.m +++ b/sources/TransferrableFileMenuItemViewController.m @@ -18,7 +18,7 @@ @implementation TransferrableFileMenuItemViewController { BOOL _hasOpenedMenu; } -- (id)initWithTransferrableFile:(TransferrableFile *)transferrableFile { +- (instancetype)initWithTransferrableFile:(TransferrableFile *)transferrableFile { self = [super init]; if (self) { _transferrableFile = [transferrableFile retain]; diff --git a/sources/Trigger.h b/sources/Trigger.h index f282338350..23bd6670a4 100644 --- a/sources/Trigger.h +++ b/sources/Trigger.h @@ -44,15 +44,15 @@ extern NSString * const kTriggerPartialLineKey; // Index of "tag" in menu; inverse of tagAtIndex. // Deprecated -- (int)indexOfTag:(int)theTag; +- (NSInteger)indexOfTag:(NSInteger)theTag DEPRECATED_ATTRIBUTE; // Tag at "index" in menu. // Deprecated -- (int)tagAtIndex:(int)index; +- (NSInteger)tagAtIndex:(NSInteger)index DEPRECATED_ATTRIBUTE; // Index of represented object (usually a NSNumber tag, but could be something else) -- (int)indexForObject:(id)object; +- (NSInteger)indexForObject:(id)object; // Represented object (usually a NSNumber tag, but could be something else) at an index. -- (id)objectAtIndex:(int)index; +- (id)objectAtIndex:(NSInteger)index; // Utility that returns keys sorted by values for a tag/represented object dict // (i.e., an element of groupedMenuItemsForPopupButton) diff --git a/sources/Trigger.m b/sources/Trigger.m index de26faca51..7dfcaf8b9c 100644 --- a/sources/Trigger.m +++ b/sources/Trigger.m @@ -41,7 +41,7 @@ + (Trigger *)triggerFromDict:(NSDictionary *)dict return trigger; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _lastLineNumber = -1; @@ -189,21 +189,21 @@ - (NSComparisonResult)compareTitle:(Trigger *)other return [[self title] compare:[other title]]; } -- (int)indexOfTag:(int)theTag +- (NSInteger)indexOfTag:(NSInteger)theTag { return theTag; } -- (int)tagAtIndex:(int)theIndex +- (NSInteger)tagAtIndex:(NSInteger)theIndex { return 0; } -- (int)indexForObject:(id)object { +- (NSInteger)indexForObject:(id)object { return [self indexOfTag:[object intValue]]; } -- (id)objectAtIndex:(int)index { +- (id)objectAtIndex:(NSInteger)index { int tag = [self tagAtIndex:index]; if (tag < 0) { return nil; diff --git a/sources/TriggerController.m b/sources/TriggerController.m index 4082d935fb..ce412a996b 100644 --- a/sources/TriggerController.m +++ b/sources/TriggerController.m @@ -74,7 +74,7 @@ @implementation TriggerController { IBOutlet NSTableColumn *_parametersColumn; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { NSMutableArray *triggers = [NSMutableArray array]; diff --git a/sources/VT100ControlParser.m b/sources/VT100ControlParser.m index 9facde61d2..e8863f86a4 100644 --- a/sources/VT100ControlParser.m +++ b/sources/VT100ControlParser.m @@ -19,7 +19,7 @@ @interface VT100ControlParser () @implementation VT100ControlParser -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _dcsParser = [[VT100DCSParser alloc] init]; diff --git a/sources/VT100DCSParser.m b/sources/VT100DCSParser.m index bd879da333..ab56e56a82 100644 --- a/sources/VT100DCSParser.m +++ b/sources/VT100DCSParser.m @@ -84,7 +84,7 @@ + (NSDictionary *)termcapTerminfoInverseNameDictionary { return result; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _data = [[NSMutableString alloc] init]; diff --git a/sources/VT100Grid.h b/sources/VT100Grid.h index e33e4b27a3..e79555f69e 100644 --- a/sources/VT100Grid.h +++ b/sources/VT100Grid.h @@ -44,7 +44,7 @@ // Serialized state, but excludes screen contents. @property(nonatomic, readonly) NSDictionary *dictionaryValue; -- (id)initWithSize:(VT100GridSize)size delegate:(id)delegate; +- (instancetype)initWithSize:(VT100GridSize)size delegate:(id)delegate; - (screen_char_t *)screenCharsAtLineNumber:(int)lineNumber; diff --git a/sources/VT100Grid.m b/sources/VT100Grid.m index 92af819121..33f4b465d1 100644 --- a/sources/VT100Grid.m +++ b/sources/VT100Grid.m @@ -51,7 +51,7 @@ @implementation VT100Grid { @synthesize cursor = cursor_; @synthesize delegate = delegate_; -- (id)initWithSize:(VT100GridSize)size delegate:(id)delegate { +- (instancetype)initWithSize:(VT100GridSize)size delegate:(id)delegate { self = [super init]; if (self) { delegate_ = delegate; diff --git a/sources/VT100LineInfo.h b/sources/VT100LineInfo.h index ad4bbd236a..ff37d72357 100644 --- a/sources/VT100LineInfo.h +++ b/sources/VT100LineInfo.h @@ -13,7 +13,7 @@ @property(nonatomic, assign) NSTimeInterval timestamp; -- (id)initWithWidth:(int)width; +- (instancetype)initWithWidth:(int)width; - (void)setDirty:(BOOL)dirty inRange:(VT100GridRange)range updateTimestamp:(BOOL)updateTimestamp; - (BOOL)isDirtyAtOffset:(int)x; - (BOOL)anyCharIsDirty; diff --git a/sources/VT100LineInfo.m b/sources/VT100LineInfo.m index 349f0518ec..87028da777 100644 --- a/sources/VT100LineInfo.m +++ b/sources/VT100LineInfo.m @@ -17,7 +17,7 @@ @implementation VT100LineInfo { @synthesize timestamp = timestamp_; -- (id)initWithWidth:(int)width { +- (instancetype)initWithWidth:(int)width { self = [super init]; if (self) { width_ = width; diff --git a/sources/VT100Output.m b/sources/VT100Output.m index 396f9ab0db..a67d4286d0 100644 --- a/sources/VT100Output.m +++ b/sources/VT100Output.m @@ -105,7 +105,7 @@ @implementation VT100Output { char *_keyStrings[TERMINFO_KEYS]; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { self.termTypeIsValid = YES; diff --git a/sources/VT100Parser.m b/sources/VT100Parser.m index 7be3fe21df..02cad7737d 100644 --- a/sources/VT100Parser.m +++ b/sources/VT100Parser.m @@ -24,7 +24,7 @@ @implementation VT100Parser { BOOL _dcsHooked; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _totalStreamLength = kDefaultStreamSize; diff --git a/sources/VT100Screen.h b/sources/VT100Screen.h index 309947f748..0e7cec223f 100644 --- a/sources/VT100Screen.h +++ b/sources/VT100Screen.h @@ -64,7 +64,7 @@ extern int kVT100ScreenMinRows; @property(nonatomic, readonly) NSIndexSet *animatedLines; // Designated initializer. -- (id)initWithTerminal:(VT100Terminal *)terminal; +- (instancetype)initWithTerminal:(VT100Terminal *)terminal; // Destructively sets the screen size. - (void)destructivelySetScreenWidth:(int)width height:(int)height; diff --git a/sources/VT100Screen.m b/sources/VT100Screen.m index 441faaa602..0026914d01 100644 --- a/sources/VT100Screen.m +++ b/sources/VT100Screen.m @@ -171,7 +171,7 @@ @implementation VT100Screen { @synthesize dvr = dvr_; @synthesize delegate = delegate_; -- (id)initWithTerminal:(VT100Terminal *)terminal { +- (instancetype)initWithTerminal:(VT100Terminal *)terminal { self = [super init]; if (self) { assert(terminal); diff --git a/sources/VT100Terminal.m b/sources/VT100Terminal.m index 8c6c4730ca..96a27c6710 100644 --- a/sources/VT100Terminal.m +++ b/sources/VT100Terminal.m @@ -195,7 +195,7 @@ @implementation VT100Terminal { #pragma mark - Instance methods -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _output = [[VT100Output alloc] init]; diff --git a/sources/iTermAnnouncementView.m b/sources/iTermAnnouncementView.m index ab6111e8c6..4650ea9bfb 100644 --- a/sources/iTermAnnouncementView.m +++ b/sources/iTermAnnouncementView.m @@ -76,7 +76,7 @@ + (id)announcementViewWithTitle:(NSString *)title return view; } -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { frameRect.size.height -= 10; diff --git a/sources/iTermApplicationDelegate.m b/sources/iTermApplicationDelegate.m index 9ab23c7fa0..30755f23bf 100644 --- a/sources/iTermApplicationDelegate.m +++ b/sources/iTermApplicationDelegate.m @@ -653,7 +653,7 @@ - (void)updateScreenParametersInAllTerminals { } // init -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/iTermColorMap.m b/sources/iTermColorMap.m index 898a28c817..0d923115a8 100644 --- a/sources/iTermColorMap.m +++ b/sources/iTermColorMap.m @@ -60,7 +60,7 @@ + (iTermColorMapKey)keyFor8bitRed:(int)red return kColorMap24bitBase + ((red & 0xff) << 16) + ((green & 0xff) << 8) + (blue & 0xff); } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _map = [[NSMutableDictionary alloc] init]; diff --git a/sources/iTermController.m b/sources/iTermController.m index da7fdb6136..0f5b6c19d6 100644 --- a/sources/iTermController.m +++ b/sources/iTermController.m @@ -142,7 +142,7 @@ + (void)sharedInstanceRelease { shared = nil; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/iTermDirectoriesModel.m b/sources/iTermDirectoriesModel.m index d3dc28b69b..4d5e7c591e 100644 --- a/sources/iTermDirectoriesModel.m +++ b/sources/iTermDirectoriesModel.m @@ -44,7 +44,7 @@ + (instancetype)nodeWithComponent:(NSString *)component { return [[[self alloc] initWithComponent:component] autorelease]; } -- (id)initWithComponent:(NSString *)component { +- (instancetype)initWithComponent:(NSString *)component { self = [super init]; if (self) { _component = [component copy]; @@ -101,7 +101,7 @@ - (void)removePath:(NSString *)path; @implementation iTermDirectoryTree -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _root = [[iTermDirectoryTreeNode alloc] initWithComponent:nil]; @@ -301,7 +301,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _hostToPathArrayDictionary = [[NSMutableDictionary alloc] init]; diff --git a/sources/iTermEditKeyActionWindowController.m b/sources/iTermEditKeyActionWindowController.m index a8237f16ca..cd0643533c 100644 --- a/sources/iTermEditKeyActionWindowController.m +++ b/sources/iTermEditKeyActionWindowController.m @@ -34,7 +34,7 @@ @implementation iTermEditKeyActionWindowController { iTermPasteSpecialViewController *_pasteSpecialViewController; } -- (id)init { +- (instancetype)init { return [super initWithWindowNibName:@"iTermEditKeyActionWindowController"]; } diff --git a/sources/iTermExpose.m b/sources/iTermExpose.m index afd63f244e..8b409da4f1 100644 --- a/sources/iTermExpose.m +++ b/sources/iTermExpose.m @@ -82,7 +82,7 @@ + (void)exitIfActive } } -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/iTermExposeGridView.m b/sources/iTermExposeGridView.m index d1fde46b9a..70e56063db 100644 --- a/sources/iTermExposeGridView.m +++ b/sources/iTermExposeGridView.m @@ -22,7 +22,7 @@ + (NSScreen *)exposeScreen { return [[[NSApplication sharedApplication] keyWindow] deepestScreen]; } -- (id)initWithFrame:(NSRect)frame +- (instancetype)initWithFrame:(NSRect)frame images:(NSArray*)images labels:(NSArray*)labels tabs:(NSArray*)tabs diff --git a/sources/iTermExposeTabView.h b/sources/iTermExposeTabView.h index 10f548ed60..0da64b52ec 100644 --- a/sources/iTermExposeTabView.h +++ b/sources/iTermExposeTabView.h @@ -42,7 +42,7 @@ BOOL wasMaximized_; } -- (id)initWithImage:(NSImage*)image +- (instancetype)initWithImage:(NSImage*)image label:(NSString*)label tab:(PTYTab*)tab frame:(NSRect)frame diff --git a/sources/iTermExposeTabView.m b/sources/iTermExposeTabView.m index 791306731a..f0e7742d41 100644 --- a/sources/iTermExposeTabView.m +++ b/sources/iTermExposeTabView.m @@ -24,7 +24,7 @@ @implementation iTermExposeTabView @synthesize label = label_; @synthesize wasMaximized = wasMaximized_; -- (id)initWithImage:(NSImage*)image +- (instancetype)initWithImage:(NSImage*)image label:(NSString*)label tab:(PTYTab*)tab frame:(NSRect)frame diff --git a/sources/iTermExposeView.m b/sources/iTermExposeView.m index 00c25f4d69..c8c78ae80b 100644 --- a/sources/iTermExposeView.m +++ b/sources/iTermExposeView.m @@ -13,7 +13,7 @@ @implementation iTermExposeView @synthesize grid = grid_; -- (id)initWithFrame:(NSRect)frameRect +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { diff --git a/sources/iTermFindCursorView.m b/sources/iTermFindCursorView.m index f56ec9a11a..57f1bcd0c1 100644 --- a/sources/iTermFindCursorView.m +++ b/sources/iTermFindCursorView.m @@ -40,7 +40,7 @@ - (void)dealloc { [super dealloc]; } -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { @@ -98,7 +98,7 @@ - (void)dealloc { [super dealloc]; } -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { diff --git a/sources/iTermFindOnPageHelper.m b/sources/iTermFindOnPageHelper.m index a19c33f6f6..d9610ae2cf 100644 --- a/sources/iTermFindOnPageHelper.m +++ b/sources/iTermFindOnPageHelper.m @@ -55,7 +55,7 @@ @implementation iTermFindOnPageHelper { BOOL _findRegex; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _highlightMap = [[NSMutableDictionary alloc] init]; diff --git a/sources/iTermGrowlDelegate.m b/sources/iTermGrowlDelegate.m index 29c9f5015c..541e7db5ed 100644 --- a/sources/iTermGrowlDelegate.m +++ b/sources/iTermGrowlDelegate.m @@ -49,7 +49,7 @@ + (id)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { NSBundle *myBundle = [NSBundle bundleForClass:[iTermGrowlDelegate class]]; diff --git a/sources/iTermInstantReplayWindowController.m b/sources/iTermInstantReplayWindowController.m index f22f0a7e83..920a02b104 100644 --- a/sources/iTermInstantReplayWindowController.m +++ b/sources/iTermInstantReplayWindowController.m @@ -55,7 +55,7 @@ @implementation iTermInstantReplayWindowController { IBOutlet NSTextField *_latestTimeLabel; } -- (id)init { +- (instancetype)init { return [super initWithWindowNibName:@"InstantReplay"]; } diff --git a/sources/iTermKeyMappingViewController.m b/sources/iTermKeyMappingViewController.m index 0f412f0038..249f1031d3 100644 --- a/sources/iTermKeyMappingViewController.m +++ b/sources/iTermKeyMappingViewController.m @@ -23,7 +23,7 @@ @implementation iTermKeyMappingViewController { IBOutlet NSPopUpButton *_presetsPopup; } -- (id)init { +- (instancetype)init { self = [super initWithNibName:@"iTermKeyMapping" bundle:nil]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/sources/iTermMouseCursor.m b/sources/iTermMouseCursor.m index 8286c17601..80e866683e 100644 --- a/sources/iTermMouseCursor.m +++ b/sources/iTermMouseCursor.m @@ -80,7 +80,7 @@ + (instancetype)mouseCursorOfType:(iTermMouseCursorType)cursorType { } } -- (id)initWithType:(iTermMouseCursorType)cursorType { +- (instancetype)initWithType:(iTermMouseCursorType)cursorType { switch (cursorType) { case iTermMouseCursorTypeIBeamWithCircle: self = [super initWithImage:[NSImage imageNamed:@"IBarCursorXMR"] diff --git a/sources/iTermNSKeyBindingEmulator.m b/sources/iTermNSKeyBindingEmulator.m index d1c60a95ea..83594780a5 100644 --- a/sources/iTermNSKeyBindingEmulator.m +++ b/sources/iTermNSKeyBindingEmulator.m @@ -43,7 +43,7 @@ @interface iTermNSKeyBindingEmulator () @implementation iTermNSKeyBindingEmulator -- (id)init +- (instancetype)init { self = [super init]; if (self) { diff --git a/sources/iTermObjectPool.h b/sources/iTermObjectPool.h index f2d99bb137..d84f8e7001 100644 --- a/sources/iTermObjectPool.h +++ b/sources/iTermObjectPool.h @@ -27,7 +27,7 @@ // } // // // Optional to impelement -init, but it must be the designated initializer. -// - (id)init { +// - (instancetype)init { // ... // } // diff --git a/sources/iTermObjectPool.m b/sources/iTermObjectPool.m index 84c6d33bde..aea5b60a5f 100644 --- a/sources/iTermObjectPool.m +++ b/sources/iTermObjectPool.m @@ -14,7 +14,7 @@ - (void)recycleObject:(iTermPooledObject *)object; @interface iTermPooledObject () -- (id)initWithPool:(iTermObjectPool *)pool collectionNumber:(int)collectionNumber; +- (instancetype)initWithPool:(iTermObjectPool *)pool collectionNumber:(int)collectionNumber; - (int)poolCollectionNumber; @end @@ -24,7 +24,7 @@ @implementation iTermPooledObject { int _collectionNumber; } -- (id)initWithPool:(iTermObjectPool *)pool collectionNumber:(int)collectionNumber { +- (instancetype)initWithPool:(iTermObjectPool *)pool collectionNumber:(int)collectionNumber { self = [super init]; if (self) { _pool = pool; @@ -70,7 +70,7 @@ @implementation iTermObjectPool { Class _class; } -- (id)initWithClass:(Class)theClass +- (instancetype)initWithClass:(Class)theClass collections:(int)numCollections objectsPerCollection:(int)objectsPerCollection { self = [super init]; diff --git a/sources/iTermOpenQuicklyItem.m b/sources/iTermOpenQuicklyItem.m index a1388f388c..c104d103cb 100644 --- a/sources/iTermOpenQuicklyItem.m +++ b/sources/iTermOpenQuicklyItem.m @@ -16,7 +16,7 @@ - (void)dealloc { @implementation iTermOpenQuicklySessionItem -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _logoGenerator = [[iTermLogoGenerator alloc] init]; diff --git a/sources/iTermOpenQuicklyWindowController.m b/sources/iTermOpenQuicklyWindowController.m index a3f6ab9b6b..b3d8e6dfac 100644 --- a/sources/iTermOpenQuicklyWindowController.m +++ b/sources/iTermOpenQuicklyWindowController.m @@ -44,7 +44,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super initWithWindowNibName:@"iTermOpenQuicklyWindowController"]; if (self) { _model = [[iTermOpenQuicklyModel alloc] init]; diff --git a/sources/iTermPasswordManagerWindowController.m b/sources/iTermPasswordManagerWindowController.m index 182414e3f4..01ef477bea 100644 --- a/sources/iTermPasswordManagerWindowController.m +++ b/sources/iTermPasswordManagerWindowController.m @@ -52,7 +52,7 @@ + (NSArray *)accountNamesWithFilter:(NSString *)filter { return [[array sortedArrayUsingSelector:@selector(compare:)] retain]; } -- (id)init { +- (instancetype)init { self = [self initWithWindowNibName:@"iTermPasswordManager"]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/sources/iTermPasteHelper.m b/sources/iTermPasteHelper.m index c2e027e80f..0f363472cf 100644 --- a/sources/iTermPasteHelper.m +++ b/sources/iTermPasteHelper.m @@ -48,7 +48,7 @@ + (NSMutableCharacterSet *)unsafeControlCodeSet { return controlSet; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _eventQueue = [[NSMutableArray alloc] init]; diff --git a/sources/iTermPreferencesBaseViewController.m b/sources/iTermPreferencesBaseViewController.m index 4f5b9e0651..20a7fde8c2 100644 --- a/sources/iTermPreferencesBaseViewController.m +++ b/sources/iTermPreferencesBaseViewController.m @@ -29,7 +29,7 @@ @implementation iTermPreferencesBaseViewController { NSMutableSet *_keys; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { diff --git a/sources/iTermProfilesWindowController.m b/sources/iTermProfilesWindowController.m index f3c670cb7d..f29f0e5b16 100644 --- a/sources/iTermProfilesWindowController.m +++ b/sources/iTermProfilesWindowController.m @@ -65,12 +65,12 @@ + (iTermProfilesWindowController*)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [self initWithWindowNibName:@"ProfilesWindow"]; return self; } -- (id)initWithWindowNibName:(NSString *)windowNibName { +- (instancetype)initWithWindowNibName:(NSString *)windowNibName { self = [super initWithWindowNibName:windowNibName]; if (self) { diff --git a/sources/iTermSelection.m b/sources/iTermSelection.m index 5ab8055f4b..c706a85812 100644 --- a/sources/iTermSelection.m +++ b/sources/iTermSelection.m @@ -143,7 +143,7 @@ + (NSString *)nameForMode:(iTermSelectionMode)mode { } } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { _subSelections = [[NSMutableArray alloc] init]; diff --git a/sources/iTermSizeRememberingView.m b/sources/iTermSizeRememberingView.m index fb0d9303cd..3e9014e189 100644 --- a/sources/iTermSizeRememberingView.m +++ b/sources/iTermSizeRememberingView.m @@ -12,7 +12,7 @@ @implementation iTermSizeRememberingView { NSSize _originalSize; } -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; _originalSize = frame.size; return self; diff --git a/sources/iTermTextExtractor.m b/sources/iTermTextExtractor.m index 40db5c4d13..6e240d6c05 100644 --- a/sources/iTermTextExtractor.m +++ b/sources/iTermTextExtractor.m @@ -43,7 +43,7 @@ + (NSCharacterSet *)wordSeparatorCharacterSet return charset; } -- (id)initWithDataSource:(id)dataSource { +- (instancetype)initWithDataSource:(id)dataSource { self = [super init]; if (self) { _dataSource = dataSource; diff --git a/sources/iTermTipCardActionButton.m b/sources/iTermTipCardActionButton.m index f8617c9284..97dd2496de 100644 --- a/sources/iTermTipCardActionButton.m +++ b/sources/iTermTipCardActionButton.m @@ -65,7 +65,7 @@ + (NSColor *)blueColor { return [NSColor colorWithCalibratedRed:0.25 green:0.25 blue:0.75 alpha:1]; } -- (id)initWithFrame:(NSRect)frameRect { +- (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { _desiredHeight = kStandardButtonHeight; diff --git a/sources/iTermToolWrapper.h b/sources/iTermToolWrapper.h index 81c8289a51..5dd1b5e2c5 100644 --- a/sources/iTermToolWrapper.h +++ b/sources/iTermToolWrapper.h @@ -61,7 +61,7 @@ @property (nonatomic, assign) id delegate; - (void)relayout; -- (id)tool; +@property (readonly, retain) id tool; - (void)removeToolSubviews; - (CGFloat)minimumHeight; diff --git a/sources/iTermToolWrapper.m b/sources/iTermToolWrapper.m index 10133a4654..adaee43e08 100644 --- a/sources/iTermToolWrapper.m +++ b/sources/iTermToolWrapper.m @@ -37,7 +37,7 @@ @implementation iTermToolWrapper { NSButton *_closeButton; } -- (id)initWithFrame:(NSRect)frame { +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { _title = [[NSTextField alloc] initWithFrame:NSMakeRect(kCloseButtonLeftMargin + kButtonSize, diff --git a/sources/iTermToolbeltView.m b/sources/iTermToolbeltView.m index 353718c3d7..6a484b99ed 100644 --- a/sources/iTermToolbeltView.m +++ b/sources/iTermToolbeltView.m @@ -128,7 +128,7 @@ + (NSDictionary *)toolsDictionary { #pragma mark - NSObject -- (id)initWithFrame:(NSRect)frame delegate:(id)delegate { +- (instancetype)initWithFrame:(NSRect)frame delegate:(id)delegate { self = [super initWithFrame:frame]; if (self) { _delegate = delegate; diff --git a/sources/iTermURLSchemeController.m b/sources/iTermURLSchemeController.m index 931b58b44b..323025861c 100644 --- a/sources/iTermURLSchemeController.m +++ b/sources/iTermURLSchemeController.m @@ -25,7 +25,7 @@ + (instancetype)sharedInstance { return instance; } -- (id)init { +- (instancetype)init { self = [super init]; if (self) { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];