diff options
| author | Po Lu | 2024-03-11 21:40:47 +0800 |
|---|---|---|
| committer | Po Lu | 2024-03-11 21:41:14 +0800 |
| commit | a7a37341cad230448e487d0ffa343eeeb8a66a65 (patch) | |
| tree | ab06b5826c5ae7bdd5b3dcc85b3ecba8dbee8c84 /src/androidterm.h | |
| parent | 75cfc6c73faa1561018b1212156964a7919c69fe (diff) | |
| download | emacs-a7a37341cad230448e487d0ffa343eeeb8a66a65.tar.gz emacs-a7a37341cad230448e487d0ffa343eeeb8a66a65.zip | |
Implement notification callbacks on Android
* doc/lispref/os.texi (Desktop Notifications): Document that
:on-cancel, :on-action and :actions are now supported on
Android.
* java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New
function.
* java/org/gnu/emacs/EmacsDesktopNotification.java
(NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED):
New constants. <actions, titles>: New fields.
(insertActions): New function.
(display1, display): Insert actions on Jelly Bean and up, and
arrange to be notified when the notification is dismissed.
(CancellationReceiver): New class.
* java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted)
(sendNotificationAction): New functions.
* src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct
return types.
(sendNotificationDeleted, sendNotificationAction)
(android_exception_check_5, android_exception_check_6): New
functions.
* src/android.h:
* src/androidgui.h (struct android_notification_event): New
structure.
(union android_event): New member for notification events.
* src/androidselect.c (android_init_emacs_desktop_notification):
Update JNI signatures.
(android_notifications_notify_1, Fandroid_notifications_notify):
New arguments ACTIONS, ACTION_CB and CANCEL_CB. Convert and
record them as appropriate.
(android_notification_deleted, android_notification_action): New
functions.
(syms_of_androidselect): Prepare a hash table of outstanding
notifications.
<QCactions, QCon_action, QCon_cancel> New defsyms.
* src/androidterm.c (handle_one_android_event)
<ANDROID_NOTIFICATION_DELETED>
<ANDROID_NOTIFICATION_ACTION>: Dispatch event contents to
androidselect.c for processing.
* src/androidterm.h:
* src/androidvfs.c (java_string_class): Export.
* src/keyboard.c (kbd_buffer_get_event) <NOTIFICATION_EVENT>:
Call callback specified by the event.
* src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New
enum NOTIFICATION_EVENT.
Diffstat (limited to 'src/androidterm.h')
| -rw-r--r-- | src/androidterm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/androidterm.h b/src/androidterm.h index 41c93067e82..ca6929bef0e 100644 --- a/src/androidterm.h +++ b/src/androidterm.h | |||
| @@ -25,6 +25,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 25 | #include "character.h" | 25 | #include "character.h" |
| 26 | #include "dispextern.h" | 26 | #include "dispextern.h" |
| 27 | #include "font.h" | 27 | #include "font.h" |
| 28 | #include "termhooks.h" | ||
| 28 | 29 | ||
| 29 | struct android_bitmap_record | 30 | struct android_bitmap_record |
| 30 | { | 31 | { |
| @@ -464,6 +465,11 @@ extern void syms_of_sfntfont_android (void); | |||
| 464 | 465 | ||
| 465 | #ifndef ANDROID_STUBIFY | 466 | #ifndef ANDROID_STUBIFY |
| 466 | 467 | ||
| 468 | extern void android_notification_deleted (struct android_notification_event *, | ||
| 469 | struct input_event *); | ||
| 470 | extern void android_notification_action (struct android_notification_event *, | ||
| 471 | struct input_event *, Lisp_Object); | ||
| 472 | |||
| 467 | extern void init_androidselect (void); | 473 | extern void init_androidselect (void); |
| 468 | extern void syms_of_androidselect (void); | 474 | extern void syms_of_androidselect (void); |
| 469 | 475 | ||