mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-11-17 23:14:23 +00:00
docs: entrypoint bare docs
This commit is contained in:
parent
77ec18e8f8
commit
bec29a3fdd
2 changed files with 66 additions and 8 deletions
53
src/lib.rs
53
src/lib.rs
|
|
@ -1,19 +1,60 @@
|
|||
#![allow(clippy::pub_use)]
|
||||
//! layer-shika: A Wayland layer shell library with Slint UI integration
|
||||
//!
|
||||
//! This crate provides a high-level API for creating Wayland layer shell windows
|
||||
//! with Slint-based user interfaces. It's built on a clean architecture with three
|
||||
//! internal layers (domain, adapters, composition), but users should only depend on
|
||||
//! this root crate.
|
||||
//!
|
||||
//! # Architecture Note
|
||||
//!
|
||||
//! layer-shika is internally organized as a Cargo workspace with three implementation
|
||||
//! crates:
|
||||
//! - `layer-shika-domain`: Core domain models and business logic
|
||||
//! - `layer-shika-adapters`: Wayland and rendering implementations
|
||||
//! - `layer-shika-composition`: Public API composition layer
|
||||
//!
|
||||
//! **Users should never import from these internal crates directly.** This allows
|
||||
//! the internal architecture to evolve without breaking semver guarantees on the
|
||||
//! public API.
|
||||
//!
|
||||
//! # Quick Start
|
||||
//!
|
||||
//! ```rust,no_run
|
||||
//! use layer_shika::prelude::*;
|
||||
//!
|
||||
//! let (window, system) = LayerShika::from_file("ui/main.slint", "AppWindow")?
|
||||
//! .with_height(42)?
|
||||
//! .with_anchor(AnchorEdges::top_bar())
|
||||
//! .with_exclusive_zone(42)
|
||||
//! .build()?;
|
||||
//!
|
||||
//! system.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
|
||||
|
||||
mod composition {
|
||||
pub use layer_shika_composition::*;
|
||||
}
|
||||
#![allow(clippy::pub_use)]
|
||||
|
||||
pub mod prelude;
|
||||
|
||||
pub use composition::{
|
||||
pub use layer_shika_composition::{
|
||||
AnchorEdges, Error, EventLoopHandle, KeyboardInteractivity, Layer, LayerShika, PopupAt,
|
||||
PopupHandle, PopupPositioningMode, PopupRequest, PopupSize, PopupWindow, Result, RuntimeState,
|
||||
SlintCallbackContract, SlintCallbackNames, WindowingSystem,
|
||||
};
|
||||
|
||||
pub use composition::{slint, slint_interpreter};
|
||||
pub use layer_shika_composition::{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::*;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,27 @@
|
|||
//! Prelude module re-exporting all public API types
|
||||
//!
|
||||
//! Import this module to get access to the most commonly used types:
|
||||
//!
|
||||
//! ```rust
|
||||
//! use layer_shika::prelude::*;
|
||||
//! ```
|
||||
|
||||
#![allow(clippy::pub_use)]
|
||||
|
||||
// Core API types
|
||||
pub use crate::{
|
||||
AnchorEdges, Error, KeyboardInteractivity, Layer, LayerShika, PopupAt, PopupPositioningMode,
|
||||
PopupRequest, PopupSize, Result,
|
||||
Error, EventLoopHandle, LayerShika, PopupWindow, Result, RuntimeState,
|
||||
SlintCallbackContract, SlintCallbackNames, WindowingSystem,
|
||||
};
|
||||
|
||||
// Domain value objects
|
||||
pub use crate::{
|
||||
AnchorEdges, KeyboardInteractivity, Layer, PopupAt, PopupHandle, PopupPositioningMode,
|
||||
PopupRequest, PopupSize,
|
||||
};
|
||||
|
||||
// Event loop types
|
||||
pub use crate::calloop;
|
||||
|
||||
// UI framework re-exports
|
||||
pub use crate::{slint, slint_interpreter};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue