Skip to content

Commit

Permalink
SDL_windowskeyboard.c: fix build with SDL_DISABLE_WINDOWS_IME defined.
Browse files Browse the repository at this point in the history
Fixes #5408
  • Loading branch information
sezero committed Mar 15, 2022
1 parent 1ee196b commit d1e4367
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions src/video/windows/SDL_windowskeyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

static SDL_bool
WIN_ShouldShowNativeUI()
{
return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_FALSE);
return SDL_FALSE;
}

#ifdef SDL_DISABLE_WINDOWS_IME


SDL_bool
IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit d1e4367

Please sign in to comment.