wayvrctl + panel-modify ipc

This commit is contained in:
galister
2025-12-23 18:20:27 +09:00
parent 5287b659e8
commit f038ad8a87
19 changed files with 697 additions and 59 deletions

View File

@@ -6,7 +6,7 @@ edition = "2024"
[dependencies]
bytes = "1.9.0"
smallvec = "1.13.2"
serde = { version = "1", features = ["derive"] }
serde.workspace = true
anyhow = "1.0.93"
log = "0.4.22"
@@ -14,7 +14,7 @@ log = "0.4.22"
interprocess = { version = "2.2.2", features = ["tokio"], optional = true }
tokio = { version = "1.43.1", features = ["macros"], optional = true }
tokio-util = { version = "0.7.13", optional = true }
serde_json = "1.0.135"
serde_json.workspace = true
[features]
default = ["client"]

View File

@@ -486,6 +486,14 @@ impl WayVRClient {
send_only!(client, &PacketClient::WlxHaptics(params));
Ok(())
}
pub async fn fn_wlx_modify_panel(
client: WayVRClientMutex,
params: packet_client::WlxModifyPanelParams,
) -> anyhow::Result<()> {
send_only!(client, &PacketClient::WlxModifyPanel(params));
Ok(())
}
}
impl Drop for WayVRClient {

View File

@@ -49,7 +49,7 @@ pub struct WlxHapticsParams {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum WlxCustomCommand {
pub enum WlxModifyPanelCommand {
SetText(String),
SetColor(String),
SetSprite(String),
@@ -58,10 +58,10 @@ pub enum WlxCustomCommand {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct WlxCustomParams {
pub struct WlxModifyPanelParams {
pub overlay: String,
pub element: String,
pub command: WlxCustomCommand,
pub command: WlxModifyPanelCommand,
}
#[derive(Debug, Serialize, Deserialize)]
@@ -84,5 +84,5 @@ pub enum PacketClient {
WvrProcessTerminate(packet_server::WvrProcessHandle),
WlxHaptics(WlxHapticsParams),
WlxInputState(Serial),
WlxCustom(WlxCustomParams),
WlxModifyPanel(WlxModifyPanelParams),
}