From 49cff8eb8ea5864f9d9c2cdadb4fe92ad7b56dce Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 7 Apr 2020 15:25:33 -0500 Subject: [PATCH] Add basic ExtensionPoint support. --- Frameworks/FeedProvider/FeedProvider.swift | 10 +- .../FeedProvider.xcodeproj/project.pbxproj | 12 ++ .../Twitter/TwitterFeedProvider.swift | 17 +++ Mac/AppAssets.swift | 30 +++-- Mac/Base.lproj/Preferences.storyboard | 24 ++-- .../ExtensionPointAdd.xib} | 8 +- .../ExtensionPointAddTableCellView.swift | 16 +++ .../ExtensionPointAddViewController.swift} | 38 ++---- ...nsionPointPreferencesViewController.swift} | 12 +- .../FeedProvidersAddTableCellView.swift | 16 --- .../PreferencesWindowController.swift | 6 +- .../Contents.json | 0 .../marsedit.pdf | Bin .../Contents.json | 15 +++ .../micro-dot-blog.pdf | Bin .../Contents.json | 0 .../twitter.pdf | Bin NetNewsWire.xcodeproj/project.pbxproj | 118 +++++++++++------- Shared/ExtensionPoints/ExtensionPoint.swift | 20 +++ .../ExtensionPointManager.swift | 49 ++++++++ .../ExtensionPoints/ExtensionPointType.swift | 14 +++ .../SendToMarsEditCommand.swift | 6 +- .../SendToMicroBlogCommand.swift | 5 +- .../TwitterFeedProvider+Extensions.swift | 23 ++++ .../AddWebFeedDefaultContainer.swift | 0 .../ArticleStringFormatter.swift | 0 .../ArticleUtilities.swift | 0 .../{Data => Extensions}/CacheCleaner.swift | 0 .../SmallIconProvider.swift | 0 29 files changed, 299 insertions(+), 140 deletions(-) create mode 100644 Frameworks/FeedProvider/Twitter/TwitterFeedProvider.swift rename Mac/Preferences/{FeedProviders/FeedProvidersAdd.xib => ExtensionPoints/ExtensionPointAdd.xib} (96%) create mode 100644 Mac/Preferences/ExtensionPoints/ExtensionPointAddTableCellView.swift rename Mac/Preferences/{FeedProviders/FeedProvidersAddViewController.swift => ExtensionPoints/ExtensionPointAddViewController.swift} (75%) rename Mac/Preferences/{FeedProviders/FeedProvidersPreferencesViewController.swift => ExtensionPoints/ExtensionPointPreferencesViewController.swift} (83%) delete mode 100644 Mac/Preferences/FeedProviders/FeedProvidersAddTableCellView.swift rename Mac/Resources/Assets.xcassets/{adapterMarsEdit.imageset => extensionPointMarsEdit.imageset}/Contents.json (100%) rename Mac/Resources/Assets.xcassets/{adapterMarsEdit.imageset => extensionPointMarsEdit.imageset}/marsedit.pdf (100%) create mode 100644 Mac/Resources/Assets.xcassets/extensionPointMicroblog.imageset/Contents.json rename Mac/Resources/Assets.xcassets/{adapterMicroblog.imageset => extensionPointMicroblog.imageset}/micro-dot-blog.pdf (100%) rename Mac/Resources/Assets.xcassets/{adapterTwitter.imageset => extensionPointTwitter.imageset}/Contents.json (100%) rename Mac/Resources/Assets.xcassets/{adapterTwitter.imageset => extensionPointTwitter.imageset}/twitter.pdf (100%) create mode 100644 Shared/ExtensionPoints/ExtensionPoint.swift create mode 100644 Shared/ExtensionPoints/ExtensionPointManager.swift create mode 100644 Shared/ExtensionPoints/ExtensionPointType.swift rename Shared/{Commands => ExtensionPoints}/SendToMarsEditCommand.swift (90%) rename Shared/{Commands => ExtensionPoints}/SendToMicroBlogCommand.swift (91%) create mode 100644 Shared/ExtensionPoints/TwitterFeedProvider+Extensions.swift rename Shared/{Data => Extensions}/AddWebFeedDefaultContainer.swift (100%) rename Shared/{Data => Extensions}/ArticleStringFormatter.swift (100%) rename Shared/{Data => Extensions}/ArticleUtilities.swift (100%) rename Shared/{Data => Extensions}/CacheCleaner.swift (100%) rename Shared/{Data => Extensions}/SmallIconProvider.swift (100%) diff --git a/Frameworks/FeedProvider/FeedProvider.swift b/Frameworks/FeedProvider/FeedProvider.swift index 8f2247cfa..f12947980 100644 --- a/Frameworks/FeedProvider/FeedProvider.swift +++ b/Frameworks/FeedProvider/FeedProvider.swift @@ -9,14 +9,6 @@ import Foundation import RSCore -public enum FeedProviderType: Int, Codable { - // Raw values should not change since they’re stored. - case marsEdit = 1 - case microblog = 2 - case twitter = 3 -} - - -protocol FeedProvider { +public protocol FeedProvider { } diff --git a/Frameworks/FeedProvider/FeedProvider.xcodeproj/project.pbxproj b/Frameworks/FeedProvider/FeedProvider.xcodeproj/project.pbxproj index 1440e387b..2b5495cd4 100644 --- a/Frameworks/FeedProvider/FeedProvider.xcodeproj/project.pbxproj +++ b/Frameworks/FeedProvider/FeedProvider.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 51107725243BE11800D97C8C /* RSParser.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51107723243BE11800D97C8C /* RSParser.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 51107728243BE15D00D97C8C /* RSCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51107727243BE15D00D97C8C /* RSCore.framework */; }; 51107729243BE15D00D97C8C /* RSCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51107727243BE15D00D97C8C /* RSCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 515A5105243D0C6B0089E588 /* TwitterFeedProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A5104243D0C6B0089E588 /* TwitterFeedProvider.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -47,6 +48,7 @@ 51107721243BE0DA00D97C8C /* FeedProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedProvider.swift; sourceTree = ""; }; 51107723243BE11800D97C8C /* RSParser.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RSParser.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51107727243BE15D00D97C8C /* RSCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RSCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 515A5104243D0C6B0089E588 /* TwitterFeedProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwitterFeedProvider.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -67,6 +69,7 @@ isa = PBXGroup; children = ( 51107721243BE0DA00D97C8C /* FeedProvider.swift */, + 515A5103243D0C230089E588 /* Twitter */, 51107689243BCEB300D97C8C /* xcconfig */, 51107663243BCE0400D97C8C /* Info.plist */, 51107660243BCE0400D97C8C /* Products */, @@ -104,6 +107,14 @@ name = Frameworks; sourceTree = ""; }; + 515A5103243D0C230089E588 /* Twitter */ = { + isa = PBXGroup; + children = ( + 515A5104243D0C6B0089E588 /* TwitterFeedProvider.swift */, + ); + path = Twitter; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -211,6 +222,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 515A5105243D0C6B0089E588 /* TwitterFeedProvider.swift in Sources */, 51107722243BE0DA00D97C8C /* FeedProvider.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Frameworks/FeedProvider/Twitter/TwitterFeedProvider.swift b/Frameworks/FeedProvider/Twitter/TwitterFeedProvider.swift new file mode 100644 index 000000000..b4858d0c5 --- /dev/null +++ b/Frameworks/FeedProvider/Twitter/TwitterFeedProvider.swift @@ -0,0 +1,17 @@ +// +// TwitterFeedProvider.swift +// FeedProvider +// +// Created by Maurice Parker on 4/7/20. +// Copyright © 2020 Ranchero Software, LLC. All rights reserved. +// + +import Foundation + +public struct TwitterFeedProvider: FeedProvider { + + public init() { + + } + +} diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index c19d809c2..b7dca8f1f 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -45,18 +45,6 @@ struct AppAssets { return RSImage(named: "accountNewsBlur") }() - static var adapterMarsEdit: RSImage = { - return RSImage(named: "adapterMarsEdit")! - }() - - static var adapterMicroblog: RSImage = { - return RSImage(named: "adapterMicroblog")! - }() - - static var adapterTwitter: RSImage = { - return RSImage(named: "adapterTwitter")! - }() - static var articleExtractor: RSImage! = { return RSImage(named: "articleExtractor") }() @@ -89,12 +77,22 @@ struct AppAssets { return RSImage(named: "articleExtractorProgress4") }() - static var bookmarkImage: RSImage? = { - let path = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns" - let image = RSImage(contentsOfFile: path) - return image + static var extensionPointMarsEdit: RSImage = { + return RSImage(named: "extensionPointMarsEdit")! }() + static var extensionPointMicroblog: RSImage = { + return RSImage(named: "extensionPointMicroblog")! + }() + + static var extensionPointTwitter: RSImage = { + return RSImage(named: "extensionPointTwitter")! + }() + + static var extensionPreference: RSImage? = { + return RSImage(contentsOfFile: "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns") + }() + static var faviconTemplateImage: RSImage = { return RSImage(named: "faviconTemplateImage")! }() diff --git a/Mac/Base.lproj/Preferences.storyboard b/Mac/Base.lproj/Preferences.storyboard index e9aad2bd7..df9a513cd 100644 --- a/Mac/Base.lproj/Preferences.storyboard +++ b/Mac/Base.lproj/Preferences.storyboard @@ -385,16 +385,16 @@ - + - + - + - + @@ -501,7 +501,7 @@ - + @@ -547,25 +547,25 @@ - + - + - + - + - + - + @@ -666,7 +666,7 @@ - + diff --git a/Mac/Preferences/FeedProviders/FeedProvidersAdd.xib b/Mac/Preferences/ExtensionPoints/ExtensionPointAdd.xib similarity index 96% rename from Mac/Preferences/FeedProviders/FeedProvidersAdd.xib rename to Mac/Preferences/ExtensionPoints/ExtensionPointAdd.xib index 874bfa9e0..d2ddc8921 100644 --- a/Mac/Preferences/FeedProviders/FeedProvidersAdd.xib +++ b/Mac/Preferences/ExtensionPoints/ExtensionPointAdd.xib @@ -5,7 +5,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -83,8 +83,8 @@ - - + + diff --git a/Mac/Preferences/ExtensionPoints/ExtensionPointAddTableCellView.swift b/Mac/Preferences/ExtensionPoints/ExtensionPointAddTableCellView.swift new file mode 100644 index 000000000..0d488d49d --- /dev/null +++ b/Mac/Preferences/ExtensionPoints/ExtensionPointAddTableCellView.swift @@ -0,0 +1,16 @@ +// +// ExtensionPointAddTableCellView.swift +// NetNewsWire +// +// Created by Maurice Parker on 4/6/20. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import AppKit + +class ExtensionPointAddTableCellView: NSTableCellView { + + @IBOutlet weak var templateImageView: NSImageView? + @IBOutlet weak var titleLabel: NSTextField? + +} diff --git a/Mac/Preferences/FeedProviders/FeedProvidersAddViewController.swift b/Mac/Preferences/ExtensionPoints/ExtensionPointAddViewController.swift similarity index 75% rename from Mac/Preferences/FeedProviders/FeedProvidersAddViewController.swift rename to Mac/Preferences/ExtensionPoints/ExtensionPointAddViewController.swift index e0721c0d3..fd1c1fbdc 100644 --- a/Mac/Preferences/FeedProviders/FeedProvidersAddViewController.swift +++ b/Mac/Preferences/ExtensionPoints/ExtensionPointAddViewController.swift @@ -1,5 +1,5 @@ // -// FeedProvidersAddViewController.swift +// ExtensionPointAddViewController.swift // NetNewsWire // // Created by Maurice Parker on 4/6/20. @@ -9,20 +9,15 @@ import AppKit import FeedProvider -class FeedProvidersAddViewController: NSViewController { +class ExtensionPointAddViewController: NSViewController { @IBOutlet weak var tableView: NSTableView! - private var accountsAddWindowController: NSWindowController? - - #if DEBUG - private var addableFeedProviderTypes: [FeedProviderType] = [.marsEdit, .microblog, .twitter] - #else - private var addableFeedProviderTypes: [FeedProviderType] = [.twitter] - #endif + private var availableExtensionPoints = [ExtensionPoint]() + private var extensionPointAddWindowController: NSWindowController? init() { - super.init(nibName: "FeedProvidersAdd", bundle: nil) + super.init(nibName: "ExtensionPointAdd", bundle: nil) } public required init?(coder: NSCoder) { @@ -33,16 +28,17 @@ class FeedProvidersAddViewController: NSViewController { super.viewDidLoad() tableView.dataSource = self tableView.delegate = self + availableExtensionPoints = ExtensionPointManager.shared.availableExtensionPoints } } // MARK: - NSTableViewDataSource -extension FeedProvidersAddViewController: NSTableViewDataSource { +extension ExtensionPointAddViewController: NSTableViewDataSource { func numberOfRows(in tableView: NSTableView) -> Int { - return addableFeedProviderTypes.count + return availableExtensionPoints.count } func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? { @@ -52,24 +48,16 @@ extension FeedProvidersAddViewController: NSTableViewDataSource { // MARK: - NSTableViewDelegate -extension FeedProvidersAddViewController: NSTableViewDelegate { +extension ExtensionPointAddViewController: NSTableViewDelegate { private static let cellIdentifier = NSUserInterfaceItemIdentifier(rawValue: "AccountCell") func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { - if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell"), owner: nil) as? FeedProvidersAddTableCellView { - switch addableFeedProviderTypes[row] { - case .marsEdit: - cell.feedProviderNameLabel?.stringValue = NSLocalizedString("MarsEdit", comment: "MarsEdit") - cell.feedProviderImageView?.image = AppAssets.adapterMarsEdit - case .microblog: - cell.feedProviderNameLabel?.stringValue = NSLocalizedString("Micro.blog", comment: "Micro.blog") - cell.feedProviderImageView?.image = AppAssets.adapterMicroblog - case .twitter: - cell.feedProviderNameLabel?.stringValue = NSLocalizedString("Twitter", comment: "Twitter") - cell.feedProviderImageView?.image = AppAssets.adapterTwitter - } + if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell"), owner: nil) as? ExtensionPointAddTableCellView { + let extensionPoint = availableExtensionPoints[row] + cell.titleLabel?.stringValue = extensionPoint.title + cell.imageView?.image = extensionPoint.templateImage return cell } return nil diff --git a/Mac/Preferences/FeedProviders/FeedProvidersPreferencesViewController.swift b/Mac/Preferences/ExtensionPoints/ExtensionPointPreferencesViewController.swift similarity index 83% rename from Mac/Preferences/FeedProviders/FeedProvidersPreferencesViewController.swift rename to Mac/Preferences/ExtensionPoints/ExtensionPointPreferencesViewController.swift index d41b97df7..de6000f6b 100644 --- a/Mac/Preferences/FeedProviders/FeedProvidersPreferencesViewController.swift +++ b/Mac/Preferences/ExtensionPoints/ExtensionPointPreferencesViewController.swift @@ -1,5 +1,5 @@ // -// FeedProvidersPreferencesViewController.swift +// ExtensionsPreferencesViewController.swift // NetNewsWire // // Created by Maurice Parker on 4/6/20. @@ -8,7 +8,7 @@ import AppKit -final class FeedProvidersPreferencesViewController: NSViewController { +final class ExtensionPointPreferencesViewController: NSViewController { @IBOutlet weak var tableView: NSTableView! @IBOutlet weak var detailView: NSView! @@ -22,7 +22,7 @@ final class FeedProvidersPreferencesViewController: NSViewController { tableView.delegate = self tableView.dataSource = self - showController(FeedProvidersAddViewController()) + showController(ExtensionPointAddViewController()) // Fix tableView frame — for some reason IB wants it 1pt wider than the clip view. This leads to unwanted horizontal scrolling. var rTable = tableView.frame @@ -34,7 +34,7 @@ final class FeedProvidersPreferencesViewController: NSViewController { // MARK: - NSTableViewDataSource -extension FeedProvidersPreferencesViewController: NSTableViewDataSource { +extension ExtensionPointPreferencesViewController: NSTableViewDataSource { func numberOfRows(in tableView: NSTableView) -> Int { return sortedAccounts.count @@ -47,7 +47,7 @@ extension FeedProvidersPreferencesViewController: NSTableViewDataSource { // MARK: - NSTableViewDelegate -extension FeedProvidersPreferencesViewController: NSTableViewDelegate { +extension ExtensionPointPreferencesViewController: NSTableViewDelegate { private static let cellIdentifier = NSUserInterfaceItemIdentifier(rawValue: "AccountCell") @@ -70,7 +70,7 @@ extension FeedProvidersPreferencesViewController: NSTableViewDelegate { // MARK: - Private -private extension FeedProvidersPreferencesViewController { +private extension ExtensionPointPreferencesViewController { func showController(_ controller: NSViewController) { diff --git a/Mac/Preferences/FeedProviders/FeedProvidersAddTableCellView.swift b/Mac/Preferences/FeedProviders/FeedProvidersAddTableCellView.swift deleted file mode 100644 index 8d0325832..000000000 --- a/Mac/Preferences/FeedProviders/FeedProvidersAddTableCellView.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// FeedProvidersAddTableCellView.swift -// NetNewsWire -// -// Created by Maurice Parker on 4/6/20. -// Copyright © 2020 Ranchero Software. All rights reserved. -// - -import AppKit - -class FeedProvidersAddTableCellView: NSTableCellView { - - @IBOutlet weak var feedProviderImageView: NSImageView? - @IBOutlet weak var feedProviderNameLabel: NSTextField? - -} diff --git a/Mac/Preferences/PreferencesWindowController.swift b/Mac/Preferences/PreferencesWindowController.swift index 9679aa9a3..143425ce5 100644 --- a/Mac/Preferences/PreferencesWindowController.swift +++ b/Mac/Preferences/PreferencesWindowController.swift @@ -24,7 +24,7 @@ private struct PreferencesToolbarItemSpec { private struct ToolbarItemIdentifier { static let General = "General" static let Accounts = "Accounts" - static let FeedProvider = "FeedProvider" + static let Extensions = "Extensions" static let Advanced = "Advanced" } @@ -40,9 +40,9 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate { specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts, name: NSLocalizedString("Accounts", comment: "Preferences"), image: NSImage(named: NSImage.userAccountsName))] - specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.FeedProvider, + specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Extensions, name: NSLocalizedString("Extensions", comment: "Preferences"), - image: AppAssets.bookmarkImage)] + image: AppAssets.extensionPreference)] // Omit the Advanced Preferences for now because the Software Update related functionality is // forbidden/non-applicable, and we can rely upon Apple to some extent for crash reports. We diff --git a/Mac/Resources/Assets.xcassets/adapterMarsEdit.imageset/Contents.json b/Mac/Resources/Assets.xcassets/extensionPointMarsEdit.imageset/Contents.json similarity index 100% rename from Mac/Resources/Assets.xcassets/adapterMarsEdit.imageset/Contents.json rename to Mac/Resources/Assets.xcassets/extensionPointMarsEdit.imageset/Contents.json diff --git a/Mac/Resources/Assets.xcassets/adapterMarsEdit.imageset/marsedit.pdf b/Mac/Resources/Assets.xcassets/extensionPointMarsEdit.imageset/marsedit.pdf similarity index 100% rename from Mac/Resources/Assets.xcassets/adapterMarsEdit.imageset/marsedit.pdf rename to Mac/Resources/Assets.xcassets/extensionPointMarsEdit.imageset/marsedit.pdf diff --git a/Mac/Resources/Assets.xcassets/extensionPointMicroblog.imageset/Contents.json b/Mac/Resources/Assets.xcassets/extensionPointMicroblog.imageset/Contents.json new file mode 100644 index 000000000..4db95b5b7 --- /dev/null +++ b/Mac/Resources/Assets.xcassets/extensionPointMicroblog.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "micro-dot-blog.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/Mac/Resources/Assets.xcassets/adapterMicroblog.imageset/micro-dot-blog.pdf b/Mac/Resources/Assets.xcassets/extensionPointMicroblog.imageset/micro-dot-blog.pdf similarity index 100% rename from Mac/Resources/Assets.xcassets/adapterMicroblog.imageset/micro-dot-blog.pdf rename to Mac/Resources/Assets.xcassets/extensionPointMicroblog.imageset/micro-dot-blog.pdf diff --git a/Mac/Resources/Assets.xcassets/adapterTwitter.imageset/Contents.json b/Mac/Resources/Assets.xcassets/extensionPointTwitter.imageset/Contents.json similarity index 100% rename from Mac/Resources/Assets.xcassets/adapterTwitter.imageset/Contents.json rename to Mac/Resources/Assets.xcassets/extensionPointTwitter.imageset/Contents.json diff --git a/Mac/Resources/Assets.xcassets/adapterTwitter.imageset/twitter.pdf b/Mac/Resources/Assets.xcassets/extensionPointTwitter.imageset/twitter.pdf similarity index 100% rename from Mac/Resources/Assets.xcassets/adapterTwitter.imageset/twitter.pdf rename to Mac/Resources/Assets.xcassets/extensionPointTwitter.imageset/twitter.pdf diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 7eb562138..6ef203954 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -28,19 +28,24 @@ 5108F6D22375EED2001ABC45 /* TimelineCustomizerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5108F6D12375EED2001ABC45 /* TimelineCustomizerViewController.swift */; }; 5108F6D42375EEEF001ABC45 /* TimelinePreviewTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5108F6D32375EEEF001ABC45 /* TimelinePreviewTableViewController.swift */; }; 5108F6D823763094001ABC45 /* TickMarkSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5108F6D723763094001ABC45 /* TickMarkSlider.swift */; }; - 510C43ED243C0973009F70C3 /* FeedProvidersAdd.xib in Resources */ = {isa = PBXBuildFile; fileRef = 510C43EC243C0973009F70C3 /* FeedProvidersAdd.xib */; }; - 510C43EE243C0973009F70C3 /* FeedProvidersAdd.xib in Resources */ = {isa = PBXBuildFile; fileRef = 510C43EC243C0973009F70C3 /* FeedProvidersAdd.xib */; }; - 510C43F0243C0A80009F70C3 /* FeedProvidersAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43EF243C0A80009F70C3 /* FeedProvidersAddViewController.swift */; }; - 510C43F1243C0A80009F70C3 /* FeedProvidersAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43EF243C0A80009F70C3 /* FeedProvidersAddViewController.swift */; }; - 510C43F3243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F2243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift */; }; - 510C43F4243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F2243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift */; }; + 510C43ED243C0973009F70C3 /* ExtensionPointAdd.xib in Resources */ = {isa = PBXBuildFile; fileRef = 510C43EC243C0973009F70C3 /* ExtensionPointAdd.xib */; }; + 510C43EE243C0973009F70C3 /* ExtensionPointAdd.xib in Resources */ = {isa = PBXBuildFile; fileRef = 510C43EC243C0973009F70C3 /* ExtensionPointAdd.xib */; }; + 510C43F0243C0A80009F70C3 /* ExtensionPointAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43EF243C0A80009F70C3 /* ExtensionPointAddViewController.swift */; }; + 510C43F1243C0A80009F70C3 /* ExtensionPointAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43EF243C0A80009F70C3 /* ExtensionPointAddViewController.swift */; }; + 510C43F3243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F2243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift */; }; + 510C43F4243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F2243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift */; }; + 510C43F7243D035C009F70C3 /* ExtensionPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F6243D035C009F70C3 /* ExtensionPoint.swift */; }; + 510C43F8243D035C009F70C3 /* ExtensionPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F6243D035C009F70C3 /* ExtensionPoint.swift */; }; + 510C43F9243D035C009F70C3 /* ExtensionPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510C43F6243D035C009F70C3 /* ExtensionPoint.swift */; }; + 510C43FA243D0445009F70C3 /* SendToMarsEditCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A1500420048DDF0046AD9A /* SendToMarsEditCommand.swift */; }; + 510C43FB243D0445009F70C3 /* SendToMicroBlogCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A14FF220048CA70046AD9A /* SendToMicroBlogCommand.swift */; }; 51102165233A7D6C0007A5F7 /* ArticleExtractorButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51102164233A7D6C0007A5F7 /* ArticleExtractorButton.swift */; }; 511076F7243BDA8100D97C8C /* FeedProvider.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51107672243BCE0500D97C8C /* FeedProvider.framework */; }; 511076F8243BDA8200D97C8C /* FeedProvider.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51107672243BCE0500D97C8C /* FeedProvider.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 511076F9243BDA9600D97C8C /* FeedProvider.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51107672243BCE0500D97C8C /* FeedProvider.framework */; }; 511076FA243BDA9600D97C8C /* FeedProvider.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51107672243BCE0500D97C8C /* FeedProvider.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 51107746243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51107745243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift */; }; - 51107747243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51107745243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift */; }; + 51107746243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51107745243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift */; }; + 51107747243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51107745243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift */; }; 5110C37D2373A8D100A9C04F /* InspectorIconHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5110C37C2373A8D100A9C04F /* InspectorIconHeaderView.swift */; }; 51126DA4225FDE2F00722696 /* RSImage-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51126DA3225FDE2F00722696 /* RSImage-Extensions.swift */; }; 5115CAF42266301400B21BCE /* AddContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51121B5A22661FEF00BC0EC1 /* AddContainerViewController.swift */; }; @@ -114,6 +119,12 @@ 51554C25228B71910055115A /* SyncDatabase.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51554C01228B6EB50055115A /* SyncDatabase.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 51554C30228B71A10055115A /* SyncDatabase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51554C01228B6EB50055115A /* SyncDatabase.framework */; }; 51554C31228B71A10055115A /* SyncDatabase.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51554C01228B6EB50055115A /* SyncDatabase.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 515A50E6243D07A90089E588 /* ExtensionPointManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A50E5243D07A90089E588 /* ExtensionPointManager.swift */; }; + 515A50E7243D07A90089E588 /* ExtensionPointManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A50E5243D07A90089E588 /* ExtensionPointManager.swift */; }; + 515A50E8243D07A90089E588 /* ExtensionPointManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A50E5243D07A90089E588 /* ExtensionPointManager.swift */; }; + 515A5107243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A5106243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift */; }; + 515A5108243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A5106243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift */; }; + 515A5109243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A5106243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift */; }; 515D4FC123257A3200EE1167 /* FolderTreeControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97A11ED9F180007D329B /* FolderTreeControllerDelegate.swift */; }; 515D4FCA23257CB500EE1167 /* Node-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97971ED9EFAA007D329B /* Node-Extensions.swift */; }; 515D4FCC2325815A00EE1167 /* SafariExt.js in Resources */ = {isa = PBXBuildFile; fileRef = 515D4FCB2325815A00EE1167 /* SafariExt.js */; }; @@ -1294,12 +1305,13 @@ 5108F6D12375EED2001ABC45 /* TimelineCustomizerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineCustomizerViewController.swift; sourceTree = ""; }; 5108F6D32375EEEF001ABC45 /* TimelinePreviewTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelinePreviewTableViewController.swift; sourceTree = ""; }; 5108F6D723763094001ABC45 /* TickMarkSlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TickMarkSlider.swift; sourceTree = ""; }; - 510C43EC243C0973009F70C3 /* FeedProvidersAdd.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FeedProvidersAdd.xib; sourceTree = ""; }; - 510C43EF243C0A80009F70C3 /* FeedProvidersAddViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedProvidersAddViewController.swift; sourceTree = ""; }; - 510C43F2243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedProvidersAddTableCellView.swift; sourceTree = ""; }; + 510C43EC243C0973009F70C3 /* ExtensionPointAdd.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ExtensionPointAdd.xib; sourceTree = ""; }; + 510C43EF243C0A80009F70C3 /* ExtensionPointAddViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPointAddViewController.swift; sourceTree = ""; }; + 510C43F2243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPointAddTableCellView.swift; sourceTree = ""; }; + 510C43F6243D035C009F70C3 /* ExtensionPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPoint.swift; sourceTree = ""; }; 51102164233A7D6C0007A5F7 /* ArticleExtractorButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleExtractorButton.swift; sourceTree = ""; }; 5110766A243BCE0400D97C8C /* FeedProvider.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = FeedProvider.xcodeproj; path = Frameworks/FeedProvider/FeedProvider.xcodeproj; sourceTree = SOURCE_ROOT; }; - 51107745243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedProvidersPreferencesViewController.swift; sourceTree = ""; }; + 51107745243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPointPreferencesViewController.swift; sourceTree = ""; }; 5110C37C2373A8D100A9C04F /* InspectorIconHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorIconHeaderView.swift; sourceTree = ""; }; 51121AA12265430A00BC0EC1 /* NetNewsWire_iOSapp_target.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = NetNewsWire_iOSapp_target.xcconfig; sourceTree = ""; }; 51121B5A22661FEF00BC0EC1 /* AddContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContainerViewController.swift; sourceTree = ""; }; @@ -1347,6 +1359,8 @@ 514B7C8223205EFB00BAC947 /* RootSplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootSplitViewController.swift; sourceTree = ""; }; 514B7D1E23219F3C00BAC947 /* AddControllerType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddControllerType.swift; sourceTree = ""; }; 51554BFC228B6EB50055115A /* SyncDatabase.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SyncDatabase.xcodeproj; path = Frameworks/SyncDatabase/SyncDatabase.xcodeproj; sourceTree = SOURCE_ROOT; }; + 515A50E5243D07A90089E588 /* ExtensionPointManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPointManager.swift; sourceTree = ""; }; + 515A5106243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TwitterFeedProvider+Extensions.swift"; sourceTree = ""; }; 515D4FCB2325815A00EE1167 /* SafariExt.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = SafariExt.js; sourceTree = ""; }; 515D4FCD2325909200EE1167 /* NetNewsWire_iOS_ShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NetNewsWire_iOS_ShareExtension.entitlements; sourceTree = ""; }; 515D4FCE2325B3D000EE1167 /* NetNewsWire_iOSshareextension_target.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = NetNewsWire_iOSshareextension_target.xcconfig; sourceTree = ""; }; @@ -1804,6 +1818,18 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 510C43F5243D0325009F70C3 /* ExtensionPoints */ = { + isa = PBXGroup; + children = ( + 510C43F6243D035C009F70C3 /* ExtensionPoint.swift */, + 515A50E5243D07A90089E588 /* ExtensionPointManager.swift */, + 84A1500420048DDF0046AD9A /* SendToMarsEditCommand.swift */, + 84A14FF220048CA70046AD9A /* SendToMicroBlogCommand.swift */, + 515A5106243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift */, + ); + path = ExtensionPoints; + sourceTree = ""; + }; 5110766B243BCE0400D97C8C /* Products */ = { isa = PBXGroup; children = ( @@ -1812,15 +1838,15 @@ name = Products; sourceTree = ""; }; - 51107744243BEDD300D97C8C /* FeedProviders */ = { + 51107744243BEDD300D97C8C /* ExtensionPoints */ = { isa = PBXGroup; children = ( - 510C43EC243C0973009F70C3 /* FeedProvidersAdd.xib */, - 510C43F2243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift */, - 510C43EF243C0A80009F70C3 /* FeedProvidersAddViewController.swift */, - 51107745243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift */, + 510C43EC243C0973009F70C3 /* ExtensionPointAdd.xib */, + 510C43F2243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift */, + 510C43EF243C0A80009F70C3 /* ExtensionPointAddViewController.swift */, + 51107745243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift */, ); - path = FeedProviders; + path = ExtensionPoints; sourceTree = ""; }; 511D43CE231FA51100FB1562 /* Resources */ = { @@ -2330,8 +2356,6 @@ 84702AA31FA27AC0006B8943 /* MarkStatusCommand.swift */, 84162A142038C12C00035290 /* MarkCommandValidationStatus.swift */, 84B99C9C1FAE83C600ECDEDB /* DeleteCommand.swift */, - 84A14FF220048CA70046AD9A /* SendToMicroBlogCommand.swift */, - 84A1500420048DDF0046AD9A /* SendToMarsEditCommand.swift */, ); path = Commands; sourceTree = ""; @@ -2379,16 +2403,21 @@ name = "Add Feed"; sourceTree = ""; }; - 849A97561ED9EB0D007D329B /* Data */ = { + 849A97561ED9EB0D007D329B /* Extensions */ = { isa = PBXGroup; children = ( 51A66684238075AE00CB272D /* AddWebFeedDefaultContainer.swift */, 849A97731ED9EC04007D329B /* ArticleStringFormatter.swift */, 849A97581ED9EB0D007D329B /* ArticleUtilities.swift */, 5108F6B52375E612001ABC45 /* CacheCleaner.swift */, + 516AE9DE2372269A007DEEAA /* IconImage.swift */, + 849A97971ED9EFAA007D329B /* Node-Extensions.swift */, + 8405DD9B22153BD7008CE1BF /* NSView-Extensions.swift */, + B2B8075D239C49D300F191E0 /* RSImage-AppIcons.swift */, + 51126DA3225FDE2F00722696 /* RSImage-Extensions.swift */, 84411E701FE5FBFA004B527F /* SmallIconProvider.swift */, ); - path = Data; + path = Extensions; sourceTree = ""; }; 849A975F1ED9EB95007D329B /* Sidebar */ = { @@ -2468,18 +2497,6 @@ path = Shared/ArticleStyles; sourceTree = SOURCE_ROOT; }; - 849A97961ED9EFAA007D329B /* Extensions */ = { - isa = PBXGroup; - children = ( - 849A97971ED9EFAA007D329B /* Node-Extensions.swift */, - 8405DD9B22153BD7008CE1BF /* NSView-Extensions.swift */, - 51126DA3225FDE2F00722696 /* RSImage-Extensions.swift */, - 516AE9DE2372269A007DEEAA /* IconImage.swift */, - B2B8075D239C49D300F191E0 /* RSImage-AppIcons.swift */, - ); - path = Extensions; - sourceTree = ""; - }; 849C64571ED37A5D003D8FC0 = { isa = PBXGroup; children = ( @@ -2635,9 +2652,9 @@ 845213211FCA5B10003B6E93 /* Images */, 8426119C1FCB6ED40086A189 /* HTMLMetadata */, 5183CCEA226F70350010922C /* Timer */, - 849A97561ED9EB0D007D329B /* Data */, 512E08DD22687FA000BDCFDD /* Tree */, - 849A97961ED9EFAA007D329B /* Extensions */, + 849A97561ED9EB0D007D329B /* Extensions */, + 510C43F5243D0325009F70C3 /* ExtensionPoints */, 513228F1233037620033D4ED /* Network */, 511D43CE231FA51100FB1562 /* Resources */, ); @@ -2654,7 +2671,7 @@ 84C9FC6A22629E1200D921D6 /* Advanced */, 84C9FC6C22629E1200D921D6 /* General */, 84C9FC6F22629E1200D921D6 /* Accounts */, - 51107744243BEDD300D97C8C /* FeedProviders */, + 51107744243BEDD300D97C8C /* ExtensionPoints */, ); path = Preferences; sourceTree = ""; @@ -3551,7 +3568,7 @@ 65ED4051235DEF6C0081F399 /* TimelineKeyboardShortcuts.plist in Resources */, 65ED4052235DEF6C0081F399 /* template.html in Resources */, 65ED4054235DEF6C0081F399 /* Main.storyboard in Resources */, - 510C43EE243C0973009F70C3 /* FeedProvidersAdd.xib in Resources */, + 510C43EE243C0973009F70C3 /* ExtensionPointAdd.xib in Resources */, 65ED4055235DEF6C0081F399 /* AccountsAdd.xib in Resources */, 65ED4056235DEF6C0081F399 /* NetNewsWire.sdef in Resources */, 65ED4057235DEF6C0081F399 /* AccountsDetail.xib in Resources */, @@ -3666,7 +3683,7 @@ 3B826DCB2385C84800FC1ADB /* AccountsFeedWrangler.xib in Resources */, 55E15BCB229D65A900D6602A /* AccountsReaderAPI.xib in Resources */, 49F40DF82335B71000552BF4 /* newsfoot.js in Resources */, - 510C43ED243C0973009F70C3 /* FeedProvidersAdd.xib in Resources */, + 510C43ED243C0973009F70C3 /* ExtensionPointAdd.xib in Resources */, BDCB516724282C8A00102A80 /* AccountsNewsBlur.xib in Resources */, 5103A9982421643300410853 /* blank.html in Resources */, 84BAE64921CEDAF20046DB56 /* CrashReporterWindow.xib in Resources */, @@ -3846,7 +3863,7 @@ files = ( 65ED3FB7235DEF6C0081F399 /* ArticleArray.swift in Sources */, 65ED3FB8235DEF6C0081F399 /* CrashReporter.swift in Sources */, - 51107747243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift in Sources */, + 51107747243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift in Sources */, 65ED3FB9235DEF6C0081F399 /* IconView.swift in Sources */, 65ED3FBB235DEF6C0081F399 /* InspectorWindowController.swift in Sources */, 65ED3FBC235DEF6C0081F399 /* ColorHash.swift in Sources */, @@ -3904,6 +3921,7 @@ 65ED3FF0235DEF6C0081F399 /* ArticleStylesManager.swift in Sources */, 65ED3FF1235DEF6C0081F399 /* DetailContainerView.swift in Sources */, 65ED3FF2235DEF6C0081F399 /* SharingServiceDelegate.swift in Sources */, + 515A50E7243D07A90089E588 /* ExtensionPointManager.swift in Sources */, 65ED3FF3235DEF6C0081F399 /* ArticleSorter.swift in Sources */, 65ED3FF4235DEF6C0081F399 /* TimelineViewController+ContextualMenus.swift in Sources */, 65ED3FF5235DEF6C0081F399 /* ArticleStringFormatter.swift in Sources */, @@ -3939,6 +3957,7 @@ 65ED4012235DEF6C0081F399 /* TimelineContainerViewController.swift in Sources */, 65ED4013235DEF6C0081F399 /* MainWIndowKeyboardHandler.swift in Sources */, 65ED4014235DEF6C0081F399 /* PasteboardWebFeed.swift in Sources */, + 510C43F8243D035C009F70C3 /* ExtensionPoint.swift in Sources */, 65ED4015235DEF6C0081F399 /* AccountsDetailViewController.swift in Sources */, 65ED4016235DEF6C0081F399 /* DetailViewController.swift in Sources */, 65ED4017235DEF6C0081F399 /* AppDelegate.swift in Sources */, @@ -3949,7 +3968,7 @@ 65ED401C235DEF6C0081F399 /* FaviconGenerator.swift in Sources */, 65ED401D235DEF6C0081F399 /* RefreshInterval.swift in Sources */, 65ED401E235DEF6C0081F399 /* TimelineCellData.swift in Sources */, - 510C43F1243C0A80009F70C3 /* FeedProvidersAddViewController.swift in Sources */, + 510C43F1243C0A80009F70C3 /* ExtensionPointAddViewController.swift in Sources */, 65ED401F235DEF6C0081F399 /* BuiltinSmartFeedInspectorViewController.swift in Sources */, 65ED4020235DEF6C0081F399 /* AppDelegate+Scriptability.swift in Sources */, 65ED4021235DEF6C0081F399 /* NNW3Document.swift in Sources */, @@ -3964,6 +3983,7 @@ 65ED4028235DEF6C0081F399 /* ExtractedArticle.swift in Sources */, 65ED4029235DEF6C0081F399 /* DeleteCommand.swift in Sources */, 65ED402A235DEF6C0081F399 /* AddFeedWindowController.swift in Sources */, + 515A5108243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift in Sources */, 65ED402B235DEF6C0081F399 /* ImportOPMLWindowController.swift in Sources */, 65ED402C235DEF6C0081F399 /* TimelineTableView.swift in Sources */, 65ED402D235DEF6C0081F399 /* DetailStatusBarView.swift in Sources */, @@ -3984,7 +4004,7 @@ 65ED403C235DEF6C0081F399 /* SingleLineTextFieldSizer.swift in Sources */, 65ED403D235DEF6C0081F399 /* TimelineTableCellView.swift in Sources */, 65ED403E235DEF6C0081F399 /* TimelineCellAppearance.swift in Sources */, - 510C43F4243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift in Sources */, + 510C43F4243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift in Sources */, 65ED403F235DEF6C0081F399 /* ArticleRenderer.swift in Sources */, 65ED4040235DEF6C0081F399 /* GeneralPrefencesViewController.swift in Sources */, 179DB1DFBCF9177104B12E0F /* AccountsNewsBlurWindowController.swift in Sources */, @@ -4008,6 +4028,7 @@ 512DD4C92430086400C17B1F /* CloudKitAccountViewController.swift in Sources */, 840D617F2029031C009BC708 /* AppDelegate.swift in Sources */, 51236339236915B100951F16 /* RoundedProgressView.swift in Sources */, + 510C43F9243D035C009F70C3 /* ExtensionPoint.swift in Sources */, 512E08E72268801200BDCFDD /* WebFeedTreeControllerDelegate.swift in Sources */, 51C452A422650A2D00C03939 /* ArticleUtilities.swift in Sources */, 51EF0F79227716380050506E /* ColorHash.swift in Sources */, @@ -4016,6 +4037,7 @@ B2B80778239C4C7000F191E0 /* RSImage-AppIcons.swift in Sources */, 518ED21D23D0F26000E0A862 /* UIViewController-Extensions.swift in Sources */, 51A9A5F52380F6A60033AADF /* ModalNavigationController.swift in Sources */, + 510C43FB243D0445009F70C3 /* SendToMicroBlogCommand.swift in Sources */, 51EAED96231363EF00A9EEE3 /* NonIntrinsicButton.swift in Sources */, 51C4527B2265091600C03939 /* MasterUnreadIndicatorView.swift in Sources */, 5186A635235EF3A800C97195 /* VibrantLabel.swift in Sources */, @@ -4034,6 +4056,7 @@ 513146B2235A81A400387FDC /* AddWebFeedIntentHandler.swift in Sources */, 51D87EE12311D34700E63F03 /* ActivityType.swift in Sources */, 51C452772265091600C03939 /* MultilineUILabelSizer.swift in Sources */, + 515A5109243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift in Sources */, 51C452A522650A2D00C03939 /* SmallIconProvider.swift in Sources */, 51AB8AB323B7F4C6008F147D /* WebViewController.swift in Sources */, 516A09392360A2AE00EAE89B /* SettingsAccountTableViewCell.swift in Sources */, @@ -4054,6 +4077,7 @@ 51EF0F77227716200050506E /* FaviconGenerator.swift in Sources */, 51938DF3231AFC660055A1A0 /* SearchTimelineFeedDelegate.swift in Sources */, 51C4525A226508D600C03939 /* UIStoryboard-Extensions.swift in Sources */, + 510C43FA243D0445009F70C3 /* SendToMarsEditCommand.swift in Sources */, 51BB7C272335A8E5008E8144 /* ArticleActivityItemSource.swift in Sources */, 51F85BF52273625800C787DC /* Bundle-Extensions.swift in Sources */, 51C452A622650A3500C03939 /* Node-Extensions.swift in Sources */, @@ -4127,6 +4151,7 @@ 514219372352510100E07E2C /* ImageScrollView.swift in Sources */, 516AE9B32371C372007DEEAA /* MasterFeedTableViewSectionHeaderLayout.swift in Sources */, 51DC370B2405BC9A0095D371 /* PreloadedWebView.swift in Sources */, + 515A50E8243D07A90089E588 /* ExtensionPointManager.swift in Sources */, C5A6ED5223C9AF4300AB6BE2 /* TitleActivityItemSource.swift in Sources */, 51DC37092402F1470095D371 /* MasterFeedDataSourceOperation.swift in Sources */, 51C4529B22650A1000C03939 /* FaviconDownloader.swift in Sources */, @@ -4198,11 +4223,12 @@ D5907D7F2004AC00005947E5 /* NSApplication+Scriptability.swift in Sources */, 8405DD9C22153BD7008CE1BF /* NSView-Extensions.swift in Sources */, 849A979F1ED9F130007D329B /* SidebarCell.swift in Sources */, + 515A50E6243D07A90089E588 /* ExtensionPointManager.swift in Sources */, 51E595A5228CC36500FCC42B /* ArticleStatusSyncTimer.swift in Sources */, 849A97651ED9EB96007D329B /* WebFeedTreeControllerDelegate.swift in Sources */, 849A97671ED9EB96007D329B /* UnreadCountView.swift in Sources */, 51FE10092346739D0056195D /* ActivityType.swift in Sources */, - 510C43F3243C11FE009F70C3 /* FeedProvidersAddTableCellView.swift in Sources */, + 510C43F3243C11FE009F70C3 /* ExtensionPointAddTableCellView.swift in Sources */, 840BEE4121D70E64009BBAFA /* CrashReportWindowController.swift in Sources */, 8426118A1FCB67AA0086A189 /* WebFeedIconDownloader.swift in Sources */, 84C9FC7B22629E1200D921D6 /* PreferencesControlsBackgroundView.swift in Sources */, @@ -4223,7 +4249,7 @@ D5907DB22004BB37005947E5 /* ScriptingObjectContainer.swift in Sources */, 849A978A1ED9ECEF007D329B /* ArticleStylesManager.swift in Sources */, 8405DD8A2213E0E3008CE1BF /* DetailContainerView.swift in Sources */, - 51107746243BEE2500D97C8C /* FeedProvidersPreferencesViewController.swift in Sources */, + 51107746243BEE2500D97C8C /* ExtensionPointPreferencesViewController.swift in Sources */, 519B8D332143397200FA689C /* SharingServiceDelegate.swift in Sources */, FF3ABF1523259DDB0074C542 /* ArticleSorter.swift in Sources */, 84E8E0DB202EC49300562D8F /* TimelineViewController+ContextualMenus.swift in Sources */, @@ -4240,6 +4266,7 @@ 5144EA51227B8E4500D19003 /* AccountsFeedbinWindowController.swift in Sources */, 84AD1EBC2032AF5C00BC20B7 /* SidebarOutlineDataSource.swift in Sources */, 845A29241FC9255E007B49E3 /* SidebarCellAppearance.swift in Sources */, + 515A5107243D0CCD0089E588 /* TwitterFeedProvider+Extensions.swift in Sources */, 845EE7B11FC2366500854A1F /* StarredFeedDelegate.swift in Sources */, 848F6AE51FC29CFB002D422E /* FaviconDownloader.swift in Sources */, 511B9806237DCAC90028BCAA /* UserInfoKey.swift in Sources */, @@ -4279,7 +4306,7 @@ 518651B223555EB20078E021 /* NNW3Document.swift in Sources */, D5F4EDB5200744A700B9E363 /* ScriptingObject.swift in Sources */, D5F4EDB920074D7C00B9E363 /* Folder+Scriptability.swift in Sources */, - 510C43F0243C0A80009F70C3 /* FeedProvidersAddViewController.swift in Sources */, + 510C43F0243C0A80009F70C3 /* ExtensionPointAddViewController.swift in Sources */, 849A97781ED9EC04007D329B /* TimelineCellLayout.swift in Sources */, 84E8E0EB202F693600562D8F /* DetailWebView.swift in Sources */, 849A976C1ED9EBC8007D329B /* TimelineTableRowView.swift in Sources */, @@ -4301,6 +4328,7 @@ 849ADEE42359817E000E1B81 /* NNW3ImportController.swift in Sources */, 849A97A31ED9F180007D329B /* FolderTreeControllerDelegate.swift in Sources */, 51126DA4225FDE2F00722696 /* RSImage-Extensions.swift in Sources */, + 510C43F7243D035C009F70C3 /* ExtensionPoint.swift in Sources */, 845A29091FC74B8E007B49E3 /* SingleFaviconDownloader.swift in Sources */, D5F4EDB720074D6500B9E363 /* WebFeed+Scriptability.swift in Sources */, 84E850861FCB60CE0072EA88 /* AuthorAvatarDownloader.swift in Sources */, diff --git a/Shared/ExtensionPoints/ExtensionPoint.swift b/Shared/ExtensionPoints/ExtensionPoint.swift new file mode 100644 index 000000000..06c6211c1 --- /dev/null +++ b/Shared/ExtensionPoints/ExtensionPoint.swift @@ -0,0 +1,20 @@ +// +// ExtensionPoint.swift +// NetNewsWire +// +// Created by Maurice Parker on 4/7/20. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import Foundation +import RSCore + +protocol ExtensionPoint { + + /// The title of the command. + var title: String { get } + + /// The template image for the command. + var templateImage: RSImage { get } + +} diff --git a/Shared/ExtensionPoints/ExtensionPointManager.swift b/Shared/ExtensionPoints/ExtensionPointManager.swift new file mode 100644 index 000000000..c7502fc19 --- /dev/null +++ b/Shared/ExtensionPoints/ExtensionPointManager.swift @@ -0,0 +1,49 @@ +// +// ExtensionPointManager.swift +// NetNewsWire +// +// Created by Maurice Parker on 4/7/20. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import Foundation +import FeedProvider +import RSCore + +struct ExtensionPointManager { + + static let shared = ExtensionPointManager() + + let marsEdit = SendToMarsEditCommand() + let microblog = SendToMicroBlogCommand() + let twitter = TwitterFeedProvider() + + let availableExtensionPoints: [ExtensionPoint] + let activeSendToCommands: [SendToCommand] + let activeFeedProviders: [FeedProvider] + + init() { + #if os(macOS) + #if DEBUG + availableExtensionPoints = [marsEdit, microblog, twitter] + activeSendToCommands = [marsEdit, microblog] + activeFeedProviders = [twitter] + #else + availableExtensionPoints = [marsEdit, microblog, twitter] + activeSendToCommands = [marsEdit, microblog] + activeFeedProviders = [twitter] + #endif + #else + #if DEBUG + availableExtensionPoints = [twitter] + activeSendToCommands = []() + activeFeedProviders = [twitter] + #else + availableExtensionPoints = [twitter] + activeSendToCommands = []() + activeFeedProviders = [twitter] + #endif + #endif + } + +} diff --git a/Shared/ExtensionPoints/ExtensionPointType.swift b/Shared/ExtensionPoints/ExtensionPointType.swift new file mode 100644 index 000000000..1b6fb845b --- /dev/null +++ b/Shared/ExtensionPoints/ExtensionPointType.swift @@ -0,0 +1,14 @@ +// +// ExtensionPointType.swift +// NetNewsWire +// +// Created by Maurice Parker on 4/7/20. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import Foundation + +enum ExtensionPoint: Int, Codable { + case sentToCommand = 1 + case feedProvider = 2 +} diff --git a/Shared/Commands/SendToMarsEditCommand.swift b/Shared/ExtensionPoints/SendToMarsEditCommand.swift similarity index 90% rename from Shared/Commands/SendToMarsEditCommand.swift rename to Shared/ExtensionPoints/SendToMarsEditCommand.swift index 7b50f07fa..d00944600 100644 --- a/Shared/Commands/SendToMarsEditCommand.swift +++ b/Shared/ExtensionPoints/SendToMarsEditCommand.swift @@ -10,14 +10,16 @@ import AppKit import RSCore import Articles -final class SendToMarsEditCommand: SendToCommand { +final class SendToMarsEditCommand: ExtensionPoint, SendToCommand { - let title = "MarsEdit" + let title = NSLocalizedString("MarsEdit", comment: "MarsEdit") + let templateImage = AppAssets.extensionPointMarsEdit var image: NSImage? { return appToUse()?.icon ?? nil } + private let marsEditApps = [UserApp(bundleID: "com.red-sweater.marsedit4"), UserApp(bundleID: "com.red-sweater.marsedit")] func canSendObject(_ object: Any?, selectedText: String?) -> Bool { diff --git a/Shared/Commands/SendToMicroBlogCommand.swift b/Shared/ExtensionPoints/SendToMicroBlogCommand.swift similarity index 91% rename from Shared/Commands/SendToMicroBlogCommand.swift rename to Shared/ExtensionPoints/SendToMicroBlogCommand.swift index 71dca639f..4c4961942 100644 --- a/Shared/Commands/SendToMicroBlogCommand.swift +++ b/Shared/ExtensionPoints/SendToMicroBlogCommand.swift @@ -12,9 +12,10 @@ import RSCore // Not undoable. -final class SendToMicroBlogCommand: SendToCommand { +final class SendToMicroBlogCommand: ExtensionPoint, SendToCommand { - let title = "Micro.blog" + let title = NSLocalizedString("Micro.blog", comment: "Micro.blog") + let templateImage = AppAssets.extensionPointMicroblog var image: NSImage? { return microBlogApp.icon diff --git a/Shared/ExtensionPoints/TwitterFeedProvider+Extensions.swift b/Shared/ExtensionPoints/TwitterFeedProvider+Extensions.swift new file mode 100644 index 000000000..560ff7ff4 --- /dev/null +++ b/Shared/ExtensionPoints/TwitterFeedProvider+Extensions.swift @@ -0,0 +1,23 @@ +// +// TwitterFeedProvider+Extensions.swift +// NetNewsWire +// +// Created by Maurice Parker on 4/7/20. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import Foundation +import FeedProvider +import RSCore + +extension TwitterFeedProvider: ExtensionPoint { + + var title: String { + return NSLocalizedString("Twitter", comment: "Twitter") + } + + var templateImage: RSImage { + return AppAssets.extensionPointTwitter + } + +} diff --git a/Shared/Data/AddWebFeedDefaultContainer.swift b/Shared/Extensions/AddWebFeedDefaultContainer.swift similarity index 100% rename from Shared/Data/AddWebFeedDefaultContainer.swift rename to Shared/Extensions/AddWebFeedDefaultContainer.swift diff --git a/Shared/Data/ArticleStringFormatter.swift b/Shared/Extensions/ArticleStringFormatter.swift similarity index 100% rename from Shared/Data/ArticleStringFormatter.swift rename to Shared/Extensions/ArticleStringFormatter.swift diff --git a/Shared/Data/ArticleUtilities.swift b/Shared/Extensions/ArticleUtilities.swift similarity index 100% rename from Shared/Data/ArticleUtilities.swift rename to Shared/Extensions/ArticleUtilities.swift diff --git a/Shared/Data/CacheCleaner.swift b/Shared/Extensions/CacheCleaner.swift similarity index 100% rename from Shared/Data/CacheCleaner.swift rename to Shared/Extensions/CacheCleaner.swift diff --git a/Shared/Data/SmallIconProvider.swift b/Shared/Extensions/SmallIconProvider.swift similarity index 100% rename from Shared/Data/SmallIconProvider.swift rename to Shared/Extensions/SmallIconProvider.swift