agentmux_srv/server/service/
window.rs1use crate::backend::service::{WebCallType, WebReturnType};
15
16use super::super::AppState;
17use super::window_close::handle_close_window;
18use super::window_create::handle_create_window;
19use super::window_mutate::{
20 handle_set_window_opacity, handle_set_window_pos_and_size, handle_set_window_topology,
21 handle_switch_workspace,
22};
23use super::window_query::{handle_find_window_by_label, handle_get_window};
24
25pub(super) async fn handle_window_service(state: &AppState, call: &WebCallType) -> WebReturnType {
26 match call.method.as_str() {
27 "GetWindow" => handle_get_window(state, call).await,
28 "FindWindowByLabel" => handle_find_window_by_label(state, call).await,
29 "CreateWindow" => handle_create_window(state, call).await,
30 "CloseWindow" => handle_close_window(state, call).await,
31 "SaveSessionSnapshot" => {
36 super::session_restore::handle_save_session_snapshot(state, call).await
37 }
38 "SwitchWorkspace" => handle_switch_workspace(state, call).await,
39 "SetWindowPosAndSize" => handle_set_window_pos_and_size(state, call).await,
40 "SetWindowOpacity" => handle_set_window_opacity(state, call).await,
41 "SetWindowTopology" => handle_set_window_topology(state, call).await,
42 "MarkWindowOpen" => super::window_inherit::handle_mark_window_open(state, call).await,
43 "InheritWindowAppearance" => {
44 super::window_inherit::handle_inherit_window_appearance(state, call).await
45 }
46 _ => WebReturnType::error(format!("unknown window method: {}", call.method)),
47 }
48}