summaryrefslogtreecommitdiffstats
path: root/win/tkWinX.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r--win/tkWinX.c66
1 files changed, 1 insertions, 65 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 819f9df..a6aea8e 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -87,7 +87,6 @@ static const char winScreenName[] = ":0"; /* Default name of windows display. */
static HINSTANCE tkInstance = NULL; /* Application instance handle. */
static int childClassInitialized; /* Registered child class? */
static WNDCLASSW childClass; /* Window class for child windows. */
-static int tkWinTheme = 0; /* See TkWinGetPlatformTheme */
static Tcl_Encoding keyInputEncoding = NULL;
/* The current character encoding for
* keyboard input */
@@ -334,69 +333,6 @@ TkWinXCleanup(
/*
*----------------------------------------------------------------------
*
- * TkWinGetPlatformTheme --
- *
- * Return the Windows drawing style we should be using.
- *
- * Results:
- * The return value is one of:
- * TK_THEME_WIN_CLASSIC 95/98/NT or XP in classic mode
- * TK_THEME_WIN_XP XP not in classic mode
- * TK_THEME_WIN_VISTA Vista or higher
- *
- *----------------------------------------------------------------------
- */
-
-int
-TkWinGetPlatformTheme(void)
-{
- if (tkWinTheme == 0) {
- OSVERSIONINFOW os;
-
- os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
- GetVersionExW(&os);
-
- if (os.dwPlatformId != VER_PLATFORM_WIN32_NT) {
- Tcl_Panic("Windows NT is the only supported platform");
- }
-
- /*
- * Set tkWinTheme to be TK_THEME_WIN_(CLASSIC|XP|VISTA). The
- * TK_THEME_WIN_CLASSIC could be set even when running under XP if the
- * windows classic theme was selected.
- */
- if (os.dwMajorVersion == 5 && os.dwMinorVersion >= 1) {
- HKEY hKey;
- LPCWSTR szSubKey = L"Control Panel\\Appearance";
- LPCWSTR szCurrent = L"Current";
- DWORD dwSize = 200;
- WCHAR pBuffer[200];
-
- memset(pBuffer, 0, dwSize);
- if (RegOpenKeyExW(HKEY_CURRENT_USER, szSubKey, 0L,
- KEY_READ, &hKey) != ERROR_SUCCESS) {
- tkWinTheme = TK_THEME_WIN_XP;
- } else {
- RegQueryValueExW(hKey, szCurrent, NULL, NULL, (LPBYTE) pBuffer, &dwSize);
- RegCloseKey(hKey);
- if (wcscmp(pBuffer, L"Windows Standard") == 0) {
- tkWinTheme = TK_THEME_WIN_CLASSIC;
- } else {
- tkWinTheme = TK_THEME_WIN_XP;
- }
- }
- } else if (os.dwMajorVersion > 5) {
- tkWinTheme = TK_THEME_WIN_VISTA;
- } else {
- tkWinTheme = TK_THEME_WIN_CLASSIC;
- }
- }
- return tkWinTheme;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TkGetDefaultScreenName --
*
* Returns the name of the screen that Tk should use during
@@ -1196,7 +1132,7 @@ GenerateXEvent(
event.key.nbytes = 0;
event.x.xkey.state = state;
event.x.xany.serial = scrollCounter++;
- event.x.xkey.keycode = (unsigned int)(-(delta << 16));
+ event.x.xkey.keycode = -((unsigned int)delta << 16);
} else {
event.x.type = MouseWheelEvent;
event.x.xany.send_event = -1;