pub struct DevToolsWindowState {
pub enabled: bool,
pub mode: DevToolsMode,
pub picker_active: bool,
pub selected: Option<u64>,
pub hovered: Option<u64>,
/* private fields */
}Expand description
Per-window devtools interaction, snapshot, overlay-runtime, and remote state.
Self::new starts disabled unless the modern or legacy remote environment
variable contains a valid loopback socket address. Keyboard shortcuts are
Ctrl+Shift+I for visibility, Ctrl+Shift+C for the picker, and Escape to leave
picker mode or hide the overlay.
§Examples
use ailloli_ui_devtools_core::DevToolsMode;
let state = ailloli_ui_winit::devtools::DevToolsWindowState::new();
assert_eq!(state.mode, DevToolsMode::Overlay);
assert!(!state.picker_active);Fields§
§enabled: boolWhether the local overlay may render and consume panel input.
mode: DevToolsModeCurrent overlay placement or hidden mode.
picker_active: boolWhether pointer motion/click selects inspected elements.
selected: Option<u64>Selected inspected element’s numeric id, or none.
hovered: Option<u64>Picker-hovered inspected element’s numeric id, or none.
Implementations§
Source§impl DevToolsWindowState
Window-local devtools lifecycle, event handling, and scene construction.
impl DevToolsWindowState
Window-local devtools lifecycle, event handling, and scene construction.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates overlay state and optionally starts the environment-configured remote.
AILLOLI_UI_DEVTOOLS_REMOTE wins over OCTAVUI_DEVTOOLS_REMOTE. Invalid,
non-loopback, or unbindable addresses behave as no remote and leave the
local overlay disabled.
§Examples
let state = ailloli_ui_winit::devtools::DevToolsWindowState::new();
assert!(state.selected.is_none() && state.hovered.is_none());Sourcepub fn set_remote_addr(&mut self, addr: Option<SocketAddr>)
pub fn set_remote_addr(&mut self, addr: Option<SocketAddr>)
Replaces the remote server with an optional loopback address.
None drops this handle’s channels but does not forcibly disable an
already-enabled local overlay. A successful server enables the overlay
and receives the previously installed host wake. Startup failure leaves
no remote.
§Examples
let mut state = ailloli_ui_winit::devtools::DevToolsWindowState::new();
state.set_remote_addr(None);
assert_eq!(state.mode, ailloli_ui_devtools_core::DevToolsMode::Overlay);Sourcepub fn handle_event(&mut self, event: &Event) -> bool
pub fn handle_event(&mut self, event: &Event) -> bool
Applies queued remote commands, shortcuts, panel input, and picker input.
Returns true only when devtools consumed the event. Panel pointer input
is routed before application content; picker motion updates hover, and a
released primary click selects then disables picking.
§Examples
use ailloli_ui_core::Event;
let mut state = ailloli_ui_winit::devtools::DevToolsWindowState::new();
let _handler: fn(&mut _, &Event) -> bool =
ailloli_ui_winit::devtools::DevToolsWindowState::handle_event;
let _ = &mut state;Sourcepub fn build_scene<A: 'static>(
&mut self,
tree: &ElementTree<A>,
root: ElementId,
viewport: Rect,
scale: Scale,
text_system: &mut TextSystem,
) -> Option<Scene>
pub fn build_scene<A: 'static>( &mut self, tree: &ElementTree<A>, root: ElementId, viewport: Rect, scale: Scale, text_system: &mut TextSystem, ) -> Option<Scene>
Updates the inspected snapshot and optionally builds the local overlay scene.
Remote-only mode still snapshots and publishes while returning None.
Visible mode reconciles, lays out, and paints a separate overlay runtime,
then inserts selection/hover rectangles as the first overlay layer. The
frame index saturates at u64::MAX.
§Examples
use ailloli_ui_core::{ElementId, Rect};
use ailloli_ui_core::math::Scale;
use ailloli_ui_runtime::element::ElementTree;
use ailloli_ui_text::TextSystem;
fn build<A: 'static>(state: &mut ailloli_ui_winit::devtools::DevToolsWindowState,
tree: &ElementTree<A>, root: ElementId, text: &mut TextSystem) {
let scene: Option<ailloli_ui_runtime::scene::Scene> = state.build_scene(
tree, root, Rect::new(0.0, 0.0, 800.0, 600.0), Scale::new(1.0), text);
let _ = scene;
}Trait Implementations§
Source§impl Default for DevToolsWindowState
Delegates to environment-aware Self::new.
impl Default for DevToolsWindowState
Delegates to environment-aware Self::new.
Source§fn default() -> Self
fn default() -> Self
Creates the same state as DevToolsWindowState::new.
Auto Trait Implementations§
impl !Freeze for DevToolsWindowState
impl !RefUnwindSafe for DevToolsWindowState
impl !Send for DevToolsWindowState
impl !Sync for DevToolsWindowState
impl Unpin for DevToolsWindowState
impl !UnwindSafe for DevToolsWindowState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().