refactor(lockable): define Lockable next to LockableSequence in the Windows tree

Windows lockable_sequence.rs becomes the KDE version (module docs, Lockable defined inline); the trait is removed from lib.rs and re-exported there as pub use lockable_sequence::Lockable, so crate::Lockable paths keep working. Prepares one shared file across the three trees.

Verified: fast-check Windows clippy --all-targets -D warnings: PASS.
This commit is contained in:
LGUG2Z committed 2026-10-31 01:37:53 -07:00
1 parent 79ffe8b7a1
commit 7aee2e53a9
2 files changed
+13 -9

No files matched your search

+1 -8
View File
@@ -11,6 +11,7 @@ pub mod core;
pub mod focus_manager;
pub mod live_resize;
pub mod lockable_sequence;
pub use lockable_sequence::Lockable;
pub mod monitor;
pub mod monitor_reconciliator;
pub mod pan;
@@ -280,14 +281,6 @@ pub struct License {
pub signature: String,
}
/// A trait for types that can be marked as locked or unlocked.
pub trait Lockable {
/// Returns `true` if the item is locked.
fn locked(&self) -> bool;
/// Sets the locked state of the item.
fn set_locked(&mut self, locked: bool) -> &mut Self;
}
#[must_use]
pub fn current_virtual_desktop() -> Option<Vec<u8>> {
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
+12 -1
View File
@@ -1,6 +1,17 @@
//! Lists in which some elements are locked in place.
//!
//! A locked container keeps its position in the layout when others are inserted, removed or
//! swapped around it. [`LockableSequence`] does that bookkeeping for a [`VecDeque`].
use std::collections::VecDeque;
use crate::Lockable;
/// A trait for types that can be marked as locked or unlocked.
pub trait Lockable {
/// Returns `true` if the item is locked.
fn locked(&self) -> bool;
/// Sets the locked state of the item.
fn set_locked(&mut self, locked: bool) -> &mut Self;
}
/// A sequence supporting insertion, removal, and swapping of elements while preserving the absolute
/// positions of locked items.