Skip to main content

Crate azul_core

Crate azul_core 

Source
Expand description

Shared datatypes for azul-* crates

azul-core provides the platform-independent core types used throughout the Azul toolkit. Key modules include dom for DOM construction, callbacks for event callback types, styled_dom for the CSSOM, and window for OS windowing abstractions.

This crate depends on azul_css for CSS property definitions and is consumed by azul-layout, azul-dll, and the platform shell crates. It supports no_std environments via #![cfg_attr(not(feature = "std"), no_std)].

Modules§

a11y
Accessibility types for screen-reader integration (AccessKit). Accessibility types for screen reader support.
animation
CSS animation and transition configuration. Core data structures for configuring and tracking CSS animations
audio
Audio POD types — AudioConfig (stream format) + AudioFrame (interleaved f32 samples). The unit captured from the mic, played back, and (P8) shared over UDP. Backend (rodio / cpal / AVAudioEngine / AAudio) lives dll-side. POD types for the audio surface (SUPER_PLAN_2 §4 P7).
biometric
Biometric-auth POD types — BiometricKind + BiometricResult + BiometricPrompt. Stateful manager lives in azul_layout::managers::biometric. POD types for the biometric-authentication surface (SUPER_PLAN_2 §1 feature 4 + research/02).
callbacks
Callback types: layout, event, timer, thread, and focus handling. Callback types for the Azul UI framework.
camera
Camera-capture POD types — CaptureStreamId + CameraConfig + CameraFacing + StreamState + … . The stateful CameraStream / CameraManager (which own the shared ImageRef texture) live in azul_layout::managers::camera. POD types for the camera-capture surface (SUPER_PLAN_2 §4 Priority 6 + research/01).
compact_cache_builder
Converts CssPropertyCache into compact three-tier numeric cache. Builder function to convert CssPropertyCache → CompactLayoutCache.
db
SQL database POD types — DbValue + DbRows (engine-agnostic). The Db handle + SQLite engine live in azul_dll behind db-sqlite. POD types for the SQL database surface (SUPER_PLAN_2 §4 P4.3).
debug
Debug logging system with category filtering. Debug logging types and macros for Azul.
diff
Linear-time DOM diffing for incremental updates. DOM Reconciliation Module
dom
DOM construction: Dom, NodeData, NodeType, and the CSS-in-Rust API. Defines the core Document Object Model (DOM) structures.
drag
Drag context for text selection, scrollbar, node, and window drags. Unified drag context for all drag operations.
events
Event filtering: mouse, keyboard, window, and synthetic events. Event and callback filtering module
gamepad
Gamepad POD types — GamepadId + GamepadButton + GamepadAxis + GamepadState. Stateful manager lives in azul_layout::managers::gamepad. POD types for the gamepad / game-controller surface (SUPER_PLAN_2 §1 feature 6 + research/03 §“Feature 6”).
geolocation
Geolocation POD types — LocationFix + GeolocationProbeConfig. Stateful manager lives in azul_layout::managers::geolocation. POD types for the geolocation surface. Defined here in azul-core so NodeType::GeolocationProbe(GeolocationProbeConfig) can carry the config without azul-layout having to be a azul-core dependency.
geom
Logical and physical coordinate types (LogicalSize, PhysicalPosition, etc.). Logical and physical coordinate types for the GUI toolkit.
gl
OpenGL context wrappers, shader compilation, and texture cache. OpenGL context wrappers, texture cache management, shader compilation, vertex buffer abstractions, and FFI-safe GL type aliases for the C/Python API.
gl_fxaa
FXAA (Fast Approximate Anti-Aliasing) shader. FXAA (Fast Approximate Anti-Aliasing) shader implementation.
glconst
OpenGL constants (GL 1.1 through GL 4.x). OpenGL constants (GL 1.1 through GL 4.x and common extensions).
gpu
GPU value cache for CSS transforms and opacity. GPU value caching for CSS transforms and opacity.
hit_test
Hit-test results: which DOM nodes are under the cursor. Hit-test result types for determining which DOM nodes are under the cursor, scroll state tracking, and pipeline/document identification. These types feed into the event dispatch system.
hit_test_tag
Type-safe hit-test tag system for compositor integration. Type-safe hit-test tag system for WebRender integration.
host_invoker
Host-language callback invoker registry — the C-ABI surface managed-FFI bindings (Lua, Ruby, …) use to register one per-kind invoker + a single shared releaser, so callbacks can be created via _createFromHostHandle without the host having to generate trampolines for struct-by-value signatures their FFI library can’t handle. Host-language callback invoker registry.
icon
Icon provider system for loading icons from fonts, images, or zip packs. Generic icon provider system for Azul
id
Arena-based node tree storage and hierarchy management. Node tree data structures and hierarchy management.
json
JSON value types for the C API (no serde dependency). JSON value types for C API (data definitions only, no serde_json dependency)
keyring
System-keyring POD types — KeyringRequest + KeyringResult. Stateful manager lives in azul_layout::managers::keyring. POD types for the system-keyring surface (SUPER_PLAN_2 §4 P4.2 + research/02 §0 “hardware-bound” storage).
macros
Internal macros for Vec, Option, and callback boilerplate. Utility macros for implementing common trait patterns on callback types and enum conversions (From, Display). Used by the core, layout, and css crates.
menu
Menu system: context menus, dropdown menus, and menu bars. Menu system for context menus, dropdown menus, and application menus.
profile
Unified AZ_PROFILE gate for memory and CPU profiling instrumentation. Unified profiling gate.
prop_cache
CSS property cache for efficient per-node style resolution. CSS property cache for efficient style resolution and animation.
refany
Type-erased, ref-counted smart pointer with runtime borrow checking. Type-erased, reference-counted smart pointer with runtime borrow checking.
resources
Resource management: font/image loading, caching, and garbage collection. Resource management types for the application.
screencap
Screen-capture POD types — ScreenCaptureSource + ScreenCaptureConfig. Symmetric to the camera surface (a “dumb widget” in azul_layout::widgets::screencap); reuses camera’s capture status types. POD types for the screen-capture surface (SUPER_PLAN_2 §4 Priority 6 + research/01).
selection
Text selection and cursor positioning for inline content. Text selection and cursor positioning for inline content.
sensors
Motion-sensor POD types — SensorKind + SensorReading. Stateful manager lives in azul_layout::managers::sensors. POD types for the motion-sensor surface (SUPER_PLAN_2 §1 feature 5 + research/03 §“Feature 5”).
style
CSS cascade: selector matching, specificity, and property inheritance. DOM tree to CSS style tree cascading.
styled_dom
StyledDom — the result of applying CSS to a DOM tree (the CSSOM). StyledDom — the result of applying CSS styles to a DOM tree.
svg
SVG rendering, path tessellation, and geometric operations. SVG rendering and path tessellation.
svg_path_parser
SVG d="" path data parser. SVG d="" path data parser.
task
Timer, thread, and async task management. Timer and thread management for asynchronous operations.
transform
3D transform matrix computation for CSS transforms. 3D transform matrix computations for CSS transforms.
ua_css
Built-in user-agent default stylesheet. User-Agent Default Stylesheet for Azul
udp_framing
UDP chunked-message framing (P8): split a >MTU payload into sequenced datagrams + reassemble them, tolerating reorder + loss. Pure logic the dll’s Udp handle builds on; unit-tested here. See udp_framing.rs. UDP chunked-message framing (SUPER_PLAN_2 P8).
ui_solver
Default font/text constants and small geometry helpers for layout. Small geometry types used by the layout solver and text shaping pipeline.
video
Video-playback POD types — VideoConfig (source URL + autoplay/loop). Same “dumb widget” architecture (azul_layout::widgets::video); decoded via vk-video into the shared GL texture. POD types for the video-playback surface (SUPER_PLAN_2 §4 Priority 6 + research).
window
Window configuration, input state, and platform-specific options. Window configuration types, input state, and platform-specific options.
xml
XML and XHTML parsing for declarative UI definitions. XML and XHTML parsing for declarative UI definitions.

Macros§

impl_callback
Implements Display, Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord for a callback struct with .cb (function pointer) and .ctx (OptionRefAny) fields. Also implements From<$callback_ty> to create a callback from a raw function pointer.
impl_callback_simple
Macro to implement callback traits for simple system callbacks (no callable field)
impl_callback_traits
Helper macro implementing the shared trait impls (Display, Debug, Hash, PartialEq, Eq, PartialOrd, Ord) for callback types. Used internally by [impl_callback!] and [impl_callback_simple!].
impl_display
Implement Display for an enum.
impl_from
Implement the From trait for any type.
impl_managed_callback
Macro that expands to the per-callback-kind boilerplate: a static thunk (compiled into libazul) that the framework calls with by-value args, a <Wrapper>::create_from_host_handle(u64) constructor, and an AzApp_set<Kind>Invoker setter the host calls once at module load.
log_debug
Log a message at debug level
log_error
Log a message at error level
log_info
Log a message at info level
log_trace
Log a message at trace level
log_warn
Log a message at warn level

Type Aliases§

FastBTreeSet
OrderedMap
Ordered map alias used throughout azul-core.