From f97de599dde49943d2742db2903b83769601deac Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 21 Oct 2020 22:45:03 -0700 Subject: [PATCH] refactor: header cleanup Replace a couple of header includes with forward declarations. --- include/bar.hpp | 2 -- include/client.hpp | 4 ++++ src/bar.cpp | 1 + src/client.cpp | 3 +++ src/modules/idle_inhibitor.cpp | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 1e3d37b0..d4748d5a 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -9,8 +9,6 @@ #include #include "AModule.hpp" -#include "idle-inhibit-unstable-v1-client-protocol.h" -#include "wlr-layer-shell-unstable-v1-client-protocol.h" #include "xdg-output-unstable-v1-client-protocol.h" namespace waybar { diff --git a/include/client.hpp b/include/client.hpp index 39b6ae3b..05215cc0 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -8,6 +8,10 @@ #include #include "bar.hpp" +struct zwlr_layer_shell_v1; +struct zwp_idle_inhibitor_v1; +struct zwp_idle_inhibit_manager_v1; + namespace waybar { class Client { diff --git a/src/bar.cpp b/src/bar.cpp index c7387e38..fb04f627 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -7,6 +7,7 @@ #include "bar.hpp" #include "client.hpp" #include "factory.hpp" +#include "wlr-layer-shell-unstable-v1-client-protocol.h" namespace waybar { static constexpr const char* MIN_HEIGHT_MSG = diff --git a/src/client.cpp b/src/client.cpp index 9dd93d81..005761ee 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -6,6 +6,9 @@ #include "util/clara.hpp" #include "util/json.hpp" +#include "idle-inhibit-unstable-v1-client-protocol.h" +#include "wlr-layer-shell-unstable-v1-client-protocol.h" + waybar::Client *waybar::Client::inst() { static auto c = new Client(); return c; diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index d94e9579..d2cfe905 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -1,4 +1,6 @@ #include "modules/idle_inhibitor.hpp" + +#include "idle-inhibit-unstable-v1-client-protocol.h" #include "util/command.hpp" waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& bar,