Copyright 2021 The Chromium Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Allows a text_input to sends more variation of operations to support richer features, such as set_preedit_region. Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding uinterface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset. Create extended_text_input object. See zcr_extended_text_input interface for details. If the given text_input object already has a extended_text_input object associated, the extended_text_input_exists protocol error is raised. The zcr_extended_text_input_v1 interface extends the text_input interface to support more rich operations on text_input. IME requests to update text_input client to set the preedit from the surrounding text. index is the starting point of the preedit, relative to the current cursor position in utf-8 byte-offset. length is the length of the preedit region in utf-8 byte length. Following the convention we have in text_input::preedit_string, text_input::preedit_styling sent just before this will be applied. Wayland has its own input-type support, which is zwp_text_input::content_purpose. However, it is not rich enough to represent all Chrome's input types. This enum is introduced to keep all entries so exo can understand it without any information loss. See TextInputType's description for details about each entry. Similar to input_type defined above, this keeps Chrome's TextInputMode. See TextInputMode's description for details for each entry. Similar to input_type defined above, this keeps Chrome's TextInputFlags, because content_hint is not enough power to represent what Chrome wants. See TextInputFlags' description for details for each entry. In wayland, there's a concept that can be mapped to Chrome's TextInputType, Mode and Flags. It can be set via zwp_text_input::set_content_type. However, the variation is not rich enough to represent Chrome's detailed behavior change. This API can be used as a replacement of set_content_type. IME requests to clear all the grammar markers within the given range defined by start and end. start and end are relative to the beginning of the input field in utf-8 byte length. IME requests to add a new grammar fragment. A grammar fragment describes a range of text (start, end) that has grammar error and also gives the correct replacement text. It is expected that the renderer will render markers (e.g. squigles or dashed underlines) under the text to notify users that there is a grammar error. It is also expected that the renderer will maintain and update the position of fragment when users edit other parts of the text, e.g. if users type something before the grammar fragment, the marker should move accordingly. start and end are relative to the beginning of the input field in utf-8 byte length. suggestion is the correct replacement text, encoded in utf-8 and suggested by ML model. Informs the IME of the grammar fragment containing the current cursor. If not existing, both start and end are set to 0. This is called whenever the cursor position or surrounding text have changed. start and end are relative to the beginning of the input field in utf-8 byte length. suggestion is the correct replacement text encoded in utf-8 and suggested by ML model. IME requests to update text_input client to set the autocorrect range. There is only one autocorrect range, so this replaces any existing autocorrect ranges. start and end are relative to the beginning of the input field in utf-8 byte length. If start and end are the same, then the autocorrect range is cleared. Informs the IME the range and bounds of the current autocorrect change. This is called whenever the range or bounds have changed. start and end are relative to the beginning of the input field in utf-8 byte length. x, y, width, and height are the bounds of the autocorrect text, relative to the window. This request only changes a pending state that will be effective on the next 'set_surrounding_text' request.