Waybar/include/modules/privacy/privacy_item.hpp

47 lines
911 B
C++
Raw Normal View History

2023-10-26 21:08:57 +00:00
#pragma once
#include <json/value.h>
#include <iostream>
#include <map>
#include <mutex>
#include <string>
#include "gtkmm/box.h"
#include "gtkmm/image.h"
#include "gtkmm/revealer.h"
#include "util/pipewire/privacy_node_info.hpp"
namespace waybar::modules::privacy {
class PrivacyItem : public Gtk::Revealer {
public:
PrivacyItem(const Json::Value&, enum util::PipewireBackend::PrivacyNodeType privacy_type_,
const std::string& pos);
bool is_enabled();
void set_in_use(bool in_use);
void set_icon_size(uint size);
private:
enum util::PipewireBackend::PrivacyNodeType privacy_type;
std::mutex mutex_;
sigc::connection signal_conn;
bool init = false;
bool in_use = false;
std::string lastStatus;
// Config
bool enabled = true;
std::string iconName = "image-missing-symbolic";
Gtk::Box box_;
Gtk::Image icon_;
};
} // namespace waybar::modules::privacy