1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/components/parser.hpp

33 lines
638 B
C++
Raw Normal View History

2016-06-14 23:32:35 -04:00
#pragma once
#include "common.hpp"
2016-11-19 00:22:44 -05:00
POLYBAR_NS
2016-06-14 23:32:35 -04:00
2016-11-21 09:07:00 -05:00
struct bar_settings;
enum class attribute : uint8_t;
enum class mousebtn : uint8_t;
2016-06-14 23:32:35 -04:00
DEFINE_ERROR(unrecognized_token);
class parser {
public:
2016-11-21 09:07:00 -05:00
explicit parser(const bar_settings& bar);
2016-11-02 15:22:45 -04:00
void operator()(string data);
void codeblock(string data);
size_t text(string data);
2016-06-14 23:32:35 -04:00
protected:
2016-11-21 09:07:00 -05:00
uint32_t parse_color(string s, uint32_t fallback = 0);
int8_t parse_fontindex(string s);
2016-11-02 15:22:45 -04:00
attribute parse_attr(const char s);
mousebtn parse_action_btn(string data);
string parse_action_cmd(string data);
2016-06-14 23:32:35 -04:00
private:
const bar_settings& m_bar;
vector<int> m_actions;
};
2016-11-19 00:22:44 -05:00
POLYBAR_NS_END