mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
[IMM32] Delete Wine-specific functions (#3902)
We don't need Wine-specific functions for Japanese input. - Delete __wine_get_ui_window, __wine_register_window and __wine_unregister_window functions. - Modify imm32.spec. CORE-11700
This commit is contained in:
parent
19d24143e9
commit
911fc3cf5b
2 changed files with 0 additions and 136 deletions
|
@ -623,7 +623,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
|
|||
0, 0, { (DWORD_PTR)(__FILE__ ": threaddata_cs") }
|
||||
};
|
||||
static CRITICAL_SECTION threaddata_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
static BOOL disable_ime;
|
||||
|
||||
static inline BOOL is_himc_ime_unicode(const InputContextData *data)
|
||||
{
|
||||
|
@ -661,38 +660,6 @@ static inline CHAR *strdupWtoA( const WCHAR *str )
|
|||
return ret;
|
||||
}
|
||||
|
||||
static IMMThreadData *IMM_GetThreadData(HWND hwnd, DWORD thread)
|
||||
{
|
||||
IMMThreadData *data;
|
||||
DWORD process;
|
||||
|
||||
if (hwnd)
|
||||
{
|
||||
if (!(thread = GetWindowThreadProcessId(hwnd, &process))) return NULL;
|
||||
if (process != GetCurrentProcessId()) return NULL;
|
||||
}
|
||||
else if (thread)
|
||||
{
|
||||
HANDLE h = OpenThread(THREAD_QUERY_INFORMATION, FALSE, thread);
|
||||
if (!h) return NULL;
|
||||
process = GetProcessIdOfThread(h);
|
||||
CloseHandle(h);
|
||||
if (process != GetCurrentProcessId()) return NULL;
|
||||
}
|
||||
else
|
||||
thread = GetCurrentThreadId();
|
||||
|
||||
EnterCriticalSection(&threaddata_cs);
|
||||
LIST_FOR_EACH_ENTRY(data, &ImmThreadDataList, IMMThreadData, entry)
|
||||
if (data->threadID == thread) return data;
|
||||
|
||||
data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data));
|
||||
data->threadID = thread;
|
||||
list_add_head(&ImmThreadDataList,&data->entry);
|
||||
TRACE("Thread Data Created (%x)\n",thread);
|
||||
return data;
|
||||
}
|
||||
|
||||
static HMODULE load_graphics_driver(void)
|
||||
{
|
||||
static const WCHAR display_device_guid_propW[] = {
|
||||
|
@ -795,12 +762,6 @@ static ImmHkl *IMM_GetImmHkl(HKL hkl)
|
|||
}
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
HWND WINAPI __wine_get_ui_window(HKL hkl)
|
||||
{
|
||||
ImmHkl *immHkl = IMM_GetImmHkl(hkl);
|
||||
return immHkl->UIWnd;
|
||||
}
|
||||
|
||||
/* for posting messages as the IME */
|
||||
static void ImmInternalPostIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -2605,97 +2566,6 @@ BOOL WINAPI ImmGetConversionStatus(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL needs_ime_window(HWND hwnd)
|
||||
{
|
||||
WCHAR classW[8];
|
||||
|
||||
if (GetClassNameW(hwnd, classW, ARRAY_SIZE(classW)) && !lstrcmpW(classW, szwIME))
|
||||
return FALSE;
|
||||
if (GetClassLongPtrW(hwnd, GCL_STYLE) & CS_IME) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* __wine_register_window (IMM32.@)
|
||||
*/
|
||||
BOOL WINAPI __wine_register_window(HWND hwnd)
|
||||
{
|
||||
HWND new = NULL;
|
||||
IMMThreadData *thread_data;
|
||||
TRACE("(%p)\n", hwnd);
|
||||
|
||||
if (!needs_ime_window(hwnd))
|
||||
return FALSE;
|
||||
|
||||
thread_data = IMM_GetThreadData(hwnd, 0);
|
||||
if (!thread_data)
|
||||
return FALSE;
|
||||
|
||||
if (thread_data->disableIME || disable_ime)
|
||||
{
|
||||
TRACE("IME for this thread is disabled\n");
|
||||
LeaveCriticalSection(&threaddata_cs);
|
||||
return FALSE;
|
||||
}
|
||||
thread_data->windowRefs++;
|
||||
TRACE("windowRefs=%u, hwndDefault=%p\n",
|
||||
thread_data->windowRefs, thread_data->hwndDefault);
|
||||
|
||||
/* Create default IME window */
|
||||
if (thread_data->windowRefs == 1)
|
||||
{
|
||||
/* Do not create the window inside of a critical section */
|
||||
LeaveCriticalSection(&threaddata_cs);
|
||||
new = CreateWindowExW( 0, szwIME, szwDefaultIME,
|
||||
WS_POPUP | WS_DISABLED | WS_CLIPSIBLINGS,
|
||||
0, 0, 1, 1, 0, 0, 0, 0);
|
||||
/* thread_data is in the current thread so we can assume it's still valid */
|
||||
EnterCriticalSection(&threaddata_cs);
|
||||
/* See if anyone beat us */
|
||||
if (thread_data->hwndDefault == NULL)
|
||||
{
|
||||
thread_data->hwndDefault = new;
|
||||
new = NULL;
|
||||
TRACE("Default is %p\n", thread_data->hwndDefault);
|
||||
}
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&threaddata_cs);
|
||||
|
||||
/* Clean up an unused new window outside of the critical section */
|
||||
if (new != NULL)
|
||||
DestroyWindow(new);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* __wine_unregister_window (IMM32.@)
|
||||
*/
|
||||
void WINAPI __wine_unregister_window(HWND hwnd)
|
||||
{
|
||||
HWND to_destroy = 0;
|
||||
IMMThreadData *thread_data;
|
||||
TRACE("(%p)\n", hwnd);
|
||||
|
||||
thread_data = IMM_GetThreadData(hwnd, 0);
|
||||
if (!thread_data) return;
|
||||
|
||||
thread_data->windowRefs--;
|
||||
TRACE("windowRefs=%u, hwndDefault=%p\n",
|
||||
thread_data->windowRefs, thread_data->hwndDefault);
|
||||
|
||||
/* Destroy default IME window */
|
||||
if (thread_data->windowRefs == 0 && thread_data->hwndDefault)
|
||||
{
|
||||
to_destroy = thread_data->hwndDefault;
|
||||
thread_data->hwndDefault = NULL;
|
||||
}
|
||||
LeaveCriticalSection(&threaddata_cs);
|
||||
|
||||
if (to_destroy) DestroyWindow( to_destroy );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ImmGetDefaultIMEWnd (IMM32.@)
|
||||
*/
|
||||
|
|
|
@ -113,9 +113,3 @@
|
|||
@ stdcall -stub ImmWINNLSEnableIME(ptr long)
|
||||
@ stdcall -stub ImmWINNLSGetEnableStatus(ptr)
|
||||
@ stub ImmWINNLSGetIMEHotkey
|
||||
|
||||
################################################################
|
||||
# Wine internal extensions
|
||||
@ stdcall __wine_get_ui_window(ptr)
|
||||
@ stdcall __wine_register_window(long)
|
||||
@ stdcall __wine_unregister_window(long)
|
||||
|
|
Loading…
Reference in a new issue