Expand description
Drag-and-drop abstractions for Lumen.
Reuses the MimePayload type from [lumen-os-mime] so a single
payload travels across both the clipboard and the DnD pipeline -
mirrors QMimeData / GdkContentProvider.
In-app drag from a DragSource entity to a lumen-core::DropTarget
is now wired end to end: begin_in_app_drag opens an ActiveDrag
session on the drag-gesture threshold (fed by
lumen-primitives::drag), track_drop_hover follows the pointer
marking the hovered target with DropHovered, and
finish_in_app_drag hit-tests the release point and emits
DropAccepted. The inbound file-drop path continues to work
unchanged via lumen-core::FileDropped / PendingFileDrops
(translate_file_drops_to_payload). Cross-window drag-source via
the platform (NSDraggingSession, DoDragDrop, wl_data_source/Xdnd)
is deferred - winit exposes no source API today.
Mirrors: the source-publishes-mime -> target-negotiates-effect ->
drop-carries-source+data shape of QDrag/QMimeData/dropEvent, and
the HTML5 dragstart/dragenter/drop + dataTransfer event model
(so the markup draggable / drop-target / on-drop surface maps
1:1 onto real DOM DnD when transpiled).
Re-exports§
pub use lumen_os_mime as mime;
Structs§
- Active
Drag - In-flight in-app drag session: the source entity, the payload it
published at drag-start, and the effects it advertises.
Nonewhen no drag gesture is active. - Active
Drag Data - Payload of an in-flight
ActiveDrag. - DndPlugin
- Plugin: registers DnD messages + both the platform file-drop -> payload translator and the in-app drag-gesture -> drop pipeline.
- Drag
Source - Marker / data component for an entity that can be the source of a
drag-and-drop. Authored by the markup layer (
<draggable mime=...>follow-up) or imperatively by the app. - Drag
Started - Emitted when a drag starts on a
DragSourceentity (in-app gesture). Cross-window drag-source via the platform is deferred - see crate docs. - Drop
Accept - MIME-type filter declared on a [
lumen_core::DropTarget] (extended by this crate). Drops are rejected when none of the configured kinds match the source payload. - Drop
Accepted - Emitted when the user releases the drag on a hovered drop target (in-app gesture).
- Drop
Effect Set - Bitset of drop effects a source advertises or a target accepts.
Enums§
- Drop
Effect - Single resolved drop effect (one bit of
DropEffectSet).
Functions§
- begin_
in_ app_ drag - Open an
ActiveDragsession and announceDragStartedwhen a drag gesture crosses the threshold on aDragSourceentity. MirrorsQDrag::execbeginning a drag with the source’sQMimeData/ HTML5dragstartpopulatingdataTransfer. - finish_
in_ app_ drag - On the release edge of an active drag, hit-test the drop point and
emit
DropAcceptedat the topmost accepting target - the in-app twin oftranslate_file_drops_to_payload. Mirrors QtdropEventcarrying the source +QMimeData/ HTML5dropcarryingdataTransfer. - track_
drop_ hover - While a drag is active, keep
DropHoveredon the topmost acceptingDropTargetunder the pointer (and off every other target). Mirrors HTML5dragenter/dragleaveso:drag-overstyling follows the cursor. - translate_
file_ drops_ to_ payload - Translate inbound platform
FileDroppedevents intoDropAcceptedwhen the target carries aDropAcceptfilter. Targets without aDropAcceptkeep the old “accept anything” behaviour, soapps/drop-targetkeeps working.