aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidgui.h
diff options
context:
space:
mode:
authorPo Lu2023-03-10 15:16:05 +0800
committerPo Lu2023-03-10 15:16:05 +0800
commitae5513ede52536df2cd823699d6168985915ce0f (patch)
tree61e38d5c1f5544b03778055af964e4e0289928ac /src/androidgui.h
parenta7c8ae7d675c402923e2ff8359b9cc286792bbb0 (diff)
downloademacs-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 'src/androidgui.h')
-rw-r--r--src/androidgui.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/androidgui.h b/src/androidgui.h
index 5858a168080..b918d03ceca 100644
--- a/src/androidgui.h
+++ b/src/androidgui.h
@@ -36,6 +36,7 @@ typedef android_handle android_pixmap, Emacs_Pixmap;
36typedef android_handle android_window, Emacs_Window; 36typedef android_handle android_window, Emacs_Window;
37typedef android_handle android_gcontext, GContext; 37typedef android_handle android_gcontext, GContext;
38typedef android_handle android_drawable, Drawable; 38typedef android_handle android_drawable, Drawable;
39typedef android_handle android_cursor, Emacs_Cursor;
39 40
40typedef unsigned int android_time; 41typedef unsigned int android_time;
41 42
@@ -162,10 +163,6 @@ struct android_swap_info
162 enum android_swap_action swap_action; 163 enum android_swap_action swap_action;
163}; 164};
164 165
165/* Android doesn't support cursors, so define this to something
166 unused. */
167typedef char Emacs_Cursor;
168
169#define NativeRectangle Emacs_Rectangle 166#define NativeRectangle Emacs_Rectangle
170#define CONVERT_TO_NATIVE_RECT(xr, nr) ((xr) = (nr)) 167#define CONVERT_TO_NATIVE_RECT(xr, nr) ((xr) = (nr))
171#define CONVERT_FROM_EMACS_RECT(xr, nr) ((nr) = (xr)) 168#define CONVERT_FROM_EMACS_RECT(xr, nr) ((nr) = (xr))
@@ -620,6 +617,29 @@ extern void android_update_extracted_text (android_window, void *,
620 int); 617 int);
621extern int android_set_fullscreen (android_window, bool); 618extern int android_set_fullscreen (android_window, bool);
622 619
620enum android_cursor_shape
621 {
622 ANDROID_XC_XTERM = 1008,
623 ANDROID_XC_LEFT_PTR = 1000,
624 ANDROID_XC_WATCH = 1004,
625 ANDROID_XC_HAND2 = 1002,
626 ANDROID_XC_SB_H_DOUBLE_ARROW = 1014,
627 ANDROID_XC_SB_V_DOUBLE_ARROW = 1015,
628 ANDROID_XC_LEFT_SIDE = 1020,
629 ANDROID_XC_TOP_LEFT_CORNER = 1020,
630 ANDROID_XC_TOP_SIDE = 1020,
631 ANDROID_XC_TOP_RIGHT_CORNER = 1020,
632 ANDROID_XC_RIGHT_SIDE = 1020,
633 ANDROID_XC_BOTTOM_RIGHT_CORNER = 1020,
634 ANDROID_XC_BOTTOM_SIDE = 1020,
635 ANDROID_XC_BOTTOM_LEFT_CORNER = 1020,
636 ANDROID_XC_NULL = 0,
637 };
638
639extern android_cursor android_create_font_cursor (enum android_cursor_shape);
640extern void android_define_cursor (android_window, android_cursor);
641extern void android_free_cursor (android_cursor);
642
623#endif 643#endif
624 644
625 645