khora_core/ui/mod.rs
1// Copyright 2025 eraflo
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Core interfaces for the UI system.
16//!
17//! `theme` and `fonts` are app-agnostic, **brand-neutral** contracts shared by
18//! every Khora UI surface (editor, hub, future tools): [`theme::UiTheme`] is a
19//! semantic slot struct with a neutral [`Default`], and the UI backend consumes
20//! it. The concrete Khora palette that fills those slots is *cosmetics* and
21//! lives outside the engine, in the `khora-tool-ui` crate — so a game built on
22//! Khora never inherits the engine vendor's brand.
23//!
24//! The `editor` submodule layers the editor-specific framework (panels, dock,
25//! viewport handle, paint `UiBuilder`) on top.
26
27pub mod app;
28pub mod editor;
29pub mod editor_overlay;
30pub mod fonts;
31pub mod geometry;
32pub mod layout;
33pub mod theme;
34pub mod types;
35
36pub use app::{App, AppContext, AppLifecycle};
37pub use editor::{
38 EditorCamera, EditorPanel, EditorShell, PanelLocation, UiBuilder, ViewportTextureHandle,
39};
40pub use editor_overlay::{EditorOverlay, OverlayError, OverlayScreenDescriptor};
41pub use fonts::{FontHandle, FontPack, NamedFont};
42pub use geometry::{Align, Align2, CornerRadius, Margin, Stroke};
43pub use layout::{LayoutSystem, UiLayoutView};
44pub use theme::UiTheme;