From b022fe55e4b474e65a5890307ba8186474daf736 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 7 Jul 2023 16:30:39 +0200 Subject: [PATCH] unstable/text-input: Add preedit text hints There seems to be some demand from input methods to be able to style different parts of the preedit string differently. Since the reasons to do that are many, and vary between IMs and languages, there may not ever be a closed semantic list of hints. But even though some IMs would much want to be able to specify colors, they lack the context to know what choice of colors provides enough contrast and legibility embedded on foreign UIs (e.g. accounting things like themes, accessibility, ...). This MR meets at a middle ground, and provides a set of wildly generic semantic values, so that clients may theme these specifically, and the IM is able to provide some hints rather than none. Control over underlining is given to the IMs, since that is less controversial. Signed-off-by: Carlos Garnacho --- .../text-input/text-input-unstable-v3.xml | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/unstable/text-input/text-input-unstable-v3.xml b/unstable/text-input/text-input-unstable-v3.xml index 1fae54d..1bf936c 100644 --- a/unstable/text-input/text-input-unstable-v3.xml +++ b/unstable/text-input/text-input-unstable-v3.xml @@ -47,7 +47,7 @@ interface version number is reset. - + The zwp_text_input_v3 interface represents text input and input methods associated with a seat. It provides enter/leave events to follow the @@ -433,6 +433,85 @@ + + + + + Underline style to apply to sections of the preedit string. + + + + + + + + + Notify of underlining style hints for the pre-edit string. This + event is always sent together with a zwp_text_input_v3.preedit_string + event. + + The parameters begin and end are counted in bytes relative to the + beginning of the text buffer submitted through + zwp_text_input_v3.preedit_string. + + Multiple events may be submitted if the preedit string has different + sections. Compositors must not send multiple + zwp_text_input_v3.preedit_underline events with overlapping extents. + + Clients may optionally honor this request. For parts of the preedit + string that are not covered by any zwp_text_input_v3.preedit_underline + event, or if no events were sent, the text will be considered not + underlined. + + Values set with this event are double-buffered. They must be applied + and reset on the next zwp_text_input_v3.done event. + + + + + + + + + Context hints to identify sections of the preedit string. + + + + + + + + + + + + + + + Notify of contextual hints for the pre-edit string. This + event is always sent together with a zwp_text_input_v3.preedit_string + event. + + The parameters begin and end are counted in bytes relative to the + beginning of the text buffer submitted through + zwp_text_input_v3.preedit_string. + + Multiple events may be submitted if the preedit string has different + sections. Compositors must not send multiple + zwp_text_input_v3.preedit_underline events with overlapping extents. + + Clients are free to pick any visuals to represent the available hints, + including none at all. For parts of the preedit string that are not + covered by any zwp_text_input_v3.preedit_hint event, or if no events + were sent, the text will be considered unhinted. + + Values set with this event are double-buffered. They must be applied + and reset on the next zwp_text_input_v3.done event. + + + + +