1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-24 00:40:35 -08:00

Implement multi-window drag-and-drop under Android

* java/org/gnu/emacs/EmacsNative.java (sendDndDrag, sendDndUri)
(sendDndText): Declare new event-sending functions.

* java/org/gnu/emacs/EmacsView.java (onDragEvent): New function.

* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): New
function; respond to each drag and drop event, request
permissions if necessary and transfer dropped data to Lisp.

* lisp/dnd.el (dnd-unescape-file-uris): New variable.
(dnd-get-local-file-name): If that variable is nil, refrain from
unescaping URLs provided.

* lisp/term/android-win.el (android-handle-dnd-event): New
function.
(special-event-map): Bind drag-n-drop-event.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): New
functions.

* src/androidgui.h (enum android_event_type): New event types
ANDROID_DND_DRAG_EVENT, ANDROID_DND_URI_EVENT,
ANDROID_DND_TEXT_EVENT.
(struct android_dnd_event): New structure.
(union android_event) <dnd>: New field.

* src/androidterm.c (handle_one_android_event)
<ANDROID_DND_..._EVENT>: Generate drag-n-drop events for each
of these types.
(syms_of_androidterm) <Quri, Qtext>: New defsyms.
This commit is contained in:
Po Lu 2023-10-14 10:15:20 +08:00
parent 0dd7e6e3ae
commit 03f5a06a05
8 changed files with 394 additions and 4 deletions

View file

@ -175,6 +175,17 @@ public final class EmacsNative
public static native long sendExpose (short window, int x, int y,
int width, int height);
/* Send an ANDROID_DND_DRAG event. */
public static native long sendDndDrag (short window, int x, int y);
/* Send an ANDROID_DND_URI event. */
public static native long sendDndUri (short window, int x, int y,
String text);
/* Send an ANDROID_DND_TEXT event. */
public static native long sendDndText (short window, int x, int y,
String text);
/* Return the file name associated with the specified file
descriptor, or NULL if there is none. */
public static native byte[] getProcName (int fd);