Remove: [Win32] Last pretenses of being able to build for Windows 95

This commit is contained in:
Niels Martin Hansen
2021-02-21 20:04:24 +01:00
parent 4bc69fec62
commit beeb9e0a1b
6 changed files with 12 additions and 201 deletions

View File

@@ -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;