mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-19 22:50:29 -08:00
Introduce an input method callback required by Android 34
* java/org/gnu/emacs/EmacsInputConnection.java (replaceText): New function. * java/org/gnu/emacs/EmacsNative.java (replaceText): Declare native function. * src/androidgui.h (enum android_ime_operation): New operation ANDROID_IME_REPLACE_TEXT. * src/androidterm.c (android_handle_ime_event): Decode text when encountering an ANDROID_IME_REPLACE_TEXT operation. Return if decoding overflowed rather than presenting Qnil to textconv functions. (replaceText): New JNI function. * src/frame.h (enum text_conversion_operation): New operation TEXTCONV_REPLACE_TEXT. * src/textconv.c (really_commit_text): Move point to start if the composing region is set. (really_replace_text): New function. (handle_pending_conversion_events_1) <TEXTCONV_REPLACE_TEXT>: New case. (replace_text): New function. * src/textconv.h: Update prototypes.
This commit is contained in:
parent
253f1aff1a
commit
123b77436e
7 changed files with 238 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ import android.graphics.Bitmap;
|
|||
import android.view.inputmethod.ExtractedText;
|
||||
import android.view.inputmethod.ExtractedTextRequest;
|
||||
import android.view.inputmethod.SurroundingText;
|
||||
import android.view.inputmethod.TextAttribute;
|
||||
import android.view.inputmethod.TextSnapshot;
|
||||
|
||||
public final class EmacsNative
|
||||
|
|
@ -219,6 +220,9 @@ public final class EmacsNative
|
|||
int leftLength,
|
||||
int rightLength);
|
||||
public static native void finishComposingText (short window);
|
||||
public static native void replaceText (short window, int start, int end,
|
||||
String text, int newCursorPosition,
|
||||
TextAttribute attributes);
|
||||
public static native String getSelectedText (short window, int flags);
|
||||
public static native String getTextAfterCursor (short window, int length,
|
||||
int flags);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue