diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index 165f7b317..4cdc2058d 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -381,87 +381,6 @@ impl Ui { } } -/// # Helpers for accessing the underlying [`Context`]. -/// These functions all lock the [`Context`] owned by this [`Ui`]. -/// Please see the documentation of [`Context`] for how locking works! -impl Ui { - /// Read-only access to the shared [`InputState`]. - /// - /// ``` - /// # egui::__run_test_ui(|ui| { - /// if ui.input(|i| i.key_pressed(egui::Key::A)) { - /// // … - /// } - /// # }); - /// ``` - #[inline] - pub fn input(&self, reader: impl FnOnce(&InputState) -> R) -> R { - self.ctx().input(reader) - } - - /// Read-write access to the shared [`InputState`]. - #[inline] - pub fn input_mut(&self, writer: impl FnOnce(&mut InputState) -> R) -> R { - self.ctx().input_mut(writer) - } - - /// Read-only access to the shared [`Memory`]. - #[inline] - pub fn memory(&self, reader: impl FnOnce(&Memory) -> R) -> R { - self.ctx().memory(reader) - } - - /// Read-write access to the shared [`Memory`]. - #[inline] - pub fn memory_mut(&self, writer: impl FnOnce(&mut Memory) -> R) -> R { - self.ctx().memory_mut(writer) - } - - /// Read-only access to the shared [`IdTypeMap`], which stores superficial widget state. - #[inline] - pub fn data(&self, reader: impl FnOnce(&IdTypeMap) -> R) -> R { - self.ctx().data(reader) - } - - /// Read-write access to the shared [`IdTypeMap`], which stores superficial widget state. - #[inline] - pub fn data_mut(&self, writer: impl FnOnce(&mut IdTypeMap) -> R) -> R { - self.ctx().data_mut(writer) - } - - /// Read-only access to the shared [`PlatformOutput`]. - /// - /// This is what egui outputs each frame. - /// - /// ``` - /// # let mut ctx = egui::Context::default(); - /// ctx.output_mut(|o| o.cursor_icon = egui::CursorIcon::Progress); - /// ``` - #[inline] - pub fn output(&self, reader: impl FnOnce(&PlatformOutput) -> R) -> R { - self.ctx().output(reader) - } - - /// Read-write access to the shared [`PlatformOutput`]. - /// - /// This is what egui outputs each frame. - /// - /// ``` - /// # let mut ctx = egui::Context::default(); - /// ctx.output_mut(|o| o.cursor_icon = egui::CursorIcon::Progress); - /// ``` - #[inline] - pub fn output_mut(&self, writer: impl FnOnce(&mut PlatformOutput) -> R) -> R { - self.ctx().output_mut(writer) - } - - /// Read-only access to [`Fonts`]. - #[inline] - pub fn fonts(&self, reader: impl FnOnce(&Fonts) -> R) -> R { - self.ctx().fonts(reader) - } -} - // ------------------------------------------------------------------------ /// # Sizes etc