2018-08-29 20:36:39 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
#include <dbus-status-notifier-item.h>
|
|
|
|
|
|
|
|
namespace waybar::modules::SNI {
|
|
|
|
|
|
|
|
class Item {
|
|
|
|
public:
|
2018-09-04 23:50:08 +02:00
|
|
|
Item(std::string, std::string, Glib::Dispatcher*);
|
|
|
|
|
|
|
|
std::string bus_name;
|
|
|
|
std::string object_path;
|
|
|
|
Gtk::EventBox event_box;
|
|
|
|
|
2018-08-29 20:36:39 +02:00
|
|
|
int icon_size;
|
|
|
|
int effective_icon_size;
|
|
|
|
Gtk::Image* image;
|
|
|
|
std::string category;
|
|
|
|
std::string id;
|
|
|
|
std::string status;
|
|
|
|
|
|
|
|
std::string title;
|
|
|
|
int32_t window_id;
|
|
|
|
std::string icon_name;
|
2018-09-09 20:46:26 +02:00
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_pixmap;
|
2018-08-29 20:36:39 +02:00
|
|
|
std::string overlay_icon_name;
|
|
|
|
std::string attention_icon_name;
|
|
|
|
std::string attention_movie_name;
|
|
|
|
std::string icon_theme_path;
|
|
|
|
std::string menu;
|
|
|
|
bool item_is_menu;
|
|
|
|
private:
|
|
|
|
static void proxyReady(GObject* obj, GAsyncResult* res, gpointer data);
|
|
|
|
static void getAll(GObject* obj, GAsyncResult* res, gpointer data);
|
|
|
|
|
|
|
|
void updateImage();
|
2018-09-09 20:46:26 +02:00
|
|
|
Glib::RefPtr<Gdk::Pixbuf> extractPixBuf(GVariant* variant);
|
2018-08-29 20:36:39 +02:00
|
|
|
Glib::RefPtr<Gdk::Pixbuf> getIconByName(std::string name, int size);
|
2018-09-04 23:50:08 +02:00
|
|
|
Glib::Dispatcher* dp_;
|
2018-08-29 20:36:39 +02:00
|
|
|
GCancellable* cancellable_ = nullptr;
|
|
|
|
SnOrgKdeStatusNotifierItem* proxy_ = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|