Chris Bracken 617f0096e3 Add multi-step input method support for Linux (flutter/engine#21897)
This implements the Gtk hooks required to support multi-step input
methods on Linux. This builds on the support for composing regions
(preedit region in Gtk terminology) added to TextInputModel in
https://github.com/flutter/engine/pull/21682.

Specifically, the following changes are included:

1. Add handler for TextInput.setMarkedTextRegion framework messages: On
any change to the EditableText in the framework, this message is sent
which provides an updated rect (in the local co-ordinates of the
EditableText) for the composing region. If not in composing mode, the
cursor rect is sent.

2. Add handler for TextInput.setEditableSizeAndTransform framework messages:
On any change to the RenderObject underlying the EditableText, an
updated size for the full EditableText widget, as well as an affine
transform matrix from local co-ordinates to Flutter root co-ordinates is
sent.

3. On either of the above messages, we use the transformed composing
rect to compute the cursor position in Gtk window co-ordinates and
inform Gtk, so that it can position any system IM composing window
correctly for on-the-spot composing, such as is used when inputting
Japanese text.

4. Adds handlers for preedit-start, preedit-changed, and preedit-end
signals from Gtk. These are passed on to the TextInputModel.

5. Updates the preedit-commit handler to commit the composing region to
the text or, if not composing, insert new text at the cursor.

6. Updates the handler for TextInput.setEditingState framework messages
to extract the composing range base and extent and pass these on to
TextInputModel.

7. Updates update_editing_state function to set composing base and
extent on text input state updates sent to the framework.
2020-10-19 16:25:56 -07:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%