From beeb9e0a1b1c6ceb61499edeb8cd6cf7999d12ea Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 21 Feb 2021 20:04:24 +0100 Subject: Remove: [Win32] Last pretenses of being able to build for Windows 95 --- src/video/win32_v.cpp | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'src/video/win32_v.cpp') diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index d32bcb222..8a0f291f0 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -234,41 +234,6 @@ bool VideoDriver_Win32Base::MakeWindow(bool full_screen) /** Forward key presses to the window system. */ static LRESULT HandleCharMsg(uint keycode, WChar charcode) { -#if !defined(UNICODE) - static char prev_char = 0; - - char input[2] = {(char)charcode, 0}; - int input_len = 1; - - if (prev_char != 0) { - /* We stored a lead byte previously, combine it with this byte. */ - input[0] = prev_char; - input[1] = (char)charcode; - input_len = 2; - } else if (IsDBCSLeadByte(charcode)) { - /* We got a lead byte, store and exit. */ - prev_char = charcode; - return 0; - } - prev_char = 0; - - wchar_t w[2]; // Can get up to two code points as a result. - int len = MultiByteToWideChar(CP_ACP, 0, input, input_len, w, 2); - switch (len) { - case 1: // Normal unicode character. - charcode = w[0]; - break; - - case 2: // Got an UTF-16 surrogate pair back. - charcode = Utf16DecodeSurrogate(w[0], w[1]); - break; - - default: // Some kind of error. - DEBUG(driver, 1, "Invalid DBCS character sequence encountered, dropping input"); - charcode = 0; - break; - } -#else static WChar prev_char = 0; /* Did we get a lead surrogate? If yes, store and exit. */ @@ -287,7 +252,6 @@ static LRESULT HandleCharMsg(uint keycode, WChar charcode) } } prev_char = 0; -#endif /* UNICODE */ HandleKeypress(keycode, charcode); @@ -396,11 +360,7 @@ static LRESULT HandleIMEComposition(HWND hwnd, WPARAM wParam, LPARAM lParam) const char *caret = utf8_buf; for (const TCHAR *c = str; *c != '\0' && *caret != '\0' && caret_bytes > 0; c++, caret_bytes--) { /* Skip DBCS lead bytes or leading surrogates. */ -#ifdef UNICODE if (Utf16IsLeadSurrogate(*c)) { -#else - if (IsDBCSLeadByte(*c)) { -#endif c++; caret_bytes--; } @@ -569,16 +529,6 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (wParam == IMN_OPENCANDIDATE) SetCandidatePos(hwnd); break; -#if !defined(UNICODE) - case WM_IME_CHAR: - if (GB(wParam, 8, 8) != 0) { - /* DBCS character, send lead byte first. */ - HandleCharMsg(0, GB(wParam, 8, 8)); - } - HandleCharMsg(0, GB(wParam, 0, 8)); - return 0; -#endif - case WM_DEADCHAR: console = GB(lParam, 16, 8) == 41; return 0; -- cgit v1.2.3-54-g00ecf