diff src/video/win32/SDL_win32window.c @ 4465:3e69e077cb95

Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API. Plus, this lets me start implementing cursor support.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 09 May 2010 20:47:22 -0700
parents f7b03b6838cb
children 237b1eb53e4d 0c39b36dd104
line wrap: on
line diff
--- a/src/video/win32/SDL_win32window.c	Sun May 09 19:55:28 2010 -0700
+++ b/src/video/win32/SDL_win32window.c	Sun May 09 20:47:22 2010 -0700
@@ -73,9 +73,6 @@
 
 #endif
 
-extern HCTX *g_hCtx;            /* the table of tablet event contexts, each windows has to have it's own tablet context */
-static Uint32 highestId = 0;    /* the highest id of the tablet context */
-
 /* Fake window to help with DirectInput events. */
 HWND SDL_HelperWindow = NULL;
 static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
@@ -165,9 +162,8 @@
         }
     }
     if (GetFocus() == hwnd) {
-        int index = data->videodata->keyboard;
         window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        SDL_SetKeyboardFocus(index, data->window);
+        SDL_SetKeyboardFocus(data->window);
 
         if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
             RECT rect;
@@ -186,11 +182,7 @@
 int
 WIN_CreateWindow(_THIS, SDL_Window * window)
 {
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     SDL_VideoDisplay *display = window->display;
-    RAWINPUTDEVICE Rid;
-    AXIS TabX, TabY;
-    LOGCONTEXTA lc;
     HWND hwnd;
     HWND top;
     RECT rect;
@@ -257,48 +249,6 @@
         return -1;
     }
 
-    /* we're configuring the tablet data. See Wintab reference for more info */
-    if (videodata->wintabDLL
-        && videodata->WTInfoA(WTI_DEFSYSCTX, 0, &lc) != 0) {
-        lc.lcPktData = PACKETDATA;
-        lc.lcPktMode = PACKETMODE;
-        lc.lcOptions |= CXO_MESSAGES;
-        lc.lcOptions |= CXO_SYSTEM;
-        lc.lcMoveMask = PACKETDATA;
-        lc.lcBtnDnMask = lc.lcBtnUpMask = PACKETDATA;
-        videodata->WTInfoA(WTI_DEVICES, DVC_X, &TabX);
-        videodata->WTInfoA(WTI_DEVICES, DVC_Y, &TabY);
-        lc.lcInOrgX = 0;
-        lc.lcInOrgY = 0;
-        lc.lcInExtX = TabX.axMax;
-        lc.lcInExtY = TabY.axMax;
-        lc.lcOutOrgX = 0;
-        lc.lcOutOrgY = 0;
-        lc.lcOutExtX = GetSystemMetrics(SM_CXSCREEN);
-        lc.lcOutExtY = -GetSystemMetrics(SM_CYSCREEN);
-        if (window->id > highestId) {
-            HCTX *tmp_hctx;
-            highestId = window->id;
-            tmp_hctx =
-                (HCTX *) SDL_realloc(g_hCtx, (highestId + 1) * sizeof(HCTX));
-            if (!tmp_hctx) {
-                SDL_OutOfMemory();
-                DestroyWindow(hwnd);
-                return -1;
-            }
-            g_hCtx = tmp_hctx;
-        }
-        g_hCtx[window->id] = videodata->WTOpenA(hwnd, &lc, TRUE);
-    }
-#ifndef _WIN32_WCE              /* has no RawInput */
-    /* we're telling the window, we want it to report raw input events from mice */
-    Rid.usUsagePage = 0x01;
-    Rid.usUsage = 0x02;
-    Rid.dwFlags = RIDEV_INPUTSINK;
-    Rid.hwndTarget = hwnd;
-    RegisterRawInputDevices(&Rid, 1, sizeof(Rid));
-#endif
-
     WIN_PumpEvents(_this);
 
     if (SetupWindowData(_this, window, hwnd, SDL_TRUE) < 0) {
@@ -620,15 +570,11 @@
 void
 WIN_DestroyWindow(_THIS, SDL_Window * window)
 {
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
 
     if (data) {
         ReleaseDC(data->hwnd, data->hdc);
         if (data->created) {
-            if (videodata->wintabDLL) {
-                videodata->WTClose(g_hCtx[window->id]);
-            }
             DestroyWindow(data->hwnd);
         }
         SDL_free(data);