diff options
| author | Po Lu | 2023-02-25 19:11:07 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-25 19:11:07 +0800 |
| commit | 8e4c5db193dc7baee5846520fe8b63d8bea99148 (patch) | |
| tree | 595eb65601d38b7895ae1d00ec9a71a947cd1af7 /src/android.h | |
| parent | d5cccfdc564f1486431f9674503c794df33d7fbc (diff) | |
| download | emacs-8e4c5db193dc7baee5846520fe8b63d8bea99148.tar.gz emacs-8e4c5db193dc7baee5846520fe8b63d8bea99148.zip | |
Update Android port
* doc/emacs/android.texi (Android Startup, Android File System)
(Android Environment, Android Windowing, Android
Troubleshooting): Improve documentation; fix typos.
* doc/lispref/commands.texi (Misc Events): Likewise.
* java/org/gnu/emacs/EmacsService.java (queryBattery): New
function.
* lisp/battery.el (battery-status-function): Set appropriately
for Android.
(battery-android): New function.
* src/android.c (struct android_emacs_service): New method
`query_battery'.
(android_check_content_access): Improve exception checking.
(android_init_emacs_service): Look up new method.
(android_destroy_handle, android_create_window)
(android_init_android_rect_class, android_init_emacs_gc_class)
(android_set_clip_rectangles)
(android_create_pixmap_from_bitmap_data, android_fill_polygon)
(android_get_image, android_put_image, android_bell)
(android_set_input_focus, android_raise_window)
(android_lower_window, android_query_tree, android_get_geometry)
(android_translate_coordinates, android_wc_lookup_string)
(android_damage_window, android_build_string)
(android_build_jstring, android_exception_check_1)
(android_exception_check_2): New functions.
(android_browse_url): Improve exception handling. Always use
android_exception_check and don't leak local refs.
(android_query_battery): New function.
* src/android.h (struct android_battery_state): New struct.
* src/androidfns.c (Fandroid_query_battery, syms_of_androidfns):
New function.
* src/androidfont.c (androidfont_from_lisp, DO_SYMBOL_FIELD)
(DO_CARDINAL_FIELD, androidfont_list, androidfont_match)
(androidfont_draw, androidfont_open_font)
(androidfont_close_font):
* src/androidselect.c (Fandroid_set_clipboard)
(Fandroid_get_clipboard):
* src/sfnt.c (sfnt_map_glyf_table):
* src/sfntfont.c (sfntfont_free_outline_cache)
(sfntfont_free_raster_cache, sfntfont_close): Allow font close
functions to be called twice.
Diffstat (limited to 'src/android.h')
| -rw-r--r-- | src/android.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/android.h b/src/android.h index ec4fa33dfc3..01076c36b70 100644 --- a/src/android.h +++ b/src/android.h | |||
| @@ -84,6 +84,8 @@ extern void android_set_dont_accept_focus (android_window, bool); | |||
| 84 | extern jstring android_build_string (Lisp_Object); | 84 | extern jstring android_build_string (Lisp_Object); |
| 85 | extern jstring android_build_jstring (const char *); | 85 | extern jstring android_build_jstring (const char *); |
| 86 | extern void android_exception_check (void); | 86 | extern void android_exception_check (void); |
| 87 | extern void android_exception_check_1 (jobject); | ||
| 88 | extern void android_exception_check_2 (jobject, jobject); | ||
| 87 | 89 | ||
| 88 | extern void android_get_keysym_name (int, char *, size_t); | 90 | extern void android_get_keysym_name (int, char *, size_t); |
| 89 | extern void android_wait_event (void); | 91 | extern void android_wait_event (void); |
| @@ -106,7 +108,37 @@ extern void android_closedir (struct android_dir *); | |||
| 106 | 108 | ||
| 107 | /* Very miscellaneous functions. */ | 109 | /* Very miscellaneous functions. */ |
| 108 | 110 | ||
| 111 | struct android_battery_state | ||
| 112 | { | ||
| 113 | /* Battery charge level in integer percentage. */ | ||
| 114 | intmax_t capacity; | ||
| 115 | |||
| 116 | /* Battery charge level in microampere-hours. */ | ||
| 117 | intmax_t charge_counter; | ||
| 118 | |||
| 119 | /* Battery current in microampere-hours. */ | ||
| 120 | intmax_t current_average; | ||
| 121 | |||
| 122 | /* Instantaneous battery current in microampere-hours. */ | ||
| 123 | intmax_t current_now; | ||
| 124 | |||
| 125 | /* Estimate as to the amount of time remaining until the battery is | ||
| 126 | charged, in milliseconds. */ | ||
| 127 | intmax_t remaining; | ||
| 128 | |||
| 129 | /* Battery status. The value is either: | ||
| 130 | |||
| 131 | 2, if the battery is charging. | ||
| 132 | 3, if the battery is discharging. | ||
| 133 | 5, if the battery is full. | ||
| 134 | 4, if the battery is not full or discharging, | ||
| 135 | but is not charging either. | ||
| 136 | 1, if the battery state is unknown. */ | ||
| 137 | int status; | ||
| 138 | }; | ||
| 139 | |||
| 109 | extern Lisp_Object android_browse_url (Lisp_Object); | 140 | extern Lisp_Object android_browse_url (Lisp_Object); |
| 141 | extern int android_query_battery (struct android_battery_state *); | ||
| 110 | 142 | ||
| 111 | 143 | ||
| 112 | 144 | ||