Skip to main content

cranpose_ui_graphics/
lib.rs

1#![doc = include_str!("../README.md")]
2
3/// Host-provided accessibility preferences shared by animation and rendering.
4///
5/// ```
6/// use cranpose_ui_graphics::accessibility::{
7///     AccessibilityOptions, platform_accessibility_options, set_platform_accessibility_options,
8/// };
9///
10/// set_platform_accessibility_options(AccessibilityOptions {
11///     reduce_motion: true,
12///     ..AccessibilityOptions::default()
13/// });
14/// assert!(platform_accessibility_options().reduce_motion);
15/// ```
16pub mod accessibility;
17
18// A framework shader as the build script wrote it: `shaders/NAME` without
19// its comments.
20macro_rules! framework_wgsl {
21    ($name:literal) => {
22        include_str!(concat!(env!("OUT_DIR"), "/shaders/", $name))
23    };
24}
25
26/// A runtime shader's source: the prelude every runtime shader starts from,
27/// followed by the named framework WGSL files.
28macro_rules! runtime_shader_wgsl {
29    ($($name:literal),+ $(,)?) => {
30        concat!(
31            framework_wgsl!("runtime_shader_prelude.wgsl"),
32            $(framework_wgsl!($name)),+
33        )
34    };
35}
36
37pub mod alpha_mask;
38mod brush;
39mod color;
40mod float;
41pub mod framework_shaders;
42mod fx_hash;
43mod geometry;
44mod gradient_blur;
45mod image;
46pub mod layer_transform;
47pub mod liquid_glass;
48mod path;
49mod path_fill;
50mod pointer_icon;
51mod record;
52pub mod render_effect;
53mod render_hash;
54mod shader_warm_up;
55mod shadow;
56mod shape_records;
57mod stroke;
58pub mod transform;
59mod typography;
60pub mod unit;
61mod vector_path;
62mod vertex_gradient;
63
64pub use alpha_mask::*;
65pub use brush::*;
66pub use color::*;
67pub use fx_hash::*;
68pub use geometry::*;
69pub use gradient_blur::*;
70pub use image::*;
71pub use liquid_glass::*;
72pub use path::*;
73pub use path_fill::*;
74pub use pointer_icon::*;
75pub use record::*;
76pub use render_effect::*;
77pub use render_hash::*;
78pub use shader_warm_up::*;
79pub use shadow::*;
80pub use shape_records::*;
81pub use stroke::*;
82pub use transform::{ProjectiveTransform, WindowCoordinates};
83pub use typography::*;
84pub use unit::*;
85pub use vector_path::*;
86
87pub mod prelude {
88    pub use crate::{
89        brush::Brush,
90        color::Color,
91        geometry::{CornerRadii, EdgeInsets, Point, Rect, RoundedCornerShape, Size},
92        image::{ColorFilter, ImageBitmap, ImageBitmapError, ImagePixelFormat, ImageSampling},
93        pointer_icon::{CursorIcon, CustomPointerIcon, PointerIcon, PointerIconError},
94        stroke::{ArcGeometry, Stroke, StrokeCap, StrokeJoin},
95        unit::{Dp, Sp},
96        vector_path::{PathFillRule, SvgPathError, VectorPath},
97    };
98}