1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 22:40:51 -08:00

Update Android port

* java/org/gnu/emacs/EmacsInputConnection.java
(EmacsInputConnection, performContextMenuAction): New function.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
(performContextMenuAction): New function.
* src/android.c (android_get_gc_values): Implement more
efficiently.
* src/androidterm.c (android_handle_ime_event): Pass through
`update' argument to `finish_composing_text'.  Fix thinko.
* src/textconv.c (really_finish_composing_text)
(really_set_composing_text, really_set_composing_region)
(handle_pending_conversion_events_1, finish_composing_text): New
argument `update'.  Notify IME of conversion region changes if
set.
* src/textconv.h: Update structs and prototypes.
This commit is contained in:
Po Lu 2023-06-01 15:16:02 +08:00
parent 9a958c59a2
commit aed0a11147
6 changed files with 136 additions and 23 deletions

View file

@ -256,6 +256,52 @@ public final class EmacsInputConnection extends BaseInputConnection
return true;
}
@Override
public boolean
performContextMenuAction (int contextMenuAction)
{
int action;
if (EmacsService.DEBUG_IC)
Log.d (TAG, "performContextMenuAction: " + contextMenuAction);
/* Translate the action in Java code. That way, a great deal of
JNI boilerplate can be avoided. */
switch (contextMenuAction)
{
case android.R.id.selectAll:
action = 0;
break;
case android.R.id.startSelectingText:
action = 1;
break;
case android.R.id.stopSelectingText:
action = 2;
break;
case android.R.id.cut:
action = 3;
break;
case android.R.id.copy:
action = 4;
break;
case android.R.id.paste:
action = 5;
break;
default:
return true;
}
EmacsNative.performContextMenuAction (windowHandle, action);
return true;
}
@Override
public ExtractedText
getExtractedText (ExtractedTextRequest request, int flags)

View file

@ -208,6 +208,8 @@ public final class EmacsNative
public static native void setSelection (short window, int start, int end);
public static native void performEditorAction (short window,
int editorAction);
public static native void performContextMenuAction (short window,
int contextMenuAction);
public static native ExtractedText getExtractedText (short window,
ExtractedTextRequest req,
int flags);