The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and ?theme choose what shows; an unknown one fails in the page and the log. set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS. scripts/stories.py writes examples/gallery/stories.json from the pages.
31 lines
829 B
Rust
31 lines
829 B
Rust
mod machine;
|
|
mod profiling;
|
|
mod session;
|
|
|
|
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
|
|
|
|
use super::Page;
|
|
use crate::step::Step;
|
|
|
|
pub const PAGE: Page = Page {
|
|
number: 20,
|
|
slug: "debug",
|
|
title: "Debug",
|
|
summary: "A paused program: its breakpoints, stack, threads and values, memory and machine code; profiles and network.",
|
|
render,
|
|
script: SCRIPT,
|
|
};
|
|
|
|
const SCRIPT: &[Step] = &[Step::Rest];
|
|
|
|
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
|
|
div()
|
|
.child(session::session(window, cx))
|
|
.child(session::breakpoints_and_stack(window, cx))
|
|
.child(session::values(window, cx))
|
|
.child(machine::machine(window, cx))
|
|
.child(profiling::profiles(window, cx))
|
|
.child(profiling::network(window, cx))
|
|
.into_any_element()
|
|
}
|