Revision: 29007
http://sourceforge.net/p/bibdesk/svn/29007
Author: hofman
Date: 2025-02-16 18:05:46 +0000 (Sun, 16 Feb 2025)
Log Message:
-----------
add nullability to most data classes
Modified Paths:
--------------
trunk/bibdesk/BDSKBookmark.h
trunk/bibdesk/BDSKCondition.h
trunk/bibdesk/BDSKErrorObject.h
trunk/bibdesk/BDSKErrorObject.m
trunk/bibdesk/BDSKFieldCollection.h
trunk/bibdesk/BDSKFileSearchResult.h
trunk/bibdesk/BDSKFilter.h
trunk/bibdesk/BDSKGroupsArray.h
trunk/bibdesk/BDSKIBArray.h
trunk/bibdesk/BDSKLinkedFile.h
trunk/bibdesk/BDSKPersistentSearch.h
trunk/bibdesk/BDSKPreferenceRecord.h
trunk/bibdesk/BDSKPreviewItem.h
trunk/bibdesk/BDSKPublicationsArray.h
trunk/bibdesk/BDSKScriptHook.h
trunk/bibdesk/BDSKScriptHook.m
trunk/bibdesk/BDSKSearchBookmark.h
trunk/bibdesk/BDSKServerInfo.h
trunk/bibdesk/BDSKStringNode.h
trunk/bibdesk/BDSKTask.h
trunk/bibdesk/BDSKTemplate.h
trunk/bibdesk/BDSKTemplateObjectProxy.h
trunk/bibdesk/BDSKTemplateTag.h
trunk/bibdesk/BDSKToken.h
trunk/bibdesk/BDSKTreeNode.h
trunk/bibdesk/BDSKTypeTemplate.h
trunk/bibdesk/BDSKVersionNumber.h
trunk/bibdesk/BibAuthor.h
Modified: trunk/bibdesk/BDSKBookmark.h
===================================================================
--- trunk/bibdesk/BDSKBookmark.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKBookmark.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKBookmarkType) {
BDSKBookmarkTypeBookmark,
BDSKBookmarkTypeFolder,
@@ -48,25 +50,25 @@
__weak BDSKBookmark *parent;
}
-- (instancetype)initWithURL:(NSURL *)aURL name:(NSString *)aName;
-- (instancetype)initFolderWithChildren:(NSArray *)aChildren name:(NSString
*)aName;
-- (instancetype)initFolderWithName:(NSString *)aName;
-- (instancetype)initRootWithChildrenDictionaries:(NSArray *)dictionaries;
-- (instancetype)initSeparator;
-- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
+- (nullable instancetype)initWithURL:(NSURL *)aURL name:(nullable NSString
*)aName;
+- (nullable instancetype)initFolderWithChildren:(NSArray *)aChildren
name:(nullable NSString *)aName;
+- (nullable instancetype)initFolderWithName:(nullable NSString *)aName;
+- (nullable instancetype)initRootWithChildrenDictionaries:(nullable NSArray
*)dictionaries;
+- (nullable instancetype)initSeparator;
+- (nullable instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property (nonatomic, readonly) NSDictionary *dictionaryValue;
@property (nonatomic, readonly) BDSKBookmarkType bookmarkType;
-@property (nonatomic, strong) NSURL *URL;
-@property (nonatomic, strong) NSString *name;
-@property (nonatomic, readonly) NSImage *icon;
-@property (nonatomic, readonly) NSString *URLDescription;
+@property (nonatomic, nullable, strong) NSURL *URL;
+@property (nonatomic, nullable, strong) NSString *name;
+@property (nonatomic, nullable, readonly) NSImage *icon;
+@property (nonatomic, nullable, readonly) NSString *URLDescription;
-@property (nonatomic, weak) BDSKBookmark *parent;
+@property (nonatomic, nullable, weak) BDSKBookmark *parent;
-- (NSArray *)children;
+- (nullable NSArray *)children;
- (NSUInteger)countOfChildren;
- (BDSKBookmark *)objectInChildrenAtIndex:(NSUInteger)idx;
- (void)insertObject:(BDSKBookmark *)child inChildrenAtIndex:(NSUInteger)idx;
@@ -78,3 +80,5 @@
- (BOOL)isDescendantOfArray:(NSArray *)bookmarks;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKCondition.h
===================================================================
--- trunk/bibdesk/BDSKCondition.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKCondition.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -39,6 +39,8 @@
#import <Cocoa/Cocoa.h>
#import "NSDate_BDSKExtensions.h"
+NS_ASSUME_NONNULL_BEGIN
+
// this should correspond to the tags of the items in the popup
typedef NS_ENUM(NSInteger, BDSKStringComparison) {
BDSKGroupContain = 0,
@@ -116,7 +118,7 @@
@property (class, nonatomic, readonly) NSString *dictionaryVersion;
-- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
+- (nullable instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property (nonatomic, readonly) NSDictionary *dictionaryValue;
@@ -123,13 +125,13 @@
- (BOOL)isSatisfiedByItem:(BibItem *)item;
// Generic accessors
-@property (nonatomic, strong) NSString *key;
-@property (nonatomic, strong) NSString *value;
+@property (nonatomic, nullable, strong) NSString *key;
+@property (nonatomic, nullable, strong) NSString *value;
@property (nonatomic) NSInteger comparison;
// String accessors
@property (nonatomic) BDSKStringComparison stringComparison;
-@property (nonatomic, strong) NSString *stringValue;
+@property (nonatomic, nullable, strong) NSString *stringValue;
// Count accessors
@property (nonatomic) BDSKAttachmentComparison attachmentComparison;
@@ -140,8 +142,8 @@
@property (nonatomic) NSInteger numberValue;
@property (nonatomic) NSInteger andNumberValue;
@property (nonatomic) BDSKPeriod periodValue;
-@property (nonatomic, strong) NSDate *dateValue;
-@property (nonatomic, strong) NSDate *toDateValue;
+@property (nonatomic, nullable, strong) NSDate *dateValue;
+@property (nonatomic, nullable, strong) NSDate *toDateValue;
- (void)setDefaultComparison;
- (void)setDefaultValue;
@@ -150,7 +152,7 @@
@property (nonatomic, readonly, getter=isAttachmentCondition) BOOL
attachmentCondition;
@property (nonatomic, readonly, getter=isStringCondition) BOOL stringCondition;
-@property (nonatomic, weak) id<BDSKSmartGroup> group;
+@property (nonatomic, nullable, weak) id<BDSKSmartGroup> group;
@end
@@ -158,3 +160,5 @@
@interface NSString (BDSKConditionExtensions)
@property (nonatomic, readonly) BDSKFieldType fieldType;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKErrorObject.h
===================================================================
--- trunk/bibdesk/BDSKErrorObject.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKErrorObject.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Foundation/Foundation.h>
+NS_ASSUME_NONNULL_BEGIN
+
@class BDSKErrorEditor, BibItem;
@interface BDSKErrorObject : NSObject <NSCopying> {
@@ -52,12 +54,12 @@
BOOL ignorableWarning;
}
-+ (void)reportError:(NSString *)className message:(NSString *)msg
forFile:(NSString *)filePath line:(NSInteger)line isWarning:(BOOL)flag;
-+ (void)reportErrorMessage:(NSString *)msg forFile:(NSString *)filePath
line:(NSInteger)line;
++ (void)reportError:(NSString *)className message:(NSString *)msg
forFile:(nullable NSString *)filePath line:(NSInteger)line isWarning:(BOOL)flag;
++ (void)reportErrorMessage:(NSString *)msg forFile:(nullable NSString
*)filePath line:(NSInteger)line;
-- (instancetype)initWithClassName:(NSString *)className message:(NSString
*)msg forFile:(NSString *)filePath line:(NSInteger)line isWarning:(BOOL)flag;
+- (instancetype)initWithClassName:(NSString *)className message:(NSString
*)msg forFile:(nullable NSString *)filePath line:(NSInteger)line
isWarning:(BOOL)flag;
-@property (nonatomic, readonly) NSString *fileName;
+@property (nonatomic, nullable, readonly) NSString *fileName;
@property (nonatomic, readonly) NSInteger lineNumber;
@property (nonatomic, readonly) NSString *errorClassName;
@property (nonatomic, readonly) NSString *errorMessage;
@@ -66,3 +68,5 @@
@property (nonatomic, strong) BibItem *publication;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKErrorObject.m
===================================================================
--- trunk/bibdesk/BDSKErrorObject.m 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKErrorObject.m 2025-02-16 18:05:46 UTC (rev 29007)
@@ -60,7 +60,7 @@
}
- (instancetype)init {
- return [self initWithClassName:nil message:nil forFile:nil line:-1
isWarning:NO];
+ return [self initWithClassName:NSLocalizedString(@"error", @"error name")
message:@"" forFile:nil line:-1 isWarning:NO];
}
- (id)copyWithZone:(NSZone *)zone {
Modified: trunk/bibdesk/BDSKFieldCollection.h
===================================================================
--- trunk/bibdesk/BDSKFieldCollection.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKFieldCollection.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,7 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, BDSKFieldCollectionType) {
BDSKStringFieldCollection,
@@ -78,3 +79,5 @@
- (id)objectAtIndex:(NSUInteger)index;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKFileSearchResult.h
===================================================================
--- trunk/bibdesk/BDSKFileSearchResult.h 2025-02-16 16:33:36 UTC (rev
29006)
+++ trunk/bibdesk/BDSKFileSearchResult.h 2025-02-16 18:05:46 UTC (rev
29007)
@@ -38,6 +38,7 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
@interface BDSKFileSearchResult : NSObject <NSCopying>
{
@@ -61,3 +62,4 @@
@end
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKFilter.h
===================================================================
--- trunk/bibdesk/BDSKFilter.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKFilter.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKConjunction) {
BDSKAnd = 0,
BDSKOr = 1
@@ -63,8 +65,10 @@
@property (nonatomic, strong) NSArray *conditions;
@property (nonatomic) BDSKConjunction conjunction;
-@property (nonatomic, weak) id<BDSKSmartGroup> group;
+@property (nonatomic, nullable, weak) id<BDSKSmartGroup> group;
-@property (nonatomic, readonly) NSUndoManager *undoManager;
+@property (nonatomic, nullable, readonly) NSUndoManager *undoManager;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKGroupsArray.h
===================================================================
--- trunk/bibdesk/BDSKGroupsArray.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKGroupsArray.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -39,6 +39,8 @@
#import <Cocoa/Cocoa.h>
#import "BDSKGroup.h"
+NS_ASSUME_NONNULL_BEGIN
+
extern NSString *BDSKDocumentGroupsKey;
extern NSString *BDSKDocumentParentGroupKey;
@@ -58,7 +60,7 @@
@property (nonatomic, readonly) NSArray *categoryParents;
@property (nonatomic, readonly) BDSKLibraryGroup *libraryGroup;
-@property (nonatomic, readonly) BDSKLastImportGroup *lastImportGroup;
+@property (nonatomic, nullable, readonly) BDSKLastImportGroup *lastImportGroup;
@property (nonatomic, readonly) NSArray *sharedGroups;
@property (nonatomic, readonly) NSArray *URLGroups;
@property (nonatomic, readonly) NSArray *scriptGroups;
@@ -80,8 +82,10 @@
- (void)sortUsingDescriptors:(NSArray *)sortDescriptors;
-@property (nonatomic, weak, readonly) BibDocument *document;
+@property (nonatomic, weak, nullable, readonly) BibDocument *document;
- (void)setGroupsOfType:(BDSKGroupType)groupType fromSerializedData:(NSData
*)data;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKIBArray.h
===================================================================
--- trunk/bibdesk/BDSKIBArray.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKIBArray.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,10 +38,13 @@
#import <Cocoa/Cocoa.h>
-
+ NS_ASSUME_NONNULL_BEGIN
+
@interface BDSKIBArray : NSArray {
id object[9];
unsigned long mutations;
}
-@property (nonatomic, strong) IBOutlet id object1, object2, object3, object4,
object5, object6, object7, object8, object9;
+@property (nonatomic, nullable, strong) IBOutlet id object1, object2, object3,
object4, object5, object6, object7, object8, object9;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKLinkedFile.h
===================================================================
--- trunk/bibdesk/BDSKLinkedFile.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKLinkedFile.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,10 +38,12 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@class BDSKLinkedFile;
@protocol BDSKLinkedFileDelegate <NSObject>
-- (NSString *)basePathForLinkedFile:(BDSKLinkedFile *)file;
+- (nullable NSString *)basePathForLinkedFile:(BDSKLinkedFile *)file;
- (void)linkedFileURLChanged:(BDSKLinkedFile *)file;
@end
@@ -48,25 +50,25 @@
@interface BDSKLinkedFile : NSObject <NSCopying, NSCoding>
-@property (nonatomic, readonly) NSURL *URL;
+@property (nonatomic, nullable, readonly) NSURL *URL;
@property (nonatomic, readonly, getter=isFile) BOOL file;
// string value to be saved as a field value, base64 encoded data for a local
file or an absolute URL string for a remote URL
-- (NSString *)stringRelativeToPath:(NSString *)newBasePath;
+- (nullable NSString *)stringRelativeToPath:(nullable NSString *)newBasePath;
-@property (nonatomic, readonly) NSURL *displayURL;
-@property (nonatomic, readonly) NSString *path;
+@property (nonatomic, nullable, readonly) NSURL *displayURL;
+@property (nonatomic, nullable, readonly) NSString *path;
-@property (nonatomic, readonly) NSString *stringValue;
-@property (nonatomic, readonly) NSString *bibTeXString;
+@property (nonatomic, nullable, readonly) NSString *stringValue;
+@property (nonatomic, nullable, readonly) NSString *bibTeXString;
// the rest is only relevant for local files, but it's safe to call for any
linked file object
-@property (nonatomic, readonly) NSString *relativePath;
+@property (nonatomic, nullable, readonly) NSString *relativePath;
-@property (nonatomic, weak) id<BDSKLinkedFileDelegate> delegate;
+@property (nonatomic, nullable, weak) id<BDSKLinkedFileDelegate> delegate;
-- (void)updateWithPath:(NSString *)aPath;
+- (void)updateWithPath:(nullable NSString *)aPath;
@property (nonatomic, readonly) BOOL hasSkimNotes;
@@ -77,15 +79,17 @@
@interface BDSKLinkedFile (BDSKLinkedFileCreation)
-+ (instancetype)linkedFileWithURL:(NSURL *)aURL
delegate:(id<BDSKLinkedFileDelegate>)aDelegate;
-+ (instancetype)linkedFileWithBase64String:(NSString *)base64String
delegate:(id<BDSKLinkedFileDelegate>)aDelegate;
-+ (instancetype)linkedFileWithURLString:(NSString *)aString;
++ (nullable instancetype)linkedFileWithURL:(NSURL *)aURL delegate:(nullable
id<BDSKLinkedFileDelegate>)aDelegate;
++ (nullable instancetype)linkedFileWithBase64String:(NSString *)base64String
delegate:(nullable id<BDSKLinkedFileDelegate>)aDelegate;
++ (nullable instancetype)linkedFileWithURLString:(NSString *)aString;
// creates a linked local file or remote URL object depending on the URL
-- (instancetype)initWithURL:(NSURL *)aURL
delegate:(id<BDSKLinkedFileDelegate>)aDelegate;
+- (nullable instancetype)initWithURL:(NSURL *)aURL delegate:(nullable
id<BDSKLinkedFileDelegate>)aDelegate;
// creates a linked local file
-- (instancetype)initWithBase64String:(NSString *)base64String
delegate:(id<BDSKLinkedFileDelegate>)aDelegate;
+- (nullable instancetype)initWithBase64String:(NSString *)base64String
delegate:(nullable id<BDSKLinkedFileDelegate>)aDelegate;
// creates a linked remote URL
-- (instancetype)initWithURLString:(NSString *)aString;
+- (nullable instancetype)initWithURLString:(NSString *)aString;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKPersistentSearch.h
===================================================================
--- trunk/bibdesk/BDSKPersistentSearch.h 2025-02-16 16:33:36 UTC (rev
29006)
+++ trunk/bibdesk/BDSKPersistentSearch.h 2025-02-16 18:05:46 UTC (rev
29007)
@@ -37,6 +37,7 @@
*/
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
@interface BDSKPersistentSearch : NSObject
{
@@ -54,10 +55,12 @@
- (BOOL)addQuery:(NSString *)queryString scopes:(NSArray *)searchScopes;
// returns nil if no results (yet)
-- (NSArray *)resultsForQuery:(NSString *)queryString attribute:(NSString
*)attribute;
+- (nullable NSArray *)resultsForQuery:(NSString *)queryString
attribute:(NSString *)attribute;
-@property (class, nonatomic, readonly) NSString *recentDownloadsQuery;
+@property (class, nonatomic, nullable, readonly) NSString
*recentDownloadsQuery;
- (BOOL)addRecentDownloadsQuery;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKPreferenceRecord.h
===================================================================
--- trunk/bibdesk/BDSKPreferenceRecord.h 2025-02-16 16:33:36 UTC (rev
29006)
+++ trunk/bibdesk/BDSKPreferenceRecord.h 2025-02-16 18:05:46 UTC (rev
29007)
@@ -38,6 +38,7 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
@interface BDSKPreferenceRecord : NSObject {
NSImage *icon;
@@ -47,17 +48,19 @@
- (instancetype)initWithDictionary:(NSDictionary *)aDictionary;
-@property (nonatomic, readonly) NSString *identifier;
-@property (nonatomic, readonly) Class paneClass;
-@property (nonatomic, readonly) NSString *nibName;
-@property (nonatomic, readonly) NSString *title;
-@property (nonatomic, readonly) NSString *label;
-@property (nonatomic, readonly) NSString *toolTip;
-@property (nonatomic, readonly) NSImage *icon;
-@property (nonatomic, readonly) NSString *helpAnchor;
-@property (nonatomic, readonly) NSURL *helpURL;
-@property (nonatomic, readonly) NSDictionary *initialValues;
-@property (nonatomic, readonly) NSArray *searchTerms;
+@property (nonatomic, nullable, readonly) NSString *identifier;
+@property (nonatomic, nullable, readonly) Class paneClass;
+@property (nonatomic, nullable, readonly) NSString *nibName;
+@property (nonatomic, nullable, readonly) NSString *title;
+@property (nonatomic, nullable, readonly) NSString *label;
+@property (nonatomic, nullable, readonly) NSString *toolTip;
+@property (nonatomic, nullable, readonly) NSImage *icon;
+@property (nonatomic, nullable, readonly) NSString *helpAnchor;
+@property (nonatomic, nullable, readonly) NSURL *helpURL;
+@property (nonatomic, nullable, readonly) NSDictionary *initialValues;
+@property (nonatomic, nullable, readonly) NSArray *searchTerms;
@property (nonatomic, readonly) NSDictionary *dictionary;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKPreviewItem.h
===================================================================
--- trunk/bibdesk/BDSKPreviewItem.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKPreviewItem.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,7 @@
#import "BDSKFormatParser.h"
+NS_ASSUME_NONNULL_BEGIN
@class BDSKPreviewOwner, BDSKPreviewLinkedFile;
@@ -50,9 +51,11 @@
@property (class, nonatomic, readonly) BDSKPreviewItem *sharedItem;
-@property (nonatomic, readonly) NSString *suggestedLocalFilePath;
-@property (nonatomic, readonly) NSString *suggestedCiteKey;
+@property (nonatomic, nullable, readonly) NSString *suggestedLocalFilePath;
+@property (nonatomic, nullable, readonly) NSString *suggestedCiteKey;
@property (nonatomic, readonly) NSString *displayText;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKPublicationsArray.h
===================================================================
--- trunk/bibdesk/BDSKPublicationsArray.h 2025-02-16 16:33:36 UTC (rev
29006)
+++ trunk/bibdesk/BDSKPublicationsArray.h 2025-02-16 18:05:46 UTC (rev
29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@class BibItem, BDSKItemSearchIndexes;
@interface BDSKPublicationsArray : NSMutableArray {
@@ -47,21 +49,23 @@
BDSKItemSearchIndexes *searchIndexes;
}
-- (instancetype)initWithArray:(NSArray *)anArray NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithArray:(nullable NSArray *)anArray
NS_DESIGNATED_INITIALIZER;
- (BDSKPublicationsArray *)copyTemporary;
// otherArray should contain the same publications, just reordered
- (void)setReorderedArray:(NSArray *)otherArray;
-- (BibItem *)itemForCiteKey:(NSString *)key;
-- (NSArray *)allItemsForCiteKey:(NSString *)key;
+- (nullable BibItem *)itemForCiteKey:(NSString *)key;
+- (nullable NSArray *)allItemsForCiteKey:(NSString *)key;
- (void)changeCiteKey:(NSString *)oldKey toCiteKey:(NSString *)newKey
forItem:(BibItem *)anItem;
-- (BibItem *)itemForIdentifierURL:(NSURL *)aURL;
-- (NSArray *)itemsForIdentifierURLs:(NSArray *)anArray;
+- (nullable BibItem *)itemForIdentifierURL:(NSURL *)aURL;
+- (nullable NSArray *)itemsForIdentifierURLs:(NSArray *)anArray;
-- (SKIndexRef)copyIndexForField:(NSString *)field;
+- (nullable SKIndexRef)copyIndexForField:(NSString *)field;
- (void)reindexPublication:(BibItem *)pub;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKScriptHook.h
===================================================================
--- trunk/bibdesk/BDSKScriptHook.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKScriptHook.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
extern NSString *BDSKScriptHookNameCloseEditorWindow;
extern NSString *BDSKScriptHookNameChangeField;
extern NSString *BDSKScriptHookNameAddFile;
@@ -63,21 +65,23 @@
NSDocument *document;
}
-+ (BDSKScriptHook *)scriptHookWithUniqueID:(NSString *)uniqueID;
++ (nullable BDSKScriptHook *)scriptHookWithUniqueID:(NSString *)uniqueID;
-+ (BDSKScriptHook *)newWithName:(NSString *)name;
++ (nullable BDSKScriptHook *)newWithName:(NSString *)name;
-- (instancetype)initWithName:(NSString *)aName script:(NSUserAppleScriptTask
*)aScript;
+- (nullable instancetype)initWithName:(NSString *)aName
script:(NSUserAppleScriptTask *)aScript;
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSString *uniqueID;
-@property (nonatomic, strong) NSString *field;
-@property (nonatomic, strong) NSArray *oldValues;
-@property (nonatomic, strong) NSArray *values;
+@property (nonatomic, nullable, strong) NSString *field;
+@property (nonatomic, nullable, strong) NSArray *oldValues;
+@property (nonatomic,nullable, strong) NSArray *values;
@property (nonatomic) BOOL cancelled;
@property (nonatomic, strong) NSDocument *document;
@property (nonatomic, readonly) NSUserAppleScriptTask *script;
-- (void)runWithPublications:(NSArray *)items completionHandler:(void (^)(BOOL
cancelled))handler;
+- (void)runWithPublications:(nullable NSArray *)items completionHandler:(void
(^ _Nullable)(BOOL cancelled))handler;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKScriptHook.m
===================================================================
--- trunk/bibdesk/BDSKScriptHook.m 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKScriptHook.m 2025-02-16 18:05:46 UTC (rev 29007)
@@ -105,7 +105,8 @@
// old designated initializer, shouldn't be used
- (instancetype)init {
- return [self initWithName:nil script:nil];
+ self = nil;
+ return self;
}
// designated initializer
Modified: trunk/bibdesk/BDSKSearchBookmark.h
===================================================================
--- trunk/bibdesk/BDSKSearchBookmark.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKSearchBookmark.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKSearchBookmarkType) {
BDSKSearchBookmarkTypeBookmark,
BDSKSearchBookmarkTypeFolder,
@@ -48,30 +50,30 @@
__weak BDSKSearchBookmark *parent;
}
-- (instancetype)initFolderWithChildren:(NSArray *)aChildren label:(NSString
*)aLabel;
-- (instancetype)initFolderWithLabel:(NSString *)aLabel;
-- (instancetype)initRootWithChildrenDictionaries:(NSArray *)dictionaries;
-- (instancetype)initSeparator;
-- (instancetype)initWithInfo:(NSDictionary *)aDictionary label:(NSString
*)aLabel;
-- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
+- (nullable instancetype)initFolderWithChildren:(NSArray *)aChildren
label:(nullable NSString *)aLabel;
+- (nullable instancetype)initFolderWithLabel:(nullable NSString *)aLabel;
+- (nullable instancetype)initRootWithChildrenDictionaries:(nullable NSArray
*)dictionaries;
+- (nullable instancetype)initSeparator;
+- (nullable instancetype)initWithInfo:(NSDictionary *)aDictionary
label:(nullable NSString *)aLabel;
+- (nullable instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property (nonatomic, readonly) NSDictionary *dictionaryValue;
@property (nonatomic, readonly) BDSKSearchBookmarkType bookmarkType;
-@property (nonatomic, strong) NSDictionary *info;
+@property (nonatomic, nullable, strong) NSDictionary *info;
-@property (nonatomic, strong) NSString *label;
+@property (nonatomic, nullable, strong) NSString *label;
-@property (nonatomic, readonly) NSImage *icon;
+@property (nonatomic, nullable, readonly) NSImage *icon;
-@property (nonatomic, readonly) NSString *name;
+@property (nonatomic, nullable, readonly) NSString *name;
-@property (nonatomic, strong) NSString *searchTerm;
+@property (nonatomic, nullable, strong) NSString *searchTerm;
-@property (nonatomic, weak) BDSKSearchBookmark *parent;
+@property (nonatomic, nullable, weak) BDSKSearchBookmark *parent;
-- (NSArray *)children;
+- (nullable NSArray *)children;
- (NSUInteger)countOfChildren;
- (BDSKSearchBookmark *)objectInChildrenAtIndex:(NSUInteger)idx;
- (void)insertObject:(BDSKSearchBookmark *)child
inChildrenAtIndex:(NSUInteger)idx;
@@ -83,3 +85,5 @@
- (BOOL)isDescendantOfArray:(NSArray *)bookmarks;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKServerInfo.h
===================================================================
--- trunk/bibdesk/BDSKServerInfo.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKServerInfo.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKServerType) {
BDSKServerTypeEntrez,
BDSKServerTypeZoom,
@@ -59,11 +61,11 @@
BDSKReadWriteLock *passwordLock;
}
-+ (instancetype)defaultServerInfoWithType:(NSString *)aType;
++ (nullable instancetype)defaultServerInfoWithType:(NSString *)aType;
-- (instancetype)initWithType:(NSString *)aType name:(NSString *)aName
database:(NSString *)aDbase host:(NSString *)aHost port:(NSString *)aPort
options:(NSDictionary *)options;
+- (nullable instancetype)initWithType:(NSString *)aType name:(NSString *)aName
database:(NSString *)aDbase host:(nullable NSString *)aHost port:(nullable
NSString *)aPort options:(nullable NSDictionary *)options;
-- (instancetype)initWithDictionary:(NSDictionary *)info;
+- (nullable instancetype)initWithDictionary:(NSDictionary *)info;
@property (nonatomic, readonly) NSDictionary *dictionaryValue;
@@ -70,15 +72,15 @@
@property (nonatomic, readonly) NSString *type;
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSString *database;
-@property (nonatomic, readonly) NSString *host;
-@property (nonatomic, readonly) NSString *port;
-@property (nonatomic, readonly) NSString *username;
-@property (nonatomic, readonly) NSString *recordSyntax;
-@property (nonatomic, readonly) NSString *resultEncoding;
-@property (nonatomic, readonly) NSString *queryConfig;
+@property (nonatomic, nullable, readonly) NSString *host;
+@property (nonatomic, nullable, readonly) NSString *port;
+@property (nonatomic, nullable, readonly) NSString *username;
+@property (nonatomic, nullable, readonly) NSString *recordSyntax;
+@property (nonatomic, nullable, readonly) NSString *resultEncoding;
+@property (nonatomic, nullable, readonly) NSString *queryConfig;
@property (nonatomic, readonly) BOOL removeDiacritics;
@property (nonatomic, readonly, getter=isLite) BOOL lite;
-@property (nonatomic, readonly) NSDictionary *options;
+@property (nonatomic, nullable, readonly) NSDictionary *options;
@property (nonatomic, readonly, getter=isEntrez) BOOL entrez;
@property (nonatomic, readonly, getter=isZoom) BOOL zoom;
@@ -90,7 +92,7 @@
@property (nonatomic, readonly) NSURL *URLValue;
// use this to get the password, as the accessor returns nil to deny access to
templating
-- (BOOL)getUsername:(NSString **)username password:(NSString **)password;
+- (BOOL)getUsername:(NSString * _Nullable * _Nullable)username
password:(NSString * _Nullable * _Nullable)password;
- (void)savePasswordInKeychain;
@@ -101,13 +103,15 @@
@property (nonatomic, copy) NSString *type;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *database;
-@property (nonatomic, copy) NSString *host;
-@property (nonatomic, copy) NSString *port;
-@property (nonatomic, copy) NSString *password;
-@property (nonatomic, copy) NSString *username;
-@property (nonatomic, copy) NSString *recordSyntax;
-@property (nonatomic, copy) NSString *resultEncoding;
+@property (nonatomic, nullable, copy) NSString *host;
+@property (nonatomic, nullable, copy) NSString *port;
+@property (nonatomic, nullable, copy) NSString *password;
+@property (nonatomic, nullable, copy) NSString *username;
+@property (nonatomic, nullable, copy) NSString *recordSyntax;
+@property (nonatomic, nullable, copy) NSString *resultEncoding;
@property (nonatomic) BOOL removeDiacritics;
@property (nonatomic, getter=isLite) BOOL lite;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKStringNode.h
===================================================================
--- trunk/bibdesk/BDSKStringNode.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKStringNode.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,7 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, BDSKStringNodeType) {
BDSKStringNodeString = 0,
@@ -133,3 +134,5 @@
@property (nonatomic, readonly) NSString *value;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKTask.h
===================================================================
--- trunk/bibdesk/BDSKTask.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKTask.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -51,6 +51,8 @@
*/
+NS_ASSUME_NONNULL_BEGIN
+
@interface BDSKTask : NSTask {
@private
NSString *_launchPath;
@@ -83,3 +85,5 @@
__eintr_result__;\
})
#endif
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKTemplate.h
===================================================================
--- trunk/bibdesk/BDSKTemplate.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKTemplate.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -39,6 +39,8 @@
#import <Cocoa/Cocoa.h>
#import "BDSKTreeNode.h"
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_OPTIONS(NSUInteger, BDSKTemplateFormat) {
BDSKTemplateFormatUnknown = 0,
BDSKTemplateFormatText = 1 << 0, // generic plain text template
@@ -74,17 +76,17 @@
+ (NSString *)unlocalizedRoleString:(NSString *)string;
// all templates
-@property (class, nonatomic, copy) NSArray *exportTemplates;
-@property (class, nonatomic, copy) NSArray *serviceTemplates;
+@property (class, nonatomic, nullable, copy) NSArray *exportTemplates;
+@property (class, nonatomic, nullable, copy) NSArray *serviceTemplates;
// known export style names
@property (class, nonatomic, readonly) NSArray *allStyleNames;
@property (class, nonatomic, readonly) NSString *defaultPreviewTemplateName;
+ (NSArray *)allStyleNamesForFormat:(BDSKTemplateFormat)format;
-+ (NSString *)defaultStyleNameForFileType:(NSString *)fileType;
++ (nullable NSString *)defaultStyleNameForFileType:(NSString *)fileType;
// export templates
-+ (BDSKTemplate *)templateForStyle:(NSString *)styleName;
++ (nullable BDSKTemplate *)templateForStyle:(NSString *)styleName;
+ (BDSKTemplate *)templateWithName:(NSString *)name mainPageURL:(NSURL
*)fileURL;
+ (BDSKTemplate *)templateWithString:(NSString *)string fileType:(NSString
*)fileType;
@@ -98,38 +100,38 @@
// top-level template accessors
@property (nonatomic, readonly) BDSKTemplateFormat templateFormat,
templateFormatNoUI;
-@property (nonatomic, readonly) NSString *fileExtension;
-@property (nonatomic, readonly) NSString *documentType;
+@property (nonatomic, nullable, readonly) NSString *fileExtension;
+@property (nonatomic, nullable, readonly) NSString *documentType;
-@property (nonatomic, readonly) NSString *mainPageString;
-- (NSAttributedString
*)mainPageAttributedStringWithDocumentAttributes:(NSDictionary **)docAttributes;
-@property (nonatomic, readonly) NSString *scriptPath;
+@property (nonatomic, nullable, readonly) NSString *mainPageString;
+- (nullable NSAttributedString
*)mainPageAttributedStringWithDocumentAttributes:(NSDictionary * _Nullable *
_Nullable)docAttributes;
+@property (nonatomic, nullable, readonly) NSString *scriptPath;
// returns the contents of a child for the given type or of the default
template
// (pass nil for the type if you explicitly desire the default template
content)
// encoding should be either Unicode, UTF-8, or defaultCStringEncoding
-- (NSString *)stringForType:(NSString *)type;
-- (NSAttributedString *)attributedStringForType:(NSString *)type;
+- (nullable NSString *)stringForType:(NSString *)type;
+- (nullable NSAttributedString *)attributedStringForType:(NSString *)type;
-@property (nonatomic, readonly) NSURL *mainPageTemplateURL;
-@property (nonatomic, readonly) NSURL *defaultItemTemplateURL;
+@property (nonatomic, nullable, readonly) NSURL *mainPageTemplateURL;
+@property (nonatomic, nullable, readonly) NSURL *defaultItemTemplateURL;
@property (nonatomic, readonly) BOOL hasMainPageTemplateURL;
-- (NSURL *)templateURLForType:(NSString *)pubType;
+- (nullable NSURL *)templateURLForType:(NSString *)pubType;
-@property (nonatomic, readonly) NSArray *accessoryFileURLs;
-@property (nonatomic, readonly) NSURL *scriptURL;
+@property (nonatomic, nullable, readonly) NSArray *accessoryFileURLs;
+@property (nonatomic, nullable, readonly) NSURL *scriptURL;
// child template accessors
-@property (nonatomic, strong) NSURL *representedFileURL;
+@property (nonatomic, nullable, strong) NSURL *representedFileURL;
-@property (nonatomic, readonly) NSURL *representedFileURLNoUI;
+@property (nonatomic, nullable, readonly) NSURL *representedFileURLNoUI;
// other methods
- (BOOL)addChildWithURL:(NSURL *)fileURL role:(NSString *)role;
-- (instancetype)childForRole:(NSString *)role;
+- (nullable instancetype)childForRole:(NSString *)role;
@end
-
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKTemplateObjectProxy.h
===================================================================
--- trunk/bibdesk/BDSKTemplateObjectProxy.h 2025-02-16 16:33:36 UTC (rev
29006)
+++ trunk/bibdesk/BDSKTemplateObjectProxy.h 2025-02-16 18:05:46 UTC (rev
29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@class BDSKTemplate;
@interface BDSKTemplateObjectProxy : NSObject {
@@ -48,13 +50,13 @@
}
+ (NSString *)stringByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items;
-+ (NSString *)stringByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items
publicationsContext:(NSArray *)itemsContext;
-+ (NSAttributedString *)attributedStringByParsingTemplate:(BDSKTemplate
*)template withObject:(id)anObject publications:(NSArray *)items
documentAttributes:(NSDictionary **)docAttributes;
-+ (NSAttributedString *)attributedStringByParsingTemplate:(BDSKTemplate
*)template withObject:(id)anObject publications:(NSArray *)items
publicationsContext:(NSArray *)itemsContext documentAttributes:(NSDictionary
**)docAttributes;
-+ (NSData *)dataByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items;
-+ (NSData *)dataByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items
publicationsContext:(NSArray *)itemsContext;
++ (NSString *)stringByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items
publicationsContext:(nullable NSArray *)itemsContext;
++ (NSAttributedString *)attributedStringByParsingTemplate:(BDSKTemplate
*)template withObject:(id)anObject publications:(NSArray *)items
documentAttributes:(NSDictionary * _Nullable * _Nullable)docAttributes;
++ (NSAttributedString *)attributedStringByParsingTemplate:(BDSKTemplate
*)template withObject:(id)anObject publications:(NSArray *)items
publicationsContext:(nullable NSArray *)itemsContext
documentAttributes:(NSDictionary * _Nullable * _Nullable)docAttributes;
++ (nullable NSData *)dataByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items;
++ (nullable NSData *)dataByParsingTemplate:(BDSKTemplate *)template
withObject:(id)anObject publications:(NSArray *)items
publicationsContext:(nullable NSArray *)itemsContext;
-- (instancetype)initWithObject:(id)anObject publications:(NSArray *)items
publicationsContext:(NSArray *)itemsContext template:(BDSKTemplate *)aTemplate;
+- (instancetype)initWithObject:(id)anObject publications:(NSArray *)items
publicationsContext:(nullable NSArray *)itemsContext template:(BDSKTemplate
*)aTemplate;
@property (nonatomic, readonly) NSArray *publications;
@property (nonatomic, readonly) id publicationsUsingTemplate;
@@ -62,3 +64,5 @@
@property (nonatomic, readonly) NSDate *currentDate;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKTemplateTag.h
===================================================================
--- trunk/bibdesk/BDSKTemplateTag.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKTemplateTag.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKTemplateTagType) {
BDSKTemplateTagValue,
BDSKTemplateTagCollection,
@@ -88,7 +90,7 @@
@property (nonatomic, readonly) NSDictionary *attributes;
-@property (nonatomic, readonly) BDSKAttributeTemplate *linkTemplate;
+@property (nonatomic, nullable, readonly) BDSKAttributeTemplate *linkTemplate;
@end
@@ -101,10 +103,10 @@
NSArray *separatorTemplate;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath
itemTemplateString:(NSString *)anItemTemplateString
separatorTemplateString:(NSString *)aSeparatorTemplateString;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath
itemTemplateString:(NSString *)anItemTemplateString
separatorTemplateString:(nullable NSString *)aSeparatorTemplateString;
@property (nonatomic, readonly) NSArray *itemTemplate;
-@property (nonatomic, readonly) NSArray *separatorTemplate;
+@property (nonatomic, nullable, readonly) NSArray *separatorTemplate;
@end
@@ -117,10 +119,10 @@
NSArray *separatorTemplate;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath
itemTemplateAttributedString:(NSAttributedString
*)anItemTemplateAttributedString
separatorTemplateAttributedString:(NSAttributedString
*)aSeparatorTemplateAttributedString;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath
itemTemplateAttributedString:(NSAttributedString
*)anItemTemplateAttributedString separatorTemplateAttributedString:(nullable
NSAttributedString *)aSeparatorTemplateAttributedString;
@property (nonatomic, readonly) NSArray *itemTemplate;
-@property (nonatomic, readonly) NSArray *separatorTemplate;
+@property (nonatomic, nullable, readonly) NSArray *separatorTemplate;
@end
@@ -186,12 +188,14 @@
Class attributeClass;
}
-- (instancetype)initWithTemplate:(NSArray *)aTemplate range:(NSRange)aRange
attributeClass:(Class)aClass;
+- (instancetype)initWithTemplate:(nullable NSArray *)aTemplate
range:(NSRange)aRange attributeClass:(nullable Class)aClass;
-@property (nonatomic, readonly) NSArray *template;
+@property (nonatomic, nullable, readonly) NSArray *template;
@property (nonatomic, readonly) NSRange range;
-@property (nonatomic, readonly) Class attributeClass;
+@property (nonatomic, nullable, readonly) Class attributeClass;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKToken.h
===================================================================
--- trunk/bibdesk/BDSKToken.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKToken.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKTokenType) {
BDSKTokenTypeField,
BDSKTokenTypeURL,
@@ -70,18 +72,18 @@
@property (nonatomic, readonly) NSString *boxTitle;
@property (nonatomic, getter=isInRepository) BOOL inRepository;
-@property (nonatomic, strong) NSString *fontName;
+@property (nonatomic, nullable, strong) NSString *fontName;
@property (nonatomic) CGFloat fontSize;
@property (nonatomic) NSInteger bold;
@property (nonatomic) NSInteger italic;
-@property (nonatomic, readonly) NSString *string;
+@property (nonatomic, nullable, readonly) NSString *string;
-- (NSAttributedString *)attributedStringWithDefaultAttributes:(NSDictionary
*)attributes;
+- (nullable NSAttributedString
*)attributedStringWithDefaultAttributes:(NSDictionary *)attributes;
@property (nonatomic, readonly) NSSet *keysForValuesToObserveForUndo;
-- (void)setKey:(NSString *)aKey toValue:(id)aValue;
+- (void)setKey:(NSString *)aKey toValue:(nullable id)aValue;
@end
@@ -106,8 +108,8 @@
}
@property (nonatomic, strong) NSString *appendingKey;
-@property (nonatomic, strong) NSString *prefix;
-@property (nonatomic, strong) NSString *suffix;
+@property (nonatomic, nullable, strong) NSString *prefix;
+@property (nonatomic, nullable, strong) NSString *suffix;
@end
@@ -118,8 +120,8 @@
NSString *cleaningKey;
}
-@property (nonatomic, strong) NSString *casingKey;
-@property (nonatomic, strong) NSString *cleaningKey;
+@property (nonatomic, nullable, strong) NSString *casingKey;
+@property (nonatomic, nullable, strong) NSString *cleaningKey;
@end
@@ -129,7 +131,7 @@
NSString *urlFormatKey;
}
-@property (nonatomic, strong) NSString *urlFormatKey;
+@property (nonatomic, nullable, strong) NSString *urlFormatKey;
@end
@@ -140,8 +142,8 @@
NSString *joinStyleKey;
}
-@property (nonatomic, strong) NSString *nameStyleKey;
-@property (nonatomic, strong) NSString *joinStyleKey;
+@property (nonatomic, nullable, strong) NSString *nameStyleKey;
+@property (nonatomic, nullable, strong) NSString *joinStyleKey;
@end
@@ -152,8 +154,8 @@
NSString *linkedFileJoinStyleKey;
}
-@property (nonatomic, strong) NSString *linkedFileFormatKey;
-@property (nonatomic, strong) NSString *linkedFileJoinStyleKey;
+@property (nonatomic, nullable, strong) NSString *linkedFileFormatKey;
+@property (nonatomic, nullable, strong) NSString *linkedFileJoinStyleKey;
@end
@@ -163,7 +165,7 @@
NSString *dateFormatKey;
}
-@property (nonatomic, strong) NSString *dateFormatKey;
+@property (nonatomic, nullable, strong) NSString *dateFormatKey;
@end
@@ -174,8 +176,8 @@
NSString *counterCasingKey;
}
-@property (nonatomic, strong) NSString *counterStyleKey;
-@property (nonatomic, strong) NSString *counterCasingKey;
+@property (nonatomic, nullable, strong) NSString *counterStyleKey;
+@property (nonatomic, nullable, strong) NSString *counterCasingKey;
@end
@@ -187,7 +189,9 @@
}
@property (nonatomic, strong) NSString *title;
-@property (nonatomic, strong) NSString *field;
-@property (nonatomic, strong) NSString *altText;
+@property (nonatomic, nullable, strong) NSString *field;
+@property (nonatomic, nullable, strong) NSString *altText;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKTreeNode.h
===================================================================
--- trunk/bibdesk/BDSKTreeNode.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKTreeNode.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,7 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
@interface BDSKTreeNode : NSObject <NSCoding, NSCopying>
{
@@ -46,18 +47,20 @@
__weak BDSKTreeNode *parent;
}
-- (instancetype)initWithColumnValues:(NSDictionary *)newColumnValues
children:(NSArray *)newChildren;
+- (instancetype)initWithColumnValues:(nullable NSDictionary *)newColumnValues
children:(nullable NSArray *)newChildren;
// uses isEqual:
-- (NSArray *)children;
-- (void)setChildren:(NSArray *)newChildren;
+- (nullable NSArray *)children;
+- (void)setChildren:(nullable NSArray *)newChildren;
- (NSUInteger)countOfChildren;
- (id)objectInChildrenAtIndex:(NSUInteger)anIndex;
- (void)insertObject:(id)obj inChildrenAtIndex:(NSUInteger)anIndex;
- (void)removeObjectFromChildrenAtIndex:(NSUInteger)anIndex;
-@property (nonatomic, weak) BDSKTreeNode *parent;
+@property (nonatomic, nullable, weak) BDSKTreeNode *parent;
@property (nonatomic, readonly, getter=isLeaf) BOOL leaf;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKTypeTemplate.h
===================================================================
--- trunk/bibdesk/BDSKTypeTemplate.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKTypeTemplate.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
extern NSString *BDSKTemplateDidChangeNotification;
@interface BDSKTypeTemplate : NSObject {
@@ -56,7 +58,7 @@
@property (nonatomic, getter=isIncluded) BOOL included;
@property (nonatomic, getter=isDefaultTemplate) BOOL defaultTemplate;
-@property (nonatomic, readonly) NSColor *textColor;
+@property (nonatomic, nullable, readonly) NSColor *textColor;
@property (nonatomic, readonly) NSArray *requiredTokens;
@property (nonatomic, readonly) NSArray *optionalTokens;
@@ -67,3 +69,5 @@
- (NSAttributedString *)attributedStringWithDefaultAttributes:(NSDictionary
*)attributes;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKVersionNumber.h
===================================================================
--- trunk/bibdesk/BDSKVersionNumber.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BDSKVersionNumber.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -38,6 +38,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
typedef NS_ENUM(NSInteger, BDSKVersionType) {
BDSKVersionTypeRelease = 0,
BDSKVersionTypeReleaseCandidate = -1,
@@ -58,9 +60,9 @@
+ (NSComparisonResult)compareVersionString:(NSString *)versionString
toVersionString:(NSString *)otherVersionString;
-+ (instancetype)versionNumberWithVersionString:(NSString *)versionString;
++ (nullable instancetype)versionNumberWithVersionString:(NSString
*)versionString;
-- (instancetype)initWithVersionString:(NSString *)versionString;
+- (nullable instancetype)initWithVersionString:(NSString *)versionString;
@property (nonatomic, readonly) NSString *originalVersionString;
@property (nonatomic, readonly) NSString *cleanVersionString;
@@ -73,3 +75,5 @@
- (NSComparisonResult)compare:(BDSKVersionNumber *)otherVersion;
@end
+
+NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BibAuthor.h
===================================================================
--- trunk/bibdesk/BibAuthor.h 2025-02-16 16:33:36 UTC (rev 29006)
+++ trunk/bibdesk/BibAuthor.h 2025-02-16 18:05:46 UTC (rev 29007)
@@ -39,6 +39,8 @@
*/
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@class BibItem;
typedef NS_OPTIONS(NSUInteger, BDSKAuthorDisplay) {
@@ -77,7 +79,7 @@
@property (class, nonatomic, readonly) BibAuthor *emptyAuthor;
+ (BibAuthor *)authorWithVCardRepresentation:(NSData *)vCard;
-- (instancetype)initWithName:(NSString *)aName publication:(BibItem *)aPub
forField:(NSString *)aField;
+- (instancetype)initWithName:(NSString *)aName publication:(nullable BibItem
*)aPub forField:(nullable NSString *)aField;
- (NSComparisonResult)compare:(BibAuthor *)otherAuth;
- (BOOL)fuzzyEqual:(BibAuthor *)otherAuth;
@@ -95,10 +97,10 @@
- (NSComparisonResult)sortCompare:(BibAuthor *)otherAuth;
// The basic parts as interpreted by btparse
-@property (nonatomic, readonly) NSString *firstName;
-@property (nonatomic, readonly) NSString *vonPart;
-@property (nonatomic, readonly) NSString *lastName;
-@property (nonatomic, readonly) NSString *jrPart;
+@property (nonatomic, nullable, readonly) NSString *firstName;
+@property (nonatomic, nullable, readonly) NSString *vonPart;
+@property (nonatomic, nullable, readonly) NSString *lastName;
+@property (nonatomic, nullable, readonly) NSString *jrPart;
// name used to create the BibAuthor instance
@property (nonatomic, readonly) NSString *originalName;
@@ -124,12 +126,12 @@
- (NSXMLElement *)MODSXMLElementWithRole:(NSString *)rel;
-@property (nonatomic, weak) BibItem *publication;
+@property (nonatomic, nullable, weak) BibItem *publication;
-@property (nonatomic, readonly) NSString *field;
+@property (nonatomic, nullable, readonly) NSString *field;
-@property (nonatomic, readonly) NSData *imageData;
-@property (nonatomic, readonly) NSData *vCardRepresentation;
+@property (nonatomic, nullable, readonly) NSData *imageData;
+@property (nonatomic, nullable, readonly) NSData *vCardRepresentation;
@end
@@ -137,3 +139,5 @@
@interface NSArray (BibAuthorMultipleCompare)
- (NSComparisonResult)sortCompareToAuthorArray:(NSArray *)other;
@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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit