From 331a1a1d3a0d8dfd4c285b755c2e13785c95ee2a Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Thu, 5 Dec 2024 01:28:00 +0200 Subject: Accumulate platform/ctl-crate additions: capture workspace, IPC responses, CLI verbs Bundles related IPC-surface and CLI additions built up over this session: - capture_workspace IPC command + srd capture workspace CLI verb (see the wayland-crate commit for the off-screen render this drives). - Expanded IPC response payloads (monitors, client events, global menu info) and their matching CLI plumbing. Same reasoning as the core-crate sweep commit for why this is coarser than the repo's usual convention: too entangled to split safely without a dedicated review pass. --- crates/platform/src/lib.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'crates/platform/src/lib.rs') diff --git a/crates/platform/src/lib.rs b/crates/platform/src/lib.rs index 4be9cc4..5de701f 100644 --- a/crates/platform/src/lib.rs +++ b/crates/platform/src/lib.rs @@ -8,9 +8,17 @@ //! pump, macOS's event taps) into the common [`srdwm_core::Event`] queue - //! everything downstream of that is platform-independent. +mod appmenu_registrar; +pub use appmenu_registrar::{AppmenuRegistrarState, RegistrarEvent}; + mod ipc; pub use ipc::IpcServer; +#[cfg(unix)] +mod pam_auth; +#[cfg(unix)] +pub use pam_auth::authenticate; + use srdwm_core::{Monitor, Rect, Window, WindowId}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -146,4 +154,22 @@ pub trait Platform { fn grab_keyboard(&mut self) -> Result<()>; fn ungrab_keyboard(&mut self) -> Result<()>; + + /// The active XKB layout's own human-readable name (e.g. `"English + /// (US)"`) - read once at startup so `WindowManager::keyboard_layout` + /// (surfaced over `srd`, for an AGS peer session's keyboard-layout + /// badge) has a real value before the first cycle, not an empty string + /// until the user cycles once. `Err(Unsupported)` on a backend with no + /// real XKB-backed seat to ask (X11, and the honest-stub Windows/macOS + /// backends) - same convention `grab_keyboard` already uses for "this + /// capability genuinely doesn't exist here" rather than inventing a + /// second one. + fn keyboard_layout(&mut self) -> Result; + + /// Cycles to the next configured XKB layout (wrapping past the last + /// one back to the first) and returns its name. A no-op that returns + /// the same name back is correct, not a bug, when only one layout is + /// configured - there's nothing to cycle *to*, same as every other + /// desktop's layout switcher under the same condition. + fn cycle_keyboard_layout(&mut self) -> Result; } -- cgit v1.2.3