diff options
| author | Po Lu | 2023-01-15 11:57:10 +0800 |
|---|---|---|
| committer | Po Lu | 2023-01-15 11:57:10 +0800 |
| commit | 6e2bc91d924fbeb0ad5728e0424eabc905c0d366 (patch) | |
| tree | f2835948a308d9d0898b9ef868893560048f6812 /src/androidterm.h | |
| parent | c02a7b2ff48746fab891db16f58ccdc11d161745 (diff) | |
| download | emacs-6e2bc91d924fbeb0ad5728e0424eabc905c0d366.tar.gz emacs-6e2bc91d924fbeb0ad5728e0424eabc905c0d366.zip | |
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.
Diffstat (limited to 'src/androidterm.h')
| -rw-r--r-- | src/androidterm.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/androidterm.h b/src/androidterm.h index e83e32a5854..9aa09877196 100644 --- a/src/androidterm.h +++ b/src/androidterm.h | |||
| @@ -132,6 +132,10 @@ struct android_display_info | |||
| 132 | 132 | ||
| 133 | /* The time of the last mouse movement. */ | 133 | /* The time of the last mouse movement. */ |
| 134 | Time last_mouse_movement_time; | 134 | Time last_mouse_movement_time; |
| 135 | |||
| 136 | /* ID of the last menu event received. -1 means Emacs is waiting | ||
| 137 | for a context menu event. */ | ||
| 138 | int menu_event_id; | ||
| 135 | }; | 139 | }; |
| 136 | 140 | ||
| 137 | /* Structure representing a single tool (finger or stylus) pressed | 141 | /* Structure representing a single tool (finger or stylus) pressed |
| @@ -407,6 +411,7 @@ extern void android_finalize_font_entity (struct font_entity *); | |||
| 407 | extern Lisp_Object android_menu_show (struct frame *, int, int, int, | 411 | extern Lisp_Object android_menu_show (struct frame *, int, int, int, |
| 408 | Lisp_Object, const char **); | 412 | Lisp_Object, const char **); |
| 409 | extern void init_androidmenu (void); | 413 | extern void init_androidmenu (void); |
| 414 | extern void syms_of_androidmenu (void); | ||
| 410 | 415 | ||
| 411 | /* Defined in sfntfont-android.c. */ | 416 | /* Defined in sfntfont-android.c. */ |
| 412 | 417 | ||