-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
543 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ShiftWindowPackages/Sources/DataLayer/Dependency/PanelSceneMessengerClient.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
PanelSceneMessengerClient.swift | ||
DataLayer | ||
|
||
Created by Takuto Nakamura on 2024/11/14. | ||
Copyright 2022 Takuto Nakamura (Kyome22) | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import PanelSceneKit | ||
|
||
public struct PanelSceneMessengerClient: DependencyClient { | ||
public var request: @Sendable (PanelAction, String, [AnyHashable : Any]?) -> Void | ||
|
||
public static let liveValue = Self( | ||
request: { PanelSceneMessenger.request(panelAction: $0, with: $1, userInfo: $2) } | ||
) | ||
|
||
public static let testValue = Self( | ||
request: { _, _, _ in } | ||
) | ||
} |
36 changes: 36 additions & 0 deletions
36
ShiftWindowPackages/Sources/DataLayer/Dependency/SpiceKeyClient.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
SpiceKeyClient.swift | ||
DataLayer | ||
|
||
Created by Takuto Nakamura on 2024/11/14. | ||
Copyright 2022 Takuto Nakamura (Kyome22) | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import SpiceKey | ||
|
||
public struct SpiceKeyClient: DependencyClient { | ||
public var register: @Sendable (SpiceKey) -> Void | ||
public var unregister: @Sendable (SpiceKey) -> Void | ||
|
||
public static let liveValue = Self( | ||
register: { $0.register() }, | ||
unregister: { $0.unregister() } | ||
) | ||
|
||
public static let testValue = Self( | ||
register: { _ in }, | ||
unregister: { _ in } | ||
) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
AppServices.swift | ||
Domain | ||
|
||
Created by Takuto Nakamura on 2024/11/14. | ||
|
||
*/ | ||
|
||
import DataLayer | ||
import Observation | ||
import SwiftUI | ||
|
||
public final class AppServices: Sendable { | ||
public let logService: LogService | ||
public let shiftService: ShiftService | ||
public let shortcutService: ShortcutService | ||
public let updateService: UpdateService | ||
|
||
public nonisolated init(appDependencies: AppDependencies) { | ||
logService = .init(appDependencies.loggingSystemClient) | ||
shiftService = .init(appDependencies.cgDirectDisplayClient, | ||
appDependencies.hiServicesClient, | ||
appDependencies.nsAppClient, | ||
appDependencies.nsScreenClient, | ||
appDependencies.nsWorkspaceClient) | ||
shortcutService = .init(appDependencies.panelSceneMessengerClient, | ||
appDependencies.spiceKeyClient, | ||
appDependencies.userDefaultsClient) | ||
updateService = .init(appDependencies.spuUpdaterClient) | ||
} | ||
} | ||
|
||
struct AppServicesKey: EnvironmentKey { | ||
static let defaultValue = AppServices(appDependencies: AppDependenciesKey.defaultValue) | ||
} | ||
|
||
public extension EnvironmentValues { | ||
var appServices: AppServices { | ||
get { self[AppServicesKey.self] } | ||
set { self[AppServicesKey.self] = newValue } | ||
} | ||
} |
Oops, something went wrong.