Revision: 13778
          http://sourceforge.net/p/skim-app/code/13778
Author:   hofman
Date:     2023-11-19 17:06:56 +0000 (Sun, 19 Nov 2023)
Log Message:
-----------
Don't pass typeSelectHelper instance in delegate methods

Modified Paths:
--------------
    trunk/SKBookmarkController.m
    trunk/SKDownloadController.m
    trunk/SKMainWindowController_UI.m
    trunk/SKNotesDocument.m
    trunk/SKOutlineView.h
    trunk/SKOutlineView.m
    trunk/SKPresentationOptionsSheetController.m
    trunk/SKTableView.h
    trunk/SKTableView.m
    trunk/SKTypeSelectHelper.h
    trunk/SKTypeSelectHelper.m

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKBookmarkController.m        2023-11-19 17:06:56 UTC (rev 13778)
@@ -1115,7 +1115,7 @@
     return [NSURL canReadFileURLFromPasteboard:pboard];
 }
 
-- (NSArray *)outlineView:(NSOutlineView *)ov 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)typeSelectHelper {
+- (NSArray *)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView *)ov {
     NSInteger i, count = [outlineView numberOfRows];
     NSMutableArray *labels = [NSMutableArray arrayWithCapacity:count];
     for (i = 0; i < count; i++) {
@@ -1125,11 +1125,11 @@
     return labels;
 }
 
-- (void)outlineView:(NSOutlineView *)ov typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString {
+- (void)outlineView:(NSOutlineView *)ov 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString {
     [[statusBar leftField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"%@\"", @"Status message"), 
searchString]];
 }
 
-- (void)outlineView:(NSOutlineView *)ov typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper updateSearchString:(NSString *)searchString {
+- (void)outlineView:(NSOutlineView *)ov 
typeSelectHelperUpdateSearchString:(NSString *)searchString {
     if (searchString)
         [[statusBar leftField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"Finding: \"%@\"", @"Status message"), 
searchString]];
     else

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKDownloadController.m        2023-11-19 17:06:56 UTC (rev 13778)
@@ -488,7 +488,7 @@
     return [NSURL canReadURLFromPasteboard:pboard];
 }
 
-- (NSArray *)tableView:(NSTableView *)aTableView 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)typeSelectHelper {
+- (NSArray *)tableViewTypeSelectHelperSelectionStrings:(NSTableView 
*)aTableView {
     return [downloads valueForKey:SKDownloadFileNameKey];
 }
 

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKMainWindowController_UI.m   2023-11-19 17:06:56 UTC (rev 13778)
@@ -622,7 +622,7 @@
     return nil;
 }
 
