pub struct Adapter { /* private fields */ }
Implementations§
Source§impl Adapter
impl Adapter
Sourcepub unsafe fn new(
view: *mut c_void,
is_view_focused: bool,
action_handler: impl 'static + ActionHandler,
) -> Self
pub unsafe fn new( view: *mut c_void, is_view_focused: bool, action_handler: impl 'static + ActionHandler, ) -> Self
Create a new macOS adapter. This function must be called on the main thread.
The action handler will always be called on the main thread.
§Safety
view
must be a valid, unreleased pointer to an NSView
.
Sourcepub fn update_if_active(
&mut self,
update_factory: impl FnOnce() -> TreeUpdate,
) -> Option<QueuedEvents>
pub fn update_if_active( &mut self, update_factory: impl FnOnce() -> TreeUpdate, ) -> Option<QueuedEvents>
If and only if the tree has been initialized, call the provided function
and apply the resulting update. Note: If the caller’s implementation of
ActivationHandler::request_initial_tree
initially returned None
,
the TreeUpdate
returned by the provided function must contain
a full tree.
If a QueuedEvents
instance is returned, the caller must call
QueuedEvents::raise
on it.
Sourcepub fn update_view_focus_state(
&mut self,
is_focused: bool,
) -> Option<QueuedEvents>
pub fn update_view_focus_state( &mut self, is_focused: bool, ) -> Option<QueuedEvents>
Update the tree state based on whether the window is focused.
If a QueuedEvents
instance is returned, the caller must call
QueuedEvents::raise
on it.
pub fn view_children<H: ActivationHandler + ?Sized>( &mut self, activation_handler: &mut H, ) -> *mut NSArray<NSObject>
pub fn focus<H: ActivationHandler + ?Sized>( &mut self, activation_handler: &mut H, ) -> *mut NSObject
pub fn hit_test<H: ActivationHandler + ?Sized>( &mut self, point: NSPoint, activation_handler: &mut H, ) -> *mut NSObject
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Adapter
impl !RefUnwindSafe for Adapter
impl !Send for Adapter
impl !Sync for Adapter
impl Unpin for Adapter
impl !UnwindSafe for Adapter
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