2023-08-14 18:15:10 +02:00
|
|
|
/**
|
|
|
|
* @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 <os/IPC.h>
|
|
|
|
#include <ui/Color.h>
|
|
|
|
#include <ui/Rect.h>
|
|
|
|
#include <ui/ipc/Client.h>
|
|
|
|
|
|
|
|
namespace ui
|
|
|
|
{
|
|
|
|
enum ServerMessages : u8
|
|
|
|
{
|
|
|
|
IPC_ENUM_SERVER(ui),
|
|
|
|
CREATE_WINDOW_ID,
|
2023-11-22 21:29:59 +01:00
|
|
|
REMOVE_SHM_ID,
|
2023-08-14 20:08:05 +02:00
|
|
|
SET_WINDOW_TITLE_ID,
|
|
|
|
INVALIDATE_ID,
|
2023-08-15 11:20:17 +02:00
|
|
|
CLOSE_WINDOW_ID,
|
2023-08-15 12:56:55 +02:00
|
|
|
GET_SCREEN_RECT_ID,
|
2023-12-27 12:56:40 +01:00
|
|
|
SET_TITLEBAR_RECT_ID,
|
2023-08-14 18:15:10 +02:00
|
|
|
};
|
|
|
|
|
2023-09-27 18:14:32 +02:00
|
|
|
enum class WindowType : u8
|
|
|
|
{
|
|
|
|
Normal,
|
|
|
|
NotDecorated,
|
|
|
|
System,
|
|
|
|
};
|
|
|
|
|
2023-08-14 18:15:10 +02:00
|
|
|
struct CreateWindowRequest
|
|
|
|
{
|
|
|
|
using ResponseType = CreateWindowResponse;
|
2023-08-15 10:28:11 +02:00
|
|
|
static constexpr u8 ID = CREATE_WINDOW_ID;
|
2023-08-14 18:15:10 +02:00
|
|
|
|
|
|
|
ui::Rect rect;
|
2023-09-27 18:14:32 +02:00
|
|
|
WindowType type;
|
2023-08-14 20:08:05 +02:00
|
|
|
};
|
|
|
|
|
2023-11-22 21:29:59 +01:00
|
|
|
struct RemoveSharedMemoryRequest
|
|
|
|
{
|
|
|
|
static constexpr u8 ID = REMOVE_SHM_ID;
|
|
|
|
|
|
|
|
int window;
|
|
|
|
};
|
|
|
|
|
2023-08-14 20:08:05 +02:00
|
|
|
struct SetWindowTitleRequest
|
|
|
|
{
|
2023-08-15 10:28:11 +02:00
|
|
|
static constexpr u8 ID = SET_WINDOW_TITLE_ID;
|
2023-08-14 20:08:05 +02:00
|
|
|
|
|
|
|
int window;
|
|
|
|
IPC_STRING(title);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InvalidateRequest
|
|
|
|
{
|
2023-08-15 10:28:11 +02:00
|
|
|
static constexpr u8 ID = INVALIDATE_ID;
|
2023-08-14 20:08:05 +02:00
|
|
|
|
|
|
|
int window;
|
2023-08-14 18:15:10 +02:00
|
|
|
};
|
2023-08-15 11:20:17 +02:00
|
|
|
|
|
|
|
struct CloseWindowRequest
|
|
|
|
{
|
|
|
|
static constexpr u8 ID = CLOSE_WINDOW_ID;
|
|
|
|
|
|
|
|
int window;
|
|
|
|
};
|
2023-08-15 12:56:55 +02:00
|
|
|
|
|
|
|
struct GetScreenRectRequest
|
|
|
|
{
|
|
|
|
using ResponseType = GetScreenRectResponse;
|
|
|
|
static constexpr u8 ID = GET_SCREEN_RECT_ID;
|
|
|
|
|
|
|
|
int _shadow; // Unused.
|
|
|
|
};
|
2023-12-27 12:56:40 +01:00
|
|
|
|
|
|
|
struct SetTitlebarRectRequest
|
|
|
|
{
|
|
|
|
static constexpr u8 ID = SET_TITLEBAR_RECT_ID;
|
|
|
|
|
|
|
|
int window;
|
|
|
|
ui::Rect titlebar_rect;
|
|
|
|
};
|
2023-08-14 18:15:10 +02:00
|
|
|
}
|