Skip to main content

Module dnd

Module dnd 

Structs§

CopiedFiles
The files a copy names: the paths of a URI_LIST_MIME body, or of a COPIED_FILES_MIME one with the cut it started with.

Enums§

DragPayload

Constants§

COPIED_FILES_MIME
The mime type a file manager’s copy of files travels as when it also says whether the copy is a cut, first line copy or cut and the URI list after it.
DRAG_START_THRESHOLD_PX
Threshold in logical pixels after which a pointer press-and-move is promoted to a drag gesture. Matches macOS / GTK conventions.
URI_LIST_MIME
The mime type a list of file:// URIs travels as.

Functions§

copied_files
Read back the files uri_list wrote, in mime.
copied_files_list
The COPIED_FILES_MIME body for paths: a first line saying whether the copy is a cut or a copy, then the uri_list, as a file manager writes it.
host_drags_in_process
The compositor hosts this process’s apps itself (no window): a drag an app starts is kept for the host to carry (take_hosted_drag).
is_file_mime
Whether mime is one of the formats a copy of files on the clipboard travels as.
mime_for_path
The mime type to offer a file’s bytes under, from its extension.
set_drag_window
Publish the window a drag out of this app is issued on.
start_drag_offering
Start a drag carrying arbitrary offers (mime type → bytes).
start_file_drag
Start a drag carrying paths, out of this app and into whatever application the pointer is released over. Call from a press-and-move gesture once the pointer has travelled DRAG_START_THRESHOLD_PX while the button is still held, so the compositor can validate the drag against that implicit grab.
take_hosted_drag
The drag a hosted app asked for since the last call: bytes per format. A file offered under its own content type is left out (the host would have to read it whole); the text/uri-list naming it stays.
uri_list
The text/uri-list body for paths: one file:// URI per line, CRLF terminated as RFC 2483 wants, with the bytes a URI cannot carry verbatim percent-encoded. A path that is not absolute has no file URI and is left out.