13# define WIN32_LEAN_AND_MEAN
23# define W32_ISO639_LEN 9
35 GHOST_IWindow *window,
36 const void *customdata)
37 : GHOST_Event(msec, type, window)
39 this->data_ = customdata;
85struct ImeComposition {
106 std::wstring ime_string;
107 std::vector<char> utf8_buf;
108 std::vector<unsigned char>
format;
127class GHOST_ImeWin32 {
133 bool is_composing()
const
135 return is_composing_;
139 void UpdateInputLanguage();
141 BOOL IsLanguage(
const char name[W32_ISO639_LEN]);
144 void UpdateConversionStatus(HWND window_handle);
147 bool IsEnglishMode();
150 bool IsImeKeyEvent(
char ascii,
GHOST_TKey key);
158 void CreateImeWindow(HWND window_handle);
180 void SetImeWindowStyle(
181 HWND window_handle, UINT message, WPARAM wparam, LPARAM lparam, BOOL *handled);
189 void DestroyImeWindow(HWND window_handle);
197 void UpdateImeWindow(HWND window_handle);
206 void CleanupComposition(HWND window_handle);
216 void ResetComposition(HWND window_handle);
239 bool GetResult(HWND window_handle, LPARAM lparam, ImeComposition *composition);
262 bool GetComposition(HWND window_handle, LPARAM lparam, ImeComposition *composition);
286 void BeginIME(HWND window_handle,
const GHOST_Rect &caret_rect,
bool complete);
297 void EndIME(HWND window_handle);
300 void UpdateInfo(HWND window_handle);
303 void CheckFirst(HWND window_handle);
305 ImeComposition resultInfo, compInfo;
306 GHOST_TEventImeData eventImeData;
310 bool IsTargetAttribute(
char attribute)
const
312 return (attribute == ATTR_TARGET_CONVERTED || attribute == ATTR_TARGET_NOTCONVERTED);
316 void GetCaret(HIMC imm_context, LPARAM lparam, ImeComposition *composition);
319 void MoveImeWindow(HWND window_handle, HIMC imm_context);
322 void CompleteComposition(HWND window_handle, HIMC imm_context);
325 bool GetString(HIMC imm_context, WPARAM lparam,
int type, ImeComposition *composition);
335 char language_[W32_ISO639_LEN];
338 DWORD conversion_modes_;
341 DWORD sentence_mode_;
352 GHOST_Rect caret_rect_;
355 bool is_first, is_enable;
unsigned long long int uint64_t