polybar/include/drawtypes/iconset.hpp

27 lines
489 B
C++
Raw Normal View History

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