From a1e18b83cb990734b5c88e0dc73ad241f0019ff9 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Wed, 22 Dec 2021 17:06:28 -0600 Subject: [PATCH] Normalize namespaces: includes all at global/root namespace. Should improve the quality of suggestions, etc. we get from tooling. --- src/platform/gui.h | 2 ++ src/platform/platform.h | 4 +++- src/resource.h | 13 +++++++++++++ src/solvespace.h | 7 ++++--- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/platform/gui.h b/src/platform/gui.h index 1608a6f2..f63fa80b 100644 --- a/src/platform/gui.h +++ b/src/platform/gui.h @@ -7,6 +7,7 @@ #ifndef SOLVESPACE_GUI_H #define SOLVESPACE_GUI_H +namespace SolveSpace { class RgbaColor; namespace Platform { @@ -386,5 +387,6 @@ void ExitGui(); void ClearGui(); } +} // namespace SolveSpace #endif diff --git a/src/platform/platform.h b/src/platform/platform.h index 21c2b2bf..1ad5e175 100644 --- a/src/platform/platform.h +++ b/src/platform/platform.h @@ -7,6 +7,7 @@ #ifndef SOLVESPACE_PLATFORM_H #define SOLVESPACE_PLATFORM_H +namespace SolveSpace { namespace Platform { // UTF-8 ⟷ UTF-16 conversion, for Windows. @@ -80,6 +81,7 @@ void DebugPrint(const char *fmt, ...); void *AllocTemporary(size_t size); void FreeAllTemporary(); -} +} // namespace Platform +} // namespace SolveSpace #endif diff --git a/src/resource.h b/src/resource.h index 18c1e582..d5c2e3f0 100644 --- a/src/resource.h +++ b/src/resource.h @@ -7,11 +7,23 @@ #ifndef SOLVESPACE_RESOURCE_H #define SOLVESPACE_RESOURCE_H +#include +#include +#include +#include +#include +#include + +namespace SolveSpace { + class Camera; class Point2d; class Pixmap; class Vector; class RgbaColor; +namespace Platform { + class Path; +} // namespace Platform std::string LoadString(const std::string &name); std::string LoadStringFromGzip(const std::string &name); @@ -109,4 +121,5 @@ public: const std::function &traceEdge, const Camera &camera); }; +} #endif diff --git a/src/solvespace.h b/src/solvespace.h index 8a922167..7305b8a8 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -7,6 +7,10 @@ #ifndef SOLVESPACE_H #define SOLVESPACE_H +#include "resource.h" +#include "platform/platform.h" +#include "platform/gui.h" + #include #include #include @@ -122,9 +126,6 @@ static constexpr double LENGTH_EPS = 1e-6; static constexpr double VERY_POSITIVE = 1e10; static constexpr double VERY_NEGATIVE = -1e10; -#include "platform/platform.h" -#include "platform/gui.h" -#include "resource.h" using Platform::AllocTemporary; using Platform::FreeAllTemporary;