From 5a3ee2b3358e147aeb0cabced90991a5ae3b5870 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 10 May 2021 17:23:17 -0400 Subject: Move Coord to its own header --- src/Canvas.cpp | 1 + src/CanvasModule.hpp | 2 -- src/Configuration.hpp | 13 +------------ src/Coord.hpp | 29 +++++++++++++++++++++++++++++ src/Patchage.cpp | 1 + src/Reactor.cpp | 1 - src/Reactor.hpp | 2 +- 7 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 src/Coord.hpp (limited to 'src') diff --git a/src/Canvas.cpp b/src/Canvas.cpp index aba9f75..2eaeb3d 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -21,6 +21,7 @@ #include "CanvasPort.hpp" #include "ClientInfo.hpp" #include "Configuration.hpp" +#include "Coord.hpp" #include "ILog.hpp" #include "Metadata.hpp" #include "Patchage.hpp" diff --git a/src/CanvasModule.hpp b/src/CanvasModule.hpp index 2dcdcc1..cdea787 100644 --- a/src/CanvasModule.hpp +++ b/src/CanvasModule.hpp @@ -39,9 +39,7 @@ namespace patchage { struct PortID; -class Configuration; class Canvas; - class CanvasPort; class CanvasModule : public Ganv::Module diff --git a/src/Configuration.hpp b/src/Configuration.hpp index 45842a4..75fdcfc 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -17,6 +17,7 @@ #ifndef PATCHAGE_CONFIGURATION_HPP #define PATCHAGE_CONFIGURATION_HPP +#include "Coord.hpp" #include "PortType.hpp" #include "SignalDirection.hpp" @@ -30,18 +31,6 @@ namespace patchage { -struct Coord { - Coord() = default; - - Coord(double x_, double y_) - : x(x_) - , y(y_) - {} - - double x{0.0}; - double y{0.0}; -}; - class Configuration { public: diff --git a/src/Coord.hpp b/src/Coord.hpp new file mode 100644 index 0000000..f77bc40 --- /dev/null +++ b/src/Coord.hpp @@ -0,0 +1,29 @@ +/* This file is part of Patchage. + * Copyright 2007-2021 David Robillard + * + * Patchage 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. + * + * Patchage 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 details. + * + * You should have received a copy of the GNU General Public License + * along with Patchage. If not, see . + */ + +#ifndef PATCHAGE_COORD_HPP +#define PATCHAGE_COORD_HPP + +namespace patchage { + +struct Coord { + double x{0.0}; + double y{0.0}; +}; + +} // namespace patchage + +#endif // PATCHAGE_COORD_HPP diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 1246771..96678a4 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -22,6 +22,7 @@ #include "CanvasModule.hpp" #include "CanvasPort.hpp" #include "Configuration.hpp" +#include "Coord.hpp" #include "Driver.hpp" #include "Event.hpp" #include "Legend.hpp" diff --git a/src/Reactor.cpp b/src/Reactor.cpp index c81df22..f8504a1 100644 --- a/src/Reactor.cpp +++ b/src/Reactor.cpp @@ -19,7 +19,6 @@ #include "Canvas.hpp" #include "CanvasModule.hpp" #include "CanvasPort.hpp" -#include "ClientID.hpp" #include "Configuration.hpp" #include "Driver.hpp" #include "ILog.hpp" diff --git a/src/Reactor.hpp b/src/Reactor.hpp index bb31cca..04b699d 100644 --- a/src/Reactor.hpp +++ b/src/Reactor.hpp @@ -18,7 +18,6 @@ #define PATCHAGE_REACTOR_HPP #include "Action.hpp" -#include "ClientID.hpp" #include "PortID.hpp" #include "SignalDirection.hpp" @@ -31,6 +30,7 @@ class CanvasPort; class Driver; class ILog; class Patchage; +class ClientID; /// Reacts to actions from the user class Reactor -- cgit v1.2.1