diff options
| author | Po Lu | 2023-04-06 09:56:23 +0800 |
|---|---|---|
| committer | Po Lu | 2023-04-06 09:56:23 +0800 |
| commit | 3b07a4b3158d024c6eb19ce0e7c67b799ae0d1fc (patch) | |
| tree | 079cb506217df20375835aa72c4bc52095c8c716 /src/android.c | |
| parent | 458c6e5c9171f41f327ef88f4a4999db586f8e91 (diff) | |
| download | emacs-3b07a4b3158d024c6eb19ce0e7c67b799ae0d1fc.tar.gz emacs-3b07a4b3158d024c6eb19ce0e7c67b799ae0d1fc.zip | |
Implement `yank-media' on Android
* doc/emacs/android.texi (Android Windowing): Update selection
restrictions.
* java/org/gnu/emacs/EmacsClipboard.java (EmacsClipboard): New
functions `getClipboardTargets' and `getClipboardData'.
* java/org/gnu/emacs/EmacsSdk11Clipboard.java
(EmacsSdk11Clipboard, getClipboardTargets, getClipboardData):
Implement.
* java/org/gnu/emacs/EmacsSdk8Clipboard.java: Stub out new
functions.
* lisp/term/android-win.el (android-get-clipboard-1): Implement
MIME type targets.
* src/android.c (android_exception_check)
(android_exception_check_1, android_exception_check_2): Fix
punctuation in warning message.
(android_exception_check_nonnull_1): New function.
* src/android.h: Update prototypes.
* src/androidselect.c (struct android_emacs_clipboard): New
methods.
(android_init_emacs_clipboard): Initialize new methods.
(Fandroid_get_clipboard_targets, android_xfree_inside)
(Fandroid_get_clipboard_data): New functions.
(syms_of_androidselect): Define new subrs.
Diffstat (limited to 'src/android.c')
| -rw-r--r-- | src/android.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/android.c b/src/android.c index 1da8bec316e..7852590acf4 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -5530,7 +5530,7 @@ android_exception_check (void) | |||
| 5530 | if ((*android_java_env)->ExceptionCheck (android_java_env)) | 5530 | if ((*android_java_env)->ExceptionCheck (android_java_env)) |
| 5531 | { | 5531 | { |
| 5532 | __android_log_print (ANDROID_LOG_WARN, __func__, | 5532 | __android_log_print (ANDROID_LOG_WARN, __func__, |
| 5533 | "Possible out of memory error." | 5533 | "Possible out of memory error. " |
| 5534 | " The Java exception follows: "); | 5534 | " The Java exception follows: "); |
| 5535 | /* Describe exactly what went wrong. */ | 5535 | /* Describe exactly what went wrong. */ |
| 5536 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5536 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| @@ -5549,7 +5549,7 @@ android_exception_check_1 (jobject object) | |||
| 5549 | if ((*android_java_env)->ExceptionCheck (android_java_env)) | 5549 | if ((*android_java_env)->ExceptionCheck (android_java_env)) |
| 5550 | { | 5550 | { |
| 5551 | __android_log_print (ANDROID_LOG_WARN, __func__, | 5551 | __android_log_print (ANDROID_LOG_WARN, __func__, |
| 5552 | "Possible out of memory error." | 5552 | "Possible out of memory error. " |
| 5553 | " The Java exception follows: "); | 5553 | " The Java exception follows: "); |
| 5554 | /* Describe exactly what went wrong. */ | 5554 | /* Describe exactly what went wrong. */ |
| 5555 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5555 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| @@ -5568,7 +5568,7 @@ android_exception_check_2 (jobject object, jobject object1) | |||
| 5568 | if ((*android_java_env)->ExceptionCheck (android_java_env)) | 5568 | if ((*android_java_env)->ExceptionCheck (android_java_env)) |
| 5569 | { | 5569 | { |
| 5570 | __android_log_print (ANDROID_LOG_WARN, __func__, | 5570 | __android_log_print (ANDROID_LOG_WARN, __func__, |
| 5571 | "Possible out of memory error." | 5571 | "Possible out of memory error. " |
| 5572 | " The Java exception follows: "); | 5572 | " The Java exception follows: "); |
| 5573 | /* Describe exactly what went wrong. */ | 5573 | /* Describe exactly what went wrong. */ |
| 5574 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5574 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| @@ -5600,6 +5600,27 @@ android_exception_check_nonnull (void *object, jobject object1) | |||
| 5600 | memory_full (0); | 5600 | memory_full (0); |
| 5601 | } | 5601 | } |
| 5602 | 5602 | ||
| 5603 | /* Check for JNI problems based on the value of OBJECT. | ||
| 5604 | |||
| 5605 | Signal out of memory if OBJECT is NULL. OBJECT1 and OBJECT2 mean | ||
| 5606 | the same as in `android_exception_check_2'. */ | ||
| 5607 | |||
| 5608 | void | ||
| 5609 | android_exception_check_nonnull_1 (void *object, jobject object1, | ||
| 5610 | jobject object2) | ||
| 5611 | { | ||
| 5612 | if (object) | ||
| 5613 | return; | ||
| 5614 | |||
| 5615 | if (object1) | ||
| 5616 | ANDROID_DELETE_LOCAL_REF (object1); | ||
| 5617 | |||
| 5618 | if (object2) | ||
| 5619 | ANDROID_DELETE_LOCAL_REF (object2); | ||
| 5620 | |||
| 5621 | memory_full (0); | ||
| 5622 | } | ||
| 5623 | |||
| 5603 | 5624 | ||
| 5604 | 5625 | ||
| 5605 | /* Native image transforms. */ | 5626 | /* Native image transforms. */ |