mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:17:34 +00:00
Userland: Change IPC funcs to use plain arguments instead of a struct
Instead of having a single overloaded handle method each method gets its own unique method name now.
This commit is contained in:
parent
d47f15ab8b
commit
065040872f
50 changed files with 897 additions and 839 deletions
|
@ -28,17 +28,17 @@ void ClientConnection::die()
|
|||
s_connections.remove(client_id());
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::NotificationServer::Greet&)
|
||||
void ClientConnection::greet()
|
||||
{
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::NotificationServer::ShowNotification& message)
|
||||
void ClientConnection::show_notification(String const& text, String const& title, Gfx::ShareableBitmap const& icon)
|
||||
{
|
||||
auto window = NotificationWindow::construct(client_id(), message.text(), message.title(), message.icon());
|
||||
auto window = NotificationWindow::construct(client_id(), text, title, icon);
|
||||
window->show();
|
||||
}
|
||||
|
||||
void ClientConnection::handle([[maybe_unused]] const Messages::NotificationServer::CloseNotification& message)
|
||||
void ClientConnection::close_notification()
|
||||
{
|
||||
auto window = NotificationWindow::get_window_by_id(client_id());
|
||||
if (window) {
|
||||
|
@ -46,26 +46,26 @@ void ClientConnection::handle([[maybe_unused]] const Messages::NotificationServe
|
|||
}
|
||||
}
|
||||
|
||||
Messages::NotificationServer::UpdateNotificationIconResponse ClientConnection::handle(const Messages::NotificationServer::UpdateNotificationIcon& message)
|
||||
Messages::NotificationServer::UpdateNotificationIconResponse ClientConnection::update_notification_icon(Gfx::ShareableBitmap const& icon)
|
||||
{
|
||||
auto window = NotificationWindow::get_window_by_id(client_id());
|
||||
if (window) {
|
||||
window->set_image(message.icon());
|
||||
window->set_image(icon);
|
||||
}
|
||||
return !!window;
|
||||
}
|
||||
|
||||
Messages::NotificationServer::UpdateNotificationTextResponse ClientConnection::handle(const Messages::NotificationServer::UpdateNotificationText& message)
|
||||
Messages::NotificationServer::UpdateNotificationTextResponse ClientConnection::update_notification_text(String const& text, String const& title)
|
||||
{
|
||||
auto window = NotificationWindow::get_window_by_id(client_id());
|
||||
if (window) {
|
||||
window->set_text(message.text());
|
||||
window->set_title(message.title());
|
||||
window->set_text(text);
|
||||
window->set_title(title);
|
||||
}
|
||||
return !!window;
|
||||
}
|
||||
|
||||
Messages::NotificationServer::IsShowingResponse ClientConnection::handle(const Messages::NotificationServer::IsShowing&)
|
||||
Messages::NotificationServer::IsShowingResponse ClientConnection::is_showing()
|
||||
{
|
||||
auto window = NotificationWindow::get_window_by_id(client_id());
|
||||
return !!window;
|
||||
|
|
|
@ -23,12 +23,12 @@ public:
|
|||
private:
|
||||
explicit ClientConnection(NonnullRefPtr<Core::LocalSocket>, int client_id);
|
||||
|
||||
virtual void handle(const Messages::NotificationServer::Greet&) override;
|
||||
virtual void handle(const Messages::NotificationServer::ShowNotification&) override;
|
||||
virtual void handle(const Messages::NotificationServer::CloseNotification& message) override;
|
||||
virtual Messages::NotificationServer::UpdateNotificationIconResponse handle(const Messages::NotificationServer::UpdateNotificationIcon& message) override;
|
||||
virtual Messages::NotificationServer::UpdateNotificationTextResponse handle(const Messages::NotificationServer::UpdateNotificationText& message) override;
|
||||
virtual Messages::NotificationServer::IsShowingResponse handle(const Messages::NotificationServer::IsShowing& message) override;
|
||||
virtual void greet() override;
|
||||
virtual void show_notification(String const&, String const&, Gfx::ShareableBitmap const&) override;
|
||||
virtual void close_notification() override;
|
||||
virtual Messages::NotificationServer::UpdateNotificationIconResponse update_notification_icon(Gfx::ShareableBitmap const&) override;
|
||||
virtual Messages::NotificationServer::UpdateNotificationTextResponse update_notification_text(String const&, String const&) override;
|
||||
virtual Messages::NotificationServer::IsShowingResponse is_showing() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue