mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:37:35 +00:00
WindowServer: Rename WSEvent to WSMessage.
Also do the same for WSMessageLoop and WSMessageReceiver. More to come.
This commit is contained in:
parent
7cf3c7461c
commit
bba21adae3
16 changed files with 129 additions and 151 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "WSWindow.h"
|
||||
#include "WSWindowManager.h"
|
||||
#include "WSEvent.h"
|
||||
#include "WSEventLoop.h"
|
||||
#include "WSMessage.h"
|
||||
#include "WSMessageLoop.h"
|
||||
#include "Process.h"
|
||||
|
||||
WSWindow::WSWindow(Process& process, int window_id)
|
||||
|
@ -54,35 +54,35 @@ static GUI_MouseButton to_api(MouseButton button)
|
|||
}
|
||||
}
|
||||
|
||||
void WSWindow::event(WSEvent& event)
|
||||
void WSWindow::event(WSMessage& event)
|
||||
{
|
||||
GUI_Event gui_event;
|
||||
gui_event.window_id = window_id();
|
||||
|
||||
switch (event.type()) {
|
||||
case WSEvent::Paint:
|
||||
case WSMessage::Paint:
|
||||
gui_event.type = GUI_Event::Type::Paint;
|
||||
gui_event.paint.rect = static_cast<WSPaintEvent&>(event).rect();
|
||||
break;
|
||||
case WSEvent::MouseMove:
|
||||
case WSMessage::MouseMove:
|
||||
gui_event.type = GUI_Event::Type::MouseMove;
|
||||
gui_event.mouse.position = static_cast<WSMouseEvent&>(event).position();
|
||||
gui_event.mouse.button = GUI_MouseButton::NoButton;
|
||||
gui_event.mouse.buttons = static_cast<WSMouseEvent&>(event).buttons();
|
||||
break;
|
||||
case WSEvent::MouseDown:
|
||||
case WSMessage::MouseDown:
|
||||
gui_event.type = GUI_Event::Type::MouseDown;
|
||||
gui_event.mouse.position = static_cast<WSMouseEvent&>(event).position();
|
||||
gui_event.mouse.button = to_api(static_cast<WSMouseEvent&>(event).button());
|
||||
gui_event.mouse.buttons = static_cast<WSMouseEvent&>(event).buttons();
|
||||
break;
|
||||
case WSEvent::MouseUp:
|
||||
case WSMessage::MouseUp:
|
||||
gui_event.type = GUI_Event::Type::MouseUp;
|
||||
gui_event.mouse.position = static_cast<WSMouseEvent&>(event).position();
|
||||
gui_event.mouse.button = to_api(static_cast<WSMouseEvent&>(event).button());
|
||||
gui_event.mouse.buttons = static_cast<WSMouseEvent&>(event).buttons();
|
||||
break;
|
||||
case WSEvent::KeyDown:
|
||||
case WSMessage::KeyDown:
|
||||
gui_event.type = GUI_Event::Type::KeyDown;
|
||||
gui_event.key.character = static_cast<WSKeyEvent&>(event).character();
|
||||
gui_event.key.key = static_cast<WSKeyEvent&>(event).key();
|
||||
|
@ -90,19 +90,19 @@ void WSWindow::event(WSEvent& event)
|
|||
gui_event.key.ctrl = static_cast<WSKeyEvent&>(event).ctrl();
|
||||
gui_event.key.shift = static_cast<WSKeyEvent&>(event).shift();
|
||||
break;
|
||||
case WSEvent::WM_Invalidate:
|
||||
case WSMessage::WM_Invalidate:
|
||||
WSWindowManager::the().invalidate(*this, static_cast<WSWindowInvalidationEvent&>(event).rect());
|
||||
return;
|
||||
case WSEvent::WM_SetWindowRect:
|
||||
case WSMessage::WM_SetWindowRect:
|
||||
set_rect(static_cast<WSSetWindowRect&>(event).rect());
|
||||
return;
|
||||
case WSEvent::WM_SetWindowTitle:
|
||||
case WSMessage::WM_SetWindowTitle:
|
||||
set_title(static_cast<WSSetWindowTitle&>(event).title());
|
||||
return;
|
||||
case WSEvent::WindowActivated:
|
||||
case WSMessage::WindowActivated:
|
||||
gui_event.type = GUI_Event::Type::WindowActivated;
|
||||
break;
|
||||
case WSEvent::WindowDeactivated:
|
||||
case WSMessage::WindowDeactivated:
|
||||
gui_event.type = GUI_Event::Type::WindowDeactivated;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue