From 77a0e91746e50d0a6dac1c73cd417066d9857b1b Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:42:15 +0200 Subject: [PATCH] more --- src/main.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f897b56..6cdd0c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -use egui::PlatformOutput; use egui_inspect::Inspect; extern crate alloc; @@ -58,6 +57,40 @@ impl std::fmt::Debug for TileDb { } } +pub struct PlatformOutput { + /// Set the cursor to this icon. + pub cursor_icon: (), + + /// If set, open this url. + pub open_url: Option<()>, + + /// If set, put this text in the system clipboard. Ignore if empty. + /// + /// This is often a response to [`crate::Event::Copy`] or [`crate::Event::Cut`]. + /// + /// ``` + /// # egui::__run_test_ui(|ui| { + /// if ui.button("📋").clicked() { + /// ui.output_mut(|o| o.copied_text = "some_text".to_string()); + /// } + /// # }); + /// ``` + pub copied_text: String, + + /// Events that may be useful to e.g. a screen reader. + pub events: Vec<()>, + + /// Is there a mutable [`TextEdit`](crate::TextEdit) under the cursor? + /// Use by `eframe` web to show/hide mobile keyboard and IME agent. + pub mutable_text_under_cursor: bool, + + /// Screen-space position of text edit cursor (used for IME). + pub text_cursor_pos: Option<()>, + + #[cfg(feature = "accesskit")] + pub accesskit_update: Option, +} + pub fn output_mut(writer: impl FnOnce(&mut PlatformOutput) -> R) -> R { loop {} }