2016-06-15 03:32:35 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-10-15 17:42:57 +00:00
|
|
|
#include "components/signals.hpp"
|
2016-10-24 23:51:55 +00:00
|
|
|
#include "components/types.hpp"
|
2016-06-15 03:32:35 +00:00
|
|
|
|
|
|
|
LEMONBUDDY_NS
|
|
|
|
|
|
|
|
DEFINE_ERROR(unrecognized_token);
|
|
|
|
|
|
|
|
class parser {
|
|
|
|
public:
|
|
|
|
explicit parser(const bar_settings& bar) : m_bar(bar) {}
|
2016-11-02 19:22:45 +00:00
|
|
|
void operator()(string data);
|
|
|
|
void codeblock(string data);
|
|
|
|
size_t text(string data);
|
2016-06-15 03:32:35 +00:00
|
|
|
|
|
|
|
protected:
|
2016-11-02 19:22:45 +00:00
|
|
|
color parse_color(string s, color fallback = color{0});
|
|
|
|
int parse_fontindex(string s);
|
|
|
|
attribute parse_attr(const char s);
|
|
|
|
mousebtn parse_action_btn(string data);
|
|
|
|
string parse_action_cmd(string data);
|
2016-06-15 03:32:35 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const bar_settings& m_bar;
|
|
|
|
vector<int> m_actions;
|
|
|
|
};
|
|
|
|
|
|
|
|
LEMONBUDDY_NS_END
|