Commit 2f3efb7
Add IME support for all platforms (#3)
* Apply shibukawa's fix of GLFW for Windows
This fix is based on shibukawa's fix:
glfw#658
shibukawa@d36a164
Some minor coding style changes are made, but not yet follow glfw's one,
and some comments doesn't follow recent changes. So further work is
needed.
Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
* Win32: Support IME
This commit re-organizes 9d9af13.
* Use dynamic load for Imm32.
* Generalize platform-specific features to _GLFWplatform.
* Add caret-position info to preedit-callback.
* Add cursorWidth to preeditCursor and related APIs.
* Handle UTF16 data correctly.
* Handle GCS_RESULTSTR so that committed texts are processed correctly.
* Handle WM_IME_ENDCOMPOSITION to clear preedit.
* Handle WM_IME_SETCONTEXT.
* https://learn.microsoft.com/en-us/windows/win32/intl/wm-ime-setcontext#remarks
* Refactor code shapes and variable names.
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
* Apply shibukawa's fix of GLFW for MacOS
This fix is based on shibukawa's fix:
glfw#658
shibukawa@d36a164
Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
* macOS: Support IME
This commit re-organizes 31b12b7.
* Use dynamic load for TIS functions and stop using Carbon.
* Generalize platform-specific features to _GLFWplatform.
* Add caret-position info to preedit-callback.
* Handle UTF16 data correctly.
* Implement `firstRectForCharacterRange:actualRange:` to display preedit candidate window correctly.
* Suppress _glfwInputKey during preediting.
* Ensure preedit cleared after committed.
* Fix wrong length of markedRange.
* Improve IME status APIs.
* Refactor code shapes and variable names.
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
Co-authored-by: xfangfang <2553041586@qq.com>
* Apply shibukawa's fix of GLFW for X11
This fix is based on shibukawa's fix:
glfw#658
The differences is the following.
* Remove `X_HAVE_UTF8_STRING` branching since the current logic doesn't use it
* Replace `XNDestroyCallback` for `XNPreeditAttributes` in `XCreateIC`
Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
* X11: Support IME
This commit re-organizes 6e7f939.
* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
* It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.
About over-the-spot style and on-the-spot style on X11:
* In over-the-spot mode, almost all APIs are disabled since applications only
need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
has the following problems.
* Status APIs don't work because status callbacks don't work.
(at least in my ibus environment).
* Can't specify the candidate window position.
Known problems:
* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
* This will be fixed in PR glfw#1972 : glfw#1972
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
* Wayland: Support text_input_unstable_v3 and text_input_unstable_v1
They are wayland protocols to support input methods:
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v3.xml
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v1.xml
text_input_unstable_v3 is widely supported by major desktop environment
on GNU/Linux such as GNOME or KDE.
text_input_unstable_v1 isn't so popular but Weston which is the
reference Wayland implementation supports only it and doesn't support
text_input_unstable_v3 so that we also implement it.
* tests: Add tests for IME features
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
* Apply shibukawa's document fix
This fix is from shibukawa's fix:
glfw#658
shibukawa@d36a164
* Doc: Improve document about IME features
* Add credit
new
- Daijiro Fukuda
- Ryo Ichinose (from glfw#658)
- Yasutaka Kumei (from glfw#658)
- xfangfang
already in the list
- Takuro Ashie
- Yoshiki Shibukawa
* Add change log entries
* Win32: Support preedit candidate feature
You can use this feature when you need to manage the drawing of
the preedit candidates on the application side.
* Don't link Fontconfig
Load it dynamically instead.
* WIN32: Better support for IME
---------
Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
Co-authored-by: xfangfang <2553041586@qq.com>1 parent ddc1926 commit 2f3efb7
30 files changed
Lines changed: 4617 additions & 159 deletions
File tree
- deps/wayland
- docs
- include/GLFW
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| 303 | + | |
301 | 304 | | |
302 | 305 | | |
303 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
172 | 194 | | |
173 | 195 | | |
174 | 196 | | |
| |||
0 commit comments