Skip to main content

plushie_core/
lib.rs

1//! Core types and protocol for Plushie.
2//!
3//! This crate contains the shared data types used by both the Plushie
4//! SDK and the renderer. It has no iced dependency, making it suitable
5//! for wire-mode apps, FFI bindings, and tooling that doesn't need
6//! the full rendering stack.
7#![deny(missing_docs)]
8
9extern crate self as plushie_core;
10
11pub use plushie_core_macros::{PlushieEnum, WidgetCommand, WidgetEvent, WidgetProps, widget};
12
13pub mod animation;
14pub mod codec_safety;
15pub mod diagnostic;
16pub mod diagnostics;
17pub mod event_type;
18pub mod key;
19pub mod ops;
20pub mod outgoing_message;
21pub mod pointer;
22pub mod protocol;
23pub mod scoped_id;
24pub mod selector;
25pub mod settings;
26pub mod spec;
27pub mod tree_walk;
28pub mod types;
29pub mod widget_builder;
30
31pub use diagnostic::{Diagnostic, DiagnosticKind};
32pub use event_type::EventType;
33pub use key::{EffectKind, InteractAction, Key, KeyPress, MouseButton, PointerKind};
34pub use scoped_id::ScopedId;
35pub use selector::{MAX_SELECTOR_SEARCH_DEPTH, Selector};
36pub use spec::{CommandSpec, EventSpec, PayloadSpec, ValueType, WidgetCommandEncode};
37pub use types::{FromNode, PlushieType, WidgetEventEncode};
38pub use widget_builder::WidgetBuilder;
39
40/// Sorted list of every built-in widget type name reserved by the
41/// stock renderer's iced widget set.
42///
43/// Tooling uses this list to detect native widgets that would shadow a
44/// built-in name without depending on `plushie-widget-sdk` or iced.
45/// Compatibility aliases accepted by the renderer are included here so
46/// reserved-name checks stay strict even when older wire emitters are
47/// still in use. Public Rust builders emit the canonical names.
48/// The widget SDK has a drift-detection test that compares this list
49/// with the renderer's registered built-in widget set.
50pub const BUILTIN_TYPE_NAMES: &[&str] = &[
51    "button",
52    "canvas",
53    "checkbox",
54    "column",
55    "combo_box",
56    "container",
57    "float",
58    "floating",
59    "grid",
60    "image",
61    "keyed_column",
62    "markdown",
63    "overlay",
64    "pane_grid",
65    "pick_list",
66    "pin",
67    "pointer_area",
68    "progress_bar",
69    "qr_code",
70    "radio",
71    "responsive",
72    "rich",
73    "rich_text",
74    "row",
75    "rule",
76    "scrollable",
77    "sensor",
78    "slider",
79    "space",
80    "stack",
81    "svg",
82    "table",
83    "text",
84    "text_editor",
85    "text_input",
86    "themer",
87    "toggler",
88    "tooltip",
89    "vertical_slider",
90    "window",
91];