diff options
| author | Po Lu | 2023-02-16 23:57:01 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-16 23:57:01 +0800 |
| commit | 2dcce30290dc7782e9de3b4adf59f38b42408c98 (patch) | |
| tree | 67b79ee1049c8fa31c8fdc2c9c67df77ac4e86ee /src/androidterm.c | |
| parent | cf24b61985c26cbf2e5a24cb0b64a8528aa3a9cc (diff) | |
| download | emacs-2dcce30290dc7782e9de3b4adf59f38b42408c98.tar.gz emacs-2dcce30290dc7782e9de3b4adf59f38b42408c98.zip | |
Update Android port
* doc/emacs/android.texi (Android Fonts):
* doc/emacs/input.texi (On-Screen Keyboards):
* doc/lispref/commands.texi (Misc Events): Update documentation.
* java/org/gnu/emacs/EmacsInputConnection.java (setSelection):
New function.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView)
(reconfigureFrontBuffer): Make bitmap references weak
references.
* java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap): Don't
clear surfaceView bitmap.
* lisp/comint.el (comint-mode):
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Improve detection of CJK fonts.
* lisp/isearch.el (set-text-conversion-style): New variable.
(isearch-mode, isearch-done): Save and restore the text
conversion style.
* lisp/minibuffer.el (minibuffer-mode): Set an appropriate text
conversion style.
* lisp/simple.el (analyze-text-conversion): Run
post-self-insert-hook properly.
* lisp/subr.el (read-char-from-minibuffer): Disable text
conversion when reading character.
* src/androidterm.c (show_back_buffer): Don't check that F is
not garbaged.
(android_update_selection, android_reset_conversion): Use the
ephemeral last point and handle text conversion being disabled.
* src/buffer.c (syms_of_buffer): Convert old style DEFVAR.
* src/keyboard.c (kbd_buffer_get_event): Handle text conversion
first.
* src/lisp.h: Update prototypes.
* src/lread.c (read_filtered_event): Temporarily disable text
conversion.
* src/sfnt.c (sfnt_decompose_glyph_1, sfnt_decompose_glyph_2):
New functions.
(sfnt_decompose_glyph, sfnt_decompose_instructed_outline):
Refactor contour decomposition to those two functions.
(main): Update tests.
* src/sfntfont-android.c (system_font_directories): Add empty
field.
(Fandroid_enumerate_fonts, init_sfntfont_android): Enumerate
fonts in a user fonts directory.
* src/sfntfont.c (struct sfnt_font_desc): New field
`num_glyphs'.
(sfnt_enum_font_1): Set num_glyphs and avoid duplicate fonts.
(sfntfont_glyph_valid): New function.
(sfntfont_lookup_char, sfntfont_list_1): Make sure glyphs found
are valid.
* src/textconv.c (sync_overlay, really_commit_text)
(really_set_composing_text, really_set_composing_region)
(really_delete_surrounding_text, really_set_point_and_mark)
(handle_pending_conversion_events_1)
(handle_pending_conversion_events, conversion_disabled_p)
(disable_text_conversion, resume_text_conversion)
(Fset_text_conversion_style, syms_of_textconv): Update to
respect new options.
* src/textconv.h:
* src/window.h (GCALIGNED_STRUCT): New field
`ephemeral_last_point'.
* src/xdisp.c (mark_window_display_accurate_1): Set it.
Diffstat (limited to 'src/androidterm.c')
| -rw-r--r-- | src/androidterm.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/androidterm.c b/src/androidterm.c index 0c990d3d2d2..c6f75ec9219 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -258,10 +258,6 @@ show_back_buffer (struct frame *f) | |||
| 258 | { | 258 | { |
| 259 | struct android_swap_info swap_info; | 259 | struct android_swap_info swap_info; |
| 260 | 260 | ||
| 261 | /* Somehow Android frames can be swapped while garbaged. */ | ||
| 262 | if (FRAME_GARBAGED_P (f)) | ||
| 263 | return; | ||
| 264 | |||
| 265 | memset (&swap_info, 0, sizeof (swap_info)); | 261 | memset (&swap_info, 0, sizeof (swap_info)); |
| 266 | swap_info.swap_window = FRAME_ANDROID_WINDOW (f); | 262 | swap_info.swap_window = FRAME_ANDROID_WINDOW (f); |
| 267 | swap_info.swap_action = ANDROID_COPIED; | 263 | swap_info.swap_action = ANDROID_COPIED; |
| @@ -5128,7 +5124,8 @@ android_update_selection (struct frame *f, struct window *w) | |||
| 5128 | /* Figure out where the point and mark are. If the mark is not | 5124 | /* Figure out where the point and mark are. If the mark is not |
| 5129 | active, then point is set to equal mark. */ | 5125 | active, then point is set to equal mark. */ |
| 5130 | b = XBUFFER (w->contents); | 5126 | b = XBUFFER (w->contents); |
| 5131 | point = min (w->last_point, TYPE_MAXIMUM (jint)); | 5127 | point = min (w->ephemeral_last_point, |
| 5128 | TYPE_MAXIMUM (jint)); | ||
| 5132 | mark = ((!NILP (BVAR (b, mark_active)) | 5129 | mark = ((!NILP (BVAR (b, mark_active)) |
| 5133 | && w->last_mark != -1) | 5130 | && w->last_mark != -1) |
| 5134 | ? min (w->last_mark, TYPE_MAXIMUM (jint)) | 5131 | ? min (w->last_mark, TYPE_MAXIMUM (jint)) |
| @@ -5150,6 +5147,7 @@ android_reset_conversion (struct frame *f) | |||
| 5150 | enum android_ic_mode mode; | 5147 | enum android_ic_mode mode; |
| 5151 | struct window *w; | 5148 | struct window *w; |
| 5152 | struct buffer *buffer; | 5149 | struct buffer *buffer; |
| 5150 | Lisp_Object style; | ||
| 5153 | 5151 | ||
| 5154 | /* Reset the input method. | 5152 | /* Reset the input method. |
| 5155 | 5153 | ||
| @@ -5160,19 +5158,20 @@ android_reset_conversion (struct frame *f) | |||
| 5160 | w = XWINDOW (f->selected_window); | 5158 | w = XWINDOW (f->selected_window); |
| 5161 | buffer = XBUFFER (WINDOW_BUFFER (w)); | 5159 | buffer = XBUFFER (WINDOW_BUFFER (w)); |
| 5162 | 5160 | ||
| 5163 | if (NILP (BVAR (buffer, text_conversion_style))) | 5161 | style = (EQ (find_symbol_value (Qoverriding_text_conversion_style), |
| 5162 | Qlambda) | ||
| 5163 | ? BVAR (buffer, text_conversion_style) | ||
| 5164 | : find_symbol_value (Qoverriding_text_conversion_style)); | ||
| 5165 | |||
| 5166 | if (NILP (style) || conversion_disabled_p ()) | ||
| 5164 | mode = ANDROID_IC_MODE_NULL; | 5167 | mode = ANDROID_IC_MODE_NULL; |
| 5165 | else if (EQ (BVAR (buffer, text_conversion_style), | 5168 | else if (EQ (style, Qaction) || EQ (f->selected_window, |
| 5166 | Qaction)) | 5169 | f->minibuffer_window)) |
| 5167 | mode = ANDROID_IC_MODE_ACTION; | 5170 | mode = ANDROID_IC_MODE_ACTION; |
| 5168 | else | 5171 | else |
| 5169 | mode = ANDROID_IC_MODE_TEXT; | 5172 | mode = ANDROID_IC_MODE_TEXT; |
| 5170 | 5173 | ||
| 5171 | android_reset_ic (FRAME_ANDROID_WINDOW (f), | 5174 | android_reset_ic (FRAME_ANDROID_WINDOW (f), mode); |
| 5172 | (EQ (f->selected_window, | ||
| 5173 | f->minibuffer_window) | ||
| 5174 | ? ANDROID_IC_MODE_ACTION | ||
| 5175 | : mode)); | ||
| 5176 | 5175 | ||
| 5177 | /* Move its selection to the specified position. */ | 5176 | /* Move its selection to the specified position. */ |
| 5178 | android_update_selection (f, NULL); | 5177 | android_update_selection (f, NULL); |