mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +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
|
@ -33,7 +33,7 @@ void WMClientConnection::die()
|
|||
});
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::SetAppletAreaPosition& message)
|
||||
void WMClientConnection::set_applet_area_position(Gfx::IntPoint const& position)
|
||||
{
|
||||
if (m_window_id < 0) {
|
||||
did_misbehave("SetAppletAreaPosition: WM didn't assign window as manager yet");
|
||||
|
@ -41,17 +41,17 @@ void WMClientConnection::handle(const Messages::WindowManagerServer::SetAppletAr
|
|||
return;
|
||||
}
|
||||
|
||||
AppletManager::the().set_position(message.position());
|
||||
AppletManager::the().set_position(position);
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::SetActiveWindow& message)
|
||||
void WMClientConnection::set_active_window(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(message.client_id());
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("SetActiveWindow: Bad client ID");
|
||||
return;
|
||||
}
|
||||
auto it = client->m_windows.find(message.window_id());
|
||||
auto it = client->m_windows.find(window_id);
|
||||
if (it == client->m_windows.end()) {
|
||||
did_misbehave("SetActiveWindow: Bad window ID");
|
||||
return;
|
||||
|
@ -61,34 +61,34 @@ void WMClientConnection::handle(const Messages::WindowManagerServer::SetActiveWi
|
|||
WindowManager::the().move_to_front_and_make_active(window);
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::PopupWindowMenu& message)
|
||||
void WMClientConnection::popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint const& screen_position)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(message.client_id());
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("PopupWindowMenu: Bad client ID");
|
||||
return;
|
||||
}
|
||||
auto it = client->m_windows.find(message.window_id());
|
||||
auto it = client->m_windows.find(window_id);
|
||||
if (it == client->m_windows.end()) {
|
||||
did_misbehave("PopupWindowMenu: Bad window ID");
|
||||
return;
|
||||
}
|
||||
auto& window = *(*it).value;
|
||||
if (auto* modal_window = window.blocking_modal_window()) {
|
||||
modal_window->popup_window_menu(message.screen_position(), WindowMenuDefaultAction::BasedOnWindowState);
|
||||
modal_window->popup_window_menu(screen_position, WindowMenuDefaultAction::BasedOnWindowState);
|
||||
} else {
|
||||
window.popup_window_menu(message.screen_position(), WindowMenuDefaultAction::BasedOnWindowState);
|
||||
window.popup_window_menu(screen_position, WindowMenuDefaultAction::BasedOnWindowState);
|
||||
}
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::StartWindowResize& request)
|
||||
void WMClientConnection::start_window_resize(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(request.client_id());
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("WM_StartWindowResize: Bad client ID");
|
||||
return;
|
||||
}
|
||||
auto it = client->m_windows.find(request.window_id());
|
||||
auto it = client->m_windows.find(window_id);
|
||||
if (it == client->m_windows.end()) {
|
||||
did_misbehave("WM_StartWindowResize: Bad window ID");
|
||||
return;
|
||||
|
@ -99,52 +99,52 @@ void WMClientConnection::handle(const Messages::WindowManagerServer::StartWindow
|
|||
WindowManager::the().start_window_resize(window, Screen::the().cursor_location(), MouseButton::Left);
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::SetWindowMinimized& message)
|
||||
void WMClientConnection::set_window_minimized(i32 client_id, i32 window_id, bool minimized)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(message.client_id());
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("WM_SetWindowMinimized: Bad client ID");
|
||||
return;
|
||||
}
|
||||
auto it = client->m_windows.find(message.window_id());
|
||||
auto it = client->m_windows.find(window_id);
|
||||
if (it == client->m_windows.end()) {
|
||||
did_misbehave("WM_SetWindowMinimized: Bad window ID");
|
||||
return;
|
||||
}
|
||||
auto& window = *(*it).value;
|
||||
WindowManager::the().minimize_windows(window, message.minimized());
|
||||
WindowManager::the().minimize_windows(window, minimized);
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::SetEventMask& message)
|
||||
void WMClientConnection::set_event_mask(u32 event_mask)
|
||||
{
|
||||
m_event_mask = message.event_mask();
|
||||
m_event_mask = event_mask;
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::SetManagerWindow& message)
|
||||
void WMClientConnection::set_manager_window(i32 window_id)
|
||||
{
|
||||
m_window_id = message.window_id();
|
||||
m_window_id = window_id;
|
||||
|
||||
// Let the window manager know that we obtained a manager window, and should
|
||||
// receive information about other windows.
|
||||
WindowManager::the().greet_window_manager(*this);
|
||||
}
|
||||
|
||||
void WMClientConnection::handle(const Messages::WindowManagerServer::SetWindowTaskbarRect& message)
|
||||
void WMClientConnection::set_window_taskbar_rect(i32 client_id, i32 window_id, Gfx::IntRect const& rect)
|
||||
{
|
||||
// Because the Taskbar (which should be the only user of this API) does not own the
|
||||
// window or the client id, there is a possibility that it may send this message for
|
||||
// a window or client that may have been destroyed already. This is not an error,
|
||||
// and we should not call did_misbehave() for either.
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(message.client_id());
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
if (!client)
|
||||
return;
|
||||
|
||||
auto it = client->m_windows.find(message.window_id());
|
||||
auto it = client->m_windows.find(window_id);
|
||||
if (it == client->m_windows.end())
|
||||
return;
|
||||
|
||||
auto& window = *(*it).value;
|
||||
window.set_taskbar_rect(message.rect());
|
||||
window.set_taskbar_rect(rect);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue