mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-12-12 13:25:54 +00:00
refactor: split into explicit facets
This commit is contained in:
parent
ccf0c9caf8
commit
6c564d95b5
7 changed files with 63 additions and 33 deletions
1
src/event.rs
Normal file
1
src/event.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
pub use layer_shika_composition::{EventContext, EventLoopHandle, ShellEventLoopHandle};
|
||||
51
src/lib.rs
51
src/lib.rs
|
|
@ -17,6 +17,17 @@
|
|||
//! the internal architecture to evolve without breaking semver guarantees on the
|
||||
//! public API.
|
||||
//!
|
||||
//! # Module Organization
|
||||
//!
|
||||
//! The API is organized into conceptual facets:
|
||||
//!
|
||||
//! - [`shell`] – Main runtime and shell composition types
|
||||
//! - [`window`] – Window configuration, layers, anchors, and popup types
|
||||
//! - [`output`] – Output (monitor) info, geometry, and policies
|
||||
//! - [`event`] – Event loop handles and contexts
|
||||
//! - [`slint_integration`] – Slint framework re-exports and wrappers
|
||||
//! - [`calloop`] – Event loop types for custom event sources
|
||||
//!
|
||||
//! # Quick Start
|
||||
//!
|
||||
//! ```rust,no_run
|
||||
|
|
@ -50,36 +61,36 @@
|
|||
//! shell.run()?;
|
||||
//! # Ok::<(), layer_shika::Error>(())
|
||||
//! ```
|
||||
//!
|
||||
//! # Re-exports
|
||||
//!
|
||||
//! This crate re-exports commonly needed types from its dependencies:
|
||||
//! - [`slint`]: The Slint UI framework (compiled API)
|
||||
//! - [`slint_interpreter`]: Runtime Slint component loading
|
||||
//! - [`calloop`]: Event loop types for custom event sources
|
||||
|
||||
#![allow(clippy::pub_use)]
|
||||
|
||||
pub mod prelude;
|
||||
|
||||
pub use layer_shika_composition::{
|
||||
AnchorEdges, AnchorStrategy, DEFAULT_WINDOW_NAME, Error, EventContext, EventLoopHandle,
|
||||
KeyboardInteractivity, Layer, LayerShika, OutputGeometry, OutputHandle, OutputInfo,
|
||||
OutputPolicy, OutputRegistry, PopupHandle, PopupPlacement, PopupPositioningMode, PopupRequest,
|
||||
PopupSize, PopupWindow, Result, ShellControl, ShellRuntime, SingleWindowShell,
|
||||
pub mod event;
|
||||
pub mod output;
|
||||
pub mod shell;
|
||||
pub mod slint_integration;
|
||||
pub mod window;
|
||||
|
||||
pub use layer_shika_composition::{Error, Result};
|
||||
|
||||
pub use shell::{
|
||||
DEFAULT_WINDOW_NAME, LayerShika, LayerSurfaceHandle, Shell, ShellComposition, ShellControl,
|
||||
ShellEventContext, ShellRuntime, ShellWindowConfigHandler, ShellWindowDefinition,
|
||||
ShellWindowHandle, SingleWindowShell,
|
||||
};
|
||||
|
||||
pub use layer_shika_composition::{
|
||||
LayerSurfaceHandle, Shell, ShellComposition, ShellEventContext, ShellEventLoopHandle,
|
||||
ShellWindowConfigHandler, ShellWindowDefinition, ShellWindowHandle,
|
||||
pub use window::{
|
||||
AnchorEdges, AnchorStrategy, KeyboardInteractivity, Layer, PopupHandle, PopupPlacement,
|
||||
PopupPositioningMode, PopupRequest, PopupSize,
|
||||
};
|
||||
|
||||
pub use layer_shika_composition::{slint, slint_interpreter};
|
||||
pub use output::{OutputGeometry, OutputHandle, OutputInfo, OutputPolicy, OutputRegistry};
|
||||
|
||||
pub use event::{EventContext, EventLoopHandle, ShellEventLoopHandle};
|
||||
|
||||
pub use slint_integration::{PopupWindow, slint, slint_interpreter};
|
||||
|
||||
/// Re-exported calloop types for event loop integration
|
||||
///
|
||||
/// These types allow users to register custom event sources on the
|
||||
/// layer-shika event loop via [`EventLoopHandle`].
|
||||
pub mod calloop {
|
||||
pub use layer_shika_composition::calloop::*;
|
||||
}
|
||||
|
|
|
|||
3
src/output.rs
Normal file
3
src/output.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub use layer_shika_composition::{
|
||||
OutputGeometry, OutputHandle, OutputInfo, OutputPolicy, OutputRegistry,
|
||||
};
|
||||
|
|
@ -8,26 +8,27 @@
|
|||
|
||||
#![allow(clippy::pub_use)]
|
||||
|
||||
pub use crate::{
|
||||
DEFAULT_WINDOW_NAME, Error, EventContext, EventLoopHandle, LayerShika, PopupWindow, Result,
|
||||
ShellControl, ShellRuntime, SingleWindowShell,
|
||||
pub use crate::shell::{
|
||||
DEFAULT_WINDOW_NAME, LayerShika, LayerSurfaceHandle, Shell, ShellComposition, ShellControl,
|
||||
ShellEventContext, ShellEventLoopHandle, ShellRuntime, ShellWindowConfigHandler,
|
||||
ShellWindowDefinition, ShellWindowHandle, SingleWindowShell,
|
||||
};
|
||||
|
||||
pub use crate::{
|
||||
LayerSurfaceHandle, Shell, ShellComposition, ShellEventContext, ShellEventLoopHandle,
|
||||
ShellWindowConfigHandler, ShellWindowDefinition, ShellWindowHandle,
|
||||
pub use crate::window::{
|
||||
AnchorEdges, AnchorStrategy, KeyboardInteractivity, Layer, PopupHandle, PopupPlacement,
|
||||
PopupPositioningMode, PopupRequest, PopupSize,
|
||||
};
|
||||
|
||||
pub use crate::{
|
||||
AnchorEdges, KeyboardInteractivity, Layer, OutputGeometry, OutputHandle, OutputInfo,
|
||||
OutputPolicy, OutputRegistry, PopupHandle, PopupPlacement, PopupPositioningMode, PopupRequest,
|
||||
PopupSize,
|
||||
};
|
||||
pub use crate::output::{OutputGeometry, OutputHandle, OutputInfo, OutputPolicy, OutputRegistry};
|
||||
|
||||
pub use crate::event::{EventContext, EventLoopHandle};
|
||||
|
||||
pub use crate::slint_integration::{PopupWindow, slint, slint_interpreter};
|
||||
|
||||
pub use crate::{Error, Result};
|
||||
|
||||
pub use layer_shika_composition::prelude::{
|
||||
Anchor, LogicalSize, Margins, PhysicalSize, ScaleFactor, WindowConfig, WindowDimension,
|
||||
};
|
||||
|
||||
pub use crate::calloop;
|
||||
|
||||
pub use crate::{slint, slint_interpreter};
|
||||
|
|
|
|||
5
src/shell.rs
Normal file
5
src/shell.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
pub use layer_shika_composition::{
|
||||
DEFAULT_WINDOW_NAME, LayerShika, LayerSurfaceHandle, Shell, ShellComposition, ShellControl,
|
||||
ShellEventContext, ShellEventLoopHandle, ShellRuntime, ShellWindowConfigHandler,
|
||||
ShellWindowDefinition, ShellWindowHandle, SingleWindowShell,
|
||||
};
|
||||
3
src/slint_integration.rs
Normal file
3
src/slint_integration.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub use layer_shika_composition::{slint, slint_interpreter};
|
||||
|
||||
pub use layer_shika_composition::PopupWindow;
|
||||
6
src/window.rs
Normal file
6
src/window.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
pub use layer_shika_composition::{
|
||||
AnchorEdges, AnchorStrategy, KeyboardInteractivity, Layer, PopupHandle, PopupPlacement,
|
||||
PopupPositioningMode, PopupRequest, PopupSize,
|
||||
};
|
||||
|
||||
pub use layer_shika_composition::DEFAULT_WINDOW_NAME;
|
||||
Loading…
Add table
Reference in a new issue