OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ime_input.h" | 5 #include "chrome/browser/ime_input.h" |
6 | 6 |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 | 9 |
10 // "imm32.lib" is required by IMM32 APIs used in this file. | 10 // "imm32.lib" is required by IMM32 APIs used in this file. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 void ImeInput::GetCaret(HIMC imm_context, LPARAM lparam, | 171 void ImeInput::GetCaret(HIMC imm_context, LPARAM lparam, |
172 ImeComposition* composition) { | 172 ImeComposition* composition) { |
173 // This operation is optional and language-dependent because the caret | 173 // This operation is optional and language-dependent because the caret |
174 // style is depended on the language, e.g.: | 174 // style is depended on the language, e.g.: |
175 // * Korean IMEs: the caret is a blinking block, | 175 // * Korean IMEs: the caret is a blinking block, |
176 // (It contains only one hangul character); | 176 // (It contains only one hangul character); |
177 // * Chinese IMEs: the caret is a blinking line, | 177 // * Chinese IMEs: the caret is a blinking line, |
178 // (i.e. they do not need to retrieve the target selection); | 178 // (i.e. they do not need to retrieve the target selection); |
179 // * Japanese IMEs: the caret is a selection (or undelined) block, | 179 // * Japanese IMEs: the caret is a selection (or underlined) block, |
180 // (which can contain one or more Japanese characters). | 180 // (which can contain one or more Japanese characters). |
181 int target_start = -1; | 181 int target_start = -1; |
182 int target_end = -1; | 182 int target_end = -1; |
183 switch (PRIMARYLANGID(input_language_id_)) { | 183 switch (PRIMARYLANGID(input_language_id_)) { |
184 case LANG_KOREAN: | 184 case LANG_KOREAN: |
185 if (lparam & CS_NOMOVECARET) { | 185 if (lparam & CS_NOMOVECARET) { |
186 target_start = 0; | 186 target_start = 0; |
187 target_end = 1; | 187 target_end = 1; |
188 } | 188 } |
189 break; | 189 break; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // This update is used for moving an IME window when a renderer process | 328 // This update is used for moving an IME window when a renderer process |
329 // resize/moves the input caret. | 329 // resize/moves the input caret. |
330 if (caret_rect.x() >= 0 && caret_rect.y() >= 0) { | 330 if (caret_rect.x() >= 0 && caret_rect.y() >= 0) { |
331 caret_rect_.SetRect(caret_rect.x(), caret_rect.y(), caret_rect.width(), | 331 caret_rect_.SetRect(caret_rect.x(), caret_rect.y(), caret_rect.width(), |
332 caret_rect.height()); | 332 caret_rect.height()); |
333 MoveImeWindow(window_handle, imm_context); | 333 MoveImeWindow(window_handle, imm_context); |
334 } | 334 } |
335 ::ImmReleaseContext(window_handle, imm_context); | 335 ::ImmReleaseContext(window_handle, imm_context); |
336 } | 336 } |
337 } | 337 } |
OLD | NEW |