lib.rs raw

//! guiduck core: widget tree, layout, events, styling, accessibility.
//!
//! The widget tree, taffy layout integration, text stack, pointer event
//! routing, dirty tracking, and the style engine live here.

// So this crate can be named `::guiduck_core::…` in its own source — which the
// `register_widget!`/`register_builtins!` expansions do, uniformly with how an
// application widget crate names it.
extern crate self as guiduck_core;

pub mod asset;
pub mod clipboard;
pub mod component;
pub mod content;
pub mod dirty;
pub mod event;
pub mod graphic;
pub mod live;
pub mod registration;
pub mod style;
pub mod text;
pub mod widget;

pub use clipboard::{Clipboard, LocalClipboard, NoClipboard, Selection};
pub use dirty::Dirt;
pub use event::{
    EventCtx, EventData, EventKind, ImeInput, Key, KeyInput, Keystroke, Modifiers, Phase,
    PointerButton, PointerEvent, PointerInput,
};
pub use registration::{SetterEntry, WidgetRegistration, registered_widget, registered_widgets};
pub use style::{ComputedStyle, InteractionState, Theme};
pub use widget::overlay::{AnchorSide, OverlayOptions, Placement};
pub use widget::{
    Button, Checkbox, ComboBox, Commands, Container, ContextMenu, CursorShape, Dialog, DialogScrim,
    DialogSheet, Dropdown, Expander, Image, ListBox, ListItem, Menu, MenuBar, MenuItem, MenuNav,
    MenuPanel, MenuSeparator, Progress, Radio, RichText, ScrollArea, ScrollAxes, Separator,
    SetterThunk, Slider, Stepper, Switch, Tab, TabList, Text, TextInput, TextSpan, TooltipPanel,
    Widget, WidgetDirt, WidgetId, WidgetMut, WidgetTree,
};

/// Layout styles and geometry vocabulary, re-exported from taffy.
pub use taffy;

/// Accessibility vocabulary, re-exported from accesskit.
pub use accesskit;

/// The reactive runtime, re-exported for convenience.
pub use guiduck_signals as signals;

/// The link-time registry, re-exported so a widget crate's `register_widget!`
/// expansion can name `::guiduck_core::inventory::submit!` without the crate
/// taking its own dependency on it.
pub use inventory;

/// Register a Rust widget from its `.gdw` manifest. Re-exported here so a
/// widget crate depends on `guiduck-core` alone: implement [`Widget`], author a
/// `.gdw`, and `guiduck_core::register_widget!(MyWidget, "widgets/my.gdw")`.
pub use guiduck_component_macro::register_widget;

// The framework's own widgets, submitted to the link-time registry from their
// descriptors — the same registry an application widget joins with
// `register_widget!`, so the interpreter builds a `container` and a `markdown`
// through one mechanism.
guiduck_component_macro::register_builtins!();