pub struct DndManager { /* private fields */ }Expand description
Drag-and-drop manager.
Implementations§
Source§impl DndManager
impl DndManager
Sourcepub 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>
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.
Sourcepub fn motion(&mut self, x: i32, y: i32) -> Result<(), DndError>
pub fn motion(&mut self, x: i32, y: i32) -> Result<(), DndError>
Update cursor position during drag. Performs hit testing and emits events.
Sourcepub fn drop_action(&mut self) -> Result<DndEvent, DndError>
pub fn drop_action(&mut self) -> Result<DndEvent, DndError>
Perform a drop at the current position.
Sourcepub fn finish_transfer(&mut self)
pub fn finish_transfer(&mut self)
Complete the data transfer (called after successful drop).
Sourcepub fn register_target(&mut self, target: DropTarget)
pub fn register_target(&mut self, target: DropTarget)
Register a drop target.
Sourcepub fn unregister_target(&mut self, surface_id: u32)
pub fn unregister_target(&mut self, surface_id: u32)
Unregister a drop target.
Sourcepub fn cursor_position(&self) -> (i32, i32)
pub fn cursor_position(&self) -> (i32, i32)
Get cursor position during drag.
Sourcepub fn source(&self) -> Option<&DragSource>
pub fn source(&self) -> Option<&DragSource>
Get the active drag source info.
Sourcepub fn ghost_position(&self) -> Option<(i32, i32, u32, u32)>
pub fn ghost_position(&self) -> Option<(i32, i32, u32, u32)>
Get the ghost image position (centered on cursor).
Sourcepub fn drain_events(&mut self) -> Vec<DndEvent>
pub fn drain_events(&mut self) -> Vec<DndEvent>
Drain pending events.
Sourcepub fn negotiate_mime(&self, surface_id: u32) -> Option<ClipboardMime>
pub fn negotiate_mime(&self, surface_id: u32) -> Option<ClipboardMime>
Find the best matching MIME between source and a specific target.