From b59d695b2b00157e403399af78b3128848a65e0f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 4 Dec 2020 18:39:11 +0100 Subject: ime: add functions to enable/disable IME, simplify code that enables IME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We may want to be able to enable/disable IME run-time, even though we have received an ‘enter’ IME event. This enables us to do that. Also add functions to enable/disable IME on a per-terminal instance basis. A terminal may have multiple seats focusing it, and enabling/disabling IME in a terminal instance enables/disables IME on all those seats. Finally, the code to enable IME is simplified; the *only* surface that can ever receive ‘enter’ IME events is the main grid. All other surfaces are sub-surfaces, without their own keyboard focus. --- terminal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index bbe7df25..6a634914 100644 --- a/terminal.h +++ b/terminal.h @@ -472,6 +472,7 @@ struct terminal { #if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED struct { + bool enabled; struct { struct cell *cells; int count; @@ -608,4 +609,7 @@ bool term_scrollback_to_text( bool term_view_to_text( const struct terminal *term, char **text, size_t *len); -void term_reset_ime(struct terminal *term); +bool term_ime_is_enabled(const struct terminal *term); +void term_ime_enable(struct terminal *term); +void term_ime_disable(struct terminal *term); +void term_ime_reset(struct terminal *term); -- cgit v1.3