File: layouticonset.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 (33 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (3)
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
27
28
29
30
31
32
33
#pragma once

#include <tuple>
#include <vector>

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

using std::tuple;

POLYBAR_NS

namespace drawtypes {
  class layouticonset : public non_copyable_mixin {
   public:
    explicit layouticonset(label_t&& default_icon);

    bool add(const string& layout, const string& variant, label_t&& icon);
    label_t get(const string& layout, const string& variant) const;
    bool contains(const string& layout, const string& variant) const;

    static constexpr const char* VARIANT_ANY = "_";

   protected:
    label_t m_default_icon;
    vector<tuple<string, string, label_t>> m_layout_icons;
  };

  using layouticonset_t = shared_ptr<layouticonset>;
}  // namespace drawtypes

POLYBAR_NS_END