Revision: 29029 http://sourceforge.net/p/bibdesk/svn/29029 Author: hofman Date: 2025-02-19 17:02:19 +0000 (Wed, 19 Feb 2025) Log Message: ----------- Add nullability to AppKit categories
Modified Paths: -------------- trunk/bibdesk/NSAnimationContext_BDSKExtensions.h trunk/bibdesk/NSBezierPath_BDSKExtensions.h trunk/bibdesk/NSColor_BDSKExtensions.h trunk/bibdesk/NSEvent_BDSKExtensions.h trunk/bibdesk/NSImage_BDSKExtensions.h trunk/bibdesk/NSMenu_BDSKExtensions.h trunk/bibdesk/NSParagraphStyle_BDSKExtensions.h trunk/bibdesk/NSPrintOperation_BDSKExtensions.h trunk/bibdesk/NSSplitView_BDSKExtensions.h trunk/bibdesk/NSTableHeaderView_BDSKExtensions.h trunk/bibdesk/NSTableView_BDSKExtensions.h trunk/bibdesk/NSTextView_BDSKExtensions.h trunk/bibdesk/NSView_BDSKExtensions.h trunk/bibdesk/NSWindowController_BDSKExtensions.h trunk/bibdesk/NSWorkspace_BDSKExtensions.h Modified: trunk/bibdesk/NSAnimationContext_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSAnimationContext_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSAnimationContext_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,7 +38,10 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSAnimationContext (BDSKExtensions) @property (class, nonatomic, readonly) NSTimeInterval defaultAnimationTimeInterval; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSBezierPath_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSBezierPath_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSBezierPath_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -37,6 +37,7 @@ */ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSBezierPath (BDSKExtensions) @@ -50,3 +51,5 @@ + (NSBezierPath *)bezierPathWithStarInRect:(NSRect)rect flipped:(BOOL)flipped; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSColor_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSColor_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSColor_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,6 +38,8 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN + enum { BDSKScriptingColorRed = 'Red ', BDSKScriptingColorOrange = 'Orng', @@ -48,7 +50,7 @@ BDSKScriptingColorGray = 'Gray', }; -extern BOOL BDSKHasDarkAppearance(id object); +extern BOOL BDSKHasDarkAppearance(id _Nullable object); @interface NSColor (BDSKExtensions) @@ -69,9 +71,11 @@ - (BOOL)isBlackOrWhiteOrTransparentForMargin:(CGFloat)margin; -- (NSComparisonResult)colorCompare:(id)other; +- (NSComparisonResult)colorCompare:(nullable id)other; -+ (NSColor *)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor; ++ (nullable NSColor *)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor; @property (nonatomic, readonly) id scriptingRgbaColorDescriptor; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSEvent_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSEvent_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSEvent_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,6 +38,7 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSEvent (BDSKExtensions) @property (class, nonatomic, readonly) NSUInteger standardModifierFlags; @@ -45,3 +46,5 @@ @property (nonatomic, readonly) NSUInteger standardModifierFlags; @property (nonatomic, readonly) unichar firstCharacter; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSImage_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSImage_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSImage_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,6 +38,8 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN + extern NSString *BDSKImageNameToolbarAddBookmarkTemplate; extern NSString *BDSKImageNameToolbarAddFolderTemplate; extern NSString *BDSKImageNameToolbarAddSeparatorTemplate; @@ -63,7 +65,7 @@ + (void)makeNamedImages; -+ (NSImage *)imageForURL:(NSURL *)aURL; ++ (nullable NSImage *)imageForURL:(NSURL *)aURL; @property (class, nonatomic, readonly) NSImage *missingFileImage; @property (class, nonatomic, readonly) NSImage *paperclipImage; @@ -94,3 +96,5 @@ @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSMenu_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSMenu_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSMenu_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,6 +38,8 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN + @interface NSMenu (BDSKExtensions) - (NSMenuItem *)itemWithAction:(SEL)action; @@ -46,11 +48,11 @@ - (NSMenuItem *)insertItemWithTitle:(NSString *)itemTitle submenu:(NSMenu *)submenu atIndex:(NSUInteger)index; - (NSMenuItem *)addItemWithTitle:(NSString *)itemTitle submenu:(NSMenu *)submenu; -- (NSMenuItem *)insertItemWithTitle:(NSString *)itemTitle submenuTitle:(NSString *)submenuTitle submenuDelegate:(id)delegate atIndex:(NSUInteger)index; -- (NSMenuItem *)addItemWithTitle:(NSString *)itemTitle submenuTitle:(NSString *)submenuTitle submenuDelegate:(id)delegate; +- (NSMenuItem *)insertItemWithTitle:(NSString *)itemTitle submenuTitle:(NSString *)submenuTitle submenuDelegate:(nullable id)delegate atIndex:(NSUInteger)index; +- (NSMenuItem *)addItemWithTitle:(NSString *)itemTitle submenuTitle:(NSString *)submenuTitle submenuDelegate:(nullable id)delegate; - (NSMenuItem *)insertItemWithTitle:(NSString *)itemTitle andSubmenuOfApplicationsForURL:(NSURL *)theURL atIndex:(NSUInteger)index; - (NSMenuItem *)addItemWithTitle:(NSString *)itemTitle andSubmenuOfApplicationsForURL:(NSURL *)theURL; -- (NSMenuItem *)insertItemWithTitle:(NSString *)itemTitle andSubmenuOfApplicationsForURL:(NSURL *)theURL searchString:(NSString *)searchString atIndex:(NSUInteger)idx; +- (NSMenuItem *)insertItemWithTitle:(NSString *)itemTitle andSubmenuOfApplicationsForURL:(NSURL *)theURL searchString:(nullable NSString *)searchString atIndex:(NSUInteger)idx; @end @@ -57,3 +59,5 @@ @interface NSMenuItem (BDSKImageExtensions) - (void)setImageAndSize:(NSImage *)image; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSParagraphStyle_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSParagraphStyle_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSParagraphStyle_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,6 +38,7 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSParagraphStyle (BDSKExtensions) @property (class, nonatomic, readonly) NSParagraphStyle *defaultClippingParagraphStyle; @@ -45,3 +46,5 @@ @property (class, nonatomic, readonly) NSParagraphStyle *defaultTruncatingMiddleParagraphStyle; @property (class, nonatomic, readonly) NSParagraphStyle *defaultCenteredParagraphStyle; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSPrintOperation_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSPrintOperation_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSPrintOperation_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,7 +38,10 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSPrintOperation (BDSKExtensions) -+ (NSPrintOperation *)printOperationWithAttributedString:(NSAttributedString *)attributedString printInfo:(NSPrintInfo *)printInfo settings:(NSDictionary *)printSettings; ++ (NSPrintOperation *)printOperationWithAttributedString:(NSAttributedString *)attributedString printInfo:(NSPrintInfo *)printInfo settings:(nullable NSDictionary *)printSettings; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSSplitView_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSSplitView_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSSplitView_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -65,6 +65,7 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSSplitView (BDSKExtensions) @@ -71,3 +72,5 @@ @property (nonatomic) CGFloat fraction; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSTableHeaderView_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSTableHeaderView_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSTableHeaderView_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,6 +38,9 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSTableHeaderView (BDSKExtensions) @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSTableView_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSTableView_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSTableView_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,10 +38,11 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSTableView (BDSKExtensions) -- (IBAction)invertSelection:(id)sender; +- (IBAction)invertSelection:(nullable id)sender; @property (nonatomic, readonly) NSInteger numberOfClickedOrSelectedRows; @property (nonatomic, readonly) NSInteger clickedOrSelectedRow; @@ -52,3 +53,5 @@ - (void)setIndicatorImageForAscending:(BOOL)ascending inTableColumn:(NSTableColumn *)tc; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSTextView_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSTextView_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSTextView_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -36,6 +36,7 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSTextView (BDSKExtensions) @@ -47,3 +48,5 @@ - (void)setSafeSelectedRanges:(NSArray *)ranges; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSView_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSView_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSView_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -65,6 +65,7 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSView (BDSKExtensions) @@ -77,3 +78,5 @@ - (NSPoint)convertPointFromScreen:(NSPoint)point; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSWindowController_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSWindowController_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSWindowController_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,20 +38,23 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSWindowController (BDSKExtensions) - (BOOL)isWindowVisible; -- (IBAction)hideWindow:(id)sender; -- (IBAction)toggleShowingWindow:(id)sender; +- (IBAction)hideWindow:(nullable id)sender; +- (IBAction)toggleShowingWindow:(nullable id)sender; - (void)setWindowFrameAutosaveNameOrCascade:(NSString *)name; - (void)setWindowFrameAutosaveNameOrCascade:(NSString *)name setFrame:(NSRect)frameRect; -- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^)(NSInteger result))handler; +- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^ _Nullable)(NSInteger result))handler; -- (IBAction)dismiss:(id)sender; +- (IBAction)dismiss:(nullable id)sender; - (void)didDismissSheet; @end + +NS_ASSUME_NONNULL_END Modified: trunk/bibdesk/NSWorkspace_BDSKExtensions.h =================================================================== --- trunk/bibdesk/NSWorkspace_BDSKExtensions.h 2025-02-19 16:41:37 UTC (rev 29028) +++ trunk/bibdesk/NSWorkspace_BDSKExtensions.h 2025-02-19 17:02:19 UTC (rev 29029) @@ -38,13 +38,14 @@ #import <Cocoa/Cocoa.h> +NS_ASSUME_NONNULL_BEGIN @interface NSWorkspace (BDSKExtensions) -- (BOOL)openURLs:(NSArray *)fileURLs withSearchString:(NSString *)searchString; +- (BOOL)openURLs:(NSArray *)fileURLs withSearchString:(nullable NSString *)searchString; - (BOOL)openURLWithDefaultApp:(NSURL *)aURL; -- (BOOL)openURL:(NSURL *)aURL withApplicationURL:(NSURL *)applicationURL andSearchString:(NSString *)searchString; +- (BOOL)openURL:(NSURL *)aURL withApplicationURL:(NSURL *)applicationURL andSearchString:(nullable NSString *)searchString; - (NSArray *)editorAndViewerURLsForURL:(NSURL *)aURL; - (NSArray *)editorAndViewerNamesAndBundleIDsForType:(NSString *)fileType; @@ -54,12 +55,14 @@ - (BOOL)isAutomatorWorkflowAtPath:(NSString *)path; - (BOOL)isFolderAtPath:(NSString *)path; -- (void)emailTo:(NSString *)receiver subject:(NSString *)subject body:(NSString *)body attachments:(NSArray *)files; +- (void)emailTo:(nullable NSString *)receiver subject:(nullable NSString *)subject body:(nullable NSString *)body attachments:(nullable NSArray *)files; @end @interface NSString (UTIExtensions) -- (BOOL)isEqualToUTI:(NSString *)UTIString; +- (BOOL)isEqualToUTI:(nullable NSString *)UTIString; @end + +NS_ASSUME_NONNULL_END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit