Trait zaplib::CxPlatformCommon
source · [−]pub trait CxPlatformCommon {
fn show_text_ime(&mut self, x: f32, y: f32);
fn hide_text_ime(&mut self);
fn start_timer(&mut self, interval: f64, repeats: bool) -> Timer;
fn stop_timer(&mut self, timer: &mut Timer);
fn post_signal(signal: Signal, status: StatusId);
fn update_menu(&mut self, menu: &Menu);
fn copy_text_to_clipboard(&mut self, text: &str);
fn send_event_from_any_thread(event: Event);
}
Expand description
A bunch of traits that are common between the different target platforms. This trait makes sure that there is consistency in the interface, and provides one place for documentation.
Required methods
fn show_text_ime(&mut self, x: f32, y: f32)
fn show_text_ime(&mut self, x: f32, y: f32)
Show an Input Method Editor (IME) at a particular location, typically with everything but the cursor hidden.
fn hide_text_ime(&mut self)
fn hide_text_ime(&mut self)
Hide the IME shown by CxPlatformCommon::show_text_ime
.
fn start_timer(&mut self, interval: f64, repeats: bool) -> Timer
fn start_timer(&mut self, interval: f64, repeats: bool) -> Timer
Start a new Timer
with the given interval
, and which may repeat
if required.
fn stop_timer(&mut self, timer: &mut Timer)
fn stop_timer(&mut self, timer: &mut Timer)
Stop zapTimer
] given by CxPlatformCommon::start_timer
.
fn post_signal(signal: Signal, status: StatusId)
fn post_signal(signal: Signal, status: StatusId)
Post a Signal
from any thread. If you don’t need to use this from a thread, you may
instead use Cx::send_signal
, which might be faster.
Set a Menu
.
fn copy_text_to_clipboard(&mut self, text: &str)
fn copy_text_to_clipboard(&mut self, text: &str)
Copy the given text to the clipboard, if possible.
fn send_event_from_any_thread(event: Event)
fn send_event_from_any_thread(event: Event)
Send zaplib Event for processing from any thread