Skip to main content

WindowOpsImpl

Struct WindowOpsImpl 

Source
pub struct WindowOpsImpl<'a> { /* private fields */ }
Expand description

App-level implementation of teksilo_core::WindowOps handed into every dispatch_event_with_ops call.

Holds &mut WindowManager plus &ActiveEventLoop so open_window can create the winit-level window synchronously before returning. Constructed by TeksiloAppHandler::dispatch_in_window after temporarily removing the dispatching window from WindowManager::windows; the removed tree is borrowed mutably for the handler run.

Implementations§

Source§

impl<'a> WindowOpsImpl<'a>

Source

pub fn new( wm: &'a mut WindowManager, event_loop: &'a ActiveEventLoop, current_id: TeksiloWindowId, current_handle: Option<RawWindowHandle>, current_window_arc: Option<Arc<Window>>, ) -> Self

Trait Implementations§

Source§

impl WindowOps for WindowOpsImpl<'_>

Source§

fn open_window(&mut self, config: WindowConfig) -> TeksiloWindowId

Open a new window. Creates the winit-level window synchronously inside this call and returns its id, which is immediately valid for any other method on this trait.
Source§

fn find_window(&self, string_id: &str) -> Option<TeksiloWindowId>

Look up a window by the stable string id it was opened with (WindowConfig::id). Returns None if no live window carries that id.
Source§

fn window_state(&self, id: TeksiloWindowId) -> Option<WindowState>

Read the reactive state for a specific window.
Source§

fn windows(&self) -> Vec<WindowState>

Every live window’s state, in creation order.
Source§

fn focus_window(&mut self, id: TeksiloWindowId)

Raise a window and give it keyboard focus.
Source§

fn request_activation_token( &mut self, id: TeksiloWindowId, cb: Box<dyn FnOnce(Option<String>)>, )

Request an xdg_activation_v1 token for id — to hand to another window or a child process so it can raise itself on Wayland. cb fires once with the token string, or with None where unsupported (everything but Wayland/X11). Default implementation: immediate None.
Source§

fn request_activation_token_self(&mut self, cb: Box<dyn FnOnce(Option<String>)>)

Like request_activation_token but for the current dispatching window — the one whose handler is running. Works even mid-dispatch, when that window is temporarily out of the manager’s map, because it uses the captured window handle instead of an id lookup. Use this when a focused widget needs a token to hand to another window or process. Default implementation: immediate None.
Source§

fn close_window_by_id(&mut self, id: TeksiloWindowId)

Close a specific window by id. The window is fully torn down before the next event-loop tick.
Source§

fn current_parent_handle(&self) -> Option<ParentHandle>

Extract the platform parent handle of the window currently dispatching the event (the one that owns the in-flight EventContext). Used by native-dialog integrations (teksilo_platform::file_dialog) to parent OS dialogs to the originating Teksilo window. Read more
Source§

fn set_ime_cursor_area(&mut self, area: Rect)

Report the focused text widget’s caret rectangle (in window-logical pixels) so the platform can position the OS IME candidate window next to the insertion point. Called from text-editing widgets whenever the caret moves. The app applies it to the in-flight window’s set_ime_cursor_area, deduped against the last value. Read more
Source§

fn begin_os_drag( &mut self, data: OutboundDragData, image: Option<DragImageData>, ) -> bool

Hand an OS-level drag to the platform when an in-app drag escalates at the window boundary (the pointer left the window carrying an OS-exportable payload). The platform backend (teksilo_platform::external_dnd) starts a native drag session (NSDraggingSource / wl_data_source / OLE IDropSource) using data, optionally drawing image as the drag cursor. Read more
Source§

fn cancel_os_drag(&mut self)

Abandon an OS drag started by Self::begin_os_drag (the user pressed Escape). Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for WindowOpsImpl<'a>

§

impl<'a> !Send for WindowOpsImpl<'a>

§

impl<'a> !Sync for WindowOpsImpl<'a>

§

impl<'a> !UnwindSafe for WindowOpsImpl<'a>

§

impl<'a> Freeze for WindowOpsImpl<'a>

§

impl<'a> Unpin for WindowOpsImpl<'a>

§

impl<'a> UnsafeUnpin for WindowOpsImpl<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more