From: Ruben Beltran del Rio Date: Mon, 16 Sep 2024 18:37:27 +0000 (+0200) Subject: Address the lint warnings X-Git-Url: https://git.r.bdr.sh/rbdr/map/commitdiff_plain/be897af3bd7cc010c1aa496d5b1faf8a2e1f82ed?ds=inline Address the lint warnings --- diff --git a/Map/Data/FocusedValues+document.swift b/Map/Data/FocusedValues+document.swift index a28404f..78db1c1 100644 --- a/Map/Data/FocusedValues+document.swift +++ b/Map/Data/FocusedValues+document.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct DocumentFocusedValueKey: FocusedValueKey { diff --git a/Map/Data/MapDocument.swift b/Map/Data/MapDocument.swift index 317c39d..1b43efb 100644 --- a/Map/Data/MapDocument.swift +++ b/Map/Data/MapDocument.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI import UniformTypeIdentifiers diff --git a/Map/Data/Stage.swift b/Map/Data/Stage.swift index 395f279..4f737a1 100644 --- a/Map/Data/Stage.swift +++ b/Map/Data/Stage.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. struct Stage { let i: String let ii: String diff --git a/Map/Logic/Constants.swift b/Map/Logic/Constants.swift index 789934a..1c6f54d 100644 --- a/Map/Logic/Constants.swift +++ b/Map/Logic/Constants.swift @@ -1,19 +1,18 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ struct Constants { static let kMaxZoom = 2.0 static let kMinZoom = 0.1 diff --git a/Map/Logic/Debouncer.swift b/Map/Logic/Debouncer.swift index 68a914d..8d40e99 100644 --- a/Map/Logic/Debouncer.swift +++ b/Map/Logic/Debouncer.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation class Debouncer { diff --git a/Map/Logic/MapParser/MapParser.swift b/Map/Logic/MapParser/MapParser.swift index 61f3e51..e94de77 100644 --- a/Map/Logic/MapParser/MapParser.swift +++ b/Map/Logic/MapParser/MapParser.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import CoreGraphics import Foundation diff --git a/Map/Logic/MapParser/Strategies/BlockerParserStrategy.swift b/Map/Logic/MapParser/Strategies/BlockerParserStrategy.swift index 0999666..4bd2ce4 100644 --- a/Map/Logic/MapParser/Strategies/BlockerParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/BlockerParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct BlockerParserStrategy: MapParserStrategy { diff --git a/Map/Logic/MapParser/Strategies/EdgeParserStrategy.swift b/Map/Logic/MapParser/Strategies/EdgeParserStrategy.swift index f8b78df..cc29b49 100644 --- a/Map/Logic/MapParser/Strategies/EdgeParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/EdgeParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct EdgeParserStrategy: MapParserStrategy { diff --git a/Map/Logic/MapParser/Strategies/GroupParserStrategy.swift b/Map/Logic/MapParser/Strategies/GroupParserStrategy.swift index d5ab60c..96de365 100644 --- a/Map/Logic/MapParser/Strategies/GroupParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/GroupParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct GroupParserStrategy: MapParserStrategy { diff --git a/Map/Logic/MapParser/Strategies/NoteParserStrategy.swift b/Map/Logic/MapParser/Strategies/NoteParserStrategy.swift index da1652e..d06c768 100644 --- a/Map/Logic/MapParser/Strategies/NoteParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/NoteParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct NoteParserStrategy: MapParserStrategy { diff --git a/Map/Logic/MapParser/Strategies/OpportunityParserStrategy.swift b/Map/Logic/MapParser/Strategies/OpportunityParserStrategy.swift index 7832055..25e6cc4 100644 --- a/Map/Logic/MapParser/Strategies/OpportunityParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/OpportunityParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct OpportunityParserStrategy: MapParserStrategy { diff --git a/Map/Logic/MapParser/Strategies/StageParserStrategy.swift b/Map/Logic/MapParser/Strategies/StageParserStrategy.swift index d20a4c6..6e4a341 100644 --- a/Map/Logic/MapParser/Strategies/StageParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/StageParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct StageParserStrategy: MapParserStrategy { diff --git a/Map/Logic/MapParser/Strategies/VertexParserStrategy.swift b/Map/Logic/MapParser/Strategies/VertexParserStrategy.swift index 0c25e61..0ca6fc1 100644 --- a/Map/Logic/MapParser/Strategies/VertexParserStrategy.swift +++ b/Map/Logic/MapParser/Strategies/VertexParserStrategy.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct VertexParserStrategy: MapParserStrategy { diff --git a/Map/MapApp.swift b/Map/MapApp.swift index 4578bd8..edfe4ec 100644 --- a/Map/MapApp.swift +++ b/Map/MapApp.swift @@ -1,20 +1,18 @@ -import Sparkle -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. +import Sparkle import SwiftUI @main diff --git a/Map/Presentation/Base Components/EvolutionPicker.swift b/Map/Presentation/Base Components/EvolutionPicker.swift index 03f5145..2768540 100644 --- a/Map/Presentation/Base Components/EvolutionPicker.swift +++ b/Map/Presentation/Base Components/EvolutionPicker.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct EvolutionPicker: View { @@ -23,21 +21,21 @@ struct EvolutionPicker: View { var body: some View { Picker("Evolution", selection: $selectedEvolution) { ForEach(StageType.types) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0) } Divider() ForEach(StageType.characteristics) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0).font(.theme.body) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0).font(.Theme.body) } Divider() ForEach(StageType.properties) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0) } Divider() ForEach(StageType.custom) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0) } - }.font(.theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0) + }.font(.Theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0) } } diff --git a/Map/Presentation/Base Components/MapRender/MapAxes.swift b/Map/Presentation/Base Components/MapRender/MapAxes.swift index bdbafbd..4f64135 100644 --- a/Map/Presentation/Base Components/MapRender/MapAxes.swift +++ b/Map/Presentation/Base Components/MapRender/MapAxes.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapAxes: View { @@ -35,14 +33,14 @@ struct MapAxes: View { path.addLine(to: CGPoint(x: mapSize.width, y: mapSize.height)) path.move(to: CGPoint(x: mapSize.width, y: mapSize.height)) path.closeSubpath() - }.stroke(Color.map.axisColor, lineWidth: lineWidth * 2) + }.stroke(Color.Map.axisColor, lineWidth: lineWidth * 2) // Y Labels - Text("Visible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect( + Text("Visible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect( Angle(degrees: -90.0) ) .offset(CGSize(width: -35.0, height: 0.0)) - Text("Invisible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect( + Text("Invisible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect( Angle(degrees: -90.0) ) .offset(CGSize(width: -40.0, height: mapSize.height - 20)) @@ -50,37 +48,37 @@ struct MapAxes: View { // X Labels Text("Uncharted") - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading) .offset(CGSize(width: 0.0, height: -stageHeight / 4.0)) Text("Industrialised") - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading) .offset(CGSize(width: mapSize.width - 100.0, height: -stageHeight / 4.0)) Text(evolution.i) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: w(stages[0]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: 0.0, height: mapSize.height + padding)) Text(evolution.ii) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: w(stages[1]) - w(stages[0]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: w(stages[0]), height: mapSize.height + padding)) Text(evolution.iii) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: w(stages[2]) - w(stages[1]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: w(stages[1]), height: mapSize.height + padding)) Text(evolution.iv) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: mapSize.width - w(stages[2]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: w(stages[2]), height: mapSize.height + padding)) } diff --git a/Map/Presentation/Base Components/MapRender/MapBlockers.swift b/Map/Presentation/Base Components/MapRender/MapBlockers.swift index 356c1d1..613b792 100644 --- a/Map/Presentation/Base Components/MapRender/MapBlockers.swift +++ b/Map/Presentation/Base Components/MapRender/MapBlockers.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapBlockers: View { @@ -34,7 +32,7 @@ struct MapBlockers: View { y: h(vertex.position.y) - vertexSize.height * 2 / 3), size: CGSize(width: vertexSize.width / 2, height: vertexSize.height * 2) ), cornerSize: cornerSize) - }.fill(Color.map.blockerColor) + }.fill(Color.Map.blockerColor) } } diff --git a/Map/Presentation/Base Components/MapRender/MapEdges.swift b/Map/Presentation/Base Components/MapRender/MapEdges.swift index a377774..3090c04 100644 --- a/Map/Presentation/Base Components/MapRender/MapEdges.swift +++ b/Map/Presentation/Base Components/MapRender/MapEdges.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapEdges: View { @@ -68,7 +66,7 @@ struct MapEdges: View { path.closeSubpath() }.applying( CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0) - ).stroke(Color.map.vertexColor, lineWidth: lineWidth) + ).stroke(Color.Map.vertexColor, lineWidth: lineWidth) } } diff --git a/Map/Presentation/Base Components/MapRender/MapGroup.swift b/Map/Presentation/Base Components/MapRender/MapGroup.swift index 852c536..a5877a8 100644 --- a/Map/Presentation/Base Components/MapRender/MapGroup.swift +++ b/Map/Presentation/Base Components/MapRender/MapGroup.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import ConcaveHull import SwiftUI diff --git a/Map/Presentation/Base Components/MapRender/MapGroups.swift b/Map/Presentation/Base Components/MapRender/MapGroups.swift index 936a1fc..41ea147 100644 --- a/Map/Presentation/Base Components/MapRender/MapGroups.swift +++ b/Map/Presentation/Base Components/MapRender/MapGroups.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import ConcaveHull import SwiftUI @@ -30,7 +28,7 @@ struct MapGroups: View { } private func color(_ index: Int) -> Color { - return .map.groupColors[index % Color.map.groupColors.count] + return .Map.groupColors[index % Color.Map.groupColors.count] } } diff --git a/Map/Presentation/Base Components/MapRender/MapNotes.swift b/Map/Presentation/Base Components/MapRender/MapNotes.swift index d2d7e1f..0119154 100644 --- a/Map/Presentation/Base Components/MapRender/MapNotes.swift +++ b/Map/Presentation/Base Components/MapRender/MapNotes.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapNotes: View { @@ -26,11 +24,11 @@ struct MapNotes: View { var body: some View { ForEach(notes, id: \.id) { note in - Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.note) + Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.note) .padding(2.0) .background(.white) - .foregroundColor(.map.labelColor) - .border(Color.map.vertexColor, width: lineWidth) + .foregroundColor(.Map.labelColor) + .border(Color.Map.vertexColor, width: lineWidth) .frame(minWidth: 16.0, maxWidth: maxWidth, alignment: .topLeading) .offset( CGSize( diff --git a/Map/Presentation/Base Components/MapRender/MapOpportunities.swift b/Map/Presentation/Base Components/MapRender/MapOpportunities.swift index 310379b..3d539d4 100644 --- a/Map/Presentation/Base Components/MapRender/MapOpportunities.swift +++ b/Map/Presentation/Base Components/MapRender/MapOpportunities.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapOpportunities: View { @@ -63,7 +61,7 @@ struct MapOpportunities: View { }.applying( CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0) ).strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0])).stroke( - Color.map.opportunityColor) + Color.Map.opportunityColor) } } diff --git a/Map/Presentation/Base Components/MapRender/MapStages.swift b/Map/Presentation/Base Components/MapRender/MapStages.swift index 754ebb2..d5e5965 100644 --- a/Map/Presentation/Base Components/MapRender/MapStages.swift +++ b/Map/Presentation/Base Components/MapRender/MapStages.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Patterns import SwiftUI @@ -27,25 +25,25 @@ struct MapStages: View { var body: some View { ZStack(alignment: .topLeading) { PatternView( - design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .frame(width: w(stages[0]), height: mapSize.height) PatternView( - design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .offset(CGSize(width: w(stages[0]), height: 0)) .frame(width: w(stages[1]) - w(stages[0]), height: mapSize.height) PatternView( - design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .offset(CGSize(width: w(stages[1]), height: 0)) .frame(width: w(stages[2]) - w(stages[1]), height: mapSize.height) PatternView( - design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .offset(CGSize(width: w(stages[2]), height: 0)) .frame(width: mapSize.width - w(stages[2]), height: mapSize.height) @@ -63,7 +61,7 @@ struct MapStages: View { path.move(to: CGPoint(x: w(stages[0]), y: 0)) path.closeSubpath() }.strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0, 18.0])).stroke( - Color.map.axisColor) + Color.Map.axisColor) } } diff --git a/Map/Presentation/Base Components/MapRender/MapVertices.swift b/Map/Presentation/Base Components/MapRender/MapVertices.swift index 1be091a..d8e3b88 100644 --- a/Map/Presentation/Base Components/MapRender/MapVertices.swift +++ b/Map/Presentation/Base Components/MapRender/MapVertices.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapVertices: View { @@ -29,9 +27,9 @@ struct MapVertices: View { ZStack(alignment: .topLeading) { ForEach(vertices, id: \.id) { vertex in ZStack(alignment: .topLeading) { - getVertexShape(vertex).fill(Color.map.vertexColor) - Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.vertexLabel) - .foregroundColor(.map.labelColor) + getVertexShape(vertex).fill(Color.Map.vertexColor) + Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.vertexLabel) + .foregroundColor(.Map.labelColor) .shadow(color: .white, radius: 0, x: -0.5, y: -0.5) .shadow(color: .white, radius: 0, x: 0.5, y: 0.5) .offset( diff --git a/Map/Presentation/Base Components/MapTextEditor.swift b/Map/Presentation/Base Components/MapTextEditor.swift index a7dbe52..2e4f279 100644 --- a/Map/Presentation/Base Components/MapTextEditor.swift +++ b/Map/Presentation/Base Components/MapTextEditor.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Cocoa import SwiftUI @@ -66,7 +64,7 @@ class MapTextEditorController: NSViewController { scrollView.translatesAutoresizingMaskIntoConstraints = false - textView.backgroundColor = .ui.background + textView.backgroundColor = .UI.background textView.allowsUndo = true textView.delegate = self textView.textStorage?.delegate = self @@ -94,7 +92,7 @@ class MapTextEditorController: NSViewController { for range in highlightRanges { let nsRange = NSRange(range, in: textStorage.string) - textStorage.addAttribute(.backgroundColor, value: NSColor.syntax.match, range: nsRange) + textStorage.addAttribute(.backgroundColor, value: NSColor.Syntax.match, range: nsRange) } textView.needsDisplay = true @@ -166,77 +164,77 @@ extension MapTextEditorController: NSTextStorageDelegate { for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 4)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 4)) } matches = edgeRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1)) let arrowRange = match.range(at: 2) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.symbol], + [.foregroundColor: NSColor.Syntax.symbol], range: NSMakeRange(arrowRange.lowerBound - 1, arrowRange.length + 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 3)) } matches = opportunityRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.symbol], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.symbol], range: match.range(at: 3)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 4)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 4)) } matches = blockerRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2)) } matches = noteRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3)) } matches = stageRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2)) } matches = groupRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2)) } } } diff --git a/Map/Presentation/Base Components/SearchBar.swift b/Map/Presentation/Base Components/SearchBar.swift index 7e921b0..e5182c5 100644 --- a/Map/Presentation/Base Components/SearchBar.swift +++ b/Map/Presentation/Base Components/SearchBar.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct SearchBar: View { @@ -50,19 +48,19 @@ struct SearchBar: View { Spacer() Button(action: onPrevious) { Image(systemName: "chevron.left") - .font(.theme.smallControl) + .font(.Theme.smallControl) }.keyboardShortcut( "g", modifiers: EventModifiers([.command, .shift]) ).help("Find Previous (⇧⌘G)") Button(action: onNext) { Image(systemName: "chevron.right") - .font(.theme.smallControl) + .font(.Theme.smallControl) }.keyboardShortcut( "g", modifiers: EventModifiers([.command]) ).help("Find Next (⌘G)") Button(action: onDismiss) { Text("Done") - .font(.theme.smallControl) + .font(.Theme.smallControl) }.keyboardShortcut(.escape, modifiers: EventModifiers()) .help("Done (⎋)") }.padding(4.0) diff --git a/Map/Presentation/Commands/MapCommands.swift b/Map/Presentation/Commands/MapCommands.swift index 83c4b27..c04cb73 100644 --- a/Map/Presentation/Commands/MapCommands.swift +++ b/Map/Presentation/Commands/MapCommands.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapCommands: Commands { diff --git a/Map/Presentation/Commands/UpdateCommands.swift b/Map/Presentation/Commands/UpdateCommands.swift index 3a019cc..bfe7078 100644 --- a/Map/Presentation/Commands/UpdateCommands.swift +++ b/Map/Presentation/Commands/UpdateCommands.swift @@ -1,20 +1,18 @@ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Sparkle -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ import SwiftUI struct UpdateCommands: Commands { diff --git a/Map/Presentation/Complex Components/MapRender/MapRenderView.swift b/Map/Presentation/Complex Components/MapRender/MapRenderView.swift index 75dde4c..1ca1ffe 100644 --- a/Map/Presentation/Complex Components/MapRender/MapRenderView.swift +++ b/Map/Presentation/Complex Components/MapRender/MapRenderView.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Combine import CoreData import CoreGraphics diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift index d7c93dd..d62d4ad 100644 --- a/Map/Presentation/MapEditor.swift +++ b/Map/Presentation/MapEditor.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// Copyright (C) 2024 Rubén Beltrán del Río + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapEditor: View { @@ -89,10 +87,10 @@ struct MapEditor: View { adaptiveStack { ZStack(alignment: .topLeading) { MapTextEditor(document: $document, highlightRanges: results, selectedRange: selectedTerm) - .background(Color.ui.background) - .foregroundColor(Color.ui.foreground) + .background(Color.UI.background) + .foregroundColor(Color.UI.foreground) .frame(minHeight: 96.0) - }.padding(.top, 8.0).padding(.leading, 8.0).background(Color.ui.background).cornerRadius( + }.padding(.top, 8.0).padding(.leading, 8.0).background(Color.UI.background).cornerRadius( 5.0) GeometryReader { geometry in ScrollView([.horizontal, .vertical]) { @@ -101,7 +99,7 @@ struct MapEditor: View { ).scaleEffect(zoom, anchor: .center).frame( width: (Dimensions.mapSize.width + 2 * Dimensions.mapPadding) * zoom, height: (Dimensions.mapSize.height + 2 * Dimensions.mapPadding) * zoom) - }.background(Color.ui.background) + }.background(Color.UI.background) .gesture( MagnificationGesture() .onChanged { value in @@ -122,16 +120,16 @@ struct MapEditor: View { value: $zoom, in: zoomRange, step: 0.1, label: { Text(formatZoom(zoom)) - .font(.theme.smallControl) + .font(.Theme.smallControl) }, minimumValueLabel: { Image(systemName: "minus.magnifyingglass") - .font(.theme.smallControl) + .font(.Theme.smallControl) .help("Zoom Out (⌘-)") }, maximumValueLabel: { Image(systemName: "plus.magnifyingglass") - .font(.theme.smallControl) + .font(.Theme.smallControl) .help("Zoom In (⌘+)") } ).frame(width: 200).padding(.trailing, 10.0) diff --git a/Map/Presentation/Theme/Color+theme.swift b/Map/Presentation/Theme/Color+theme.swift index d09fabe..feac76a 100644 --- a/Map/Presentation/Theme/Color+theme.swift +++ b/Map/Presentation/Theme/Color+theme.swift @@ -1,23 +1,21 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI extension Color { - struct theme { + struct Theme { static let darkSlate = Color("Dark Slate") static let jasperRed = Color("Jasper Red") static let olympicBlue = Color("Olympic Blue") @@ -30,24 +28,24 @@ extension Color { static let darkerNeutralGray = Color("Darker Neutral Gray") } - struct map { - static let labelColor = Color.theme.darkSlate - static let axisColor = Color.theme.darkSlate - static let vertexColor = Color.theme.darkSlate - static let blockerColor = Color.theme.jasperRed - static let opportunityColor = Color.theme.olympicBlue - static let stageForeground = Color.theme.lightNeutralGray + struct Map { + static let labelColor = Color.Theme.darkSlate + static let axisColor = Color.Theme.darkSlate + static let vertexColor = Color.Theme.darkSlate + static let blockerColor = Color.Theme.jasperRed + static let opportunityColor = Color.Theme.olympicBlue + static let stageForeground = Color.Theme.lightNeutralGray static let stageBackground = Color.white static let groupColors = [ - Color.theme.olympicBlue, - Color.theme.jasperRed, - Color.theme.lightPorcelainGreen, - Color.theme.naplesYellow, - Color.theme.hermosaPink, + Color.Theme.olympicBlue, + Color.Theme.jasperRed, + Color.Theme.lightPorcelainGreen, + Color.Theme.naplesYellow, + Color.Theme.hermosaPink, ] } - struct ui { + struct UI { static let foreground = Color("Foreground") static let background = Color("Background") } diff --git a/Map/Presentation/Theme/Dimensions.swift b/Map/Presentation/Theme/Dimensions.swift index ac87c12..99a6207 100644 --- a/Map/Presentation/Theme/Dimensions.swift +++ b/Map/Presentation/Theme/Dimensions.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Foundation struct Dimensions { diff --git a/Map/Presentation/Theme/Font+theme.swift b/Map/Presentation/Theme/Font+theme.swift index db781c3..1a9abb8 100644 --- a/Map/Presentation/Theme/Font+theme.swift +++ b/Map/Presentation/Theme/Font+theme.swift @@ -1,23 +1,21 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI extension Font { - public struct theme { + public struct Theme { // Map static let note = Font.system(size: 12, design: .serif) diff --git a/Map/Presentation/Theme/NSColor+theme.swift b/Map/Presentation/Theme/NSColor+theme.swift index f1a046d..61b5498 100644 --- a/Map/Presentation/Theme/NSColor+theme.swift +++ b/Map/Presentation/Theme/NSColor+theme.swift @@ -1,23 +1,21 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import AppKit extension NSColor { - struct syntax { + struct Syntax { static let vertex = NSColor(named: "Vertex") ?? .textColor static let number = NSColor(named: "Number") ?? .textColor static let option = NSColor(named: "Option") ?? .textColor @@ -27,7 +25,7 @@ extension NSColor { 0.3) } - struct ui { + struct UI { static let background = NSColor(named: "Background") ?? .windowBackgroundColor } } diff --git a/Map/Presentation/ViewStyle.swift b/Map/Presentation/ViewStyle.swift index e490c4d..f1b7732 100644 --- a/Map/Presentation/ViewStyle.swift +++ b/Map/Presentation/ViewStyle.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. enum ViewStyle: String { case vertical, horizontal }