Removed SDL_TextInputShown()

This was only implemented on Windows and often confused with SDL_ScreenKeyboardShown()
main
Sam Lantinga 2024-03-25 13:05:42 -07:00
parent 6443c75eda
commit b9a88bbecb
13 changed files with 4 additions and 63 deletions

View File

@ -861,7 +861,9 @@ Text input is no longer automatically enabled when initializing video, you shoul
The following functions have been renamed:
* SDL_IsScreenKeyboardShown() => SDL_ScreenKeyboardShown()
* SDL_IsTextInputActive() => SDL_TextInputActive()
* SDL_IsTextInputShown() => SDL_TextInputShown()
The following functions have been removed:
* SDL_IsTextInputShown()
## SDL_keycode.h

View File

@ -342,15 +342,6 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
*/
extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
/**
* Returns if an IME Composite or Candidate window is currently shown.
*
* \returns SDL_TRUE if shown, else SDL_FALSE
*
* \since This function is available since SDL 3.0.0.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_TextInputShown(void);
/**
* Set the rectangle used to type Unicode text inputs.
*

View File

@ -339,7 +339,6 @@
/* ##SDL_keyboard.h */
#define SDL_IsScreenKeyboardShown SDL_ScreenKeyboardShown
#define SDL_IsTextInputActive SDL_TextInputActive
#define SDL_IsTextInputShown SDL_TextInputShown
/* ##SDL_keycode.h */
#define KMOD_ALT SDL_KMOD_ALT
@ -840,7 +839,6 @@
/* ##SDL_keyboard.h */
#define SDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown_renamed_SDL_ScreenKeyboardShown
#define SDL_IsTextInputActive SDL_IsTextInputActive_renamed_SDL_TextInputActive
#define SDL_IsTextInputShown SDL_IsTextInputShown_renamed_SDL_TextInputShown
/* ##SDL_keycode.h */
#define KMOD_ALT KMOD_ALT_renamed_SDL_KMOD_ALT

View File

