rewrite built-in wayland compositor egl → vulkan

This commit is contained in:
galister
2025-12-25 21:26:38 +09:00
parent 3b6acb3673
commit 40dc33410d
34 changed files with 923 additions and 3051 deletions

View File

@@ -315,93 +315,16 @@ impl WayVRClient {
}
}
pub async fn fn_wvr_display_list(
pub async fn fn_wvr_window_list(
client: WayVRClientMutex,
serial: Serial,
) -> anyhow::Result<Vec<packet_server::WvrDisplay>> {
Ok(
send_and_wait!(
client,
serial,
&PacketClient::WvrDisplayList(serial),
WvrDisplayListResponse
)
.list,
)
}
pub async fn fn_wvr_display_get(
client: WayVRClientMutex,
serial: Serial,
handle: packet_server::WvrDisplayHandle,
) -> anyhow::Result<Option<packet_server::WvrDisplay>> {
Ok(send_and_wait!(
client,
serial,
&PacketClient::WvrDisplayGet(serial, handle),
WvrDisplayGetResponse
))
}
pub async fn fn_wvr_display_remove(
client: WayVRClientMutex,
serial: Serial,
handle: packet_server::WvrDisplayHandle,
) -> anyhow::Result<()> {
send_and_wait!(
client,
serial,
&PacketClient::WvrDisplayRemove(serial, handle),
WvrDisplayRemoveResponse
)
.map_err(|e| anyhow::anyhow!("{}", e))
}
pub async fn fn_wvr_display_create(
client: WayVRClientMutex,
serial: Serial,
params: packet_client::WvrDisplayCreateParams,
) -> anyhow::Result<packet_server::WvrDisplayHandle> {
Ok(send_and_wait!(
client,
serial,
&PacketClient::WvrDisplayCreate(serial, params),
WvrDisplayCreateResponse
))
}
pub async fn fn_wvr_display_set_visible(
client: WayVRClientMutex,
handle: packet_server::WvrDisplayHandle,
visible: bool,
) -> anyhow::Result<()> {
send_only!(client, &PacketClient::WvrDisplaySetVisible(handle, visible));
Ok(())
}
pub async fn fn_wvr_display_set_layout(
client: WayVRClientMutex,
handle: packet_server::WvrDisplayHandle,
layout: packet_server::WvrDisplayWindowLayout,
) -> anyhow::Result<()> {
send_only!(
client,
&PacketClient::WvrDisplaySetWindowLayout(handle, layout)
);
Ok(())
}
pub async fn fn_wvr_display_window_list(
client: WayVRClientMutex,
serial: Serial,
handle: packet_server::WvrDisplayHandle,
) -> anyhow::Result<Option<Vec<packet_server::WvrWindow>>> {
Ok(
send_and_wait!(
client,
serial,
&PacketClient::WvrDisplayWindowList(serial, handle),
WvrDisplayWindowListResponse
&PacketClient::WvrWindowList(serial),
WvrWindowListResponse
)
.map(|res| res.list),
)
@@ -478,14 +401,6 @@ impl WayVRClient {
))
}
pub async fn fn_wlx_haptics(
client: WayVRClientMutex,
params: packet_client::WlxHapticsParams,
) -> anyhow::Result<()> {
send_only!(client, &PacketClient::WlxHaptics(params));
Ok(())
}
pub async fn fn_wlx_device_haptics(
client: WayVRClientMutex,
device: usize,

View File

@@ -67,22 +67,12 @@ pub struct WlxModifyPanelParams {
#[derive(Debug, Serialize, Deserialize)]
pub enum PacketClient {
Handshake(Handshake),
WvrDisplayCreate(Serial, WvrDisplayCreateParams),
WvrDisplayGet(Serial, packet_server::WvrDisplayHandle),
WvrDisplayList(Serial),
WvrDisplayRemove(Serial, packet_server::WvrDisplayHandle),
WvrDisplaySetVisible(packet_server::WvrDisplayHandle, bool),
WvrDisplayWindowList(Serial, packet_server::WvrDisplayHandle),
WvrDisplaySetWindowLayout(
packet_server::WvrDisplayHandle,
packet_server::WvrDisplayWindowLayout,
),
WvrWindowList(Serial),
WvrWindowSetVisible(packet_server::WvrWindowHandle, bool),
WvrProcessGet(Serial, packet_server::WvrProcessHandle),
WvrProcessLaunch(Serial, WvrProcessLaunchParams),
WvrProcessList(Serial),
WvrProcessTerminate(packet_server::WvrProcessHandle),
WlxHaptics(WlxHapticsParams),
WlxInputState(Serial),
WlxModifyPanel(WlxModifyPanelParams),
WlxDeviceHaptics(usize, WlxHapticsParams),

View File

@@ -48,14 +48,11 @@ pub struct WvrDisplay {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WvrWindow {
pub pos_x: i32,
pub pos_y: i32,
pub size_x: u32,
pub size_y: u32,
pub visible: bool,
pub handle: WvrWindowHandle,
pub process_handle: WvrProcessHandle,
pub display_handle: WvrDisplayHandle,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -71,7 +68,6 @@ pub struct WvrWindowList {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WvrProcess {
pub name: String,
pub display_handle: WvrDisplayHandle,
pub handle: WvrProcessHandle,
pub userdata: HashMap<String, String>,
}
@@ -103,8 +99,6 @@ pub enum WvrDisplayWindowLayout {
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum WvrStateChanged {
DisplayCreated,
DisplayRemoved,
ProcessCreated,
ProcessRemoved,
WindowCreated,
@@ -132,11 +126,7 @@ pub enum PacketServer {
Disconnect(Disconnect),
HandshakeSuccess(HandshakeSuccess),
WlxInputStateResponse(Serial, WlxInputState),
WvrDisplayCreateResponse(Serial, WvrDisplayHandle),
WvrDisplayGetResponse(Serial, Option<WvrDisplay>),
WvrDisplayListResponse(Serial, WvrDisplayList),
WvrDisplayRemoveResponse(Serial, Result<(), String>),
WvrDisplayWindowListResponse(Serial, Option<WvrWindowList>),
WvrWindowListResponse(Serial, Option<WvrWindowList>),
WvrProcessGetResponse(Serial, Option<WvrProcess>),
WvrProcessLaunchResponse(Serial, Result<WvrProcessHandle, String>),
WvrProcessListResponse(Serial, WvrProcessList),
@@ -149,11 +139,7 @@ impl PacketServer {
PacketServer::Disconnect(_) => None,
PacketServer::HandshakeSuccess(_) => None,
PacketServer::WlxInputStateResponse(serial, _) => Some(serial),
PacketServer::WvrDisplayCreateResponse(serial, _) => Some(serial),
PacketServer::WvrDisplayGetResponse(serial, _) => Some(serial),
PacketServer::WvrDisplayListResponse(serial, _) => Some(serial),
PacketServer::WvrDisplayRemoveResponse(serial, _) => Some(serial),
PacketServer::WvrDisplayWindowListResponse(serial, _) => Some(serial),
PacketServer::WvrWindowListResponse(serial, _) => Some(serial),
PacketServer::WvrProcessGetResponse(serial, _) => Some(serial),
PacketServer::WvrProcessLaunchResponse(serial, _) => Some(serial),
PacketServer::WvrProcessListResponse(serial, _) => Some(serial),