1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +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:
Gunnar Beutner 2021-05-02 19:54:34 +02:00 committed by Andreas Kling
parent d47f15ab8b
commit 065040872f
50 changed files with 897 additions and 839 deletions

View file

@ -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;