⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

DndManager

Struct DndManager 

Source
pub struct DndManager { /* private fields */ }
Expand description

Drag-and-drop manager.

Implementations§

Source§

impl DndManager

Source

pub fn new() -> Self

Create a new DnD manager.

Source

pub fn start_drag( &mut self, source_surface: u32, offered_mimes: Vec<ClipboardMime>, origin_x: i32, origin_y: i32, ghost_width: u32, ghost_height: u32, ) -> Result<(), DndError>

Begin a drag operation.

Source

pub fn motion(&mut self, x: i32, y: i32) -> Result<(), DndError>

Update cursor position during drag. Performs hit testing and emits events.

Source

pub fn drop_action(&mut self) -> Result<DndEvent, DndError>

Perform a drop at the current position.

Source

pub fn cancel(&mut self)

Cancel the current drag operation.

Source

pub fn finish_transfer(&mut self)

Complete the data transfer (called after successful drop).

Source

pub fn register_target(&mut self, target: DropTarget)

Register a drop target.

Source

pub fn unregister_target(&mut self, surface_id: u32)

Unregister a drop target.

Source

pub fn state(&self) -> DndState

Get current DnD state.

Source

pub fn cursor_position(&self) -> (i32, i32)

Get cursor position during drag.

Source

pub fn source(&self) -> Option<&DragSource>

Get the active drag source info.

Source

pub fn ghost_position(&self) -> Option<(i32, i32, u32, u32)>

Get the ghost image position (centered on cursor).

Source

pub fn drain_events(&mut self) -> Vec<DndEvent>

Drain pending events.

Source

pub fn negotiate_mime(&self, surface_id: u32) -> Option<ClipboardMime>

Find the best matching MIME between source and a specific target.

Trait Implementations§

Source§

impl Debug for DndManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DndManager

Available on crate feature alloc only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for DndManager

§

impl RefUnwindSafe for DndManager

§

impl Send for DndManager

§

impl Sync for DndManager

§

impl Unpin for DndManager

§

impl UnwindSafe for DndManager

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.