]> git.eshelyaron.com Git - emacs.git/commit
Implement toolkit menus on Android
authorPo Lu <luangruo@yahoo.com>
Sun, 15 Jan 2023 03:57:10 +0000 (11:57 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 15 Jan 2023 03:57:10 +0000 (11:57 +0800)
commit6e2bc91d924fbeb0ad5728e0424eabc905c0d366
treef2835948a308d9d0898b9ef868893560048f6812
parentc02a7b2ff48746fab891db16f58ccdc11d161745
Implement toolkit menus on Android

* java/org/gnu/emacs/EmacsActivity.java (onContextMenuClosed):
New function.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
New field `itemAlreadySelected'.
(onMenuItemClick): New function.
(inflateMenuItems): Attach onClickListener as appropriate.
(display1): Clear itemAlreadySelected.
(display): Fix runnable synchronization.
* java/org/gnu/emacs/EmacsNative.java (sendContextMenu): New
function.
* java/org/gnu/emacs/EmacsView.java (popupMenu):
(cancelPopupMenu): Set popupactive correctly.

* src/android.c (android_run_select_thread): Fix android_select
again.
(android_wait_event): New function.
* src/android.h: Update prototypes.
* src/androidgui.h (enum android_event_type): New
`ANDROID_CONTEXT_MENU' event.
(struct android_menu_event, union android_event): Add new event.

* src/androidmenu.c (struct android_emacs_context_menu): New
structure.
(android_init_emacs_context_menu): Add `dismiss' method.
(struct android_dismiss_menu_data): New structure.
(android_dismiss_menu, android_process_events_for_menu): New
functions.
(android_menu_show): Set an actual item ID.
(popup_activated): Define when stubify as well.
(Fmenu_or_popup_active_p): New function.
(syms_of_androidmenu): New function.

* src/androidterm.c (handle_one_android_event): Handle context
menu events.
* src/androidterm.h (struct android_display_info): New field for
menu item ID.
* src/emacs.c (android_emacs_init): Call syms_of_androidmenu.
* src/xdisp.c (note_mouse_highlight): Return if popup_activated
on Android as well.
12 files changed:
java/org/gnu/emacs/EmacsActivity.java
java/org/gnu/emacs/EmacsContextMenu.java
java/org/gnu/emacs/EmacsNative.java
java/org/gnu/emacs/EmacsView.java
src/android.c
src/android.h
src/androidgui.h
src/androidmenu.c
src/androidterm.c
src/androidterm.h
src/emacs.c
src/xdisp.c