changeset 4750:22aa6a631d34

Changed StartTextInput to take an SDL_Window parameter.
author dewyatt
date Thu, 08 Jul 2010 01:35:47 -0400
parents 0fa503d49cb4
children f3908cd80b10
files include/SDL_keyboard.h src/SDL_compat.c src/events/SDL_keyboard.c src/video/SDL_sysvideo.h src/video/SDL_video.c src/video/win32/SDL_win32keyboard.c src/video/win32/SDL_win32keyboard.h src/video/win32/SDL_win32video.c
diffstat 8 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_keyboard.h	Tue Jul 06 08:22:36 2010 -0700
+++ b/include/SDL_keyboard.h	Thu Jul 08 01:35:47 2010 -0400
@@ -140,7 +140,7 @@
  *  \sa SDL_StopTextInput()
  *  \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.
--- a/src/SDL_compat.c	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/SDL_compat.c	Thu Jul 08 01:35:47 2010 -0400
@@ -1740,7 +1740,7 @@
     switch (enable) {
     case 1:
         SDL_enabled_UNICODE = 1;
-        SDL_StartTextInput();
+        SDL_StartTextInput(SDL_VideoWindow);
         break;
     case 0:
         SDL_enabled_UNICODE = 0;
--- a/src/events/SDL_keyboard.c	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/events/SDL_keyboard.c	Thu Jul 08 01:35:47 2010 -0400
@@ -617,7 +617,7 @@
                             0, 0);
 
         if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
-            SDL_StartTextInput();
+            SDL_StartTextInput(window);
         }
     }
 }
--- a/src/video/SDL_sysvideo.h	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/video/SDL_sysvideo.h	Thu Jul 08 01:35:47 2010 -0400
@@ -299,7 +299,7 @@
     void (*SuspendScreenSaver) (_THIS);
 
     /* Text input */
-    void (*StartTextInput) (_THIS);
+    void (*StartTextInput) (_THIS, SDL_Window *window);
     void (*StopTextInput) (_THIS);
     void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
 
--- a/src/video/SDL_video.c	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/video/SDL_video.c	Thu Jul 08 01:35:47 2010 -0400
@@ -3385,10 +3385,10 @@
 }
 
 void
-SDL_StartTextInput(void)
+SDL_StartTextInput(SDL_Window *window)
 {
     if (_this && _this->StartTextInput) {
-        _this->StartTextInput(_this);
+        _this->StartTextInput(_this, window);
     }
     SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
     SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE);
--- a/src/video/win32/SDL_win32keyboard.c	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/video/win32/SDL_win32keyboard.c	Thu Jul 08 01:35:47 2010 -0400
@@ -123,9 +123,8 @@
 }
 
 void
-WIN_StartTextInput(_THIS)
+WIN_StartTextInput(_THIS, SDL_Window *window)
 {
-	SDL_Window *window = SDL_GetKeyboardFocus();
 	HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
 
 }
--- a/src/video/win32/SDL_win32keyboard.h	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/video/win32/SDL_win32keyboard.h	Thu Jul 08 01:35:47 2010 -0400
@@ -31,7 +31,7 @@
 extern void WIN_UpdateKeymap(void);
 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_SetTextInputRect(_THIS, SDL_Rect *rect);
 
--- a/src/video/win32/SDL_win32video.c	Tue Jul 06 08:22:36 2010 -0700
+++ b/src/video/win32/SDL_win32video.c	Thu Jul 08 01:35:47 2010 -0400
@@ -163,7 +163,7 @@
     device->GL_DeleteContext = WIN_GL_DeleteContext;
 #endif
     device->StartTextInput = WIN_StartTextInput;
-    device->StopTextInput = WIN_StartTextInput;
+    device->StopTextInput = WIN_StopTextInput;
     device->SetTextInputRect = WIN_SetTextInputRect;
 
     device->free = WIN_DeleteDevice;