mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 08:43:40 -07:00
Add file dragging support to NS port
* lisp/dired.el (dired-mouse-drag-files): Document that `dired-mouse-drag-files' now works on NS. * lisp/term/ns-win.el (x-begin-drag): Handle FILE_NAME. * src/nsselect.m (ns_decode_data_to_pasteboard): Handle file URL type. (ns_lisp_to_pasteboard, Fns_begin_drag): Handle new type `file'.
This commit is contained in:
parent
3c5fbfe4ac
commit
ffab237cbf
3 changed files with 32 additions and 2 deletions
|
|
@ -561,17 +561,34 @@ static void
|
|||
ns_decode_data_to_pasteboard (Lisp_Object type, Lisp_Object data,
|
||||
NSPasteboard *pasteboard)
|
||||
{
|
||||
NSArray *types, *new;
|
||||
|
||||
types = [pasteboard types];
|
||||
|
||||
CHECK_SYMBOL (type);
|
||||
|
||||
if (EQ (type, Qstring))
|
||||
{
|
||||
CHECK_STRING (data);
|
||||
|
||||
[pasteboard declareTypes: [NSArray arrayWithObject: NSPasteboardTypeString]
|
||||
new = [types arrayByAddingObject: NSPasteboardTypeString];
|
||||
|
||||
[pasteboard declareTypes: new
|
||||
owner: nil];
|
||||
[pasteboard setString: [NSString stringWithLispString: data]
|
||||
forType: NSPasteboardTypeString];
|
||||
}
|
||||
else if (EQ (type, Qfile))
|
||||
{
|
||||
CHECK_STRING (data);
|
||||
|
||||
new = [types arrayByAddingObject: NSPasteboardTypeFileURL];
|
||||
|
||||
[pasteboard declareTypes: new
|
||||
owner: nil];
|
||||
[pasteboard setString: [NSString stringWithLispString: data]
|
||||
forType: NSPasteboardTypeFileURL];
|
||||
}
|
||||
else
|
||||
signal_error ("Unknown pasteboard type", type);
|
||||
}
|
||||
|
|
@ -582,6 +599,9 @@ ns_lisp_to_pasteboard (Lisp_Object object,
|
|||
{
|
||||
Lisp_Object tem, type, data;
|
||||
|
||||
[pasteboard declareTypes: [NSArray array]
|
||||
owner: nil];
|
||||
|
||||
CHECK_LIST (object);
|
||||
for (tem = object; CONSP (tem); tem = XCDR (tem))
|
||||
{
|
||||
|
|
@ -642,6 +662,9 @@ the meaning of DATA:
|
|||
- `string' means DATA should be a string describing text that will
|
||||
be dragged to another program.
|
||||
|
||||
- `file' means DATA should be a file URL that will be dragged to
|
||||
another program.
|
||||
|
||||
ACTION is the action that will be taken by the drop target towards the
|
||||
data inside PBOARD.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue