1 // Copyright (C) 2024 Rubén Beltrán del Río
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program. If not, see https://map.tranquil.systems.
17 struct DocumentFocusedValueKey: FocusedValueKey {
18 typealias Value = Binding<MapDocument>
21 struct IsSearchingValueKey: FocusedValueKey {
22 typealias Value = Binding<Bool>
25 struct SelectedEvolutionValueKey: FocusedValueKey {
26 typealias Value = Binding<StageType>
29 struct FileURLValueKey: FocusedValueKey {
33 extension FocusedValues {
34 var document: DocumentFocusedValueKey.Value? {
35 get { self[DocumentFocusedValueKey.self] }
36 set { self[DocumentFocusedValueKey.self] = newValue }
38 var isSearching: IsSearchingValueKey.Value? {
39 get { self[IsSearchingValueKey.self] }
40 set { self[IsSearchingValueKey.self] = newValue }
42 var selectedEvolution: SelectedEvolutionValueKey.Value? {
43 get { self[SelectedEvolutionValueKey.self] }
44 set { self[SelectedEvolutionValueKey.self] = newValue }
46 var fileURL: FileURLValueKey.Value? {
47 get { self[FileURLValueKey.self] }
48 set { self[FileURLValueKey.self] = newValue }