1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

Update Android port

* java/org/gnu/emacs/EmacsInputConnection.java
(requestCursorUpdates):
* java/org/gnu/emacs/EmacsNative.java (requestCursorUpdates):
* java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo):
New functions.
* src/android.c (struct android_emacs_service)
(android_init_emacs_service): Add new method.
(android_update_cursor_anchor_info): New function.
* src/androidfns.c (android_set_preeditarea): New function.
* src/androidgui.h (enum android_ime_operation): New operation
`REQUEST_CURSOR_UPDATES'.
(struct android_ime_event): Document new meaning of `length'.
* src/androidterm.c (android_request_cursor_updates): New
function.
(android_handle_ime_event): Handle new operations.
(handle_one_android_event, android_draw_window_cursor): Update
the preedit area if needed, like on X.
(requestCursorUpdates): New function.
* src/androidterm.h (struct android_output): New field
`need_cursor_updates'.
This commit is contained in:
Po Lu 2023-05-07 11:09:56 +08:00
parent c0a52c6cef
commit 889b61b999
8 changed files with 213 additions and 1 deletions

View file

@ -3000,6 +3000,34 @@ for more details about these values. */)
make_fixnum (state.temperature));
}
/* Miscellaneous input method related stuff. */
/* Report X, Y, by the phys cursor width and height as the cursor
anchor rectangle for W's frame. */
void
android_set_preeditarea (struct window *w, int x, int y)
{
struct frame *f;
f = WINDOW_XFRAME (w);
/* Convert the window coordinates to the frame's coordinate
space. */
x = (WINDOW_TO_FRAME_PIXEL_X (w, x)
+ WINDOW_LEFT_FRINGE_WIDTH (w)
+ WINDOW_LEFT_MARGIN_WIDTH (w));
y = WINDOW_TO_FRAME_PIXEL_Y (w, y);
/* Note that calculating the baseline is too hard, so the bottom of
the cursor is used instead. */
android_update_cursor_anchor_info (FRAME_ANDROID_WINDOW (f), x,
y, y + w->phys_cursor_height,
y + w->phys_cursor_height);
}
#endif