The function set-drop-object-supported-formats
sets the list of formats that the drop object
drop-object
wants to receive.
The format :string
can be used to receive a string from another application and the :filename-list
format can be used to receive a list of filenames from another application such as the Macintosh Finder or the Windows Explorer.
GTK+ supports dragging of list of URIs. LispWorks uses a list of URIs to pass/receive the data with the format :filename-list
, and also adds the format :uris
. The behavior is as follows:
:filename-list
(that is, call drag-pane-object with a plist containing :filename-list
, or including :filename-list
in the value that
drag-callback
returns) the argument must be a list of pathname designators. LispWorks canonicalizes the pathnames and converts them to file URIs.:uris
, each value in the list must either a string containing a colon, or a pathname designator. A string containing a colon is passed unchanged. Other it is assumed to be a pathname designator, and is converted to a file URI.:filename-list
(that is, calling drop-object-get-object with :filename-list
), LispWorks converts each file URI to the corresponding filename string (without checking whether it is a proper file name), and discards all other URIs.:uris
, LispWorks returns all the URIs as strings.
There is an example of :filename-list
and :uris
here:
(example-edit-file "capi/elements/gtk-filename-list-and-uris")
On Cocoa and GTK+ the :image
format can be used to receive images. The value passed needs to be an image obtect.
Any other keyword in formats is assumed to be a private format that can only be used to receive objects from with the same Lisp image.
set-drop-object-supported-formats
should only be called within a
drop-callback
. See simple-pane for information about drop callbacks.
(example-edit-file "capi/output-panes/drag-and-drop")
(example-edit-file "capi/choice/drag-and-drop")
(example-edit-file "capi/choice/list-panel-drag-images")
CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017