diff options
| author | Po Lu | 2023-06-01 15:16:02 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-01 15:16:02 +0800 |
| commit | aed0a11147e29fc73405f1815fef91ecf6cca7fb (patch) | |
| tree | 35f335168eb4fe2c642a4c1a26109c71c3dacae6 /java | |
| parent | 9a958c59a2ce546e6ec99c58ca181dafeac8dd6b (diff) | |
| download | emacs-aed0a11147e29fc73405f1815fef91ecf6cca7fb.tar.gz emacs-aed0a11147e29fc73405f1815fef91ecf6cca7fb.zip | |
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.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsInputConnection.java | 46 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsNative.java | 2 |
2 files changed, 48 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsInputConnection.java b/java/org/gnu/emacs/EmacsInputConnection.java index 54c98d950aa..eb6fd5f2763 100644 --- a/java/org/gnu/emacs/EmacsInputConnection.java +++ b/java/org/gnu/emacs/EmacsInputConnection.java | |||
| @@ -257,6 +257,52 @@ public final class EmacsInputConnection extends BaseInputConnection | |||
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | @Override | 259 | @Override |
| 260 | public boolean | ||
| 261 | performContextMenuAction (int contextMenuAction) | ||
| 262 | { | ||
| 263 | int action; | ||
| 264 | |||
| 265 | if (EmacsService.DEBUG_IC) | ||
| 266 | Log.d (TAG, "performContextMenuAction: " + contextMenuAction); | ||
| 267 | |||
| 268 | /* Translate the action in Java code. That way, a great deal of | ||
| 269 | JNI boilerplate can be avoided. */ | ||
| 270 | |||
| 271 | switch (contextMenuAction) | ||
| 272 | { | ||
| 273 | case android.R.id.selectAll: | ||
| 274 | action = 0; | ||
| 275 | break; | ||
| 276 | |||
| 277 | case android.R.id.startSelectingText: | ||
| 278 | action = 1; | ||
| 279 | break; | ||
| 280 | |||
| 281 | case android.R.id.stopSelectingText: | ||
| 282 | action = 2; | ||
| 283 | break; | ||
| 284 | |||
| 285 | case android.R.id.cut: | ||
| 286 | action = 3; | ||
| 287 | break; | ||
| 288 | |||
| 289 | case android.R.id.copy: | ||
| 290 | action = 4; | ||
| 291 | break; | ||
| 292 | |||
| 293 | case android.R.id.paste: | ||
| 294 | action = 5; | ||
| 295 | break; | ||
| 296 | |||
| 297 | default: | ||
| 298 | return true; | ||
| 299 | } | ||
| 300 | |||
| 301 | EmacsNative.performContextMenuAction (windowHandle, action); | ||
| 302 | return true; | ||
| 303 | } | ||
| 304 | |||
| 305 | @Override | ||
| 260 | public ExtractedText | 306 | public ExtractedText |
| 261 | getExtractedText (ExtractedTextRequest request, int flags) | 307 | getExtractedText (ExtractedTextRequest request, int flags) |
| 262 | { | 308 | { |
diff --git a/java/org/gnu/emacs/EmacsNative.java b/java/org/gnu/emacs/EmacsNative.java index 56c03ee38dc..eb75201088b 100644 --- a/java/org/gnu/emacs/EmacsNative.java +++ b/java/org/gnu/emacs/EmacsNative.java | |||
| @@ -208,6 +208,8 @@ public final class EmacsNative | |||
| 208 | public static native void setSelection (short window, int start, int end); | 208 | public static native void setSelection (short window, int start, int end); |
| 209 | public static native void performEditorAction (short window, | 209 | public static native void performEditorAction (short window, |
| 210 | int editorAction); | 210 | int editorAction); |
| 211 | public static native void performContextMenuAction (short window, | ||
| 212 | int contextMenuAction); | ||
| 211 | public static native ExtractedText getExtractedText (short window, | 213 | public static native ExtractedText getExtractedText (short window, |
| 212 | ExtractedTextRequest req, | 214 | ExtractedTextRequest req, |
| 213 | int flags); | 215 | int flags); |