2020-05-06 19:26:14 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2020-11-22 17:05:45 -05:00
|
|
|
|
|
|
|
namespace modules {
|
|
|
|
struct module_interface;
|
|
|
|
} // namespace modules
|
2020-05-06 19:26:14 -04:00
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
namespace actions_util {
|
2020-11-25 04:16:26 -05:00
|
|
|
|
|
|
|
using action = std::tuple<string, string, string>;
|
|
|
|
|
2020-11-22 17:05:45 -05:00
|
|
|
string get_action_string(const modules::module_interface& module, string action, string data);
|
2022-01-22 14:35:37 -05:00
|
|
|
string get_action_string(const string& module_name, string action, string data);
|
2020-05-31 10:28:31 -04: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 15:40:48 -05:00
|
|
|
* @returns a triple (name, action, data)
|
2020-05-31 10:28:31 -04: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 15:40:48 -05:00
|
|
|
* @throws runtime_error If the action string is malformed
|
2020-05-31 10:28:31 -04:00
|
|
|
*/
|
2020-11-25 04:16:26 -05:00
|
|
|
action parse_action_string(string action);
|
2020-05-06 19:26:14 -04:00
|
|
|
} // namespace actions_util
|
|
|
|
|
|
|
|
POLYBAR_NS_END
|