1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00
Files
egui/crates/egui_inspection/src/lib.rs
lucasmerlin 72389ed5a8 egui_inspection: PNG-encode screenshots on the wire; collapse protocol feature
- FrameScreenshot now carries PNG bytes instead of raw RGBA (PROTOCOL_VERSION 1→2);
  add a shared `encode_png` helper behind a new `png` feature so the live plugin and the
  kittest harness encode frames identically.
- Make the protocol module unconditional: drop the `protocol` feature flag and the
  optional serde/serde_bytes/rmp-serde deps it gated.
- plugin.rs: re-stamp screenshot-bearing frames with the current step (so inspectors
  waiting for step > prev don't reject them) and pump a tail-side repaint while awaiting
  the GPU readback.
2026-05-26 16:20:07 +02:00

36 lines
1.1 KiB
Rust

#![cfg_attr(doc, doc = include_str!("../README.md"))]
//!
//! ## Feature flags
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
pub mod protocol;
pub use protocol::{
Capabilities, Frame, FrameScreenshot, HarnessMessage, InspectorCommand, MAX_MESSAGE_BYTES,
PROTOCOL_VERSION, PeerHello, PeerKind, SourceView, read_message, write_message,
};
/// Environment variable: when set to a local-socket name, [`InspectionPlugin::from_env`]
/// (and similar inspector-side code) connects to it. Parse it with
/// [`transport::socket_name`].
///
/// Exposed unconditionally so both ends of the connection — the plugin (on `plugin`) and
/// the inspector / MCP server — can reference the same name without pulling in the full
/// plugin impl.
pub const INSPECTION_SOCKET_ENV_VAR: &str = "EGUI_INSPECTION_SOCKET";
#[cfg(feature = "transport")]
pub mod transport;
#[cfg(feature = "png")]
mod png;
#[cfg(feature = "png")]
pub use png::encode_png;
#[cfg(feature = "plugin")]
mod plugin;
#[cfg(feature = "plugin")]
pub use plugin::{InspectionError, InspectionPlugin};