mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
New `egui_inspection` crate ships: - `protocol` (default): wire types + length-prefixed msgpack framing for the inspector ↔ egui-peer connection. Transport-neutral (stdio / unix socket / TCP). - `plugin`: `InspectionPlugin`, an `egui::Plugin` that dials a unix socket from `EGUI_INSPECTION_SOCKET`, streams frames + accesskit tree updates, and applies inbound `InspectorCommand`s back into the running `egui::Context`. eframe gains an `inspection` feature that auto-attaches the plugin during native startup (glow + wgpu integrations) when the env var is set. Connection failures log via `log::warn!` and do not abort startup. Lives in its own crate (rather than `egui_kittest`) so eframe can pull the protocol in without picking up the test harness, and so external tools can depend on it directly.
276 lines
8.5 KiB
TOML
276 lines
8.5 KiB
TOML
[package]
|
|
name = "eframe"
|
|
version.workspace = true
|
|
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
|
description = "egui framework - write GUI apps that compiles to web and/or natively"
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
homepage = "https://github.com/emilk/egui/tree/main/crates/eframe"
|
|
license.workspace = true
|
|
readme = "README.md"
|
|
repository = "https://github.com/emilk/egui/tree/main/crates/eframe"
|
|
categories = ["gui", "game-development"]
|
|
keywords = ["egui", "gui", "gamedev"]
|
|
include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml", "data/icon.png"]
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
|
|
rustdoc-args = ["--generate-link-to-definition"]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
|
|
|
|
[features]
|
|
default = [
|
|
"accesskit",
|
|
"default_fonts",
|
|
"wayland", # Required for Linux support (including CI!)
|
|
"web_screen_reader",
|
|
"wgpu",
|
|
"winit/default",
|
|
"x11",
|
|
]
|
|
|
|
## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/).
|
|
accesskit = ["egui-winit/accesskit"]
|
|
|
|
# Allow crates to choose an android-activity backend via Winit
|
|
# - It's important that most applications should not have to depend on android-activity directly, and can
|
|
# rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
|
|
# - It's also important that we don't impose an android-activity backend by taking this choice away from applications.
|
|
|
|
## Enable the `game-activity` backend via `egui-winit` on Android
|
|
android-game-activity = ["egui-winit/android-game-activity"]
|
|
## Enable the `native-activity` backend via `egui-winit` on Android
|
|
android-native-activity = ["egui-winit/android-native-activity"]
|
|
|
|
## If set, egui will use `include_bytes!` to bundle some fonts.
|
|
## If you plan on specifying your own fonts you may disable this feature.
|
|
default_fonts = ["egui/default_fonts"]
|
|
|
|
## Enable [`glow`](https://github.com/grovesNL/glow) for painting, via [`egui_glow`](https://github.com/emilk/egui/tree/main/crates/egui_glow).
|
|
##
|
|
## There is generally no need to enable both the `wgpu` and `glow` features,
|
|
## but if you do you can pick the renderer to use with [`NativeOptions::renderer`]
|
|
## and `WebOptions::renderer`.
|
|
glow = ["dep:egui_glow", "dep:glow", "dep:glutin-winit", "dep:glutin"]
|
|
|
|
## Enable saving app state to disk.
|
|
persistence = ["dep:home", "egui-winit/serde", "egui/persistence", "ron", "serde"]
|
|
|
|
## Enables wayland support and fixes clipboard issue.
|
|
##
|
|
## If you are compiling for Linux (or want to test on a CI system using Linux), you should enable this feature.
|
|
wayland = [
|
|
"egui-winit/wayland",
|
|
"egui-wgpu?/wayland",
|
|
"egui_glow?/wayland",
|
|
"glutin?/wayland",
|
|
"glutin-winit?/wayland",
|
|
]
|
|
|
|
## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web.
|
|
##
|
|
## For other platforms, use the `accesskit` feature instead.
|
|
web_screen_reader = ["web-sys/SpeechSynthesis", "web-sys/SpeechSynthesisUtterance"]
|
|
|
|
## Enable [`wgpu`](https://docs.rs/wgpu) for painting (via [`egui-wgpu`](https://github.com/emilk/egui/tree/main/crates/egui-wgpu)).
|
|
##
|
|
## There is generally no need to enable both the `wgpu` and `glow` features,
|
|
## but if you do you can pick the renderer to use with [`NativeOptions::renderer`]
|
|
## and `WebOptions::renderer`.
|
|
##
|
|
## Switching from `wgpu (the default)` to `glow` can significantly reduce your binary size
|
|
## (including the .wasm of a web app).
|
|
## See <https://github.com/emilk/egui/issues/5889> for more details.
|
|
##
|
|
## By default, eframe will prefer WebGPU over WebGL, but
|
|
## you can configure this at run-time with `WebOptions::wgpu_options`.
|
|
wgpu = ["wgpu_no_default_features", "egui-wgpu/default"]
|
|
|
|
## This is exactly like the `wgpu` feature, but does NOT enable the default features of `wgpu` and `egui-wgpu`.
|
|
##
|
|
## This means that no `wgpu` backends are enabled. You will need to enable them yourself, e.g. like this:
|
|
##
|
|
## ```toml
|
|
## wgpu = { version = "*", features = ["dx12", "metal", "webgl"] }
|
|
## ```
|
|
wgpu_no_default_features = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster"]
|
|
|
|
## Enables compiling for x11.
|
|
x11 = [
|
|
"egui-winit/x11",
|
|
"egui-wgpu?/x11",
|
|
"egui_glow?/x11",
|
|
"glutin?/x11",
|
|
"glutin?/glx",
|
|
"glutin-winit?/x11",
|
|
"glutin-winit?/glx",
|
|
]
|
|
|
|
## If set, eframe will look for the env-var `EFRAME_SCREENSHOT_TO` and write a screenshot to that location, and then quit.
|
|
## This is used to generate images for examples.
|
|
__screenshot = []
|
|
|
|
## Enable the [`egui_inspection`] plugin. When the `EGUI_INSPECTION_SOCKET` env var points
|
|
## at a unix socket, eframe attaches an `InspectionPlugin` to the egui context on startup
|
|
## that streams the AccessKit tree and applies received commands. Unix-only; no-op on
|
|
## non-unix targets.
|
|
inspection = ["dep:egui_inspection", "accesskit"]
|
|
|
|
[dependencies]
|
|
egui = { workspace = true, default-features = false, features = ["bytemuck"] }
|
|
|
|
ahash.workspace = true
|
|
document-features.workspace = true
|
|
log.workspace = true
|
|
parking_lot.workspace = true
|
|
profiling.workspace = true
|
|
raw-window-handle.workspace = true
|
|
static_assertions.workspace = true
|
|
web-time.workspace = true
|
|
|
|
# Optional dependencies
|
|
|
|
egui_glow = { workspace = true, optional = true, default-features = false }
|
|
egui_inspection = { workspace = true, optional = true, features = ["plugin"] }
|
|
glow = { workspace = true, optional = true }
|
|
ron = { workspace = true, optional = true, features = ["integer128"] }
|
|
serde = { workspace = true, optional = true }
|
|
|
|
# -------------------------------------------
|
|
# native:
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
egui-winit = { workspace = true, default-features = false, features = ["clipboard", "links"] }
|
|
image = { workspace = true, features = ["png"] } # Needed for app icon
|
|
winit = { workspace = true, default-features = false, features = ["rwh_06"] }
|
|
|
|
# optional native:
|
|
egui-wgpu = { workspace = true, optional = true, features = [
|
|
"winit",
|
|
"capture",
|
|
] } # if wgpu is used, use it with winit
|
|
pollster = { workspace = true, optional = true } # needed for wgpu
|
|
|
|
glutin = { workspace = true, optional = true, default-features = false, features = ["egl", "wgl"] }
|
|
glutin-winit = { workspace = true, optional = true, default-features = false, features = [
|
|
"egl",
|
|
"wgl",
|
|
] }
|
|
home = { workspace = true, optional = true }
|
|
|
|
# mac:
|
|
[target.'cfg(any(target_os = "macos"))'.dependencies]
|
|
objc2.workspace = true
|
|
objc2-foundation = { workspace = true, default-features = false, features = [
|
|
"std",
|
|
"block2",
|
|
"NSData",
|
|
"NSString",
|
|
] }
|
|
objc2-app-kit = { workspace = true, default-features = false, features = [
|
|
"std",
|
|
"NSApplication",
|
|
"NSBitmapImageRep",
|
|
"NSButton",
|
|
"NSControl",
|
|
"NSGraphics",
|
|
"NSImage",
|
|
"NSImageRep",
|
|
"NSMenu",
|
|
"NSMenuItem",
|
|
"NSResponder",
|
|
"NSView",
|
|
"NSWindow",
|
|
] }
|
|
|
|
# windows:
|
|
[target.'cfg(any(target_os = "windows"))'.dependencies]
|
|
windows-sys = { workspace = true, features = [
|
|
"Win32_Foundation",
|
|
"Win32_System_Com",
|
|
"Win32_UI_Input_KeyboardAndMouse",
|
|
"Win32_UI_Shell",
|
|
"Win32_UI_WindowsAndMessaging",
|
|
] }
|
|
|
|
# -------------------------------------------
|
|
# web:
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
bytemuck.workspace = true
|
|
image = { workspace = true, features = ["png"] } # For copying images
|
|
js-sys.workspace = true
|
|
percent-encoding.workspace = true
|
|
wasm-bindgen.workspace = true
|
|
wasm-bindgen-futures.workspace = true
|
|
web-sys = { workspace = true, features = [
|
|
"AddEventListenerOptions",
|
|
"BinaryType",
|
|
"Blob",
|
|
"BlobPropertyBag",
|
|
"Clipboard",
|
|
"ClipboardEvent",
|
|
"ClipboardItem",
|
|
"CompositionEvent",
|
|
"console",
|
|
"CssStyleDeclaration",
|
|
"DataTransfer",
|
|
"DataTransferItem",
|
|
"DataTransferItemList",
|
|
"Document",
|
|
"DomRect",
|
|
"DragEvent",
|
|
"Element",
|
|
"Event",
|
|
"EventListener",
|
|
"EventTarget",
|
|
"ExtSRgb",
|
|
"File",
|
|
"FileList",
|
|
"FocusEvent",
|
|
"HtmlCanvasElement",
|
|
"HtmlElement",
|
|
"HtmlInputElement",
|
|
"InputEvent",
|
|
"KeyboardEvent",
|
|
"Location",
|
|
"MediaQueryList",
|
|
"MediaQueryListEvent",
|
|
"MouseEvent",
|
|
"Navigator",
|
|
"Node",
|
|
"NodeList",
|
|
"Performance",
|
|
"ResizeObserver",
|
|
"ResizeObserverBoxOptions",
|
|
"ResizeObserverEntry",
|
|
"ResizeObserverOptions",
|
|
"ResizeObserverSize",
|
|
"ShadowRoot",
|
|
"Storage",
|
|
"Touch",
|
|
"TouchEvent",
|
|
"PointerEvent",
|
|
"TouchList",
|
|
"WebGl2RenderingContext",
|
|
"WebglDebugRendererInfo",
|
|
"WebGlRenderingContext",
|
|
"WheelEvent",
|
|
"Window",
|
|
] }
|
|
|
|
# optional web:
|
|
egui-wgpu = { workspace = true, optional = true, features = [
|
|
# if wgpu is used, use it without (!) winit:
|
|
"capture",
|
|
] }
|
|
wgpu = { workspace = true, optional = true }
|
|
|
|
# Native dev dependencies for testing
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
|
directories.workspace = true
|