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