#pragma once #include #include #include #include #include #include #include #include #include #include #ifdef FILESYSTEM_EXPERIMENTAL #include #else #include #endif namespace waybar::modules::SNI { class Item : public sigc::trackable { public: Item(std::string, std::string, const Json::Value&); ~Item() = default; std::string bus_name; std::string object_path; int icon_size; int effective_icon_size; Gtk::Image image; Gtk::EventBox event_box; std::string category; std::string id; std::string status; std::string title; int32_t window_id; std::string icon_name; Glib::RefPtr icon_pixmap; Glib::RefPtr icon_theme; std::string overlay_icon_name; std::string attention_icon_name; std::string attention_movie_name; std::string icon_theme_path; std::string menu; DbusmenuGtkMenu* dbus_menu = nullptr; Gtk::Menu* gtk_menu = nullptr; bool item_is_menu; private: void proxyReady(Glib::RefPtr& result); void setProperty(const Glib::ustring& name, Glib::VariantBase& value); void getUpdatedProperties(); void processUpdatedProperties(Glib::RefPtr& result); void onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, const Glib::VariantContainerBase& arguments); void updateImage(); Glib::RefPtr extractPixBuf(GVariant* variant); Glib::RefPtr getIconByName(std::string name, int size); static void onMenuDestroyed(Item* self); bool makeMenu(GdkEventButton* const& ev); bool handleClick(GdkEventButton* const& /*ev*/); Glib::RefPtr cancellable_; Glib::RefPtr proxy_; std::vector default_icon_path_; bool update_pending_; }; } // namespace waybar::modules::SNI