summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-15 09:17:18 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-15 09:17:18 +0100
commit29c49356e3229acb740f016d39629e322d31abd1 (patch)
tree3e9b6bb9cf4bdf2a002d68e8050ad76ed75297cc
parenta54cd84c5935437412d3986f7a02a4271ae1ae65 (diff)
downloadserenity-29c49356e3229acb740f016d39629e322d31abd1.zip
WindowServer: Rename GUI_Foo to WSAPI_Foo.
-rw-r--r--LibGUI/GEventLoop.cpp70
-rw-r--r--LibGUI/GEventLoop.h20
-rw-r--r--LibGUI/GMenu.cpp24
-rw-r--r--LibGUI/GMenuBar.cpp24
-rw-r--r--LibGUI/GWindow.cpp42
-rw-r--r--SharedGraphics/Painter.cpp10
-rw-r--r--SharedGraphics/Point.h6
-rw-r--r--SharedGraphics/Rect.h6
-rw-r--r--SharedGraphics/Size.h6
-rw-r--r--WindowServer/WSAPITypes.h54
-rw-r--r--WindowServer/WSClientConnection.cpp58
-rw-r--r--WindowServer/WSClientConnection.h4
-rw-r--r--WindowServer/WSMenu.cpp4
-rw-r--r--WindowServer/WSMessageLoop.cpp44
-rw-r--r--WindowServer/WSMessageLoop.h4
-rw-r--r--WindowServer/WSWindow.cpp32
16 files changed, 204 insertions, 204 deletions
diff --git a/LibGUI/GEventLoop.cpp b/LibGUI/GEventLoop.cpp
index f7cf99ca96..843c5144fb 100644
--- a/LibGUI/GEventLoop.cpp
+++ b/LibGUI/GEventLoop.cpp
@@ -112,7 +112,7 @@ void GEventLoop::post_event(GObject* receiver, OwnPtr<GEvent>&& event)
m_queued_events.append({ receiver, move(event) });
}
-void GEventLoop::handle_paint_event(const GUI_ServerMessage& event, GWindow& window)
+void GEventLoop::handle_paint_event(const WSAPI_ServerMessage& event, GWindow& window)
{
#ifdef GEVENTLOOP_DEBUG
dbgprintf("WID=%x Paint [%d,%d %dx%d]\n", event.window_id, event.paint.rect.location.x, event.paint.rect.location.y, event.paint.rect.size.width, event.paint.rect.size.height);
@@ -120,25 +120,25 @@ void GEventLoop::handle_paint_event(const GUI_ServerMessage& event, GWindow& win
post_event(&window, make<GPaintEvent>(event.paint.rect));
}
-void GEventLoop::handle_window_activation_event(const GUI_ServerMessage& event, GWindow& window)
+void GEventLoop::handle_window_activation_event(const WSAPI_ServerMessage& event, GWindow& window)
{
#ifdef GEVENTLOOP_DEBUG
dbgprintf("WID=%x WindowActivation\n", event.window_id);
#endif
- post_event(&window, make<GEvent>(event.type == GUI_ServerMessage::Type::WindowActivated ? GEvent::WindowBecameActive : GEvent::WindowBecameInactive));
+ post_event(&window, make<GEvent>(event.type == WSAPI_ServerMessage::Type::WindowActivated ? GEvent::WindowBecameActive : GEvent::WindowBecameInactive));
}
-void GEventLoop::handle_window_close_request_event(const GUI_ServerMessage&, GWindow& window)
+void GEventLoop::handle_window_close_request_event(const WSAPI_ServerMessage&, GWindow& window)
{
post_event(&window, make<GEvent>(GEvent::WindowCloseRequest));
}
-void GEventLoop::handle_key_event(const GUI_ServerMessage& event, GWindow& window)
+void GEventLoop::handle_key_event(const WSAPI_ServerMessage& event, GWindow& window)
{
#ifdef GEVENTLOOP_DEBUG
dbgprintf("WID=%x KeyEvent character=0x%b\n", event.window_id, event.key.character);
#endif
- auto key_event = make<GKeyEvent>(event.type == GUI_ServerMessage::Type::KeyDown ? GEvent::KeyDown : GEvent::KeyUp, event.key.key);
+ auto key_event = make<GKeyEvent>(event.type == WSAPI_ServerMessage::Type::KeyDown ? GEvent::KeyDown : GEvent::KeyUp, event.key.key);
key_event->m_alt = event.key.alt;
key_event->m_ctrl = event.key.ctrl;
key_event->m_shift = event.key.shift;
@@ -147,32 +147,32 @@ void GEventLoop::handle_key_event(const GUI_ServerMessage& event, GWindow& windo
post_event(&window, move(key_event));
}
-void GEventLoop::handle_mouse_event(const GUI_ServerMessage& event, GWindow& window)
+void GEventLoop::handle_mouse_event(const WSAPI_ServerMessage& event, GWindow& window)
{
#ifdef GEVENTLOOP_DEBUG
dbgprintf("WID=%x MouseEvent %d,%d\n", event.window_id, event.mouse.position.x, event.mouse.position.y);
#endif
GMouseEvent::Type type;
switch (event.type) {
- case GUI_ServerMessage::Type::MouseMove: type = GEvent::MouseMove; break;
- case GUI_ServerMessage::Type::MouseUp: type = GEvent::MouseUp; break;
- case GUI_ServerMessage::Type::MouseDown: type = GEvent::MouseDown; break;
+ case WSAPI_ServerMessage::Type::MouseMove: type = GEvent::MouseMove; break;
+ case WSAPI_ServerMessage::Type::MouseUp: type = GEvent::MouseUp; break;
+ case WSAPI_ServerMessage::Type::MouseDown: type = GEvent::MouseDown; break;
default: ASSERT_NOT_REACHED(); break;
}
GMouseButton button { GMouseButton::None };
switch (event.mouse.button) {
- case GUI_MouseButton::NoButton: button = GMouseButton::None; break;
- case GUI_MouseButton::Left: button = GMouseButton::Left; break;
- case GUI_MouseButton::Right: button = GMouseButton::Right; break;
- case GUI_MouseButton::Middle: button = GMouseButton::Middle; break;
+ case WSAPI_MouseButton::NoButton: button = GMouseButton::None; break;
+ case WSAPI_MouseButton::Left: button = GMouseButton::Left; break;
+ case WSAPI_MouseButton::Right: button = GMouseButton::Right; break;
+ case WSAPI_MouseButton::Middle: button = GMouseButton::Middle; break;
default: ASSERT_NOT_REACHED(); break;
}
post_event(&window, make<GMouseEvent>(type, event.mouse.position, event.mouse.buttons, button));
}
-void GEventLoop::handle_menu_event(const GUI_ServerMessage& event)
+void GEventLoop::handle_menu_event(const WSAPI_ServerMessage& event)
{
- if (event.type == GUI_ServerMessage::Type::MenuItemActivated) {
+ if (event.type == WSAPI_ServerMessage::Type::MenuItemActivated) {
auto* menu = GMenu::from_menu_id(event.menu.menu_id);
if (!menu) {
dbgprintf("GEventLoop received event for invalid window ID %d\n", event.window_id);
@@ -253,7 +253,7 @@ void GEventLoop::wait_for_event()
auto unprocessed_events = move(m_unprocessed_messages);
for (auto& event : unprocessed_events) {
- if (event.type == GUI_ServerMessage::Error) {
+ if (event.type == WSAPI_ServerMessage::Error) {
dbgprintf("GEventLoop got error message from server\n");
dbgprintf(" - error message: %s\n", String(event.text, event.text_length).characters());
exit(1);
@@ -261,7 +261,7 @@ void GEventLoop::wait_for_event()
}
switch (event.type) {
- case GUI_ServerMessage::MenuItemActivated:
+ case WSAPI_ServerMessage::MenuItemActivated:
handle_menu_event(event);
continue;
default:
@@ -274,23 +274,23 @@ void GEventLoop::wait_for_event()
continue;
}
switch (event.type) {
- case GUI_ServerMessage::Type::Paint:
+ case WSAPI_ServerMessage::Type::Paint:
handle_paint_event(event, *window);
break;
- case GUI_ServerMessage::Type::MouseDown:
- case GUI_ServerMessage::Type::MouseUp:
- case GUI_ServerMessage::Type::MouseMove:
+ case WSAPI_ServerMessage::Type::MouseDown:
+ case WSAPI_ServerMessage::Type::MouseUp:
+ case WSAPI_ServerMessage::Type::MouseMove:
handle_mouse_event(event, *window);
break;
- case GUI_ServerMessage::Type::WindowActivated:
- case GUI_ServerMessage::Type::WindowDeactivated:
+ case WSAPI_ServerMessage::Type::WindowActivated:
+ case WSAPI_ServerMessage::Type::WindowDeactivated:
handle_window_activation_event(event, *window);
break;
- case GUI_ServerMessage::Type::WindowCloseRequest:
+ case WSAPI_ServerMessage::Type::WindowCloseRequest:
handle_window_close_request_event(event, *window);
break;
- case GUI_ServerMessage::Type::KeyDown:
- case GUI_ServerMessage::Type::KeyUp:
+ case WSAPI_ServerMessage::Type::KeyDown:
+ case WSAPI_ServerMessage::Type::KeyUp:
handle_key_event(event, *window);
break;
default:
@@ -302,8 +302,8 @@ void GEventLoop::wait_for_event()
bool GEventLoop::drain_messages_from_server()
{
for (;;) {
- GUI_ServerMessage message;
- ssize_t nread = read(m_event_fd, &message, sizeof(GUI_ServerMessage));
+ WSAPI_ServerMessage message;
+ ssize_t nread = read(m_event_fd, &message, sizeof(WSAPI_ServerMessage));
if (nread < 0) {
perror("read");
exit(1);
@@ -376,13 +376,13 @@ void GEventLoop::unregister_notifier(Badge<GNotifier>, GNotifier& notifier)
m_notifiers.remove(&notifier);
}
-bool GEventLoop::post_message_to_server(const GUI_ClientMessage& message)
+bool GEventLoop::post_message_to_server(const WSAPI_ClientMessage& message)
{
- int nwritten = write(m_event_fd, &message, sizeof(GUI_ClientMessage));
- return nwritten == sizeof(GUI_ClientMessage);
+ int nwritten = write(m_event_fd, &message, sizeof(WSAPI_ClientMessage));
+ return nwritten == sizeof(WSAPI_ClientMessage);
}
-bool GEventLoop::wait_for_specific_event(GUI_ServerMessage::Type type, GUI_ServerMessage& event)
+bool GEventLoop::wait_for_specific_event(WSAPI_ServerMessage::Type type, WSAPI_ServerMessage& event)
{
for (;;) {
fd_set rfds;
@@ -404,12 +404,12 @@ bool GEventLoop::wait_for_specific_event(GUI_ServerMessage::Type type, GUI_Serve
}
}
-GUI_ServerMessage GEventLoop::sync_request(const GUI_ClientMessage& request, GUI_ServerMessage::Type response_type)
+WSAPI_ServerMessage GEventLoop::sync_request(const WSAPI_ClientMessage& request, WSAPI_ServerMessage::Type response_type)
{
bool success = post_message_to_server(request);
ASSERT(success);
- GUI_ServerMessage response;
+ WSAPI_ServerMessage response;
success = GEventLoop::main().wait_for_specific_event(response_type, response);
ASSERT(success);
return response;
diff --git a/LibGUI/GEventLoop.h b/LibGUI/GEventLoop.h
index bc9b5894bb..1918e732cf 100644
--- a/LibGUI/GEventLoop.h
+++ b/LibGUI/GEventLoop.h
@@ -34,20 +34,20 @@ public:
void exit(int);
- bool post_message_to_server(const GUI_ClientMessage&);
- bool wait_for_specific_event(GUI_ServerMessage::Type, GUI_ServerMessage&);
+ bool post_message_to_server(const WSAPI_ClientMessage&);
+ bool wait_for_specific_event(WSAPI_ServerMessage::Type, WSAPI_ServerMessage&);
- GUI_ServerMessage sync_request(const GUI_ClientMessage& request, GUI_ServerMessage::Type response_type);
+ WSAPI_ServerMessage sync_request(const WSAPI_ClientMessage& request, WSAPI_ServerMessage::Type response_type);
private:
void wait_for_event();
bool drain_messages_from_server();
- void handle_paint_event(const GUI_ServerMessage&, GWindow&);
- void handle_mouse_event(const GUI_ServerMessage&, GWindow&);
- void handle_key_event(const GUI_ServerMessage&, GWindow&);
- void handle_window_activation_event(const GUI_ServerMessage&, GWindow&);
- void handle_window_close_request_event(const GUI_ServerMessage&, GWindow&);
- void handle_menu_event(const GUI_ServerMessage&);
+ void handle_paint_event(const WSAPI_ServerMessage&, GWindow&);
+ void handle_mouse_event(const WSAPI_ServerMessage&, GWindow&);
+ void handle_key_event(const WSAPI_ServerMessage&, GWindow&);
+ void handle_window_activation_event(const WSAPI_ServerMessage&, GWindow&);
+ void handle_window_close_request_event(const WSAPI_ServerMessage&, GWindow&);
+ void handle_menu_event(const WSAPI_ServerMessage&);
void get_next_timer_expiration(timeval&);
struct QueuedEvent {
@@ -56,7 +56,7 @@ private:
};
Vector<QueuedEvent> m_queued_events;
- Vector<GUI_ServerMessage> m_unprocessed_messages;
+ Vector<WSAPI_ServerMessage> m_unprocessed_messages;
int m_event_fd { -1 };
bool m_running { false };
diff --git a/LibGUI/GMenu.cpp b/LibGUI/GMenu.cpp
index 2852e4090f..105b9a93ba 100644
--- a/LibGUI/GMenu.cpp
+++ b/LibGUI/GMenu.cpp
@@ -41,34 +41,34 @@ void GMenu::add_separator()
int GMenu::realize_menu()
{
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::CreateMenu;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::CreateMenu;
ASSERT(m_name.length() < sizeof(request.text));
strcpy(request.text, m_name.characters());
request.text_length = m_name.length();
- auto response = GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidCreateMenu);
+ auto response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidCreateMenu);
m_menu_id = response.menu.menu_id;
ASSERT(m_menu_id > 0);
for (size_t i = 0; i < m_items.size(); ++i) {
auto& item = *m_items[i];
if (item.type() == GMenuItem::Separator) {
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::AddMenuSeparator;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::AddMenuSeparator;
request.menu.menu_id = m_menu_id;
- GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidAddMenuSeparator);
+ GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidAddMenuSeparator);
continue;
}
if (item.type() == GMenuItem::Action) {
auto& action = *item.action();
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::AddMenuItem;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::AddMenuItem;
request.menu.menu_id = m_menu_id;
request.menu.identifier = i;
ASSERT(action.text().length() < sizeof(request.text));
strcpy(request.text, action.text().characters());
request.text_length = action.text().length();
- GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidAddMenuItem);
+ GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidAddMenuItem);
}
}
all_menus().set(m_menu_id, this);
@@ -80,10 +80,10 @@ void GMenu::unrealize_menu()
if (!m_menu_id)
return;
all_menus().remove(m_menu_id);
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::DestroyMenu;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::DestroyMenu;
request.menu.menu_id = m_menu_id;
- GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidDestroyMenu);
+ GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidDestroyMenu);
m_menu_id = 0;
}
diff --git a/LibGUI/GMenuBar.cpp b/LibGUI/GMenuBar.cpp
index 574ab8b3cb..1cce445e69 100644
--- a/LibGUI/GMenuBar.cpp
+++ b/LibGUI/GMenuBar.cpp
@@ -17,9 +17,9 @@ void GMenuBar::add_menu(OwnPtr<GMenu>&& menu)
int GMenuBar::realize_menubar()
{
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::CreateMenubar;
- GUI_ServerMessage response = GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidCreateMenubar);
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::CreateMenubar;
+ WSAPI_ServerMessage response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidCreateMenubar);
return response.menu.menubar_id;
}
@@ -27,10 +27,10 @@ void GMenuBar::unrealize_menubar()
{
if (!m_menubar_id)
return;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::DestroyMenubar;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::DestroyMenubar;
request.menu.menubar_id = m_menubar_id;
- GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidDestroyMenubar);
+ GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidDestroyMenubar);
m_menubar_id = 0;
}
@@ -43,16 +43,16 @@ void GMenuBar::notify_added_to_application(Badge<GApplication>)
ASSERT(menu);
int menu_id = menu->realize_menu();
ASSERT(menu_id > 0);
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::AddMenuToMenubar;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::AddMenuToMenubar;
request.menu.menubar_id = m_menubar_id;
request.menu.menu_id = menu_id;
- GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidAddMenuToMenubar);
+ GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidAddMenuToMenubar);
}
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::SetApplicationMenubar;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::SetApplicationMenubar;
request.menu.menubar_id = m_menubar_id;
- GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidSetApplicationMenubar);
+ GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidSetApplicationMenubar);
}
void GMenuBar::notify_removed_from_application(Badge<GApplication>)
diff --git a/LibGUI/GWindow.cpp b/LibGUI/GWindow.cpp
index a50f7804fc..c3e74186b9 100644
--- a/LibGUI/GWindow.cpp
+++ b/LibGUI/GWindow.cpp
@@ -55,14 +55,14 @@ void GWindow::show()
if (m_window_id)
return;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::CreateWindow;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::CreateWindow;
request.window_id = m_window_id;
request.window.rect = m_rect_when_windowless;
ASSERT(m_title_when_windowless.length() < sizeof(request.text));
strcpy(request.text, m_title_when_windowless.characters());
request.text_length = m_title_when_windowless.length();
- auto response = GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidCreateWindow);
+ auto response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidCreateWindow);
m_window_id = response.window_id;
windows().set(m_window_id, this);
@@ -74,8 +74,8 @@ void GWindow::hide()
if (!m_window_id)
return;
windows().remove(m_window_id);
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::DestroyWindow;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::DestroyWindow;
request.window_id = m_window_id;
ASSERT(m_title_when_windowless.length() < sizeof(request.text));
strcpy(request.text, m_title_when_windowless.characters());
@@ -89,8 +89,8 @@ void GWindow::set_title(String&& title)
if (!m_window_id)
return;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::SetWindowTitle;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::SetWindowTitle;
request.window_id = m_window_id;
ASSERT(m_title_when_windowless.length() < sizeof(request.text));
strcpy(request.text, m_title_when_windowless.characters());
@@ -103,13 +103,13 @@ String GWindow::title() const
if (!m_window_id)
return m_title_when_windowless;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::GetWindowTitle;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::GetWindowTitle;
request.window_id = m_window_id;
ASSERT(m_title_when_windowless.length() < sizeof(request.text));
strcpy(request.text, m_title_when_windowless.characters());
request.text_length = m_title_when_windowless.length();
- auto response = GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidGetWindowTitle);
+ auto response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidGetWindowTitle);
return String(response.text, response.text_length);
}
@@ -118,10 +118,10 @@ Rect GWindow::rect() const
if (!m_window_id)
return m_rect_when_windowless;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::GetWindowRect;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::GetWindowRect;
request.window_id = m_window_id;
- auto response = GEventLoop::main().sync_request(request, GUI_ServerMessage::Type::DidGetWindowRect);
+ auto response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::Type::DidGetWindowRect);
ASSERT(response.window_id == m_window_id);
return response.window.rect;
}
@@ -131,8 +131,8 @@ void GWindow::set_rect(const Rect& a_rect)
m_rect_when_windowless = a_rect;
if (!m_window_id)
return;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::SetWindowRect;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::SetWindowRect;
request.window_id = m_window_id;
request.window.rect = a_rect;
GEventLoop::main().post_message_to_server(request);
@@ -170,8 +170,8 @@ void GWindow::event(GEvent& event)
rect = m_main_widget->rect();
m_main_widget->event(*make<GPaintEvent>(rect));
if (m_window_id) {
- GUI_ClientMessage message;
- message.type = GUI_ClientMessage::Type::DidFinishPainting;
+ WSAPI_ClientMessage message;
+ message.type = WSAPI_ClientMessage::Type::DidFinishPainting;
message.window_id = m_window_id;
message.window.rect = rect;
GEventLoop::main().post_message_to_server(message);
@@ -223,8 +223,8 @@ void GWindow::update(const Rect& a_rect)
}
m_pending_paint_event_rects.append(a_rect);
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::InvalidateRect;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::InvalidateRect;
request.window_id = m_window_id;
request.window.rect = a_rect;
GEventLoop::main().post_message_to_server(request);
@@ -272,8 +272,8 @@ void GWindow::set_global_cursor_tracking_widget(GWidget* widget)
return;
m_global_cursor_tracking_widget = widget ? widget->make_weak_ptr() : nullptr;
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::SetGlobalCursorTracking;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::SetGlobalCursorTracking;
request.window_id = m_window_id;
request.value = widget != nullptr;
// FIXME: What if the cursor moves out of our interest range before the server can handle this?
diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp
index acc51b7a95..e65ecbcbad 100644
--- a/SharedGraphics/Painter.cpp
+++ b/SharedGraphics/Painter.cpp
@@ -26,10 +26,10 @@ Painter::Painter(GraphicsBitmap& bitmap)
Painter::Painter(GWidget& widget)
: m_font(&widget.font())
{
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::GetWindowBackingStore;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::GetWindowBackingStore;
request.window_id = widget.window()->window_id();
- auto response = GEventLoop::main().sync_request(request, GUI_ServerMessage::DidGetWindowBackingStore);
+ auto response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::DidGetWindowBackingStore);
m_backing_store_id = response.backing.backing_store_id;
m_target = GraphicsBitmap::create_wrapper(response.backing.size, response.backing.pixels);
@@ -53,8 +53,8 @@ Painter::~Painter()
#ifdef USERLAND
m_target = nullptr;
if (m_backing_store_id) {
- GUI_ClientMessage request;
- request.type = GUI_ClientMessage::Type::ReleaseWindowBackingStore;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::ReleaseWindowBackingStore;
request.backing.backing_store_id = m_backing_store_id;
GEventLoop::main().post_message_to_server(request);
}
diff --git a/SharedGraphics/Point.h b/SharedGraphics/Point.h
index fd1cc28c1e..cf5fd11ef6 100644
--- a/SharedGraphics/Point.h
+++ b/SharedGraphics/Point.h
@@ -3,13 +3,13 @@
#include <AK/AKString.h>
class Rect;
-struct GUI_Point;
+struct WSAPI_Point;
class Point {
public:
Point() { }
Point(int x, int y) : m_x(x) , m_y(y) { }
- Point(const GUI_Point&);
+ Point(const WSAPI_Point&);
int x() const { return m_x; }
int y() const { return m_y; }
@@ -48,7 +48,7 @@ public:
return !(*this == other);
}
- operator GUI_Point() const;
+ operator WSAPI_Point() const;
String to_string() const { return String::format("[%d,%d]", x(), y()); }
private:
diff --git a/SharedGraphics/Rect.h b/SharedGraphics/Rect.h
index d7ed95dcd1..931f230b6e 100644
--- a/SharedGraphics/Rect.h
+++ b/SharedGraphics/Rect.h
@@ -4,7 +4,7 @@
#include "Size.h"
#include <AK/AKString.h>
-struct GUI_Rect;
+struct WSAPI_Rect;
class Rect {
public:
@@ -25,7 +25,7 @@ public:
{
}
- Rect(const GUI_Rect&);
+ Rect(const WSAPI_Rect&);
bool is_null() const
{
@@ -170,7 +170,7 @@ public:
Point location() const { return m_location; }
Size size() const { return m_size; }
- operator GUI_Rect() const;
+ operator WSAPI_Rect() const;
bool operator==(const Rect& other) const
{
diff --git a/SharedGraphics/Size.h b/SharedGraphics/Size.h
index 7fe41d125d..d5d914af19 100644
--- a/SharedGraphics/Size.h
+++ b/SharedGraphics/Size.h
@@ -2,13 +2,13 @@
#include <AK/AKString.h>
-struct GUI_Size;
+struct WSAPI_Size;
class Size {
public:
Size() { }
Size(int w, int h) : m_width(w), m_height(h) { }
- Size(const GUI_Size&);
+ Size(const WSAPI_Size&);
bool is_empty() const { return !m_width || !m_height; }
@@ -38,7 +38,7 @@ public:
return *this;
}
- operator GUI_Size() const;
+ operator WSAPI_Size() const;
String to_string() const { return String::format("[%d,%d]", m_width, m_height); }
diff --git a/WindowServer/WSAPITypes.h b/WindowServer/WSAPITypes.h
index 29c2ef240d..ac55785b53 100644
--- a/WindowServer/WSAPITypes.h
+++ b/WindowServer/WSAPITypes.h
@@ -5,57 +5,57 @@
// GUI system call API types.
-struct GUI_WindowFlags { enum {
+struct WSAPI_WindowFlags { enum {
Visible = 1 << 0,
}; };
-typedef unsigned GUI_Color;
+typedef unsigned WSAPI_Color;
-struct GUI_Point {
+struct WSAPI_Point {
int x;
int y;
};
-struct GUI_Size {
+struct WSAPI_Size {
int width;
int height;
};
-struct GUI_Rect {
- GUI_Point location;
- GUI_Size size;
+struct WSAPI_Rect {
+ WSAPI_Point location;
+ WSAPI_Size size;
};
-struct GUI_WindowParameters {
- GUI_Rect rect;
+struct WSAPI_WindowParameters {
+ WSAPI_Rect rect;
Color background_color;
unsigned flags { 0 };
char title[128];
};
-struct GUI_WindowBackingStoreInfo {
+struct WSAPI_WindowBackingStoreInfo {
void* backing_store_id;
- GUI_Size size;
+ WSAPI_Size size;
size_t bpp;
size_t pitch;
RGBA32* pixels;
};
-enum class GUI_MouseButton : unsigned char {
+enum class WSAPI_MouseButton : unsigned char {
NoButton = 0,
Left = 1,
Right = 2,
Middle = 4,
};
-struct GUI_KeyModifiers { enum {
+struct WSAPI_KeyModifiers { enum {
Shift = 1 << 0,
Alt = 1 << 1,
Ctrl = 1 << 2,
}; };
-struct GUI_ServerMessage {
+struct WSAPI_ServerMessage {
enum Type : unsigned {
Invalid,
Error,
@@ -90,14 +90,14 @@ struct GUI_ServerMessage {
union {
struct {
- GUI_Rect rect;
+ WSAPI_Rect rect;
} window;
struct {
- GUI_Rect rect;
+ WSAPI_Rect rect;
} paint;
struct {
- GUI_Point position;
- GUI_MouseButton button;
+ WSAPI_Point position;
+ WSAPI_MouseButton button;
unsigned buttons;
} mouse;
struct {
@@ -115,7 +115,7 @@ struct GUI_ServerMessage {
} menu;
struct {
void* backing_store_id;
- GUI_Size size;
+ WSAPI_Size size;
size_t bpp;
size_t pitch;
RGBA32* pixels;
@@ -123,7 +123,7 @@ struct GUI_ServerMessage {
};
};
-struct GUI_ClientMessage {
+struct WSAPI_ClientMessage {
enum Type : unsigned {
Invalid,
CreateMenubar,
@@ -159,7 +159,7 @@ struct GUI_ClientMessage {
unsigned identifier;
} menu;
struct {
- GUI_Rect rect;
+ WSAPI_Rect rect;
} window;
struct {
void* backing_store_id;
@@ -167,9 +167,9 @@ struct GUI_ClientMessage {
};
};
-inline Rect::Rect(const GUI_Rect& r) : Rect(r.location, r.size) { }
-inline Point::Point(const GUI_Point& p) : Point(p.x, p.y) { }
-inline Size::Size(const GUI_Size& s) : Size(s.width, s.height) { }
-inline Rect::operator GUI_Rect() const { return { m_location, m_size }; }
-inline Point::operator GUI_Point() const { return { m_x, m_y }; }
-inline Size::operator GUI_Size() const { return { m_width, m_height }; }
+inline Rect::Rect(const WSAPI_Rect& r) : Rect(r.location, r.size) { }
+inline Point::Point(const WSAPI_Point& p) : Point(p.x, p.y) { }
+inline Size::Size(const WSAPI_Size& s) : Size(s.width, s.height) { }
+inline Rect::operator WSAPI_Rect() const { return { m_location, m_size }; }
+inline Point::operator WSAPI_Point() const { return { m_x, m_y }; }
+inline Size::operator WSAPI_Size() const { return { m_width, m_height }; }
diff --git a/WindowServer/WSClientConnection.cpp b/WindowServer/WSClientConnection.cpp
index 16e994e293..ea134818a1 100644
--- a/WindowServer/WSClientConnection.cpp
+++ b/WindowServer/WSClientConnection.cpp
@@ -69,15 +69,15 @@ WSClientConnection::~WSClientConnection()
void WSClientConnection::post_error(const String& error_message)
{
dbgprintf("WSClientConnection::post_error: client_id=%d: %s\n", m_client_id, error_message.characters());
- GUI_ServerMessage message;
- message.type = GUI_ServerMessage::Type::Error;
+ WSAPI_ServerMessage message;
+ message.type = WSAPI_ServerMessage::Type::Error;
ASSERT(error_message.length() < sizeof(message.text));
strcpy(message.text, error_message.characters());
message.text_length = error_message.length();
WSMessageLoop::the().post_message_to_client(m_client_id, message);
}
-void WSClientConnection::post_message(const GUI_ServerMessage& message)
+void WSClientConnection::post_message(const WSAPI_ServerMessage& message)
{
int nwritten = WSMessageLoop::the().server_process().sys$write(m_fd, &message, sizeof(message));
ASSERT(nwritten == sizeof(message));
@@ -110,8 +110,8 @@ void WSClientConnection::handle_request(WSAPICreateMenubarRequest& request)
int menubar_id = m_next_menubar_id++;
auto menubar = make<WSMenuBar>(request.client_id(), menubar_id);
m_menubars.set(menubar_id, move(menubar));
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidCreateMenubar;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidCreateMenubar;
response.menu.menubar_id = menubar_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -127,8 +127,8 @@ void WSClientConnection::handle_request(WSAPIDestroyMenubarRequest& request)
auto& menubar = *(*it).value;
WSWindowManager::the().close_menubar(menubar);
m_menubars.remove(it);
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidDestroyMenubar;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidDestroyMenubar;
response.menu.menubar_id = menubar_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -138,8 +138,8 @@ void WSClientConnection::handle_request(WSAPICreateMenuRequest& request)
int menu_id = m_next_menu_id++;
auto menu = make<WSMenu>(request.client_id(), menu_id, request.text());
m_menus.set(menu_id, move(menu));
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidCreateMenu;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidCreateMenu;
response.menu.menu_id = menu_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -155,8 +155,8 @@ void WSClientConnection::handle_request(WSAPIDestroyMenuRequest& request)
auto& menu = *(*it).value;
WSWindowManager::the().close_menu(menu);
m_menus.remove(it);
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidDestroyMenu;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidDestroyMenu;
response.menu.menu_id = menu_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -172,8 +172,8 @@ void WSClientConnection::handle_request(WSAPISetApplicationMenubarRequest& reque
auto& menubar = *(*it).value;
m_app_menubar = menubar.make_weak_ptr();
WSWindowManager::the().notify_client_changed_app_menubar(*this);
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidSetApplicationMenubar;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidSetApplicationMenubar;
response.menu.menubar_id = menubar_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -195,8 +195,8 @@ void WSClientConnection::handle_request(WSAPIAddMenuToMenubarRequest& request)
auto& menubar = *(*it).value;
auto& menu = *(*jt).value;
menubar.add_menu(&menu);
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidAddMenuToMenubar;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidAddMenuToMenubar;
response.menu.menubar_id = menubar_id;
response.menu.menu_id = menu_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
@@ -214,8 +214,8 @@ void WSClientConnection::handle_request(WSAPIAddMenuItemRequest& request)
}
auto& menu = *(*it).value;
menu.add_item(make<WSMenuItem>(identifier, move(text)));
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidAddMenuItem;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidAddMenuItem;
response.menu.menu_id = menu_id;
response.menu.identifier = identifier;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
@@ -231,8 +231,8 @@ void WSClientConnection::handle_request(WSAPIAddMenuSeparatorRequest& request)
}
auto& menu = *(*it).value;
menu.add_item(make<WSMenuItem>(WSMenuItem::Separator));
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidAddMenuSeparator;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidAddMenuSeparator;
response.menu.menu_id = menu_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -258,8 +258,8 @@ void WSClientConnection::handle_request(WSAPIGetWindowTitleRequest& request)
return;
}
auto& window = *(*it).value;
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidGetWindowTitle;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidGetWindowTitle;
response.window_id = window.window_id();
ASSERT(window.title().length() < sizeof(response.text));
strcpy(response.text, window.title().characters());
@@ -288,8 +288,8 @@ void WSClientConnection::handle_request(WSAPIGetWindowRectRequest& request)
return;
}
auto& window = *(*it).value;
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidGetWindowRect;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidGetWindowRect;
response.window_id = window.window_id();
response.window.rect = window.rect();
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
@@ -302,8 +302,8 @@ void WSClientConnection::handle_request(WSAPICreateWindowRequest& request)
window->set_title(request.title());
window->set_rect(request.rect());
m_windows.set(window_id, move(window));
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidCreateWindow;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidCreateWindow;
response.window_id = window_id;
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
}
@@ -329,8 +329,8 @@ void WSClientConnection::handle_request(WSAPIInvalidateRectRequest& request)
post_error("Bad window ID");
return;
}
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::Paint;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::Paint;
response.window_id = window_id;
response.paint.rect = request.rect();
WSMessageLoop::the().post_message_to_client(request.client_id(), response);
@@ -362,8 +362,8 @@ void WSClientConnection::handle_request(WSAPIGetWindowBackingStoreRequest& reque
// FIXME: It shouldn't work this way!
backing_store->retain();
- GUI_ServerMessage response;
- response.type = GUI_ServerMessage::Type::DidGetWindowBackingStore;
+ WSAPI_ServerMessage response;
+ response.type = WSAPI_ServerMessage::Type::DidGetWindowBackingStore;
response.window_id = window_id;
response.backing.backing_store_id = backing_store;
response.backing.bpp = sizeof(RGBA32);
diff --git a/WindowServer/WSClientConnection.h b/WindowServer/WSClientConnection.h
index 34e4f884e4..b8b09018e2 100644
--- a/WindowServer/WSClientConnection.h
+++ b/WindowServer/WSClientConnection.h
@@ -11,7 +11,7 @@
class WSWindow;
class WSMenu;
class WSMenuBar;
-struct GUI_ServerMessage;
+struct WSAPI_ServerMessage;
// FIXME: Remove.
class Process;
@@ -25,7 +25,7 @@ public:
static WSClientConnection* ensure_for_client_id(int client_id);
static void for_each_client(Function<void(WSClientConnection&)>);
- void post_message(const GUI_ServerMessage&);
+ void post_message(const WSAPI_ServerMessage&);
RetainPtr<GraphicsBitmap> create_bitmap(const Size&);
int client_id() const { return m_client_id; }
diff --git a/WindowServer/WSMenu.cpp b/WindowServer/WSMenu.cpp
index e39c850015..04201f7a15 100644
--- a/WindowServer/WSMenu.cpp
+++ b/WindowServer/WSMenu.cpp
@@ -139,8 +139,8 @@ void WSMenu::did_activate(WSMenuItem& item)
close();
- GUI_ServerMessage message;
- message.type = GUI_ServerMessage::Type::MenuItemActivated;
+ WSAPI_ServerMessage message;
+ message.type = WSAPI_ServerMessage::Type::MenuItemActivated;
message.menu.menu_id = m_menu_id;
message.menu.identifier = item.identifier();
diff --git a/WindowServer/WSMessageLoop.cpp b/WindowServer/WSMessageLoop.cpp
index 644aa99922..de550148c2 100644
--- a/WindowServer/WSMessageLoop.cpp
+++ b/WindowServer/WSMessageLoop.cpp
@@ -87,7 +87,7 @@ Process* WSMessageLoop::process_from_client_id(int client_id)
return (Process*)client_id;
}
-void WSMessageLoop::post_message_to_client(int client_id, const GUI_ServerMessage& message)
+void WSMessageLoop::post_message_to_client(int client_id, const WSAPI_ServerMessage& message)
{
auto* client = WSClientConnection::from_client_id(client_id);
if (!client)
@@ -245,7 +245,7 @@ void WSMessageLoop::wait_for_message()
WSClientConnection::for_each_client([&] (WSClientConnection& client) {
if (bitmap.get(client.fd())) {
byte buffer[4096];
- ssize_t nread = m_server_process->sys$read(client.fd(), buffer, sizeof(GUI_ClientMessage));
+ ssize_t nread = m_server_process->sys$read(client.fd(), buffer, sizeof(WSAPI_ClientMessage));
on_receive_from_client(client.client_id(), buffer, nread);
}
});
@@ -323,66 +323,66 @@ ssize_t WSMessageLoop::on_receive_from_client(int client_id, const byte* data, s
WSClientConnection* client = WSClientConnection::ensure_for_client_id(client_id);
- ASSERT(size == sizeof(GUI_ClientMessage));
- auto& message = *reinterpret_cast<const GUI_ClientMessage*>(data);
+ ASSERT(size == sizeof(WSAPI_ClientMessage));
+ auto& message = *reinterpret_cast<const WSAPI_ClientMessage*>(data);
switch (message.type) {
- case GUI_ClientMessage::Type::CreateMenubar:
+ case WSAPI_ClientMessage::Type::CreateMenubar:
post_message(client, make<WSAPICreateMenubarRequest>(client_id));
break;
- case GUI_ClientMessage::Type::DestroyMenubar:
+ case WSAPI_ClientMessage::Type::DestroyMenubar:
post_message(client, make<WSAPIDestroyMenubarRequest>(client_id, message.menu.menubar_id));
break;
- case GUI_ClientMessage::Type::SetApplicationMenubar:
+ case WSAPI_ClientMessage::Type::SetApplicationMenubar:
post_message(client, make<WSAPISetApplicationMenubarRequest>(client_id, message.menu.menubar_id));
break;
- case GUI_ClientMessage::Type::AddMenuToMenubar:
+ case WSAPI_ClientMessage::Type::AddMenuToMenubar:
post_message(client, make<WSAPIAddMenuToMenubarRequest>(client_id, message.menu.menubar_id, message.menu.menu_id));
break;
- case GUI_ClientMessage::Type::CreateMenu:
+ case WSAPI_ClientMessage::Type::CreateMenu:
ASSERT(message.text_length < sizeof(message.text));
post_message(client, make<WSAPICreateMenuRequest>(client_id, String(message.text, message.text_length)));
break;
- case GUI_ClientMessage::Type::DestroyMenu:
+ case WSAPI_ClientMessage::Type::DestroyMenu:
post_message(client, make<WSAPIDestroyMenuRequest>(client_id, message.menu.menu_id));
break;
- case GUI_ClientMessage::Type::AddMenuItem:
+ case WSAPI_ClientMessage::Type::AddMenuItem:
ASSERT(message.text_length < sizeof(message.text));
post_message(client, make<WSAPIAddMenuItemRequest>(client_id, message.menu.menu_id, message.menu.identifier, String(message.text, message.text_length)));
break;
- case GUI_ClientMessage::Type::CreateWindow:
+ case WSAPI_ClientMessage::Type::CreateWindow:
ASSERT(message.text_length < sizeof(message.text));
post_message(client, make<WSAPICreateWindowRequest>(client_id, message.window.rect, String(message.text, message.text_length)));
break;
- case GUI_ClientMessage::Type::DestroyWindow:
+ case WSAPI_ClientMessage::Type::DestroyWindow:
post_message(client, make<WSAPIDestroyWindowRequest>(client_id, message.window_id));
break;
- case GUI_ClientMessage::Type::SetWindowTitle:
+ case WSAPI_ClientMessage::Type::SetWindowTitle:
ASSERT(message.text_length < sizeof(message.text));
post_message(client, make<WSAPISetWindowTitleRequest>(client_id, message.window_id, String(message.text, message.text_length)));
break;
- case GUI_ClientMessage::Type::GetWindowTitle:
+ case WSAPI_ClientMessage::Type::GetWindowTitle:
ASSERT(message.text_length < sizeof(message.text));
post_message(client, make<WSAPIGetWindowTitleRequest>(client_id, message.window_id));
break;
- case GUI_ClientMessage::Type::SetWindowRect:
+ case WSAPI_ClientMessage::Type::SetWindowRect:
post_message(client, make<WSAPISetWindowRectRequest>(client_id, message.window_id, message.window.rect));
break;
- case GUI_ClientMessage::Type::GetWindowRect:
+ case WSAPI_ClientMessage::Type::GetWindowRect:
post_message(client, make<WSAPIGetWindowRectRequest>(client_id, message.window_id));
break;
- case GUI_ClientMessage::Type::InvalidateRect:
+ case WSAPI_ClientMessage::Type::InvalidateRect:
post_message(client, make<WSAPIInvalidateRectRequest>(client_id, message.window_id, message.window.rect));
break;
- case GUI_ClientMessage::Type::DidFinishPainting:
+ case WSAPI_ClientMessage::Type::DidFinishPainting:
post_message(client, make<WSAPIDidFinishPaintingNotification>(client_id, message.window_id, message.window.rect));
break;
- case GUI_ClientMessage::Type::GetWindowBackingStore:
+ case WSAPI_ClientMessage::Type::GetWindowBackingStore:
post_message(client, make<WSAPIGetWindowBackingStoreRequest>(client_id, message.window_id));
break;
- case GUI_ClientMessage::Type::ReleaseWindowBackingStore:
+ case WSAPI_ClientMessage::Type::ReleaseWindowBackingStore:
post_message(client, make<WSAPIReleaseWindowBackingStoreRequest>(client_id, (int)message.backing.backing_store_id));
break;
- case GUI_ClientMessage::Type::SetGlobalCursorTracking:
+ case WSAPI_ClientMessage::Type::SetGlobalCursorTracking:
post_message(client, make<WSAPISetGlobalCursorTrackingRequest>(client_id, message.window_id, message.value));
break;
}
diff --git a/WindowServer/WSMessageLoop.h b/WindowServer/WSMessageLoop.h
index c0bd7abf83..51b064589d 100644
--- a/WindowServer/WSMessageLoop.h
+++ b/WindowServer/WSMessageLoop.h
@@ -9,7 +9,7 @@
class WSMessageReceiver;
class Process;
-struct GUI_ServerMessage;
+struct WSAPI_ServerMessage;
class WSMessageLoop {
public:
@@ -30,7 +30,7 @@ public:
int start_timer(int ms, Function<void()>&&);
int stop_timer(int timer_id);
- void post_message_to_client(int client_id, const GUI_ServerMessage&);
+ void post_message_to_client(int client_id, const WSAPI_ServerMessage&);
ssize_t on_receive_from_client(int client_id, const byte*, size_t);
static Process* process_from_client_id(int client_id);
diff --git a/WindowServer/WSWindow.cpp b/WindowServer/WSWindow.cpp
index 5755329012..7dc9de2254 100644
--- a/WindowServer/WSWindow.cpp
+++ b/WindowServer/WSWindow.cpp
@@ -54,13 +54,13 @@ void WSWindow::set_rect(const Rect& rect)
}
// FIXME: Just use the same types.
-static GUI_MouseButton to_api(MouseButton button)
+static WSAPI_MouseButton to_api(MouseButton button)
{
switch (button) {
- case MouseButton::None: return GUI_MouseButton::NoButton;
- case MouseButton::Left: return GUI_MouseButton::Left;
- case MouseButton::Right: return GUI_MouseButton::Right;
- case MouseButton::Middle: return GUI_MouseButton::Middle;
+ case MouseButton::None: return WSAPI_MouseButton::NoButton;
+ case MouseButton::Left: return WSAPI_MouseButton::Left;
+ case MouseButton::Right: return WSAPI_MouseButton::Right;
+ case MouseButton::Middle: return WSAPI_MouseButton::Middle;
}
ASSERT_NOT_REACHED();
}
@@ -72,30 +72,30 @@ void WSWindow::on_message(WSMessage& message)
return;
}
- GUI_ServerMessage server_message;
+ WSAPI_ServerMessage server_message;
server_message.window_id = window_id();
switch (message.type()) {
case WSMessage::MouseMove:
- server_message.type = GUI_ServerMessage::Type::MouseMove;
+ server_message.type = WSAPI_ServerMessage::Type::MouseMove;
server_message.mouse.position = static_cast<WSMouseEvent&>(message).position();
- server_message.mouse.button = GUI_MouseButton::NoButton;
+ server_message.mouse.button = WSAPI_MouseButton::NoButton;
server_message.mouse.buttons = static_cast<WSMouseEvent&>(message).buttons();
break;
case WSMessage::MouseDown:
- server_message.type = GUI_ServerMessage::Type::MouseDown;
+ server_message.type = WSAPI_ServerMessage::Type::MouseDown;
server_message.mouse.position = static_cast<WSMouseEvent&>(message).position();
server_message.mouse.button = to_api(static_cast<WSMouseEvent&>(message).button());
server_message.mouse.buttons = static_cast<WSMouseEvent&>(message).buttons();
break;
case WSMessage::MouseUp:
- server_message.type = GUI_ServerMessage::Type::MouseUp;
+ server_message.type = WSAPI_ServerMessage::Type::MouseUp;
server_message.mouse.position = static_cast<WSMouseEvent&>(message).position();
server_message.mouse.button = to_api(static_cast<WSMouseEvent&>(message).button());
server_message.mouse.buttons = static_cast<WSMouseEvent&>(message).buttons();
break;
case WSMessage::KeyDown:
- server_message.type = GUI_ServerMessage::Type::KeyDown;
+ server_message.type = WSAPI_ServerMessage::Type::KeyDown;
server_message.key.character = static_cast<WSKeyEvent&>(message).character();
server_message.key.key = static_cast<WSKeyEvent&>(message).key();
server_message.key.alt = static_cast<WSKeyEvent&>(message).alt();
@@ -103,7 +103,7 @@ void WSWindow::on_message(WSMessage& message)
server_message.key.shift = static_cast<WSKeyEvent&>(message).shift();
break;
case WSMessage::KeyUp:
- server_message.type = GUI_ServerMessage::Type::KeyUp;
+ server_message.type = WSAPI_ServerMessage::Type::KeyUp;
server_message.key.character = static_cast<WSKeyEvent&>(message).character();
server_message.key.key = static_cast<WSKeyEvent&>(message).key();
server_message.key.alt = static_cast<WSKeyEvent&>(message).alt();
@@ -111,19 +111,19 @@ void WSWindow::on_message(WSMessage& message)
server_message.key.shift = static_cast<WSKeyEvent&>(message).shift();
break;
case WSMessage::WindowActivated:
- server_message.type = GUI_ServerMessage::Type::WindowActivated;
+ server_message.type = WSAPI_ServerMessage::Type::WindowActivated;
break;
case WSMessage::WindowDeactivated:
- server_message.type = GUI_ServerMessage::Type::WindowDeactivated;
+ server_message.type = WSAPI_ServerMessage::Type::WindowDeactivated;
break;
case WSMessage::WindowCloseRequest:
- server_message.type = GUI_ServerMessage::Type::WindowCloseRequest;
+ server_message.type = WSAPI_ServerMessage::Type::WindowCloseRequest;
break;
default:
break;
}
- if (server_message.type == GUI_ServerMessage::Type::Invalid)
+ if (server_message.type == WSAPI_ServerMessage::Type::Invalid)
return;
if (auto* client = WSClientConnection::from_client_id(m_client_id))