From d1e4367f58f59747de69787e6f33c7252fda63d8 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 15 Mar 2022 21:41:02 +0300 Subject: [PATCH] SDL_windowskeyboard.c: fix build with SDL_DISABLE_WINDOWS_IME defined. Fixes https://github.com/libsdl-org/SDL/issues/5408 --- src/video/windows/SDL_windowskeyboard.c | 35 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index deea44be2..626e8763c 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -276,27 +276,18 @@ WIN_SetTextInputRect(_THIS, SDL_Rect *rect) } } + +#ifdef SDL_DISABLE_WINDOWS_IME + void WIN_ClearComposition(_THIS) { - SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; - IME_ClearComposition(videodata); } SDL_bool WIN_IsTextInputShown(_THIS) { - SDL_VideoData* videodata = (SDL_VideoData*)_this->driverdata; - return IME_IsTextInputShown(videodata); + return SDL_FALSE; } -static SDL_bool -WIN_ShouldShowNativeUI() -{ - return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_FALSE); -} - -#ifdef SDL_DISABLE_WINDOWS_IME - - SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { @@ -378,6 +369,12 @@ static void UILess_ReleaseSinks(SDL_VideoData *videodata); static void UILess_EnableUIUpdates(SDL_VideoData *videodata); static void UILess_DisableUIUpdates(SDL_VideoData *videodata); +static SDL_bool +WIN_ShouldShowNativeUI() +{ + return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_FALSE); +} + static void IME_Init(SDL_VideoData *videodata, HWND hwnd) { @@ -1714,6 +1711,18 @@ void IME_Present(SDL_VideoData *videodata) /* FIXME: Need to show the IME bitmap */ } +SDL_bool WIN_IsTextInputShown(_THIS) +{ + SDL_VideoData* videodata = (SDL_VideoData*)_this->driverdata; + return IME_IsTextInputShown(videodata); +} + +void WIN_ClearComposition(_THIS) +{ + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + IME_ClearComposition(videodata); +} + #endif /* SDL_DISABLE_WINDOWS_IME */ #endif /* SDL_VIDEO_DRIVER_WINDOWS */