Revision: 13935
          http://sourceforge.net/p/skim-app/code/13935
Author:   hofman
Date:     2023-12-19 17:32:24 +0000 (Tue, 19 Dec 2023)
Log Message:
-----------
declare extended delegates as property

Modified Paths:
--------------
    trunk/SKApplication.h
    trunk/SKMainWindow.h
    trunk/SKMainWindow.m
    trunk/SKNoteOutlineView.h
    trunk/SKNoteOutlineView.m
    trunk/SKOutlineView.h
    trunk/SKOutlineView.m
    trunk/SKPDFDocument.h
    trunk/SKPDFDocument.m
    trunk/SKPDFView.h
    trunk/SKSnapshotPDFView.h
    trunk/SKSnapshotPDFView.m
    trunk/SKTableView.h
    trunk/SKTableView.m

Modified: trunk/SKApplication.h
===================================================================
--- trunk/SKApplication.h       2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKApplication.h       2023-12-19 17:32:24 UTC (rev 13935)
@@ -42,7 +42,10 @@
 
 extern NSString *SKApplicationStartsTerminatingNotification;
 
-@protocol SKApplicationDelegate;
+@protocol SKApplicationDelegate <NSApplicationDelegate>
+@optional
+- (void)applicationStartsTerminating:(NSNotification *)aNotification;
+@end
 
 @class SPUStandardUpdaterController;
 
@@ -59,18 +62,11 @@
 
 - (BOOL)willDragMouse;
 
-- (nullable id <SKApplicationDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKApplicationDelegate>)newDelegate;
+@property (nullable, weak) id<SKApplicationDelegate> delegate;
 
 @end
 
 
-@protocol SKApplicationDelegate <NSApplicationDelegate>
-@optional
-- (void)applicationStartsTerminating:(NSNotification *)aNotification;
-@end
-
-
 enum {
     SKRemoteButtonEvent = 1
 };

Modified: trunk/SKMainWindow.h
===================================================================
--- trunk/SKMainWindow.h        2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKMainWindow.h        2023-12-19 17:32:24 UTC (rev 13935)
@@ -52,8 +52,7 @@
 @property (nonatomic) BOOL disableConstrainedFrame;
 @property (nonatomic) NSRect windowFrame;
 
-- (nullable id<SKMainWindowDelegate>)delegate;
-- (void)setDelegate:(nullable id<SKMainWindowDelegate>)newDelegate;
+@property (nullable, weak) id<SKMainWindowDelegate> delegate;
 
 @end
 

Modified: trunk/SKMainWindow.m
===================================================================
--- trunk/SKMainWindow.m        2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKMainWindow.m        2023-12-19 17:32:24 UTC (rev 13935)
@@ -45,7 +45,7 @@
 @implementation SKMainWindow
 
 @synthesize disableConstrainedFrame;
