NS_ASSUME_NONNULL
This commit is contained in:
@@ -27,8 +27,6 @@
|
|||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
<MacroExpansion>
|
<MacroExpansion>
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
@@ -38,8 +36,8 @@
|
|||||||
ReferencedContainer = "container:baRSS.xcodeproj">
|
ReferencedContainer = "container:baRSS.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</MacroExpansion>
|
</MacroExpansion>
|
||||||
<AdditionalOptions>
|
<Testables>
|
||||||
</AdditionalOptions>
|
</Testables>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
@@ -49,7 +47,7 @@
|
|||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
stopOnEveryMainThreadCheckerIssue = "YES"
|
migratedStopOnEveryIssue = "YES"
|
||||||
debugServiceExtension = "internal"
|
debugServiceExtension = "internal"
|
||||||
allowLocationSimulation = "YES">
|
allowLocationSimulation = "YES">
|
||||||
<BuildableProductRunnable
|
<BuildableProductRunnable
|
||||||
@@ -83,8 +81,6 @@
|
|||||||
isEnabled = "NO">
|
isEnabled = "NO">
|
||||||
</EnvironmentVariable>
|
</EnvironmentVariable>
|
||||||
</EnvironmentVariables>
|
</EnvironmentVariables>
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Release"
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#import "Feed+CoreDataClass.h"
|
#import "Feed+CoreDataClass.h"
|
||||||
@class RSParsedFeed;
|
@class RSParsedFeed;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface Feed (Ext)
|
@interface Feed (Ext)
|
||||||
@property (readonly) BOOL hasIcon;
|
@property (readonly) BOOL hasIcon;
|
||||||
@property (nonnull, readonly) NSImage* iconImage16;
|
@property (nonnull, readonly) NSImage* iconImage16;
|
||||||
@@ -38,3 +40,5 @@
|
|||||||
// Article properties
|
// Article properties
|
||||||
- (NSArray<FeedArticle*>*)sortedArticles;
|
- (NSArray<FeedArticle*>*)sortedArticles;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,7 +24,11 @@
|
|||||||
#import "FeedArticle+CoreDataClass.h"
|
#import "FeedArticle+CoreDataClass.h"
|
||||||
@class RSParsedArticle;
|
@class RSParsedArticle;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface FeedArticle (Ext)
|
@interface FeedArticle (Ext)
|
||||||
+ (instancetype)newArticle:(RSParsedArticle*)entry inContext:(NSManagedObjectContext*)moc;
|
+ (instancetype)newArticle:(RSParsedArticle*)entry inContext:(NSManagedObjectContext*)moc;
|
||||||
- (NSMenuItem*)newMenuItem;
|
- (NSMenuItem*)newMenuItem;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ typedef NS_ENUM(int16_t, FeedGroupType) {
|
|||||||
GROUP = 0, FEED = 1, SEPARATOR = 2
|
GROUP = 0, FEED = 1, SEPARATOR = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface FeedGroup (Ext)
|
@interface FeedGroup (Ext)
|
||||||
/// Overwrites @c type attribute with enum. Use one of: @c GROUP, @c FEED, @c SEPARATOR.
|
/// Overwrites @c type attribute with enum. Use one of: @c GROUP, @c FEED, @c SEPARATOR.
|
||||||
@@ -39,7 +40,7 @@ typedef NS_ENUM(int16_t, FeedGroupType) {
|
|||||||
|
|
||||||
+ (instancetype)newGroup:(FeedGroupType)type inContext:(NSManagedObjectContext*)context;
|
+ (instancetype)newGroup:(FeedGroupType)type inContext:(NSManagedObjectContext*)context;
|
||||||
+ (instancetype)appendToRoot:(FeedGroupType)type inContext:(NSManagedObjectContext*)moc;
|
+ (instancetype)appendToRoot:(FeedGroupType)type inContext:(NSManagedObjectContext*)moc;
|
||||||
- (void)setParent:(FeedGroup *)parent andSortIndex:(int32_t)sortIndex;
|
- (void)setParent:(nullable FeedGroup *)parent andSortIndex:(int32_t)sortIndex;
|
||||||
- (void)setSortIndexIfChanged:(int32_t)sortIndex;
|
- (void)setSortIndexIfChanged:(int32_t)sortIndex;
|
||||||
- (void)setNameIfChanged:(nullable NSString*)name;
|
- (void)setNameIfChanged:(nullable NSString*)name;
|
||||||
- (NSMenuItem*)newMenuItem;
|
- (NSMenuItem*)newMenuItem;
|
||||||
@@ -50,3 +51,5 @@ typedef NS_ENUM(int16_t, FeedGroupType) {
|
|||||||
// Printing
|
// Printing
|
||||||
- (NSString*)readableDescription;
|
- (NSString*)readableDescription;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Set @c parent and @c sortIndex. Also if type is @c FEED calculate and set @c indexPath string.
|
/// Set @c parent and @c sortIndex. Also if type is @c FEED calculate and set @c indexPath string.
|
||||||
- (void)setParent:(FeedGroup *)parent andSortIndex:(int32_t)sortIndex {
|
- (void)setParent:(nullable FeedGroup *)parent andSortIndex:(int32_t)sortIndex {
|
||||||
self.parent = parent;
|
self.parent = parent;
|
||||||
self.sortIndex = sortIndex;
|
self.sortIndex = sortIndex;
|
||||||
if (self.type == FEED)
|
if (self.type == FEED)
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
static int32_t const kDefaultFeedRefreshInterval = 30 * 60;
|
static int32_t const kDefaultFeedRefreshInterval = 30 * 60;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface FeedMeta (Ext)
|
@interface FeedMeta (Ext)
|
||||||
+ (instancetype)newMetaInContext:(NSManagedObjectContext*)moc;
|
+ (instancetype)newMetaInContext:(NSManagedObjectContext*)moc;
|
||||||
// HTTP response
|
// HTTP response
|
||||||
@@ -35,3 +37,5 @@ static int32_t const kDefaultFeedRefreshInterval = 30 * 60;
|
|||||||
- (void)setRefreshIfChanged:(int32_t)refresh;
|
- (void)setRefreshIfChanged:(int32_t)refresh;
|
||||||
- (void)scheduleNow:(NSTimeInterval)future;
|
- (void)scheduleNow:(NSTimeInterval)future;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSFetchRequest<ResultType> (Ext)
|
@interface NSFetchRequest<ResultType> (Ext)
|
||||||
// Perform core data request and fetch data
|
// Perform core data request and fetch data
|
||||||
- (NSArray<ResultType>*)fetchAllRows:(NSManagedObjectContext*)moc;
|
- (NSArray<ResultType>*)fetchAllRows:(NSManagedObjectContext*)moc;
|
||||||
@@ -37,3 +39,5 @@
|
|||||||
- (instancetype)sortDESC:(NSString*)key; // add .sortDescriptors -> ascending:NO
|
- (instancetype)sortDESC:(NSString*)key; // add .sortDescriptors -> ascending:NO
|
||||||
- (instancetype)addFunctionExpression:(NSString*)fn onKeyPath:(NSString*)keyPath name:(NSString*)name type:(NSAttributeType)type; // add .propertiesToFetch -> (expressionForFunction:@[expressionForKeyPath:])
|
- (instancetype)addFunctionExpression:(NSString*)fn onKeyPath:(NSString*)keyPath name:(NSString*)name type:(NSAttributeType)type; // add .propertiesToFetch -> (expressionForFunction:@[expressionForKeyPath:])
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
#import "DBv1+CoreDataModel.h"
|
#import "DBv1+CoreDataModel.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface StoreCoordinator : NSObject
|
@interface StoreCoordinator : NSObject
|
||||||
// Managing contexts
|
// Managing contexts
|
||||||
+ (NSManagedObjectContext*)getMainContext;
|
+ (NSManagedObjectContext*)getMainContext;
|
||||||
@@ -44,7 +46,7 @@
|
|||||||
+ (NSArray<NSDictionary*>*)countAggregatedUnread;
|
+ (NSArray<NSDictionary*>*)countAggregatedUnread;
|
||||||
|
|
||||||
// Get List Of Elements
|
// Get List Of Elements
|
||||||
+ (NSArray<FeedGroup*>*)sortedFeedGroupsWithParent:(id)parent inContext:(nullable NSManagedObjectContext*)moc;
|
+ (NSArray<FeedGroup*>*)sortedFeedGroupsWithParent:(nullable id)parent inContext:(nullable NSManagedObjectContext*)moc;
|
||||||
+ (Feed*)feedWithIndexPath:(nonnull NSString*)path inContext:(nullable NSManagedObjectContext*)moc;
|
+ (Feed*)feedWithIndexPath:(nonnull NSString*)path inContext:(nullable NSManagedObjectContext*)moc;
|
||||||
+ (NSString*)urlForFeedWithIndexPath:(nonnull NSString*)path;
|
+ (NSString*)urlForFeedWithIndexPath:(nonnull NSString*)path;
|
||||||
|
|
||||||
@@ -55,3 +57,5 @@
|
|||||||
+ (void)cleanupAndShowAlert:(BOOL)flag;
|
+ (void)cleanupAndShowAlert:(BOOL)flag;
|
||||||
+ (NSUInteger)cleanupFavicons;
|
+ (NSUInteger)cleanupFavicons;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
@param moc If @c nil perform requests on main context (ok for reading).
|
@param moc If @c nil perform requests on main context (ok for reading).
|
||||||
@return Sorted list of @c FeedGroup items where @c FeedGroup.parent @c = @c parent.
|
@return Sorted list of @c FeedGroup items where @c FeedGroup.parent @c = @c parent.
|
||||||
*/
|
*/
|
||||||
+ (NSArray<FeedGroup*>*)sortedFeedGroupsWithParent:(id)parent inContext:(nullable NSManagedObjectContext*)moc {
|
+ (NSArray<FeedGroup*>*)sortedFeedGroupsWithParent:(nullable id)parent inContext:(nullable NSManagedObjectContext*)moc {
|
||||||
return [[[[FeedGroup fetchRequest] where:@"parent = %@", parent] sortASC:@"sortIndex"] fetchAllRows:moc ? moc : [self getMainContext]];
|
return [[[[FeedGroup fetchRequest] where:@"parent = %@", parent] sortASC:@"sortIndex"] fetchAllRows:moc ? moc : [self getMainContext]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,13 @@
|
|||||||
|
|
||||||
#define ENV_LOG_YOUTUBE 1
|
#define ENV_LOG_YOUTUBE 1
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
// TODO: Make plugins extensible? community extensions.
|
// TODO: Make plugins extensible? community extensions.
|
||||||
@interface YouTubePlugin : NSObject
|
@interface YouTubePlugin : NSObject
|
||||||
+ (NSString*)feedURL:(NSURL*)url;
|
+ (NSString*)feedURL:(NSURL*)url;
|
||||||
+ (NSString*)videoImage:(NSString*)videoid;
|
+ (NSString*)videoImage:(NSString*)videoid;
|
||||||
+ (NSString*)videoImageHQ:(NSString*)videoid;
|
+ (NSString*)videoImageHQ:(NSString*)videoid;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
@class Feed, RSHTMLMetadata, FeedDownload;
|
@class Feed, RSHTMLMetadata, FeedDownload;
|
||||||
@protocol FaviconDownloadDelegate;
|
@protocol FaviconDownloadDelegate;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface FaviconDownload : NSObject
|
@interface FaviconDownload : NSObject
|
||||||
/// @c img and @c path are @c nil if image is not valid or couldn't be downloaded.
|
/// @c img and @c path are @c nil if image is not valid or couldn't be downloaded.
|
||||||
typedef void(^FaviconDownloadBlock)(NSImage * _Nullable img, NSURL * _Nullable path);
|
typedef void(^FaviconDownloadBlock)(NSImage * _Nullable img, NSURL * _Nullable path);
|
||||||
@@ -45,3 +47,5 @@ typedef void(^FaviconDownloadBlock)(NSImage * _Nullable img, NSURL * _Nullable p
|
|||||||
/// Called after image download. Called on error, but not if download is cancled.
|
/// Called after image download. Called on error, but not if download is cancled.
|
||||||
- (void)faviconDownload:(FaviconDownload*)sender didFinish:(nullable NSURL*)path;
|
- (void)faviconDownload:(FaviconDownload*)sender didFinish:(nullable NSURL*)path;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
@class RSParsedFeed, RSHTMLMetadataFeedLink, Feed, FaviconDownload;
|
@class RSParsedFeed, RSHTMLMetadataFeedLink, Feed, FaviconDownload;
|
||||||
@protocol FeedDownloadDelegate;
|
@protocol FeedDownloadDelegate;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
All properties will be parsed and stored in local variables.
|
All properties will be parsed and stored in local variables.
|
||||||
This will avoid unnecessary core data operations if user decides to cancel the edit.
|
This will avoid unnecessary core data operations if user decides to cancel the edit.
|
||||||
@@ -61,3 +63,5 @@ typedef void (^FeedDownloadBlock)(FeedDownload *sender);
|
|||||||
/// Called after xml data is loaded and parsed. Called on error, but not if download is cancled.
|
/// Called after xml data is loaded and parsed. Called on error, but not if download is cancled.
|
||||||
- (void)feedDownloadDidFinish:(FeedDownload*)sender;
|
- (void)feedDownloadDidFinish:(FeedDownload*)sender;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ typedef NS_OPTIONS(NSUInteger, OpmlFileExportOptions) {
|
|||||||
OpmlFileExportOptionFullBackup = 1 << 2,
|
OpmlFileExportOptionFullBackup = 1 << 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
#pragma mark - Protocols
|
#pragma mark - Protocols
|
||||||
|
|
||||||
@protocol OpmlFileImportDelegate <NSObject>
|
@protocol OpmlFileImportDelegate <NSObject>
|
||||||
@@ -61,3 +63,5 @@ typedef NS_OPTIONS(NSUInteger, OpmlFileExportOptions) {
|
|||||||
- (void)showExportDialog:(NSWindow*)window;
|
- (void)showExportDialog:(NSWindow*)window;
|
||||||
- (nullable NSError*)writeOPMLFile:(NSURL*)url withOptions:(OpmlFileExportOptions)opt;
|
- (nullable NSError*)writeOPMLFile:(NSURL*)url withOptions:(OpmlFileExportOptions)opt;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
@class Feed;
|
@class Feed;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface UpdateScheduler : NSObject
|
@interface UpdateScheduler : NSObject
|
||||||
@property (class, readonly) NSUInteger feedsInQueue;
|
@property (class, readonly) NSUInteger feedsInQueue;
|
||||||
@property (class, readonly) NSDate *dateScheduled;
|
@property (class, readonly) NSDate *dateScheduled;
|
||||||
@@ -46,3 +48,5 @@
|
|||||||
+ (void)registerNetworkChangeNotification;
|
+ (void)registerNetworkChangeNotification;
|
||||||
+ (void)unregisterNetworkChangeNotification;
|
+ (void)unregisterNetworkChangeNotification;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>14471</string>
|
<string>14505</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.news</string>
|
<string>public.app-category.news</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ typedef NS_ENUM(int32_t, TimeUnitType) {
|
|||||||
TimeUnitYears = 365 * 24 * 60 * 60
|
TimeUnitYears = 365 * 24 * 60 * 60
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSDate (Ext)
|
@interface NSDate (Ext)
|
||||||
+ (NSString*)timeStringISO8601;
|
+ (NSString*)timeStringISO8601;
|
||||||
+ (NSString*)dayStringISO8601;
|
+ (NSString*)dayStringISO8601;
|
||||||
@@ -57,3 +59,5 @@ typedef NS_ENUM(int32_t, TimeUnitType) {
|
|||||||
@interface NSDate (Statistics)
|
@interface NSDate (Statistics)
|
||||||
+ (NSDictionary*)refreshIntervalStatistics:(NSArray<NSDate*> *)list;
|
+ (NSDictionary*)refreshIntervalStatistics:(NSArray<NSDate*> *)list;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
/// Log error message and prepend calling class and calling method.
|
/// Log error message and prepend calling class and calling method.
|
||||||
#define NSLogCaller(desc) { NSLog(@"%@:%@ %@", [self class], NSStringFromSelector(_cmd), desc); }
|
#define NSLogCaller(desc) { NSLog(@"%@:%@ %@", [self class], NSStringFromSelector(_cmd), desc); }
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSError (Ext)
|
@interface NSError (Ext)
|
||||||
// Generators
|
// Generators
|
||||||
+ (instancetype)statusCode:(NSInteger)code reason:(nullable NSString*)reason;
|
+ (instancetype)statusCode:(NSInteger)code reason:(nullable NSString*)reason;
|
||||||
@@ -35,3 +37,5 @@
|
|||||||
- (BOOL)inCaseLog:(nullable const char*)title;
|
- (BOOL)inCaseLog:(nullable const char*)title;
|
||||||
- (BOOL)inCasePresent:(NSApplication*)app;
|
- (BOOL)inCasePresent:(NSApplication*)app;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSString (PlainHTML)
|
@interface NSString (PlainHTML)
|
||||||
+ (NSString*)plainTextFromHTMLData:(NSData*)data;
|
+ (NSString*)plainTextFromHTMLData:(NSData*)data;
|
||||||
- (nonnull NSString*)htmlToPlainText;
|
- (nonnull NSString*)htmlToPlainText;
|
||||||
@@ -30,3 +32,5 @@
|
|||||||
@interface NSString (HexColor)
|
@interface NSString (HexColor)
|
||||||
- (nullable NSColor*)hexColor;
|
- (nullable NSColor*)hexColor;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#define ENV_LOG_FILES 0
|
#define ENV_LOG_FILES 0
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSURL (Ext)
|
@interface NSURL (Ext)
|
||||||
// Generators
|
// Generators
|
||||||
+ (NSURL*)applicationSupportURL;
|
+ (NSURL*)applicationSupportURL;
|
||||||
@@ -38,3 +40,5 @@
|
|||||||
- (void)remove;
|
- (void)remove;
|
||||||
- (void)moveTo:(NSURL*)destination;
|
- (void)moveTo:(NSURL*)destination;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,8 +24,12 @@
|
|||||||
|
|
||||||
#define ENV_LOG_DOWNLOAD 1
|
#define ENV_LOG_DOWNLOAD 1
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSURLRequest (Ext)
|
@interface NSURLRequest (Ext)
|
||||||
+ (instancetype)withURL:(NSString*)urlStr;
|
+ (instancetype)withURL:(NSString*)urlStr;
|
||||||
- (NSURLSessionDataTask*)dataTask:(nonnull void(^)(NSData * _Nullable data, NSError * _Nullable error, NSHTTPURLResponse *response))block;
|
- (NSURLSessionDataTask*)dataTask:(nonnull void(^)(NSData * _Nullable data, NSError * _Nullable error, NSHTTPURLResponse *response))block;
|
||||||
- (NSURLSessionDownloadTask*)downloadTask:(void(^)(NSURL * _Nullable path, NSError * _Nullable error))block;
|
- (NSURLSessionDownloadTask*)downloadTask:(void(^)(NSURL * _Nullable path, NSError * _Nullable error))block;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
/// Static variable to calculate origin center coordinate in its @c superview. The value of this var isn't used.
|
/// Static variable to calculate origin center coordinate in its @c superview. The value of this var isn't used.
|
||||||
static CGFloat const CENTER = -0.015625;
|
static CGFloat const CENTER = -0.015625;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/// Calculate @c origin.y going down from the top border of its @c superview
|
/// Calculate @c origin.y going down from the top border of its @c superview
|
||||||
static inline CGFloat YFromTop(NSView *view) { return NSHeight(view.superview.frame) - NSMinY(view.frame) - view.alignmentRectInsets.bottom; }
|
static inline CGFloat YFromTop(NSView *view) { return NSHeight(view.superview.frame) - NSMinY(view.frame) - view.alignmentRectInsets.bottom; }
|
||||||
/// @c MAX()
|
/// @c MAX()
|
||||||
@@ -65,7 +67,7 @@ static inline CGFloat NSMaxWidth(NSView *a, NSView *b) { return Max(NSWidth(a.fr
|
|||||||
+ (NSButton*)inlineButton:(NSString*)text;
|
+ (NSButton*)inlineButton:(NSString*)text;
|
||||||
+ (NSPopUpButton*)popupButton:(CGFloat)w;
|
+ (NSPopUpButton*)popupButton:(CGFloat)w;
|
||||||
// UI: Others
|
// UI: Others
|
||||||
+ (NSImageView*)imageView:(NSImageName)name size:(CGFloat)size;
|
+ (NSImageView*)imageView:(nullable NSImageName)name size:(CGFloat)size;
|
||||||
+ (NSButton*)checkbox:(BOOL)flag;
|
+ (NSButton*)checkbox:(BOOL)flag;
|
||||||
+ (NSProgressIndicator*)activitySpinner;
|
+ (NSProgressIndicator*)activitySpinner;
|
||||||
+ (NSView*)radioGroup:(NSArray<NSString*>*)entries target:(id)target action:(nonnull SEL)action;
|
+ (NSView*)radioGroup:(NSArray<NSString*>*)entries target:(id)target action:(nonnull SEL)action;
|
||||||
@@ -91,7 +93,7 @@ static inline CGFloat NSMaxWidth(NSView *a, NSView *b) { return Max(NSWidth(a.fr
|
|||||||
|
|
||||||
|
|
||||||
@interface NSControl (Ext)
|
@interface NSControl (Ext)
|
||||||
- (instancetype)action:(SEL)selector target:(id)target;
|
- (instancetype)action:(SEL)selector target:(nullable id)target;
|
||||||
- (instancetype)large;
|
- (instancetype)large;
|
||||||
- (instancetype)small;
|
- (instancetype)small;
|
||||||
- (instancetype)tiny;
|
- (instancetype)tiny;
|
||||||
@@ -106,3 +108,5 @@ static inline CGFloat NSMaxWidth(NSView *a, NSView *b) { return Max(NSWidth(a.fr
|
|||||||
- (instancetype)selectable;
|
- (instancetype)selectable;
|
||||||
- (instancetype)multiline:(NSSize)size;
|
- (instancetype)multiline:(NSSize)size;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/// Create @c ImageView with square @c size
|
/// Create @c ImageView with square @c size
|
||||||
+ (NSImageView*)imageView:(NSImageName)name size:(CGFloat)size {
|
+ (NSImageView*)imageView:(nullable NSImageName)name size:(CGFloat)size {
|
||||||
NSImageView *imgView = [[NSImageView alloc] initWithFrame: NSMakeRect(0, 0, size, size)];
|
NSImageView *imgView = [[NSImageView alloc] initWithFrame: NSMakeRect(0, 0, size, size)];
|
||||||
if (name) imgView.image = [NSImage imageNamed:name];
|
if (name) imgView.image = [NSImage imageNamed:name];
|
||||||
return imgView;
|
return imgView;
|
||||||
@@ -328,7 +328,7 @@ static inline void SetFrameWidth(NSView *view, CGFloat w) {
|
|||||||
@implementation NSControl (Ext)
|
@implementation NSControl (Ext)
|
||||||
|
|
||||||
/// Set @c target and @c action simultaneously
|
/// Set @c target and @c action simultaneously
|
||||||
- (instancetype)action:(SEL)selector target:(id)target {
|
- (instancetype)action:(SEL)selector target:(nullable id)target {
|
||||||
self.action = selector;
|
self.action = selector;
|
||||||
self.target = target;
|
self.target = target;
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -22,6 +22,10 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface SettingsAppearance : NSViewController
|
@interface SettingsAppearance : NSViewController
|
||||||
- (void)didSelectCheckbox:(NSButton*)sender;
|
- (void)didSelectCheckbox:(NSButton*)sender;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#import "ModalSheet.h"
|
#import "ModalSheet.h"
|
||||||
@class FeedGroup, ModalSheet;
|
@class FeedGroup, ModalSheet;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface ModalEditDialog : NSViewController
|
@interface ModalEditDialog : NSViewController
|
||||||
+ (instancetype)modalWith:(FeedGroup*)group;
|
+ (instancetype)modalWith:(FeedGroup*)group;
|
||||||
- (ModalSheet*)getModalSheet;
|
- (ModalSheet*)getModalSheet;
|
||||||
@@ -38,3 +40,4 @@
|
|||||||
@interface ModalGroupEdit : ModalEditDialog
|
@interface ModalGroupEdit : ModalEditDialog
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
@class ModalFeedEdit;
|
@class ModalFeedEdit;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface ModalFeedEditView : NSView
|
@interface ModalFeedEditView : NSView
|
||||||
@property (strong) IBOutlet NSTextField *url;
|
@property (strong) IBOutlet NSTextField *url;
|
||||||
@property (strong) IBOutlet NSProgressIndicator *spinnerURL;
|
@property (strong) IBOutlet NSProgressIndicator *spinnerURL;
|
||||||
@@ -43,3 +45,5 @@
|
|||||||
- (instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
|
- (instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
|
||||||
- (nullable instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
- (nullable instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@protocol RefreshIntervalButtonDelegate <NSObject>
|
@protocol RefreshIntervalButtonDelegate <NSObject>
|
||||||
@required
|
@required
|
||||||
/// @c sender.tag is refresh interval in seconds
|
/// @c sender.tag is refresh interval in seconds
|
||||||
@@ -34,3 +36,5 @@
|
|||||||
- (instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
|
- (instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
|
||||||
- (nullable instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
- (nullable instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,7 +23,11 @@
|
|||||||
#import "SettingsFeeds.h"
|
#import "SettingsFeeds.h"
|
||||||
#import "OpmlFile.h"
|
#import "OpmlFile.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface SettingsFeeds (DragDrop) <NSOutlineViewDataSource, NSFilePromiseProviderDelegate, NSPasteboardTypeOwner, OpmlFileImportDelegate, OpmlFileExportDelegate>
|
@interface SettingsFeeds (DragDrop) <NSOutlineViewDataSource, NSFilePromiseProviderDelegate, NSPasteboardTypeOwner, OpmlFileImportDelegate, OpmlFileExportDelegate>
|
||||||
- (void)prepareOutlineViewForDragDrop:(NSOutlineView*)outline;
|
- (void)prepareOutlineViewForDragDrop:(NSOutlineView*)outline;
|
||||||
- (void)importOpmlFiles:(NSArray<NSURL*>*)files;
|
- (void)importOpmlFiles:(NSArray<NSURL*>*)files;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,10 +22,12 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/** Manages the NSOutlineView and Feed creation and editing */
|
/** Manages the NSOutlineView and Feed creation and editing */
|
||||||
@interface SettingsFeeds : NSViewController <NSOutlineViewDelegate>
|
@interface SettingsFeeds : NSViewController <NSOutlineViewDelegate>
|
||||||
@property (strong) NSTreeController *dataStore;
|
@property (strong) NSTreeController *dataStore;
|
||||||
@property (strong) NSArray<NSTreeNode*> *currentlyDraggedNodes;
|
@property (strong, nullable) NSArray<NSTreeNode*> *currentlyDraggedNodes;
|
||||||
|
|
||||||
- (void)editSelectedItem;
|
- (void)editSelectedItem;
|
||||||
- (void)doubleClickOutlineView:(NSOutlineView*)sender;
|
- (void)doubleClickOutlineView:(NSOutlineView*)sender;
|
||||||
@@ -40,3 +42,5 @@
|
|||||||
- (BOOL)endCoreDataChangeUndoEmpty:(BOOL)undoEmpty forceUndo:(BOOL)force;
|
- (BOOL)endCoreDataChangeUndoEmpty:(BOOL)undoEmpty forceUndo:(BOOL)force;
|
||||||
- (void)restoreOrderingAndIndexPathStr:(NSArray<NSTreeNode*>*)parentsList;
|
- (void)restoreOrderingAndIndexPathStr:(NSArray<NSTreeNode*>*)parentsList;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
@class SettingsFeeds;
|
@class SettingsFeeds;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface SettingsFeedsView : NSView
|
@interface SettingsFeedsView : NSView
|
||||||
@property (strong) IBOutlet NSOutlineView *outline;
|
@property (strong) IBOutlet NSOutlineView *outline;
|
||||||
@property (strong) IBOutlet NSTextField *status;
|
@property (strong) IBOutlet NSTextField *status;
|
||||||
@@ -45,3 +47,5 @@ extern NSUserInterfaceItemIdentifier const CustomCellRefresh;
|
|||||||
@interface SeparatorColumnCell : NSTableCellView
|
@interface SeparatorColumnCell : NSTableCellView
|
||||||
extern NSUserInterfaceItemIdentifier const CustomCellSeparator;
|
extern NSUserInterfaceItemIdentifier const CustomCellSeparator;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,7 +22,11 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface SettingsGeneral : NSViewController
|
@interface SettingsGeneral : NSViewController
|
||||||
- (void)changeHttpApplication:(NSPopUpButton *)sender;
|
- (void)changeHttpApplication:(NSPopUpButton *)sender;
|
||||||
- (void)clickHowToDefaults:(NSButton *)sender;
|
- (void)clickHowToDefaults:(NSButton *)sender;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
@class SettingsGeneral;
|
@class SettingsGeneral;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface SettingsGeneralView : NSView
|
@interface SettingsGeneralView : NSView
|
||||||
@property (strong) IBOutlet NSPopUpButton* popupHttpApplication;
|
@property (strong) IBOutlet NSPopUpButton* popupHttpApplication;
|
||||||
@property (strong) IBOutlet NSTextField *defaultReader;
|
@property (strong) IBOutlet NSTextField *defaultReader;
|
||||||
@@ -32,3 +34,4 @@
|
|||||||
- (nullable instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
- (nullable instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface ModalSheet : NSPanel
|
@interface ModalSheet : NSPanel
|
||||||
@property (readonly) BOOL didTapCancel;
|
@property (readonly) BOOL didTapCancel;
|
||||||
|
|
||||||
@@ -31,3 +33,5 @@
|
|||||||
- (void)setDoneEnabled:(BOOL)accept;
|
- (void)setDoneEnabled:(BOOL)accept;
|
||||||
- (void)extendContentViewBy:(CGFloat)dy;
|
- (void)extendContentViewBy:(CGFloat)dy;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,7 +23,11 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
@class SettingsFeeds;
|
@class SettingsFeeds;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface Preferences : NSWindow <NSWindowDelegate>
|
@interface Preferences : NSWindow <NSWindowDelegate>
|
||||||
+ (instancetype)window;
|
+ (instancetype)window;
|
||||||
- (__kindof NSViewController*)selectTab:(NSUInteger)index;
|
- (__kindof NSViewController*)selectTab:(NSUInteger)index;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,7 +23,11 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
@class BarStatusItem;
|
@class BarStatusItem;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface BarMenu : NSObject <NSMenuDelegate>
|
@interface BarMenu : NSObject <NSMenuDelegate>
|
||||||
- (instancetype)init NS_UNAVAILABLE;
|
- (instancetype)init NS_UNAVAILABLE;
|
||||||
- (instancetype)initWithStatusItem:(BarStatusItem*)statusItem NS_DESIGNATED_INITIALIZER;
|
- (instancetype)initWithStatusItem:(BarStatusItem*)statusItem NS_DESIGNATED_INITIALIZER;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface BarStatusItem : NSObject
|
@interface BarStatusItem : NSObject
|
||||||
@property (weak, readonly) NSMenu *mainMenu;
|
@property (weak, readonly) NSMenu *mainMenu;
|
||||||
|
|
||||||
@@ -32,3 +34,4 @@
|
|||||||
- (void)showWelcomeMessage;
|
- (void)showWelcomeMessage;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface UnreadTotal : NSObject
|
@interface UnreadTotal : NSObject
|
||||||
@property (nonatomic, assign) NSUInteger unread;
|
@property (nonatomic, assign) NSUInteger unread;
|
||||||
@property (nonatomic, assign) NSUInteger total;
|
@property (nonatomic, assign) NSUInteger total;
|
||||||
@@ -39,3 +41,5 @@
|
|||||||
- (UnreadTotal*)objectForKeyedSubscript:(NSString*)key;
|
- (UnreadTotal*)objectForKeyedSubscript:(NSString*)key;
|
||||||
- (void)setObject:(UnreadTotal*)obj forKeyedSubscript:(NSString*)key;
|
- (void)setObject:(UnreadTotal*)obj forKeyedSubscript:(NSString*)key;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
@import Cocoa;
|
@import Cocoa;
|
||||||
@class FeedGroup;
|
@class FeedGroup;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSMenu (Ext)
|
@interface NSMenu (Ext)
|
||||||
@property (nonnull, copy, readonly) NSString *titleIndexPath;
|
@property (nonnull, copy, readonly) NSString *titleIndexPath;
|
||||||
@property (nullable, readonly) NSMenuItem* parentItem;
|
@property (nullable, readonly) NSMenuItem* parentItem;
|
||||||
@@ -42,3 +44,5 @@
|
|||||||
- (instancetype)alternateWithTitle:(NSString*)title;
|
- (instancetype)alternateWithTitle:(NSString*)title;
|
||||||
- (void)setTitleCount:(NSUInteger)count;
|
- (void)setTitleCount:(NSUInteger)count;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
Reference in New Issue
Block a user