waybar/include/modules/sni/snh.hpp

38 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
#include <gtkmm.h>
2018-09-04 23:50:08 +02:00
#include <tuple>
#include <dbus-status-notifier-watcher.h>
#include "modules/sni/sni.hpp"
namespace waybar::modules::SNI {
class Host {
public:
2018-09-04 23:50:08 +02:00
Host(Glib::Dispatcher*);
std::vector<Item> items;
private:
static void busAcquired(GDBusConnection*, const gchar*, gpointer);
static void nameAppeared(GDBusConnection*, const gchar*, const gchar*,
gpointer);
static void nameVanished(GDBusConnection*, const gchar*, gpointer);
static void proxyReady(GObject*, GAsyncResult*, gpointer);
static void registerHost(GObject*, GAsyncResult*, gpointer);
2018-10-26 10:05:54 +02:00
static void itemRegistered(SnWatcher*, const gchar*, gpointer);
static void itemUnregistered(SnWatcher*, const gchar*, gpointer);
2018-09-04 23:50:08 +02:00
std::tuple<std::string, std::string> getBusNameAndObjectPath(const gchar*);
void addRegisteredItem(const gchar* service);
uint32_t bus_name_id_;
uint32_t watcher_id_;
std::string bus_name_;
std::string object_path_;
2018-09-04 23:50:08 +02:00
Glib::Dispatcher* dp_;
GCancellable* cancellable_ = nullptr;
2018-10-26 10:05:54 +02:00
SnWatcher* watcher_ = nullptr;
};
}