File: iconset.hpp

package info (click to toggle)
polybar 3.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,108 kB
  • sloc: cpp: 30,424; python: 3,750; sh: 284; makefile: 83
file content (26 lines) | stat: -rw-r--r-- 532 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <map>

#include "common.hpp"
#include "drawtypes/label.hpp"
#include "utils/mixins.hpp"

POLYBAR_NS

namespace drawtypes {
  class iconset : public non_copyable_mixin {
   public:
    void add(string id, label_t&& icon);
    bool has(const string& id);
    label_t get(const string& id, const string& fallback_id = "", bool fuzzy_match = false);
    operator bool();

   protected:
    std::map<string, label_t> m_icons;
  };

  using iconset_t = shared_ptr<iconset>;
} // namespace drawtypes

POLYBAR_NS_END