From 60bda7ee3d0a77d19277540cce53ecbddeabd716 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 5 Feb 2024 01:56:38 +0000 Subject: pluginapi: allow registering hyprctl commands closes #4616 --- src/debug/HyprCtl.hpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/debug/HyprCtl.hpp') diff --git a/src/debug/HyprCtl.hpp b/src/debug/HyprCtl.hpp index 1bef65a0..339acd1b 100644 --- a/src/debug/HyprCtl.hpp +++ b/src/debug/HyprCtl.hpp @@ -9,28 +9,17 @@ class CHyprCtl { public: CHyprCtl(); - enum eHyprCtlOutputFormat { - FORMAT_NORMAL = 0, - FORMAT_JSON - }; + std::string makeDynamicCall(const std::string& input); + std::shared_ptr registerCommand(SHyprCtlCommand cmd); + void unregisterCommand(const std::shared_ptr& cmd); + std::string getReply(std::string); - struct SCommand { - std::string name = ""; - bool exact = true; - std::function fn; - }; - - std::string makeDynamicCall(const std::string& input); - std::shared_ptr registerCommand(SCommand cmd); - void unregisterCommand(const std::shared_ptr& cmd); - std::string getReply(std::string); - - int m_iSocketFD = -1; + int m_iSocketFD = -1; private: - void startHyprCtlSocket(); + void startHyprCtlSocket(); - std::vector> m_vCommands; + std::vector> m_vCommands; }; inline std::unique_ptr g_pHyprCtl; \ No newline at end of file -- cgit v1.2.3