diff options
| author | Po Lu | 2023-03-10 15:16:13 +0800 |
|---|---|---|
| committer | Po Lu | 2023-03-10 15:16:13 +0800 |
| commit | 98d43dbef5786e02389e883ba5b4aaae7f261b79 (patch) | |
| tree | 168d89b7106f308454ce9e1440ef5d3a7b50edae /java | |
| parent | ae5513ede52536df2cd823699d6168985915ce0f (diff) | |
| download | emacs-98d43dbef5786e02389e883ba5b4aaae7f261b79.tar.gz emacs-98d43dbef5786e02389e883ba5b4aaae7f261b79.zip | |
* java/org/gnu/emacs/EmacsCursor.java: New file.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsCursor.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsCursor.java b/java/org/gnu/emacs/EmacsCursor.java new file mode 100644 index 00000000000..c14c6f2a11b --- /dev/null +++ b/java/org/gnu/emacs/EmacsCursor.java | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | ||
| 2 | |||
| 3 | Copyright (C) 2023 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 10 | your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | package org.gnu.emacs; | ||
| 21 | |||
| 22 | import android.view.PointerIcon; | ||
| 23 | import android.os.Build; | ||
| 24 | |||
| 25 | /* Cursor wrapper. Note that pointer icons are not supported prior to | ||
| 26 | Android 24. */ | ||
| 27 | |||
| 28 | public final class EmacsCursor extends EmacsHandleObject | ||
| 29 | { | ||
| 30 | /* The pointer icon associated with this cursor. */ | ||
| 31 | public final PointerIcon icon; | ||
| 32 | |||
| 33 | public | ||
| 34 | EmacsCursor (short handle, int glyph) | ||
| 35 | { | ||
| 36 | super (handle); | ||
| 37 | |||
| 38 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) | ||
| 39 | { | ||
| 40 | icon = null; | ||
| 41 | return; | ||
| 42 | } | ||
| 43 | |||
| 44 | icon = PointerIcon.getSystemIcon (EmacsService.SERVICE, | ||
| 45 | glyph); | ||
| 46 | } | ||
| 47 | }; | ||