winemac: Use an init once function to register IME classes.
This commit is contained in:
parent
7cc272cdef
commit
639c202ea7
|
@ -563,25 +563,6 @@ static void UpdateDataInDefaultIMEWindow(HIMC hIMC, HWND hwnd, BOOL showable)
|
||||||
UnlockRealIMC(hIMC);
|
UnlockRealIMC(hIMC);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOption)
|
|
||||||
{
|
|
||||||
TRACE("\n");
|
|
||||||
IME_RegisterClasses( macdrv_module );
|
|
||||||
lpIMEInfo->dwPrivateDataSize = sizeof(IMEPRIVATE);
|
|
||||||
lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET;
|
|
||||||
lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE;
|
|
||||||
lpIMEInfo->fdwSentenceCaps = IME_SMODE_AUTOMATIC;
|
|
||||||
lpIMEInfo->fdwUICaps = UI_CAP_2700;
|
|
||||||
/* Tell App we cannot accept ImeSetCompositionString calls */
|
|
||||||
/* FIXME: Can we? */
|
|
||||||
lpIMEInfo->fdwSCSCaps = 0;
|
|
||||||
lpIMEInfo->fdwSelectCaps = SELECT_CAP_CONVERSION;
|
|
||||||
|
|
||||||
lstrcpyW(lpszUIClass, UI_CLASS_NAME);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL WINAPI ImeConfigure(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
|
BOOL WINAPI ImeConfigure(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
|
||||||
{
|
{
|
||||||
FIXME("(%p, %p, %d, %p): stub\n", hKL, hWnd, dwMode, lpData);
|
FIXME("(%p, %p, %d, %p): stub\n", hKL, hWnd, dwMode, lpData);
|
||||||
|
@ -1394,10 +1375,7 @@ static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL WINAPI register_classes( INIT_ONCE *once, void *param, void **context )
|
||||||
/* Interfaces to other parts of the Mac driver */
|
|
||||||
|
|
||||||
void IME_RegisterClasses(HINSTANCE hImeInst)
|
|
||||||
{
|
{
|
||||||
WNDCLASSW wndClass;
|
WNDCLASSW wndClass;
|
||||||
ZeroMemory(&wndClass, sizeof(WNDCLASSW));
|
ZeroMemory(&wndClass, sizeof(WNDCLASSW));
|
||||||
|
@ -1405,7 +1383,7 @@ void IME_RegisterClasses(HINSTANCE hImeInst)
|
||||||
wndClass.lpfnWndProc = (WNDPROC) IME_WindowProc;
|
wndClass.lpfnWndProc = (WNDPROC) IME_WindowProc;
|
||||||
wndClass.cbClsExtra = 0;
|
wndClass.cbClsExtra = 0;
|
||||||
wndClass.cbWndExtra = 2 * sizeof(LONG_PTR);
|
wndClass.cbWndExtra = 2 * sizeof(LONG_PTR);
|
||||||
wndClass.hInstance = hImeInst;
|
wndClass.hInstance = macdrv_module;
|
||||||
wndClass.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
|
wndClass.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
|
||||||
wndClass.hIcon = LoadIconW(NULL, (LPWSTR)IDI_APPLICATION);
|
wndClass.hIcon = LoadIconW(NULL, (LPWSTR)IDI_APPLICATION);
|
||||||
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||||
|
@ -1421,8 +1399,32 @@ void IME_RegisterClasses(HINSTANCE hImeInst)
|
||||||
WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert");
|
WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert");
|
||||||
WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
|
WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
|
||||||
WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
|
WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOption)
|
||||||
|
{
|
||||||
|
static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
|
||||||
|
|
||||||
|
TRACE("\n");
|
||||||
|
InitOnceExecuteOnce( &init_once, register_classes, NULL, NULL );
|
||||||
|
lpIMEInfo->dwPrivateDataSize = sizeof(IMEPRIVATE);
|
||||||
|
lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET;
|
||||||
|
lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE;
|
||||||
|
lpIMEInfo->fdwSentenceCaps = IME_SMODE_AUTOMATIC;
|
||||||
|
lpIMEInfo->fdwUICaps = UI_CAP_2700;
|
||||||
|
/* Tell App we cannot accept ImeSetCompositionString calls */
|
||||||
|
/* FIXME: Can we? */
|
||||||
|
lpIMEInfo->fdwSCSCaps = 0;
|
||||||
|
lpIMEInfo->fdwSelectCaps = SELECT_CAP_CONVERSION;
|
||||||
|
|
||||||
|
lstrcpyW(lpszUIClass, UI_CLASS_NAME);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Interfaces to other parts of the Mac driver */
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* macdrv_im_set_text
|
* macdrv_im_set_text
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -210,8 +210,6 @@ extern CGImageRef create_cgimage_from_icon_bitmaps(HDC hdc, HANDLE icon, HBITMAP
|
||||||
* Mac IME driver
|
* Mac IME driver
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void IME_RegisterClasses(HINSTANCE hImeInst) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
extern BOOL macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state,
|
extern BOOL macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state,
|
||||||
void *himc) DECLSPEC_HIDDEN;
|
void *himc) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue