diff --git a/libui/CMakeLists.txt b/libui/CMakeLists.txt index 79c0deae..4a1adaa2 100644 --- a/libui/CMakeLists.txt +++ b/libui/CMakeLists.txt @@ -4,6 +4,8 @@ file(GLOB HEADERS include/ui/*.h) set(SOURCES ${HEADERS} + include/ui/ipc/Server.h + include/ui/ipc/Client.h src/Canvas.cpp src/Rect.cpp src/Font.cpp diff --git a/libui/include/ui/ipc/Client.h b/libui/include/ui/ipc/Client.h new file mode 100644 index 00000000..876f50ef --- /dev/null +++ b/libui/include/ui/ipc/Client.h @@ -0,0 +1,27 @@ +/** + * @file ipc/Client.h + * @author apio (cloudapio.eu) + * @brief IPC message definitions for UI messages sent to the client. + * + * @copyright Copyright (c) 2023, the Luna authors. + * + */ + +#pragma once +#include + +namespace ui +{ + enum ClientMessages : u8 + { + IPC_ENUM_CLIENT(ui), + CREATE_WINDOW_RESPONSE_ID, + }; + + struct CreateWindowResponse + { + static constexpr u8 id = CREATE_WINDOW_RESPONSE_ID; + + int window; + }; +} diff --git a/libui/include/ui/ipc/Server.h b/libui/include/ui/ipc/Server.h new file mode 100644 index 00000000..bfa4afbe --- /dev/null +++ b/libui/include/ui/ipc/Server.h @@ -0,0 +1,33 @@ +/** + * @file ipc/Server.h + * @author apio (cloudapio.eu) + * @brief IPC message definitions for UI messages sent to the server. + * + * @copyright Copyright (c) 2023, the Luna authors. + * + */ + +#pragma once +#include +#include +#include +#include + +namespace ui +{ + enum ServerMessages : u8 + { + IPC_ENUM_SERVER(ui), + CREATE_WINDOW_ID, + }; + + struct CreateWindowRequest + { + using ResponseType = CreateWindowResponse; + static constexpr u8 id = CREATE_WINDOW_ID; + + ui::Rect rect; + IPC_STRING(name); + ui::Color color; + }; +}