refactor(modules): Move setup to constructor

This commit is contained in:
Michael Carlberg 2016-12-21 08:00:09 +01:00
parent 81e6fb062f
commit c01f111e34
52 changed files with 100 additions and 149 deletions
include/modules

View file

@ -8,15 +8,6 @@ POLYBAR_NS
struct ipc_hook; // fwd
namespace modules {
/**
* Hook structure that will be fired
* when receiving a message with specified id
*/
struct hook {
string payload;
string command;
};
/**
* Module that allow users to configure hooks on
* received ipc messages. The hook will execute the defined
@ -25,9 +16,18 @@ namespace modules {
*/
class ipc_module : public static_module<ipc_module> {
public:
using static_module::static_module;
/**
* Hook structure that will be fired
* when receiving a message with specified id
*/
struct hook {
string payload;
string command;
};
public:
explicit ipc_module(const bar_settings&, string);
void setup();
string get_output();
bool build(builder* builder, const string& tag) const;
void on_message(const ipc_hook& message);