diff options
author | crupest <crupest@outlook.com> | 2020-07-05 23:06:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-05 23:06:02 +0800 |
commit | 5c805e494425a88da1813902b1ad8a1ab351e30d (patch) | |
tree | be3cfd96dcac19db3e256d610d48b5083c489a6c /include/cru/platform/native/InputMethod.hpp | |
parent | bbec59718bf8a824583869126762013112f8e568 (diff) | |
download | cru-5c805e494425a88da1813902b1ad8a1ab351e30d.tar.gz cru-5c805e494425a88da1813902b1ad8a1ab351e30d.tar.bz2 cru-5c805e494425a88da1813902b1ad8a1ab351e30d.zip |
...
Diffstat (limited to 'include/cru/platform/native/InputMethod.hpp')
-rw-r--r-- | include/cru/platform/native/InputMethod.hpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/include/cru/platform/native/InputMethod.hpp b/include/cru/platform/native/InputMethod.hpp index 1ede15b2..1c5b287e 100644 --- a/include/cru/platform/native/InputMethod.hpp +++ b/include/cru/platform/native/InputMethod.hpp @@ -18,28 +18,11 @@ struct CompositionClause { using CompositionClauses = std::vector<CompositionClause>; struct CompositionText { - std::string text; + std::u16string text; CompositionClauses clauses; TextRange selection; }; -inline std::ostream& operator<<(std::ostream& stream, - const CompositionText& composition_text) { - stream << "text: " << composition_text.text << "\n" - << "clauses:\n"; - for (int i = 0; i < static_cast<int>(composition_text.clauses.size()); i++) { - const auto& clause = composition_text.clauses[i]; - stream << "\t" << i << ". start:" << clause.start << " end:" << clause.end; - if (clause.target) { - stream << " target"; - } - stream << "\n"; - } - stream << "selection: position:" << composition_text.selection.position - << " count:" << composition_text.selection.count; - return stream; -} - struct IInputMethodContext : virtual INativeResource { // Return true if you should draw composition text manually. Return false if // system will take care of that for you. @@ -67,7 +50,7 @@ struct IInputMethodContext : virtual INativeResource { // Triggered every time composition text changes. virtual IEvent<std::nullptr_t>* CompositionEvent() = 0; - virtual IEvent<std::string_view>* TextEvent() = 0; + virtual IEvent<std::u16string_view>* TextEvent() = 0; }; struct IInputMethodManager : virtual INativeResource { |