@ -789,7 +789,6 @@ SDL3_0.0.0 {
SDL_SyncWindow;
SDL_TellIO;
SDL_TextInputActive;
SDL_TextInputShown;
SDL_TimeFromWindows;
SDL_TimeToDateTime;
SDL_TimeToWindows;

View File

@ -813,7 +813,6 @@
#define SDL_SyncWindow SDL_SyncWindow_REAL
#define SDL_TellIO SDL_TellIO_REAL
#define SDL_TextInputActive SDL_TextInputActive_REAL
#define SDL_TextInputShown SDL_TextInputShown_REAL
#define SDL_TimeFromWindows SDL_TimeFromWindows_REAL
#define SDL_TimeToDateTime SDL_TimeToDateTime_REAL
#define SDL_TimeToWindows SDL_TimeToWindows_REAL

View File

@ -833,7 +833,6 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasRLE,(SDL_Surface *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SyncWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(Sint64,SDL_TellIO,(SDL_IOStream *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_TextInputActive,(void),(),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_TextInputShown,(void),(),return)
SDL_DYNAPI_PROC(SDL_Time,SDL_TimeFromWindows,(Uint32 a, Uint32 b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_TimeToDateTime,(SDL_Time a, SDL_DateTime *b, SDL_bool c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_TimeToWindows,(SDL_Time a, Uint32 *b, Uint32 *c),(a,b,c),)

View File

@ -308,7 +308,6 @@ struct SDL_VideoDevice
void (*StopTextInput)(SDL_VideoDevice *_this);
int (*SetTextInputRect)(SDL_VideoDevice *_this, const SDL_Rect *rect);
void (*ClearComposition)(SDL_VideoDevice *_this);
SDL_bool (*IsTextInputShown)(SDL_VideoDevice *_this);
/* Screen keyboard */
SDL_bool (*HasScreenKeyboardSupport)(SDL_VideoDevice *_this);

View File

@ -4793,15 +4793,6 @@ void SDL_ClearComposition(void)
}
}
SDL_bool SDL_TextInputShown(void)
{
if (_this && _this->IsTextInputShown) {
return _this->IsTextInputShown(_this);
}
return SDL_FALSE;
}
SDL_bool SDL_TextInputActive(void)
{
return _this && _this->text_input_active;

View File

@ -217,17 +217,6 @@ void GDK_ClearComposition(SDL_VideoDevice *_this)
/* See notice in GDK_StartTextInput */
}
SDL_bool GDK_IsTextInputShown(SDL_VideoDevice *_this)
{
/*
* The XGameUiShowTextEntryAsync window
* does specify potential input candidates
* just below the text box, so technically
* this is true whenever the window is shown.
*/
return (g_TextBlock != NULL);
}
SDL_bool GDK_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
{
/* Currently always true for this input method */
@ -287,8 +276,7 @@ void GDK_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window)
SDL_bool GDK_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
{
/* See notice in GDK_IsTextInputShown */
return GDK_IsTextInputShown(_this);
return (g_TextBlock != NULL);
}
#ifdef __cplusplus

View File

@ -36,7 +36,6 @@ void GDK_StartTextInput(SDL_VideoDevice *_this);
void GDK_StopTextInput(SDL_VideoDevice *_this);
int GDK_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect);
void GDK_ClearComposition(SDL_VideoDevice *_this);
SDL_bool GDK_IsTextInputShown(SDL_VideoDevice *_this);
SDL_bool GDK_HasScreenKeyboardSupport(SDL_VideoDevice *_this);
void GDK_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window);

View File

@ -35,7 +35,6 @@ static int IME_Init(SDL_VideoData *videodata, HWND hwnd);
static void IME_Enable(SDL_VideoData *videodata, HWND hwnd);
static void IME_Disable(SDL_VideoData *videodata, HWND hwnd);
static void IME_Quit(SDL_VideoData *videodata);
static SDL_bool IME_IsTextInputShown(SDL_VideoData *videodata);
#endif /* !SDL_DISABLE_WINDOWS_IME */
#ifndef MAPVK_VK_TO_VSC
@ -293,11 +292,6 @@ void WIN_ClearComposition(SDL_VideoDevice *_this)
{
}
SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this)
{
return SDL_FALSE;
}
SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
{
return SDL_FALSE;
@ -776,15 +770,6 @@ static void IME_ClearComposition(SDL_VideoData *videodata)
SDL_SendEditingText("", 0, 0);
}
static SDL_bool IME_IsTextInputShown(SDL_VideoData *videodata)
{
if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) {
return SDL_FALSE;
}
return videodata->ime_uicontext != 0;
}
static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string)
{
LONG length;
@ -1733,12 +1718,6 @@ void IME_Present(SDL_VideoData *videodata)
/* FIXME: Need to show the IME bitmap */
}
SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this)
{
SDL_VideoData *videodata = _this->driverdata;
return IME_IsTextInputShown(videodata);
}
void WIN_ClearComposition(SDL_VideoDevice *_this)
{
SDL_VideoData *videodata = _this->driverdata;

View File

@ -33,7 +33,6 @@ extern void WIN_StartTextInput(SDL_VideoDevice *_this);
extern void WIN_StopTextInput(SDL_VideoDevice *_this);
extern int WIN_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect);
extern void WIN_ClearComposition(SDL_VideoDevice *_this);
extern SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this);
extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata);

View File

@ -256,7 +256,6 @@ static SDL_VideoDevice *WIN_CreateDevice(void)
device->StopTextInput = WIN_StopTextInput;
device->SetTextInputRect = WIN_SetTextInputRect;
device->ClearComposition = WIN_ClearComposition;
device->IsTextInputShown = WIN_IsTextInputShown;
device->SetClipboardData = WIN_SetClipboardData;
device->GetClipboardData = WIN_GetClipboardData;
@ -270,7 +269,6 @@ static SDL_VideoDevice *WIN_CreateDevice(void)
device->StopTextInput = GDK_StopTextInput;
device->SetTextInputRect = GDK_SetTextInputRect;
device->ClearComposition = GDK_ClearComposition;
device->IsTextInputShown = GDK_IsTextInputShown;
device->HasScreenKeyboardSupport = GDK_HasScreenKeyboardSupport;
device->ShowScreenKeyboard = GDK_ShowScreenKeyboard;