MCPcopy Create free account
hub / github.com/EasyIME/PIME / updateCommitString

Method updateCommitString

PIMETextService/PIMEClient.cpp:147–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void Client::updateCommitString(Json::Value& msg, Ime::EditSession* session) {
148 // handle comosition and commit strings
149 const auto& commitStringVal = msg["commitString"];
150 if (commitStringVal.isString()) {
151 std::wstring commitString = utf8ToUtf16(commitStringVal.asCString());
152 if (!commitString.empty()) {
153 if (!textService_->isComposing()) {
154 textService_->startComposition(session->context());
155 }
156 textService_->setCompositionString(session, commitString.c_str(), commitString.length());
157 // FIXME: update the position of candidate and message window when the composition string is changed.
158 if (textService_->candidateWindow_ != nullptr) {
159 textService_->updateCandidatesWindow(session);
160 }
161 if (textService_->messageWindow_ != nullptr) {
162 textService_->updateMessageWindow(session);
163 }
164 textService_->endComposition(session->context());
165 }
166 }
167}
168
169void Client::updateComposition(Json::Value& msg, Ime::EditSession* session, bool& endComposition) {
170 const auto& compositionStringVal = msg["compositionString"];

Callers

nothing calls this directly

Calls 6

isComposingMethod · 0.80
setCompositionStringMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45
updateMessageWindowMethod · 0.45

Tested by

no test coverage detected