kas/lib.rs
1// Licensed under the Apache License, Version 2.0 (the "License");
2// you may not use this file except in compliance with the License.
3// You may obtain a copy of the License in the LICENSE-APACHE file or at:
4// https://www.apache.org/licenses/LICENSE-2.0
5
6//! KAS GUI Toolkit
7//!
8//! This, the main KAS crate, is a wrapper over other crates designed to make
9//! content easily available while remaining configurable. The following crates
10//! (some optional, dependant on a feature flag) are re-exported by this crate:
11//!
12//! - [`kas_core`] is re-export at the top-level
13//! - [`easy-cast`](https://crates.io/crates/easy-cast) is re-export as [`cast`]
14//! - `kas_macros` is an extended version of [`impl-tools`](https://crates.io/crates/impl-tools),
15//! re-export at the top-level
16//! - [`kas_widgets`](https://crates.io/crates/kas-widgets) is re-export as [`widgets`](mod@widgets)
17//! - [`kas_image`](https://crates.io/crates/kas-image) is re-export as [`image`] (`svg` or `canvas` feature)
18//! - [`kas_view`](https://crates.io/crates/kas-view) is re-export as [`view`] (`view` feature)
19//!
20//! Also refer to:
21//!
22//! - [KAS Tutorials](https://kas-gui.github.io/tutorials/)
23//! - [Examples](https://github.com/kas-gui/kas/tree/master/examples)
24//! - [Discuss](https://github.com/kas-gui/kas/discussions)
25
26#![cfg_attr(docsrs, feature(doc_cfg))]
27
28/// KAS prelude
29///
30/// This module allows convenient importation of common unabiguous items:
31/// ```
32/// use kas::prelude::*;
33/// ```
34///
35/// This prelude may be more useful when implementing widgets than when simply
36/// using widgets in a GUI.
37pub mod prelude {
38 #[doc(no_inline)] pub use kas_core::prelude::*;
39 #[doc(no_inline)]
40 pub use kas_widgets::adapt::{AdaptWidget, AdaptWidgetAny};
41}
42
43pub use kas_core::*;
44
45#[doc(inline)] pub extern crate kas_widgets as widgets;
46
47#[cfg(feature = "view")]
48#[doc(inline)]
49pub extern crate kas_view as view;
50
51/// `Canvas` and `Svg` widgets over [`tiny-skia`](https://crates.io/crates/tiny-skia)
52/// and [`resvg`](https://crates.io/crates/resvg)
53///
54/// This crate provides widgets using
55/// libraries by [Yevhenii Reizner "RazrFalcon"](https://github.com/RazrFalcon/).
56#[cfg(any(feature = "image", feature = "svg", feature = "canvas"))]
57pub mod image {
58 pub use kas_image::*;
59}
60
61pub mod runner;
62
63#[cfg(feature = "dynamic")]
64#[allow(unused_imports)]
65use kas_dylib;