aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-03-10 15:16:13 +0800
committerPo Lu2023-03-10 15:16:13 +0800
commit98d43dbef5786e02389e883ba5b4aaae7f261b79 (patch)
tree168d89b7106f308454ce9e1440ef5d3a7b50edae /java
parentae5513ede52536df2cd823699d6168985915ce0f (diff)
downloademacs-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.java47
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
3Copyright (C) 2023 Free Software Foundation, Inc.
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or (at
10your option) any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
19
20package org.gnu.emacs;
21
22import android.view.PointerIcon;
23import android.os.Build;
24
25/* Cursor wrapper. Note that pointer icons are not supported prior to
26 Android 24. */
27
28public 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};