| 145 | } |
| 146 | |
| 147 | void 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 | |
| 169 | void Client::updateComposition(Json::Value& msg, Ime::EditSession* session, bool& endComposition) { |
| 170 | const auto& compositionStringVal = msg["compositionString"]; |
nothing calls this directly
no test coverage detected