-- (NSArray *)tableView:(NSTableView *)tv 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)typeSelectHelper {
+- (NSArray *)tableViewTypeSelectHelperSelectionStrings:(NSTableView *)tv {
     if ([tv isEqual:leftSideController.thumbnailTableView]) {
         return pageLabels;
     }
@@ -629,13 +629,13 @@
     return nil;
 }
 
-- (void)tableView:(NSTableView *)tv typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString {
+- (void)tableView:(NSTableView *)tv 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString {
     if ([tv isEqual:leftSideController.thumbnailTableView]) {
         [[statusBar leftField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"%@\"", @"Status message"), 
searchString]];
     }
 }
 
-- (void)tableView:(NSTableView *)tv typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper updateSearchString:(NSString *)searchString {
+- (void)tableView:(NSTableView *)tv 
typeSelectHelperUpdateSearchString:(NSString *)searchString {
     if ([tv isEqual:leftSideController.thumbnailTableView]) {
         if (searchString)
             [[statusBar leftField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"Go to page: %@", @"Status message"), 
searchString]];
@@ -940,7 +940,7 @@
     return nil;
 }
 
-- (NSArray *)outlineView:(NSOutlineView *)ov 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)typeSelectHelper {
+- (NSArray *)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView *)ov {
     if ([ov isEqual:rightSideController.noteOutlineView]) {
         NSInteger i, count = [rightSideController.noteOutlineView 
numberOfRows];
         NSMutableArray *texts = [NSMutableArray arrayWithCapacity:count];
@@ -960,7 +960,7 @@
     return nil;
 }
 
-- (void)outlineView:(NSOutlineView *)ov typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString {
+- (void)outlineView:(NSOutlineView *)ov 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString {
     if ([ov isEqual:rightSideController.noteOutlineView]) {
         [[statusBar rightField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"%@\"", @"Status message"), 
searchString]];
     } else if ([ov isEqual:leftSideController.tocOutlineView]) {
@@ -968,7 +968,7 @@
     }
 }
 
-- (void)outlineView:(NSOutlineView *)ov typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper updateSearchString:(NSString *)searchString {
+- (void)outlineView:(NSOutlineView *)ov 
typeSelectHelperUpdateSearchString:(NSString *)searchString {
     if ([ov isEqual:rightSideController.noteOutlineView]) {
         if (searchString)
             [[statusBar rightField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"Finding note: \"%@\"", @"Status message"), 
searchString]];

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKNotesDocument.m     2023-11-19 17:06:56 UTC (rev 13778)
@@ -820,7 +820,7 @@
     NSMapInsert(rowHeights, item, (NSInteger)round(newHeight));
 }
 
-- (NSArray *)outlineView:(NSOutlineView *)ov 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)typeSelectHelper {
+- (NSArray *)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView *)ov {
     NSInteger i, count = [outlineView numberOfRows];
     NSMutableArray *texts = [NSMutableArray arrayWithCapacity:count];
     for (i = 0; i < count; i++) {
@@ -831,11 +831,11 @@
     return texts;
 }
 
-- (void)outlineView:(NSOutlineView *)ov typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString {
+- (void)outlineView:(NSOutlineView *)ov 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString {
     [[statusBar leftField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"%@\"", @"Status message"), 
searchString]];
 }
 
-- (void)outlineView:(NSOutlineView *)ov typeSelectHelper:(SKTypeSelectHelper 
*)typeSelectHelper updateSearchString:(NSString *)searchString {
+- (void)outlineView:(NSOutlineView *)ov 
typeSelectHelperUpdateSearchString:(NSString *)searchString {
     if (searchString)
         [[statusBar leftField] setStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"Finding note: \"%@\"", @"Status message"), 
searchString]];
     else

Modified: trunk/SKOutlineView.h
===================================================================
--- trunk/SKOutlineView.h       2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKOutlineView.h       2023-11-19 17:06:56 UTC (rev 13778)
@@ -88,8 +88,8 @@
 
 - (id <SKImageToolTipContext>)outlineView:(NSOutlineView *)anOutlineView 
imageContextForItem:(id)item scale:(CGFloat *)scale;
 
-- (NSArray *)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)aTypeSelectHelper;
-- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString;
-- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
updateSearchString:(NSString *)searchString;
+- (NSArray *)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView 
*)anOutlineView;
+- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString;
+- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperUpdateSearchString:(NSString *)searchString;
 
 @end

Modified: trunk/SKOutlineView.m
===================================================================
--- trunk/SKOutlineView.m       2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKOutlineView.m       2023-11-19 17:06:56 UTC (rev 13778)
@@ -375,29 +375,29 @@
 
 #pragma mark SKTypeSelectHelper datasource protocol
 
-- (NSArray *)typeSelectHelperSelectionStrings:(SKTypeSelectHelper 
*)aTypeSelectHelper {
-    if ([[self delegate] 
respondsToSelector:@selector(outlineView:typeSelectHelperSelectionStrings:)])
-        return [[self delegate] outlineView:self 
typeSelectHelperSelectionStrings:aTypeSelectHelper];
+- (NSArray *)typeSelectHelperSelectionStrings {
+    if ([[self delegate] 
respondsToSelector:@selector(outlineViewTypeSelectHelperSelectionStrings:)])
+        return [[self delegate] 
outlineViewTypeSelectHelperSelectionStrings:self];
     return nil;
 }
 
-- (NSUInteger)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper 
*)aTypeSelectHelper {
+- (NSUInteger)typeSelectHelperCurrentlySelectedIndex {
     return [[self selectedRowIndexes] lastIndex];
 }
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
selectItemAtIndex:(NSUInteger)itemIndex {
+- (void)typeSelectHelperSelectItemAtIndex:(NSUInteger)itemIndex {
     [self selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] 
byExtendingSelection:NO];
     [self scrollRowToVisible:itemIndex];
 }
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString {
-    if ([[self delegate] 
respondsToSelector:@selector(outlineView:typeSelectHelper:didFailToFindMatchForSearchString:)])
-        [[self delegate] outlineView:self typeSelectHelper:aTypeSelectHelper 
didFailToFindMatchForSearchString:searchString];
+- (void)typeSelectHelperDidFailToFindMatchForSearchString:(NSString 
*)searchString {
+    if ([[self delegate] 
respondsToSelector:@selector(outlineView:typeSelectHelperDidFailToFindMatchForSearchString:)])
+        [[self delegate] outlineView:self 
typeSelectHelperDidFailToFindMatchForSearchString:searchString];
 }
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
updateSearchString:(NSString *)searchString {
-    if ([[self delegate] 
respondsToSelector:@selector(outlineView:typeSelectHelper:updateSearchString:)])
-        [[self delegate] outlineView:self typeSelectHelper:aTypeSelectHelper 
updateSearchString:searchString];
+- (void)typeSelectHelperUpdateSearchString:(NSString *)searchString {
+    if ([[self delegate] 
respondsToSelector:@selector(outlineView:typeSelectHelperUpdateSearchString:)])
+        [[self delegate] outlineView:self 
typeSelectHelperUpdateSearchString:searchString];
 }
 
 - (id <SKOutlineViewDelegate>)delegate {

Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m        2023-11-19 16:53:21 UTC 
(rev 13777)
+++ trunk/SKPresentationOptionsSheetController.m        2023-11-19 17:06:56 UTC 
(rev 13778)
@@ -531,7 +531,7 @@
     [selTransitions setValue:empty forKey:PROPERTIES_KEY];
 }
 
-- (NSArray *)tableView:(NSTableView *)tv 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)typeSelectHelper {
+- (NSArray *)tableViewTypeSelectHelperSelectionStrings:(NSTableView *)tv {
     return [transitions valueForKeyPath:@"thumbnail.label"];
 }
 

Modified: trunk/SKTableView.h
===================================================================
--- trunk/SKTableView.h 2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKTableView.h 2023-11-19 17:06:56 UTC (rev 13778)
@@ -100,8 +100,8 @@
 
 - (id <SKImageToolTipContext>)tableView:(NSTableView *)aTableView 
imageContextForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex 
 scale:(CGFloat *)scale;
 
-- (NSArray *)tableView:(NSTableView *)aTableView 
typeSelectHelperSelectionStrings:(SKTypeSelectHelper *)aTypeSelectHelper;
-- (void)tableView:(NSTableView *)aTableView 
typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString;
-- (void)tableView:(NSTableView *)aTableView 
typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
updateSearchString:(NSString *)searchString;
+- (NSArray *)tableViewTypeSelectHelperSelectionStrings:(NSTableView 
*)aTableView;
+- (void)tableView:(NSTableView *)aTableView 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString;
+- (void)tableView:(NSTableView *)aTableView 
typeSelectHelperUpdateSearchString:(NSString *)searchString;
 
 @end

Modified: trunk/SKTableView.m
===================================================================
--- trunk/SKTableView.m 2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKTableView.m 2023-11-19 17:06:56 UTC (rev 13778)
@@ -392,29 +392,29 @@
 
 #pragma mark SKTypeSelectHelper datasource protocol
 
-- (NSArray *)typeSelectHelperSelectionStrings:(SKTypeSelectHelper 
*)aTypeSelectHelper {
-    if ([[self delegate] 
respondsToSelector:@selector(tableView:typeSelectHelperSelectionStrings:)])
-        return [[self delegate] tableView:self 
typeSelectHelperSelectionStrings:aTypeSelectHelper];
+- (NSArray *)typeSelectHelperSelectionStrings {
+    if ([[self delegate] 
respondsToSelector:@selector(tableViewTypeSelectHelperSelectionStrings:)])
+        return [[self delegate] 
tableViewTypeSelectHelperSelectionStrings:self];
     return nil;
 }
 
-- (NSUInteger)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper 
*)aTypeSelectHelper {
+- (NSUInteger)typeSelectHelperCurrentlySelectedIndex {
     return [[self selectedRowIndexes] lastIndex];
 }
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
selectItemAtIndex:(NSUInteger)itemIndex {
+- (void)typeSelectHelperSelectItemAtIndex:(NSUInteger)itemIndex {
     [self selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] 
byExtendingSelection:NO];
     [self scrollRowToVisible:itemIndex];
 }
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString {
-    if ([[self delegate] 
respondsToSelector:@selector(tableView:typeSelectHelper:didFailToFindMatchForSearchString:)])
-        [[self delegate] tableView:self typeSelectHelper:aTypeSelectHelper 
didFailToFindMatchForSearchString:searchString];
+- (void)typeSelectHelperDidFailToFindMatchForSearchString:(NSString 
*)searchString {
+    if ([[self delegate] 
respondsToSelector:@selector(tableView:typeSelectHelperDidFailToFindMatchForSearchString:)])
+        [[self delegate] tableView:self 
typeSelectHelperDidFailToFindMatchForSearchString:searchString];
 }
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)aTypeSelectHelper 
updateSearchString:(NSString *)searchString {
-    if ([[self delegate] 
respondsToSelector:@selector(tableView:typeSelectHelper:updateSearchString:)])
-        [[self delegate] tableView:self typeSelectHelper:aTypeSelectHelper 
updateSearchString:searchString];
+- (void)typeSelectHelperUpdateSearchString:(NSString *)searchString {
+    if ([[self delegate] 
respondsToSelector:@selector(tableView:typeSelectHelperUpdateSearchString:)])
+        [[self delegate] tableView:self 
typeSelectHelperUpdateSearchString:searchString];
 }
 
 - (id <SKTableViewDelegate>)delegate {

Modified: trunk/SKTypeSelectHelper.h
===================================================================
--- trunk/SKTypeSelectHelper.h  2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKTypeSelectHelper.h  2023-11-19 17:06:56 UTC (rev 13778)
@@ -74,13 +74,13 @@
 
 @protocol SKTypeSelectDelegate <NSObject>
 
-- (NSArray *)typeSelectHelperSelectionStrings:(SKTypeSelectHelper 
*)typeSelectHelper; // required
-- (NSUInteger)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper 
*)typeSelectHelper; // required
-- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
selectItemAtIndex:(NSUInteger)itemIndex; // required
+- (NSArray *)typeSelectHelperSelectionStrings; // required
+- (NSUInteger)typeSelectHelperCurrentlySelectedIndex; // required
+- (void)typeSelectHelperSelectItemAtIndex:(NSUInteger)itemIndex; // required
 
 @optional
 
-- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString; // optional
-- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
updateSearchString:(NSString *)searchString; // optional
+- (void)typeSelectHelperDidFailToFindMatchForSearchString:(NSString 
*)searchString; // optional
+- (void)typeSelectHelperUpdateSearchString:(NSString *)searchString; // 
optional
 
 @end

Modified: trunk/SKTypeSelectHelper.m
===================================================================
--- trunk/SKTypeSelectHelper.m  2023-11-19 16:53:21 UTC (rev 13777)
+++ trunk/SKTypeSelectHelper.m  2023-11-19 17:06:56 UTC (rev 13778)
@@ -172,8 +172,8 @@
 
 - (void)updateSearchString:(NSString *)string {
     id del = [self delegate];
-    if ([del 
respondsToSelector:@selector(typeSelectHelper:updateSearchString:)])
-        [del typeSelectHelper:self updateSearchString:string];
+    if ([del 
respondsToSelector:@selector(typeSelectHelperUpdateSearchString:)])
+        [del typeSelectHelperUpdateSearchString:string];
 }
 
 - (void)searchWithEvent:(NSEvent *)keyEvent {
@@ -263,7 +263,7 @@
     NSArray *cache = nil;
     @synchronized(self) {
         if (searchCache == nil)
-            searchCache = [[delegate typeSelectHelperSelectionStrings:self] 
retain];
+            searchCache = [[delegate typeSelectHelperSelectionStrings] retain];
         cache = [[searchCache retain] autorelease];
     }
     return cache;
@@ -303,7 +303,7 @@
         NSUInteger selectedIndex, startIndex, foundIndex;
         
         if (matchOption != SKFullStringMatch) {
-            selectedIndex = [[self delegate] 
typeSelectHelperCurrentlySelectedIndex:self];
+            selectedIndex = [[self delegate] 
typeSelectHelperCurrentlySelectedIndex];
             if (selectedIndex >= [[self searchCache] count])
                 selectedIndex = NSNotFound;
         } else {
@@ -318,11 +318,11 @@
         
         if (foundIndex == NSNotFound) {
             id del = [self delegate];
-            if ([del 
respondsToSelector:@selector(typeSelectHelper:didFailToFindMatchForSearchString:)])
-                [del typeSelectHelper:self 
didFailToFindMatchForSearchString:searchString];
+            if ([del 
respondsToSelector:@selector(typeSelectHelperDidFailToFindMatchForSearchString:)])
+                [del 
typeSelectHelperDidFailToFindMatchForSearchString:searchString];
         } else if (foundIndex != selectedIndex) {
             // Avoid flashing a selection all over the place while you're 
still typing the thing you have selected
-            [[self delegate] typeSelectHelper:self 
selectItemAtIndex:foundIndex];
+            [[self delegate] typeSelectHelperSelectItemAtIndex:foundIndex];
         }
     }
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to