diff options
| author | Po Lu | 2023-03-10 15:16:05 +0800 |
|---|---|---|
| committer | Po Lu | 2023-03-10 15:16:05 +0800 |
| commit | ae5513ede52536df2cd823699d6168985915ce0f (patch) | |
| tree | 61e38d5c1f5544b03778055af964e4e0289928ac /java | |
| parent | a7c8ae7d675c402923e2ff8359b9cc286792bbb0 (diff) | |
| download | emacs-ae5513ede52536df2cd823699d6168985915ce0f.tar.gz emacs-ae5513ede52536df2cd823699d6168985915ce0f.zip | |
Implement mouse cursors on Android 7.0 and later
* java/org/gnu/emacs/EmacsWindow.java (defineCursor): New
function.
* src/android.c (struct android_emacs_cursor): New struct.
(android_init_emacs_cursor): New function.
(JNICALL): Call it.
(android_create_font_cursor, android_define_cursor)
(android_free_cursor): New functions.
* src/android.h (enum android_handle_type): Add cursor handle
type.
* src/androidfns.c (Fx_create_frame, android_create_tip_frame)
(enum mouse_cursor, struct mouse_cursor_types, mouse_cursor_types)
(struct mouse_cursor_data, android_set_mouse_color)
(syms_of_androidfns):
* src/androidgui.h (enum android_cursor_shape):
* src/androidterm.c (make_invisible_cursor)
(android_toggle_invisible_pointer, android_free_frame_resources)
(android_define_frame_cursor):
* src/androidterm.h (struct android_display_info)
(struct android_output): Port mouse cursor code over from X.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsWindow.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 3569d93136b..6be609edcfe 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java | |||
| @@ -1222,4 +1222,20 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 1222 | } | 1222 | } |
| 1223 | }); | 1223 | }); |
| 1224 | } | 1224 | } |
| 1225 | |||
| 1226 | public void | ||
| 1227 | defineCursor (final EmacsCursor cursor) | ||
| 1228 | { | ||
| 1229 | /* Don't post this message if pointer icons aren't supported. */ | ||
| 1230 | |||
| 1231 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | ||
| 1232 | view.post (new Runnable () { | ||
| 1233 | @Override | ||
| 1234 | public void | ||
| 1235 | run () | ||
| 1236 | { | ||
| 1237 | view.setPointerIcon (cursor.icon); | ||
| 1238 | } | ||
| 1239 | }); | ||
| 1240 | } | ||
| 1225 | }; | 1241 | }; |