summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.hpp
blob: cad57447269d5a7f103cd2cd83b518b7fbea6cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "../Compositor.hpp"
#include <fstream>
#include "../helpers/MiscFunctions.hpp"
#include <functional>

class CHyprCtl {
  public:
    CHyprCtl();

    std::string                      makeDynamicCall(const std::string& input);
    std::shared_ptr<SHyprCtlCommand> registerCommand(SHyprCtlCommand cmd);
    void                             unregisterCommand(const std::shared_ptr<SHyprCtlCommand>& cmd);
    std::string                      getReply(std::string);

    int                              m_iSocketFD = -1;

    struct {
        bool all = false;
    } m_sCurrentRequestParams;

  private:
    void                                          startHyprCtlSocket();

    std::vector<std::shared_ptr<SHyprCtlCommand>> m_vCommands;
};

inline std::unique_ptr<CHyprCtl> g_pHyprCtl;