#include #include #include #include namespace GUI { class NotificationServerConnection : public IPC::ServerConnection , public NotificationClientEndpoint { C_OBJECT(NotificationServerConnection) public: virtual void handshake() override { auto response = send_sync(); set_my_client_id(response->client_id()); } private: NotificationServerConnection() : IPC::ServerConnection(*this, "/tmp/portal/notify") { } virtual void handle(const Messages::NotificationClient::Dummy&) override {} }; Notification::Notification() { } Notification::~Notification() { } void Notification::show() { auto connection = NotificationServerConnection::construct(); connection->send_sync(m_text, m_title, m_icon ? m_icon->to_shareable_bitmap(connection->server_pid()) : Gfx::ShareableBitmap()); } }