1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

WindowServer: Port WindowServer to LibCore.

This was pretty straightforward thanks to the work I did separating out
LibCore from LibGUI already. :^)

- WSMessageLoop now inherits from CEventLoop.
- WSMessage now inherits from CEvent.
- WSMessageReceiver goes away.

Now there is only one event loop in Serenity. Very nice!
This commit is contained in:
Andreas Kling 2019-04-14 05:15:22 +02:00
parent 4132f645ee
commit de184d0999
20 changed files with 170 additions and 320 deletions

View file

@ -18,7 +18,7 @@ static GraphicsBitmap& default_window_icon()
return *s_icon;
}
WSWindow::WSWindow(WSMessageReceiver& internal_owner, WSWindowType type)
WSWindow::WSWindow(CObject& internal_owner, WSWindowType type)
: m_internal_owner(&internal_owner)
, m_type(type)
, m_icon(default_window_icon())
@ -130,10 +130,10 @@ void WSWindow::set_minimized(bool minimized)
WSWindowManager::the().notify_minimization_state_changed(*this);
}
void WSWindow::on_message(const WSMessage& message)
void WSWindow::event(CEvent& message)
{
if (m_internal_owner)
return m_internal_owner->on_message(message);
return m_internal_owner->event(message);
if (is_blocked_by_modal_window())
return;
@ -141,7 +141,7 @@ void WSWindow::on_message(const WSMessage& message)
WSAPI_ServerMessage server_message;
server_message.window_id = window_id();
if (message.is_mouse_event())
if (static_cast<WSMessage&>(message).is_mouse_event())
return handle_mouse_event(static_cast<const WSMouseEvent&>(message));
switch (message.type()) {