summaryrefslogtreecommitdiffstats
path: root/win/tkWinX.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-03-31 09:24:26 (GMT)
committerhobbs <hobbs>2000-03-31 09:24:26 (GMT)
commitd0234726eb4b759870dace2f272efee107024394 (patch)
treee97af0ad0371bd7cbd7c2c4ca58ee0a393407a74 /win/tkWinX.c
parentb6e815a78d530ea2de673fd5df7b83e08bcfca25 (diff)
downloadtk-d0234726eb4b759870dace2f272efee107024394.zip
tk-d0234726eb4b759870dace2f272efee107024394.tar.gz
tk-d0234726eb4b759870dace2f272efee107024394.tar.bz2
* win/tkWinDialog.c: added unicode-aware open/save file dialogs
* win/tkWinFont.c (TkpFontPkgInit): move private ref to platformId to TkWinGetPlatformId * win/tkWinMenu.c (SetDefaults): moved private use of versionInfo to TkWinGetPlatformId and removed all code for (versionInfo.dwMajorVersion < 4) (== Win32s) * win/tkWinX.c: * win/tkWin32Dll.c: moved TkWinGetPlatformId to tkWinX.c * win/tkWinInit.c: added TkWinXInit to TkpInit to ensure that its called for static Windows shells. [Bug: 3647] * win/tkWinInt.h: * win/tkWinX.c: * win/tkWinDraw.c (SetUpGraphicsPort): * win/tkWinScrlbr.c (UpdateScrollbar): removed use of tkpIsWin32s * win/tkWinInt.h (TkWinDCState struct): added bkmode value * win/tkWinDraw.c (TkWinGetDrawableDC, et al): added support for properly transparent dashed lines on Windows. [Bug: 4617]
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r--win/tkWinX.c63
1 files changed, 41 insertions, 22 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c
index e60d001..d537a7f 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinX.c,v 1.7 1999/11/19 22:00:19 hobbs Exp $
+ * RCS: @(#) $Id: tkWinX.c,v 1.8 2000/03/31 09:24:27 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -22,12 +22,6 @@
#include <zmouse.h>
/*
- * Definitions of extern variables supplied by this file.
- */
-
-int tkpIsWin32s = -1;
-
-/*
* Declarations of static variables used in this file.
*/
@@ -35,6 +29,7 @@ static char winScreenName[] = ":0"; /* Default name of windows display. */
static HINSTANCE tkInstance; /* Application instance handle. */
static int childClassInitialized; /* Registered child class? */
static WNDCLASS childClass; /* Window class for child windows. */
+static int tkPlatformId; /* version of Windows platform */
TCL_DECLARE_MUTEX(winXMutex)
@@ -84,16 +79,14 @@ TkGetServerInfo(interp, tkwin)
Tk_Window tkwin; /* Token for window; this selects a
* particular display and server. */
{
- char buffer[50];
- OSVERSIONINFO info;
-
- info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&info);
- sprintf(buffer, "Windows %d.%d %d ", info.dwMajorVersion,
- info.dwMinorVersion, info.dwBuildNumber);
- Tcl_AppendResult(interp, buffer,
- (info.dwPlatformId == VER_PLATFORM_WIN32s) ? "Win32s" : "Win32",
- (char *) NULL);
+ char buffer[60];
+ OSVERSIONINFO os;
+
+ os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&os);
+ sprintf(buffer, "Windows %d.%d %d Win32", os.dwMajorVersion,
+ os.dwMinorVersion, os.dwBuildNumber);
+ Tcl_SetResult(interp, buffer, TCL_VOLATILE);
}
/*
@@ -138,11 +131,7 @@ void
TkWinXInit(hInstance)
HINSTANCE hInstance;
{
- OSVERSIONINFO info;
-
- info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&info);
- tkpIsWin32s = (info.dwPlatformId == VER_PLATFORM_WIN32s);
+ OSVERSIONINFO os;
if (childClassInitialized != 0) {
return;
@@ -151,6 +140,10 @@ TkWinXInit(hInstance)
tkInstance = hInstance;
+ os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&os);
+ tkPlatformId = os.dwPlatformId;
+
/*
* When threads are enabled, we cannot use CLASSDC because
* threads will then write into the same device context.
@@ -225,6 +218,32 @@ TkWinXCleanup(hInstance)
/*
*----------------------------------------------------------------------
*
+ * TkWinGetPlatformId --
+ *
+ * Determines whether running under NT, 95, or Win32s, to allow
+ * runtime conditional code.
+ *
+ * Results:
+ * The return value is one of:
+ * VER_PLATFORM_WIN32s Win32s on Windows 3.1.
+ * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95.
+ * VER_PLATFORM_WIN32_NT Win32 on Windows NT
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkWinGetPlatformId()
+{
+ return tkPlatformId;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkGetDefaultScreenName --
*
* Returns the name of the screen that Tk should use during