mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 13:51:19 +01:00
refactor(mac): converge the payload enums of core/mod.rs to the shared text
The seven payload enums take the shared text (same as the Windows and KDE revisions): WindowKind gets the Windows variant docs, SubscribeOptions and StateQuery get the KDE docs, ApplicationIdentifier::Class gets the cfg_attr doc (macOS keeps 'Role or subrole'). The spelling of Move, MonocleFocus and OperationBehaviour was already the Windows one on macOS. komorebi-for-mac/schema.json needs no change: none of the changed docs is embedded in it (grep: WindowKind, SubscribeOptions, StateQuery are not in the schema; the four embedded descriptions are unchanged). Verified: fast-check macOS (fake CC) cargo check --workspace --all-targets: PASS. macOS tests not run (cannot).
This commit is contained in:
1 parent
c586257e57
commit
3efd1420de
1 file changed
+22
-2
@@ -210,11 +210,13 @@ pub enum ApplicationIdentifier {
|
||||
/// Executable name
|
||||
#[serde(alias = "exe")]
|
||||
Exe,
|
||||
/// Role or subrole
|
||||
// the description is part of the checked-in schemas, which differ per platform
|
||||
#[cfg_attr(target_os = "windows", doc = " Class")]
|
||||
#[cfg_attr(not(target_os = "windows"), doc = " Role or subrole")]
|
||||
#[serde(alias = "class")]
|
||||
Class,
|
||||
/// Window title
|
||||
#[serde(alias = "title")]
|
||||
/// Window title
|
||||
Title,
|
||||
/// Executable path
|
||||
#[serde(alias = "path")]
|
||||
@@ -236,16 +238,26 @@ pub enum ApplicationIdentifier {
|
||||
Hash,
|
||||
)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
/// What a window is to the layout, which decides the color of its border
|
||||
pub enum WindowKind {
|
||||
/// Single window
|
||||
Single,
|
||||
/// Stack container
|
||||
Stack,
|
||||
/// Monocle container
|
||||
Monocle,
|
||||
#[default]
|
||||
/// Unfocused window
|
||||
Unfocused,
|
||||
/// Unfocused locked container
|
||||
UnfocusedLocked,
|
||||
/// Floating window
|
||||
Floating,
|
||||
}
|
||||
|
||||
/// A question about the window manager that `SocketMessage::Query` asks, answered with one
|
||||
/// value as text: an index, the name of a layout or of a container kind, or the version of the
|
||||
/// daemon.
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub enum StateQuery {
|
||||
@@ -259,6 +271,14 @@ pub enum StateQuery {
|
||||
Version,
|
||||
}
|
||||
|
||||
/// The options of a subscriber, which `SocketMessage::AddSubscriberSocketWithOptions` sets
|
||||
///
|
||||
/// A subscriber added with `SocketMessage::AddSubscriberSocket` has the default options, and is
|
||||
/// sent a notification for every event and message the window manager handles. With
|
||||
/// `filter_state_changes`, it is sent one only when the event or the message changed the
|
||||
/// state, and always when a window is shown, when a subscriber is added (so a new subscriber
|
||||
/// receives the state as soon as it subscribes), when a theme is set (the colors of the borders
|
||||
/// are not part of the state) and when the configuration is reloaded.
|
||||
#[derive(Default, Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct SubscribeOptions {
|
||||
|
||||
Reference in new issue
Block a user