mirror of
https://github.com/polybar/polybar.git
synced 2024-10-27 05:23:39 -04:00
29 lines
600 B
C++
29 lines
600 B
C++
#pragma once
|
|
|
|
#include "common.hpp"
|
|
#include "components/signals.hpp"
|
|
|
|
POLYBAR_NS
|
|
|
|
DEFINE_ERROR(unrecognized_token);
|
|
|
|
class parser {
|
|
public:
|
|
explicit parser(const bar_settings& bar) : m_bar(bar) {}
|
|
void operator()(string data);
|
|
void codeblock(string data);
|
|
size_t text(string data);
|
|
|
|
protected:
|
|
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);
|
|
|
|
private:
|
|
const bar_settings& m_bar;
|
|
vector<int> m_actions;
|
|
};
|
|
|
|
POLYBAR_NS_END
|