diff --git a/Gray.xcodeproj/project.pbxproj b/Gray.xcodeproj/project.pbxproj index 59554b0..899de19 100644 --- a/Gray.xcodeproj/project.pbxproj +++ b/Gray.xcodeproj/project.pbxproj @@ -17,10 +17,10 @@ BD67CE10215BF16100216FDB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD67CE0F215BF16100216FDB /* Assets.xcassets */; }; BD67CE13215BF16100216FDB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BD67CE11215BF16100216FDB /* MainMenu.xib */; }; BD67CE1C215BF4FE00216FDB /* ApplicationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD67CE1B215BF4FE00216FDB /* ApplicationsViewController.swift */; }; + BD6F243221620A240032338F /* ApplicationsCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9D3D7E215C30B000233333 /* ApplicationsCollectionViewController.swift */; }; BD750FDC215C1AC60024E70A /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD750FDB215C1AC60024E70A /* Application.swift */; }; BD9D3D7B215C2D5C00233333 /* ApplicationsDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9D3D7A215C2D5C00233333 /* ApplicationsDataSource.swift */; }; BD9D3D7D215C2D7100233333 /* ApplicationListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9D3D7C215C2D7100233333 /* ApplicationListView.swift */; }; - BD9D3D7F215C30B000233333 /* ApplicationCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9D3D7E215C30B000233333 /* ApplicationCollectionViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -42,7 +42,7 @@ BD750FDB215C1AC60024E70A /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = ""; }; BD9D3D7A215C2D5C00233333 /* ApplicationsDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationsDataSource.swift; sourceTree = ""; }; BD9D3D7C215C2D7100233333 /* ApplicationListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationListView.swift; sourceTree = ""; }; - BD9D3D7E215C30B000233333 /* ApplicationCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationCollectionViewController.swift; sourceTree = ""; }; + BD9D3D7E215C30B000233333 /* ApplicationsCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationsCollectionViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -77,11 +77,10 @@ BD111047215CEB8E0002D537 /* Sources */ = { isa = PBXGroup; children = ( - BD9D3D79215C2D3F00233333 /* Applications */, BD67CE0D215BF15F00216FDB /* AppDelegate.swift */, - BD111045215CEB240002D537 /* Shell.swift */, - BD1D9544215E435F003ABBCF /* VersionController.swift */, - BD1BA9BD215E68840052633B /* IconController.swift */, + BD9D3D79215C2D3F00233333 /* Applications */, + BD6F243621620A570032338F /* Utilities */, + BD6F243321620A370032338F /* Versions */, ); path = Sources; sourceTree = ""; @@ -116,16 +115,73 @@ path = Resources; sourceTree = ""; }; - BD9D3D79215C2D3F00233333 /* Applications */ = { + BD6F242D216209BF0032338F /* DataSource */ = { isa = PBXGroup; children = ( - BD750FDB215C1AC60024E70A /* Application.swift */, - BD9D3D7E215C30B000233333 /* ApplicationCollectionViewController.swift */, BD9D3D7A215C2D5C00233333 /* ApplicationsDataSource.swift */, + ); + path = DataSource; + sourceTree = ""; + }; + BD6F242E216209C50032338F /* Views */ = { + isa = PBXGroup; + children = ( + BD1BA9BF215E6DBB0052633B /* ApplicationGridView.swift */, + BD9D3D7C215C2D7100233333 /* ApplicationListView.swift */, + ); + path = Views; + sourceTree = ""; + }; + BD6F242F216209CC0032338F /* Models */ = { + isa = PBXGroup; + children = ( + BD750FDB215C1AC60024E70A /* Application.swift */, + ); + path = Models; + sourceTree = ""; + }; + BD6F2430216209DE0032338F /* Logic */ = { + isa = PBXGroup; + children = ( BD308449215C198D002A9349 /* ApplicationsLogicController.swift */, + ); + path = Logic; + sourceTree = ""; + }; + BD6F2431216209E50032338F /* View Controllers */ = { + isa = PBXGroup; + children = ( + BD9D3D7E215C30B000233333 /* ApplicationsCollectionViewController.swift */, BD67CE1B215BF4FE00216FDB /* ApplicationsViewController.swift */, - BD9D3D7C215C2D7100233333 /* ApplicationListView.swift */, - BD1BA9BF215E6DBB0052633B /* ApplicationGridView.swift */, + ); + path = "View Controllers"; + sourceTree = ""; + }; + BD6F243321620A370032338F /* Versions */ = { + isa = PBXGroup; + children = ( + BD1D9544215E435F003ABBCF /* VersionController.swift */, + ); + path = Versions; + sourceTree = ""; + }; + BD6F243621620A570032338F /* Utilities */ = { + isa = PBXGroup; + children = ( + BD1BA9BD215E68840052633B /* IconController.swift */, + BD111045215CEB240002D537 /* Shell.swift */, + ); + path = Utilities; + sourceTree = ""; + }; + BD9D3D79215C2D3F00233333 /* Applications */ = { + isa = PBXGroup; + children = ( + BD6F242D216209BF0032338F /* DataSource */, + BD6F2430216209DE0032338F /* Logic */, + BD6F242F216209CC0032338F /* Models */, + BD6F2431216209E50032338F /* View Controllers */, + BD6F242E216209C50032338F /* Views */, ); path = Applications; sourceTree = ""; @@ -231,6 +287,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + BD6F243221620A240032338F /* ApplicationsCollectionViewController.swift in Sources */, BD750FDC215C1AC60024E70A /* Application.swift in Sources */, BD9D3D7B215C2D5C00233333 /* ApplicationsDataSource.swift in Sources */, BD1BA9BE215E68840052633B /* IconController.swift in Sources */, @@ -241,7 +298,6 @@ BD1D9545215E435F003ABBCF /* VersionController.swift in Sources */, BD9D3D7D215C2D7100233333 /* ApplicationListView.swift in Sources */, BD111046215CEB240002D537 /* Shell.swift in Sources */, - BD9D3D7F215C30B000233333 /* ApplicationCollectionViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sources/Applications/ApplicationsDataSource.swift b/Sources/Applications/DataSource/ApplicationsDataSource.swift similarity index 100% rename from Sources/Applications/ApplicationsDataSource.swift rename to Sources/Applications/DataSource/ApplicationsDataSource.swift diff --git a/Sources/Applications/ApplicationsLogicController.swift b/Sources/Applications/Logic/ApplicationsLogicController.swift similarity index 100% rename from Sources/Applications/ApplicationsLogicController.swift rename to Sources/Applications/Logic/ApplicationsLogicController.swift diff --git a/Sources/Applications/Application.swift b/Sources/Applications/Models/Application.swift similarity index 100% rename from Sources/Applications/Application.swift rename to Sources/Applications/Models/Application.swift diff --git a/Sources/Applications/ApplicationCollectionViewController.swift b/Sources/Applications/View Controllers/ApplicationsCollectionViewController.swift similarity index 93% rename from Sources/Applications/ApplicationCollectionViewController.swift rename to Sources/Applications/View Controllers/ApplicationsCollectionViewController.swift index 5b8ee2c..bc10e00 100644 --- a/Sources/Applications/ApplicationCollectionViewController.swift +++ b/Sources/Applications/View Controllers/ApplicationsCollectionViewController.swift @@ -2,14 +2,14 @@ import Blueprints import Cocoa import UserInterface -protocol ApplicationCollectionViewControllerDelegate: class { - func applicationCollectionViewController(_ controller: ApplicationCollectionViewController, +protocol ApplicationsCollectionViewControllerDelegate: class { + func applicationCollectionViewController(_ controller: ApplicationsCollectionViewController, toggleAppearance newAppearance: Application.Appearance, application: Application) } -class ApplicationCollectionViewController: NSViewController, ApplicationListViewDelegate, NSCollectionViewDelegate { - weak var delegate: ApplicationCollectionViewControllerDelegate? +class ApplicationsCollectionViewController: NSViewController, ApplicationListViewDelegate, NSCollectionViewDelegate { + weak var delegate: ApplicationsCollectionViewControllerDelegate? let dataSource: ApplicationsDataSource lazy var listLayout = VerticalBlueprintLayout( itemsPerRow: 1, diff --git a/Sources/Applications/ApplicationsViewController.swift b/Sources/Applications/View Controllers/ApplicationsViewController.swift similarity index 87% rename from Sources/Applications/ApplicationsViewController.swift rename to Sources/Applications/View Controllers/ApplicationsViewController.swift index cb46c43..b28769c 100644 --- a/Sources/Applications/ApplicationsViewController.swift +++ b/Sources/Applications/View Controllers/ApplicationsViewController.swift @@ -1,10 +1,10 @@ import Cocoa import Family -class ApplicationsViewController: FamilyViewController, ApplicationCollectionViewControllerDelegate { +class ApplicationsViewController: FamilyViewController, ApplicationsCollectionViewControllerDelegate { enum State { case list([Application]) } let logicController = ApplicationsLogicController() - lazy var collectionViewController = ApplicationCollectionViewController() + lazy var collectionViewController = ApplicationsCollectionViewController() override func viewWillAppear() { super.viewWillAppear() @@ -23,7 +23,7 @@ class ApplicationsViewController: FamilyViewController, ApplicationCollectionVie // MARK: - ApplicationCollectionViewControllerDelegate - func applicationCollectionViewController(_ controller: ApplicationCollectionViewController, + func applicationCollectionViewController(_ controller: ApplicationsCollectionViewController, toggleAppearance newAppearance: Application.Appearance, application: Application) { logicController.toggleAppearance(for: application, newAppearance: newAppearance, then: render) diff --git a/Sources/Applications/ApplicationGridView.swift b/Sources/Applications/Views/ApplicationGridView.swift similarity index 100% rename from Sources/Applications/ApplicationGridView.swift rename to Sources/Applications/Views/ApplicationGridView.swift diff --git a/Sources/Applications/ApplicationListView.swift b/Sources/Applications/Views/ApplicationListView.swift similarity index 100% rename from Sources/Applications/ApplicationListView.swift rename to Sources/Applications/Views/ApplicationListView.swift diff --git a/Sources/IconController.swift b/Sources/Utilities/IconController.swift similarity index 100% rename from Sources/IconController.swift rename to Sources/Utilities/IconController.swift diff --git a/Sources/Shell.swift b/Sources/Utilities/Shell.swift similarity index 100% rename from Sources/Shell.swift rename to Sources/Utilities/Shell.swift diff --git a/Sources/VersionController.swift b/Sources/Versions/VersionController.swift similarity index 100% rename from Sources/VersionController.swift rename to Sources/Versions/VersionController.swift