2023-08-14 16:15:10 +00: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 20:29:59 +00:00
|
|
|
REMOVE_SHM_ID,
|
2023-08-14 18:08:05 +00:00
|
|
|
SET_WINDOW_TITLE_ID,
|
|
|
|
INVALIDATE_ID,
|
2023-08-15 09:20:17 +00:00
|
|
|
CLOSE_WINDOW_ID,
|
2023-08-15 10:56:55 +00:00
|
|
|
GET_SCREEN_RECT_ID,
|
2024-02-04 12:13:21 +00:00
|
|
|
SET_TITLEBAR_HEIGHT_ID,
|
2024-12-13 20:53:12 +00:00
|
|
|
SET_WINDOW_LAYER_ID,
|
2023-09-27 16:14:32 +00:00
|
|
|
};
|
|
|
|
|
2023-08-14 16:15:10 +00:00
|
|
|
struct CreateWindowRequest
|
|
|
|
{
|
|
|
|
using ResponseType = CreateWindowResponse;
|
2023-08-15 08:28:11 +00:00
|
|
|
static constexpr u8 ID = CREATE_WINDOW_ID;
|
2023-08-14 16:15:10 +00:00
|
|
|
|
|
|
|
ui::Rect rect;
|
2023-08-14 18:08:05 +00:00
|
|
|
};
|
|
|
|
|
2023-11-22 20:29:59 +00:00
|
|
|
struct RemoveSharedMemoryRequest
|
|
|
|
{
|
|
|
|
static constexpr u8 ID = REMOVE_SHM_ID;
|
|
|
|
|
|
|
|
int window;
|
|
|
|
};
|
|
|
|
|
2023-08-14 18:08:05 +00:00
|
|
|
struct SetWindowTitleRequest
|
|
|
|
{
|
2023-08-15 08:28:11 +00:00
|
|
|
static constexpr u8 ID = SET_WINDOW_TITLE_ID;
|
2023-08-14 18:08:05 +00:00
|
|
|
|
|
|
|
int window;
|
|
|
|
IPC_STRING(title);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InvalidateRequest
|
|
|
|
{
|
2023-08-15 08:28:11 +00:00
|
|
|
static constexpr u8 ID = INVALIDATE_ID;
|
2023-08-14 18:08:05 +00:00
|
|
|
|
|
|
|
int window;
|
2023-08-14 16:15:10 +00:00
|
|
|
};
|
2023-08-15 09:20:17 +00:00
|
|
|
|
|
|
|
struct CloseWindowRequest
|
|
|
|
{
|
|
|
|
static constexpr u8 ID = CLOSE_WINDOW_ID;
|
|
|
|
|
|
|
|
int window;
|
|
|
|
};
|
2023-08-15 10:56:55 +00:00
|
|
|
|
|
|
|
struct GetScreenRectRequest
|
|
|
|
{
|
|
|
|
using ResponseType = GetScreenRectResponse;
|
|
|
|
static constexpr u8 ID = GET_SCREEN_RECT_ID;
|
|
|
|
|
|
|
|
int _shadow; // Unused.
|
|
|
|
};
|
2023-12-27 11:56:40 +00:00
|
|
|
|
2024-02-04 12:13:21 +00:00
|
|
|
struct SetTitlebarHeightRequest
|
2023-12-27 11:56:40 +00:00
|
|
|
{
|
2024-02-04 12:13:21 +00:00
|
|
|
static constexpr u8 ID = SET_TITLEBAR_HEIGHT_ID;
|
2023-12-27 11:56:40 +00:00
|
|
|
|
|
|
|
int window;
|
2024-02-04 12:13:21 +00:00
|
|
|
int height;
|
2023-12-27 11:56:40 +00:00
|
|
|
};
|
2024-02-04 12:35:50 +00:00
|
|
|
|
2024-12-13 20:53:12 +00:00
|
|
|
enum Layer : u8
|
2024-02-04 12:35:50 +00:00
|
|
|
{
|
2024-12-13 20:53:12 +00:00
|
|
|
Background,
|
|
|
|
Global,
|
|
|
|
GlobalTop,
|
|
|
|
System,
|
|
|
|
Lock
|
2024-02-04 12:35:50 +00:00
|
|
|
};
|
|
|
|
|
2024-12-13 20:53:12 +00:00
|
|
|
struct SetWindowLayer
|
2024-02-04 12:35:50 +00:00
|
|
|
{
|
2024-12-13 20:53:12 +00:00
|
|
|
static constexpr u8 ID = SET_WINDOW_LAYER_ID;
|
2024-02-04 12:35:50 +00:00
|
|
|
|
|
|
|
int window;
|
2024-12-13 20:53:12 +00:00
|
|
|
Layer layer;
|
2024-02-04 12:35:50 +00:00
|
|
|
};
|
2023-08-14 16:15:10 +00:00
|
|
|
}
|