Changed StartTextInput to take an SDL_Window parameter.

This commit is contained in:
dewyatt 2010-07-08 01:35:47 -04:00
parent 9807496e30
commit 2beaeb4080
8 changed files with 9 additions and 10 deletions

View file

@ -140,7 +140,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
* \sa SDL_StopTextInput() * \sa SDL_StopTextInput()
* \sa SDL_SetTextInputRect() * \sa SDL_SetTextInputRect()
*/ */
extern DECLSPEC void SDLCALL SDL_StartTextInput(void); extern DECLSPEC void SDLCALL SDL_StartTextInput(SDL_Window *window);
/** /**
* \brief Stop receiving any text input events. * \brief Stop receiving any text input events.

View file

@ -1740,7 +1740,7 @@ SDL_EnableUNICODE(int enable)
switch (enable) { switch (enable) {
case 1: case 1:
SDL_enabled_UNICODE = 1; SDL_enabled_UNICODE = 1;
SDL_StartTextInput(); SDL_StartTextInput(SDL_VideoWindow);
break; break;
case 0: case 0:
SDL_enabled_UNICODE = 0; SDL_enabled_UNICODE = 0;

View file

@ -617,7 +617,7 @@ SDL_SetKeyboardFocus(SDL_Window * window)
0, 0); 0, 0);
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
SDL_StartTextInput(); SDL_StartTextInput(window);
} }
} }
} }

View file

@ -299,7 +299,7 @@ struct SDL_VideoDevice
void (*SuspendScreenSaver) (_THIS); void (*SuspendScreenSaver) (_THIS);
/* Text input */ /* Text input */
void (*StartTextInput) (_THIS); void (*StartTextInput) (_THIS, SDL_Window *window);
void (*StopTextInput) (_THIS); void (*StopTextInput) (_THIS);
void (*SetTextInputRect) (_THIS, SDL_Rect *rect); void (*SetTextInputRect) (_THIS, SDL_Rect *rect);

View file

@ -3385,10 +3385,10 @@ SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info)
} }
void void
SDL_StartTextInput(void) SDL_StartTextInput(SDL_Window *window)
{ {
if (_this && _this->StartTextInput) { if (_this && _this->StartTextInput) {
_this->StartTextInput(_this); _this->StartTextInput(_this, window);
} }
SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE); SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE); SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE);

View file

@ -123,9 +123,8 @@ WIN_QuitKeyboard(_THIS)
} }
void void
WIN_StartTextInput(_THIS) WIN_StartTextInput(_THIS, SDL_Window *window)
{ {
SDL_Window *window = SDL_GetKeyboardFocus();
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
} }

View file

@ -31,7 +31,7 @@ extern void WIN_InitKeyboard(_THIS);
extern void WIN_UpdateKeymap(void); extern void WIN_UpdateKeymap(void);
extern void WIN_QuitKeyboard(_THIS); extern void WIN_QuitKeyboard(_THIS);
extern void WIN_StartTextInput(_THIS); extern void WIN_StartTextInput(_THIS, SDL_Window *window);
extern void WIN_StopTextInput(_THIS); extern void WIN_StopTextInput(_THIS);
extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect); extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect);

View file

@ -163,7 +163,7 @@ WIN_CreateDevice(int devindex)
device->GL_DeleteContext = WIN_GL_DeleteContext; device->GL_DeleteContext = WIN_GL_DeleteContext;
#endif #endif
device->StartTextInput = WIN_StartTextInput; device->StartTextInput = WIN_StartTextInput;
device->StopTextInput = WIN_StartTextInput; device->StopTextInput = WIN_StopTextInput;
device->SetTextInputRect = WIN_SetTextInputRect; device->SetTextInputRect = WIN_SetTextInputRect;
device->free = WIN_DeleteDevice; device->free = WIN_DeleteDevice;