Waybar/include/modules/sni/tray.hpp

30 lines
627 B
C++
Raw Normal View History

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