2016-06-14 23:32:35 -04:00
|
|
|
#pragma once
|
|
|
|
|
2016-12-05 14:41:00 -05:00
|
|
|
#include <map>
|
|
|
|
|
2016-06-14 23:32:35 -04:00
|
|
|
#include "common.hpp"
|
|
|
|
#include "drawtypes/label.hpp"
|
|
|
|
#include "utils/mixins.hpp"
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
namespace drawtypes {
|
|
|
|
class iconset : public non_copyable_mixin<iconset> {
|
|
|
|
public:
|
2016-11-02 15:22:45 -04:00
|
|
|
void add(string id, icon_t&& icon);
|
2016-11-25 07:55:15 -05:00
|
|
|
bool has(const string& id);
|
2017-01-19 23:35:52 -05:00
|
|
|
icon_t get(const string& id, const string& fallback_id = "", bool fuzzy_match = false);
|
2016-11-02 15:22:45 -04:00
|
|
|
operator bool();
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
protected:
|
2016-12-05 14:41:00 -05:00
|
|
|
std::map<string, icon_t> m_icons;
|
2016-06-14 23:32:35 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
using iconset_t = shared_ptr<iconset>;
|
|
|
|
}
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|