1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-03 04:33:30 -05:00
polybar/include/utils/actions.hpp
2020-11-26 20:53:53 +01:00

31 lines
825 B
C++

#pragma once
#include "common.hpp"
namespace modules {
struct module_interface;
} // namespace modules
POLYBAR_NS
namespace actions_util {
using action = std::tuple<string, string, string>;
string get_action_string(const modules::module_interface& module, string action, string data);
/**
* Parses an action string of the form "#name.action[.data]".
*
* Only call this function with an action string that begins with '#'.
*
* \returns a triple (name, action, data)
* If no data exists, the third string will be empty.
* This means "#name.action." and "#name.action" will be produce the
* same result.
* \throws runtime_error If the action string is malformed
*/
action parse_action_string(string action);
} // namespace actions_util
POLYBAR_NS_END