2020-05-06 23:26:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2020-11-22 22:05:45 +00:00
|
|
|
|
|
|
|
namespace modules {
|
|
|
|
struct module_interface;
|
|
|
|
} // namespace modules
|
2020-05-06 23:26:14 +00:00
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
namespace actions_util {
|
2020-11-25 09:16:26 +00:00
|
|
|
|
|
|
|
using action = std::tuple<string, string, string>;
|
|
|
|
|
2020-11-22 22:05:45 +00:00
|
|
|
string get_action_string(const modules::module_interface& module, string action, string data);
|
2022-01-22 19:35:37 +00:00
|
|
|
string get_action_string(const string& module_name, string action, string data);
|
2020-05-31 14:28:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Parses an action string of the form "#name.action[.data]".
|
|
|
|
*
|
|
|
|
* Only call this function with an action string that begins with '#'.
|
|
|
|
*
|
2022-02-20 20:40:48 +00:00
|
|
|
* @returns a triple (name, action, data)
|
2020-05-31 14:28:31 +00:00
|
|
|
* If no data exists, the third string will be empty.
|
|
|
|
* This means "#name.action." and "#name.action" will be produce the
|
|
|
|
* same result.
|
2022-02-20 20:40:48 +00:00
|
|
|
* @throws runtime_error If the action string is malformed
|
2020-05-31 14:28:31 +00:00
|
|
|
*/
|
2020-11-25 09:16:26 +00:00
|
|
|
action parse_action_string(string action);
|
2020-05-06 23:26:14 +00:00
|
|
|
} // namespace actions_util
|
|
|
|
|
|
|
|
POLYBAR_NS_END
|