-@dynamic windowFrame;
+@dynamic windowFrame, delegate;
 
 + (id)defaultAnimationForKey:(NSString *)key {
     if ([key isEqualToString:@"windowFrame"]) {

Modified: trunk/SKNoteOutlineView.h
===================================================================
--- trunk/SKNoteOutlineView.h   2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKNoteOutlineView.h   2023-12-19 17:32:24 UTC (rev 13935)
@@ -41,14 +41,19 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@protocol SKNoteOutlineViewDelegate;
+@protocol SKNoteOutlineViewDelegate <SKOutlineViewDelegate>
+@optional
 
+- (void)outlineView:(NSOutlineView *)anOutlineView 
setHeight:(CGFloat)newHeight ofRowByItem:(id)item;
+- (void)outlineView:(NSOutlineView *)anOutlineView 
didChangeHiddenOfTableColumn:(NSTableColumn *)aTableColumn;
+
+@end
+
 @interface SKNoteOutlineView : SKOutlineView
 
 - (void)toggleTableColumn:(nullable id)sender;
 
-- (nullable id <SKNoteOutlineViewDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKNoteOutlineViewDelegate>)newDelegate;
+@property (nullable, weak) id<SKNoteOutlineViewDelegate> delegate;
 
 @property (nonatomic, readonly) CGFloat fullWidthCellWidth;
 @property (nonatomic, readonly) CGFloat outlineIndentation;
@@ -55,13 +60,4 @@
 
 @end
 
-
-@protocol SKNoteOutlineViewDelegate <SKOutlineViewDelegate>
-@optional
-
-- (void)outlineView:(NSOutlineView *)anOutlineView 
setHeight:(CGFloat)newHeight ofRowByItem:(id)item;
-- (void)outlineView:(NSOutlineView *)anOutlineView 
didChangeHiddenOfTableColumn:(NSTableColumn *)aTableColumn;
-
-@end
-
 NS_ASSUME_NONNULL_END

Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m   2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKNoteOutlineView.m   2023-12-19 17:32:24 UTC (rev 13935)
@@ -61,7 +61,7 @@
 
 @implementation SKNoteOutlineView
 
-@dynamic fullWidthCellWidth, outlineIndentation;
+@dynamic fullWidthCellWidth, outlineIndentation, delegate;
 
 static inline NSString *titleForTableColumnIdentifier(NSString *identifier) {
     if ([identifier isEqualToString:NOTE_COLUMNID])

Modified: trunk/SKOutlineView.h
===================================================================
--- trunk/SKOutlineView.h       2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKOutlineView.h       2023-12-19 17:32:24 UTC (rev 13935)
@@ -42,8 +42,26 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@protocol SKOutlineViewDelegate;
+@protocol SKOutlineViewDelegate <NSOutlineViewDelegate>
+@optional
 
+- (void)outlineView:(NSOutlineView *)anOutlineView deleteItems:(NSArray 
*)items;
+- (BOOL)outlineView:(NSOutlineView *)anOutlineView canDeleteItems:(NSArray 
*)items;
+
+- (void)outlineView:(NSOutlineView *)anOutlineView copyItems:(NSArray *)items;
+- (BOOL)outlineView:(NSOutlineView *)anOutlineView canCopyItems:(NSArray 
*)items;
+
+- (void)outlineView:(NSOutlineView *)anOutlineView 
pasteFromPasteboard:(NSPasteboard *)pboard;
+- (BOOL)outlineView:(NSOutlineView *)anOutlineView 
canPasteFromPasteboard:(NSPasteboard *)pboard;
+
+- (nullable id <SKImageToolTipContext>)outlineView:(NSOutlineView 
*)anOutlineView imageContextForItem:(id)item scale:(CGFloat *)scale;
+
+- (nullable NSArray 
*)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView *)anOutlineView;
+- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString;
+- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperUpdateSearchString:(NSString *)searchString;
+
+@end
+
 @interface SKOutlineView : NSOutlineView <SKTypeSelectDelegate> {
     SKTypeSelectHelper *typeSelectHelper;
     BOOL hasImageToolTips;
@@ -70,30 +88,8 @@
 - (void)noteHeightOfRowsChangedAnimating:(BOOL)animate;
 - (void)noteHeightOfRowChanged:(NSInteger)row animating:(BOOL)animate;
 
-- (nullable id <SKOutlineViewDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKOutlineViewDelegate>)newDelegate;
+@property (nullable, weak) id<SKOutlineViewDelegate> delegate;
 
 @end
 
-
-@protocol SKOutlineViewDelegate <NSOutlineViewDelegate>
-@optional
-
-- (void)outlineView:(NSOutlineView *)anOutlineView deleteItems:(NSArray 
*)items;
-- (BOOL)outlineView:(NSOutlineView *)anOutlineView canDeleteItems:(NSArray 
*)items;
-
-- (void)outlineView:(NSOutlineView *)anOutlineView copyItems:(NSArray *)items;
-- (BOOL)outlineView:(NSOutlineView *)anOutlineView canCopyItems:(NSArray 
*)items;
-
-- (void)outlineView:(NSOutlineView *)anOutlineView 
pasteFromPasteboard:(NSPasteboard *)pboard;
-- (BOOL)outlineView:(NSOutlineView *)anOutlineView 
canPasteFromPasteboard:(NSPasteboard *)pboard;
-
-- (nullable id <SKImageToolTipContext>)outlineView:(NSOutlineView 
*)anOutlineView imageContextForItem:(id)item scale:(CGFloat *)scale;
-
-- (nullable NSArray 
*)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView *)anOutlineView;
-- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString;
-- (void)outlineView:(NSOutlineView *)anOutlineView 
typeSelectHelperUpdateSearchString:(NSString *)searchString;
-
-@end
-
 NS_ASSUME_NONNULL_END

Modified: trunk/SKOutlineView.m
===================================================================
--- trunk/SKOutlineView.m       2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKOutlineView.m       2023-12-19 17:32:24 UTC (rev 13935)
@@ -47,7 +47,7 @@
 @implementation SKOutlineView
 
 @synthesize typeSelectHelper, hasImageToolTips, supportsQuickLook;
-@dynamic selectedItems, canDelete, canCopy, canPaste;
+@dynamic selectedItems, canDelete, canCopy, canPaste, delegate;
 
 - (NSArray *)itemsAtRowIndexes:(NSIndexSet *)indexes {
     NSMutableArray *items = [NSMutableArray array];

Modified: trunk/SKPDFDocument.h
===================================================================
--- trunk/SKPDFDocument.h       2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKPDFDocument.h       2023-12-19 17:32:24 UTC (rev 13935)
@@ -42,7 +42,11 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@protocol SKPDFDocumentDelegate;
+@protocol SKPDFDocumentDelegate <PDFDocumentDelegate>
+@optional
+- (void)document:(PDFDocument *)document didUnlockWithPassword:(NSString 
*)password;
+- (void)document:(PDFDocument *)document didDetectWidgets:(NSArray *)widgets 
onPage:(PDFPage *)page;
+@end
 
 @interface SKPDFDocument : PDFDocument {
     SKLanguageDirectionAngles *languageDirectionAngles;
@@ -51,17 +55,8 @@
 }
 @property (nonatomic, nullable, weak) NSDocument *containingDocument;
 @property (nonatomic, nullable, readonly) NSArray *detectedWidgets;
-- (nullable id <SKPDFDocumentDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKPDFDocumentDelegate>)newDelegate;
+@property (nonatomic, nullable, weak) id<SKPDFDocumentDelegate> delegate;
 - (void)detectedWidgets:(NSArray *)newWidgets onPage:(PDFPage *)page;
 @end
 
-#pragma mark -
-
-@protocol SKPDFDocumentDelegate <PDFDocumentDelegate>
-@optional
-- (void)document:(PDFDocument *)document didUnlockWithPassword:(NSString 
*)password;
-- (void)document:(PDFDocument *)document didDetectWidgets:(NSArray *)widgets 
onPage:(PDFPage *)page;
-@end
-
 NS_ASSUME_NONNULL_END

Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m       2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKPDFDocument.m       2023-12-19 17:32:24 UTC (rev 13935)
@@ -44,6 +44,7 @@
 @implementation SKPDFDocument
 
 @synthesize containingDocument, detectedWidgets;
+@dynamic delegate;
 
 - (void)dealloc {
     if (languageDirectionAngles) free(languageDirectionAngles);

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKPDFView.h   2023-12-19 17:32:24 UTC (rev 13935)
@@ -112,7 +112,20 @@
      kPDFDisplayHorizontalContinuous = 4
 };
 
-@protocol SKPDFViewDelegate;
+@protocol SKPDFViewDelegate <PDFViewDelegate>
+@optional
+- (void)PDFViewDidBeginEditing:(PDFView *)sender;
+- (void)PDFViewDidEndEditing:(PDFView *)sender;
+- (void)PDFView:(PDFView *)sender editAnnotation:(PDFAnnotation *)annotation;
+- (void)PDFView:(PDFView *)sender showSnapshotAtPageNumber:(NSInteger)pageNum 
forRect:(NSRect)rect scaleFactor:(CGFloat)scaleFactor autoFits:(BOOL)autoFits;
+- (void)PDFViewExitPresentation:(PDFView *)sender;
+- (void)PDFViewTogglePages:(PDFView *)sender;
+- (void)PDFViewToggleContents:(PDFView *)sender;
+- (void)PDFViewPerformHideFind:(PDFView *)sender;
+- (BOOL)PDFViewIsFindVisible:(PDFView *)sender;
+- (void)PDFView:(PDFView *)sender rotatePageAtIndex:(NSUInteger)idx 
by:(NSInteger)rotation;
+- (nullable NSUndoManager *)undoManagerForPDFView:(PDFView *)sender;
+@end
 
 @class SKReadingBar, SKTransitionController, SKTypeSelectHelper, 
SKNavigationWindow, SKCursorStyleWindow, SKTextNoteEditor, SKSyncDot, 
SKLoupeController, SKLayerController;
 
@@ -258,8 +271,7 @@
 
 - (void)resetHistory;
 
-- (nullable id <SKPDFViewDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKPDFViewDelegate>)newDelegate;
+@property (nonatomic, nullable, weak) id<SKPDFViewDelegate> delegate;
 
 - (nullable NSString *)currentColorDefaultKeyForAlternate:(BOOL)isAlt;
 
@@ -267,21 +279,4 @@
 
 @end
 
-#pragma mark -
-
-@protocol SKPDFViewDelegate <PDFViewDelegate>
-@optional
-- (void)PDFViewDidBeginEditing:(PDFView *)sender;
-- (void)PDFViewDidEndEditing:(PDFView *)sender;
-- (void)PDFView:(PDFView *)sender editAnnotation:(PDFAnnotation *)annotation;
-- (void)PDFView:(PDFView *)sender showSnapshotAtPageNumber:(NSInteger)pageNum 
forRect:(NSRect)rect scaleFactor:(CGFloat)scaleFactor autoFits:(BOOL)autoFits;
-- (void)PDFViewExitPresentation:(PDFView *)sender;
-- (void)PDFViewTogglePages:(PDFView *)sender;
-- (void)PDFViewToggleContents:(PDFView *)sender;
-- (void)PDFViewPerformHideFind:(PDFView *)sender;
-- (BOOL)PDFViewIsFindVisible:(PDFView *)sender;
-- (void)PDFView:(PDFView *)sender rotatePageAtIndex:(NSUInteger)idx 
by:(NSInteger)rotation;
-- (nullable NSUndoManager *)undoManagerForPDFView:(PDFView *)sender;
-@end
-
 NS_ASSUME_NONNULL_END

Modified: trunk/SKSnapshotPDFView.h
===================================================================
--- trunk/SKSnapshotPDFView.h   2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKSnapshotPDFView.h   2023-12-19 17:32:24 UTC (rev 13935)
@@ -42,7 +42,10 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@protocol SKSnapshotPDFViewDelegate;
+@protocol SKSnapshotPDFViewDelegate <PDFViewDelegate>
+@optional
+- (void)PDFView:(PDFView *)sender goToExternalDestination:(PDFDestination 
*)destination;
+@end
 
 @interface SKSnapshotPDFView : SKBasePDFView {
     NSPopUpButton *scalePopUpButton;
@@ -63,14 +66,8 @@
 
 - (void)resetHistory;
 
-- (nullable id <SKSnapshotPDFViewDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKSnapshotPDFViewDelegate>)newDelegate;
+@property (nonatomic, nullable, weak) id<SKSnapshotPDFViewDelegate> delegate;
 
 @end
 
-@protocol SKSnapshotPDFViewDelegate <PDFViewDelegate>
-@optional
-- (void)PDFView:(PDFView *)sender goToExternalDestination:(PDFDestination 
*)destination;
-@end
-
 NS_ASSUME_NONNULL_END

Modified: trunk/SKSnapshotPDFView.m
===================================================================
--- trunk/SKSnapshotPDFView.m   2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKSnapshotPDFView.m   2023-12-19 17:32:24 UTC (rev 13935)
@@ -73,6 +73,7 @@
 @implementation SKSnapshotPDFView
 
 @synthesize autoFits, shouldAutoFit;
+@dynamic delegate;
 
 #define SKPDFContentViewChangedNotification 
@"SKPDFContentViewChangedNotification"
 

Modified: trunk/SKTableView.h
===================================================================
--- trunk/SKTableView.h 2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKTableView.h 2023-12-19 17:32:24 UTC (rev 13935)
@@ -42,8 +42,31 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@protocol SKTableViewDelegate;
+@protocol SKTableViewDelegate <NSTableViewDelegate>
+@optional
 
+- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet 
*)rowIndexes;
+- (BOOL)tableView:(NSTableView *)aTableView 
canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes;
+
+- (void)tableView:(NSTableView *)aTableView copyRowsWithIndexes:(NSIndexSet 
*)rowIndexes;
+- (BOOL)tableView:(NSTableView *)aTableView canCopyRowsWithIndexes:(NSIndexSet 
*)rowIndexes;
+
+- (void)tableView:(NSTableView *)aTableView pasteFromPasteboard:(NSPasteboard 
*)pboard;
+- (BOOL)tableView:(NSTableView *)aTableView 
canPasteFromPasteboard:(NSPasteboard *)pboard;
+
+- (void)tableViewMoveLeft:(NSTableView *)aTableView;
+- (void)tableViewMoveRight:(NSTableView *)aTableView;
+
+- (BOOL)tableView:(NSTableView *)tableView 
commandSelectRow:(NSInteger)rowIndex;
+
+- (nullable id <SKImageToolTipContext>)tableView:(NSTableView *)aTableView 
imageContextForTableColumn:(nullable NSTableColumn *)tableColumn 
row:(NSInteger)rowIndex  scale:(CGFloat *)scale;
+
+- (nullable NSArray *)tableViewTypeSelectHelperSelectionStrings:(NSTableView 
*)aTableView;
+- (void)tableView:(NSTableView *)aTableView 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString;
+- (void)tableView:(NSTableView *)aTableView 
typeSelectHelperUpdateSearchString:(NSString *)searchString;
+
+@end
+
 typedef NS_ENUM(NSInteger, SKTableImageToolTipLayout) {
     SKTableImageToolTipNone,
     SKTableImageToolTipByRow,
@@ -77,35 +100,8 @@
 - (void)noteHeightOfRowsChangedAnimating:(BOOL)animate;
 - (void)noteHeightOfRowChanged:(NSInteger)row animating:(BOOL)animate;
 
-- (nullable id <SKTableViewDelegate>)delegate;
-- (void)setDelegate:(nullable id <SKTableViewDelegate>)newDelegate;
+@property (nullable, weak) id<SKTableViewDelegate> delegate;
 
 @end
 
-
-@protocol SKTableViewDelegate <NSTableViewDelegate>
-@optional
-
-- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet 
*)rowIndexes;
-- (BOOL)tableView:(NSTableView *)aTableView 
canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes;
-
-- (void)tableView:(NSTableView *)aTableView copyRowsWithIndexes:(NSIndexSet 
*)rowIndexes;
-- (BOOL)tableView:(NSTableView *)aTableView canCopyRowsWithIndexes:(NSIndexSet 
*)rowIndexes;
-
-- (void)tableView:(NSTableView *)aTableView pasteFromPasteboard:(NSPasteboard 
*)pboard;
-- (BOOL)tableView:(NSTableView *)aTableView 
canPasteFromPasteboard:(NSPasteboard *)pboard;
-
-- (void)tableViewMoveLeft:(NSTableView *)aTableView;
-- (void)tableViewMoveRight:(NSTableView *)aTableView;
-
-- (BOOL)tableView:(NSTableView *)tableView 
commandSelectRow:(NSInteger)rowIndex;
-
-- (nullable id <SKImageToolTipContext>)tableView:(NSTableView *)aTableView 
imageContextForTableColumn:(nullable NSTableColumn *)tableColumn 
row:(NSInteger)rowIndex  scale:(CGFloat *)scale;
-
-- (nullable NSArray *)tableViewTypeSelectHelperSelectionStrings:(NSTableView 
*)aTableView;
-- (void)tableView:(NSTableView *)aTableView 
typeSelectHelperDidFailToFindMatchForSearchString:(NSString *)searchString;
-- (void)tableView:(NSTableView *)aTableView 
typeSelectHelperUpdateSearchString:(NSString *)searchString;
-
-@end
-
 NS_ASSUME_NONNULL_END

Modified: trunk/SKTableView.m
===================================================================
--- trunk/SKTableView.m 2023-12-19 17:14:31 UTC (rev 13934)
+++ trunk/SKTableView.m 2023-12-19 17:32:24 UTC (rev 13935)
@@ -48,7 +48,7 @@
 @implementation SKTableView
 
 @synthesize typeSelectHelper, supportsQuickLook, imageToolTipLayout;
-@dynamic canDelete, canCopy, canPaste;
+@dynamic canDelete, canCopy, canPaste, delegate;
 
 - (void)dealloc {
     [typeSelectHelper setDelegate:nil];

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