pub struct TitleBarHostCallbacks {
pub request_close: Rc<dyn Fn()>,
pub post_external: Rc<dyn Fn(Box<dyn Any + Send>)>,
pub teksilo_id: TeksiloWindowId,
}Expand description
Callbacks the window manager hands to a platform host at construction time. Hosts invoke these for operations that must go through the event loop:
request_close: winit 0.30 has no synchronousWindow::request_close, so the host posts aCloseWindowRequestandteksilo-approutes it toWindowManager::queue_close.post_external: the Windows backend forwardsWM_NCLBUTTONUP/WM_NCMOUSEMOVEover its custom title-bar buttons asTitleBarSyntheticEvent/TitleBarHoverEventpayloads through the sameAppEvent::Externalarm. The closure abstracts the posting mechanism (a winitEventLoopProxyin production) so teksilo-core stays winit-free.teksilo_id: the host’s window id, copied into the synthetic payloads so the dispatcher knows which window to address.
Fields§
§request_close: Rc<dyn Fn()>§post_external: Rc<dyn Fn(Box<dyn Any + Send>)>Post a Box<dyn Any + Send> payload back to the application
event loop. Currently used by the Windows backend for
TitleBarSyntheticEvent and TitleBarHoverEvent. Wayland and
macOS construct hosts that never call this.
teksilo_id: TeksiloWindowIdteksilo-side window id. The Windows backend stamps this into
every synthetic payload it posts so the app dispatcher can
route into the right WidgetTree.
Implementations§
Trait Implementations§
Source§impl Clone for TitleBarHostCallbacks
impl Clone for TitleBarHostCallbacks
Source§fn clone(&self) -> TitleBarHostCallbacks
fn clone(&self) -> TitleBarHostCallbacks
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TitleBarHostCallbacks
impl !Send for TitleBarHostCallbacks
impl !Sync for TitleBarHostCallbacks
impl !UnwindSafe for TitleBarHostCallbacks
impl Freeze for TitleBarHostCallbacks
impl Unpin for TitleBarHostCallbacks
impl UnsafeUnpin for TitleBarHostCallbacks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more