2018-08-29 18:36:39 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fmt/format.h>
|
2019-06-15 12:57:52 +00:00
|
|
|
#include "AModule.hpp"
|
2019-04-17 12:19:04 +00:00
|
|
|
#include "bar.hpp"
|
2018-11-22 14:47:23 +00:00
|
|
|
#include "modules/sni/host.hpp"
|
2019-04-17 12:19:04 +00:00
|
|
|
#include "modules/sni/watcher.hpp"
|
|
|
|
#include "util/json.hpp"
|
2018-08-29 18:36:39 +00:00
|
|
|
|
|
|
|
namespace waybar::modules::SNI {
|
|
|
|
|
2019-06-15 12:57:52 +00:00
|
|
|
class Tray : public AModule {
|
2019-04-17 12:19:04 +00:00
|
|
|
public:
|
|
|
|
Tray(const std::string&, const Bar&, const Json::Value&);
|
|
|
|
~Tray() = default;
|
|
|
|
auto update() -> void;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void onAdd(std::unique_ptr<Item>& item);
|
|
|
|
void onRemove(std::unique_ptr<Item>& item);
|
2018-11-22 14:47:23 +00:00
|
|
|
|
2019-04-17 12:19:04 +00:00
|
|
|
static inline std::size_t nb_hosts_ = 0;
|
2019-04-18 15:52:00 +00:00
|
|
|
Gtk::Box box_;
|
2020-02-19 11:06:35 +00:00
|
|
|
SNI::Watcher::singleton watcher_;
|
2019-04-18 15:52:00 +00:00
|
|
|
SNI::Host host_;
|
2018-08-29 18:36:39 +00:00
|
|
|
};
|
|
|
|
|
2019-04-17 12:19:04 +00:00
|
|
|
} // namespace waybar::modules::SNI
|