summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-31 04:53:04 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-31 04:53:04 (GMT)
commita2b7afd83359a8b5149462e93b174ca5784d1e1a (patch)
tree0d86ddd173e57154f68d6c3505b9ceaa39a54676 /generic
parentda68cb938e2bec4280883c4052906b9811aadf7c (diff)
parent91ae12c773a03fe4533d19a6d115deb6a4c95351 (diff)
downloadtk-a2b7afd83359a8b5149462e93b174ca5784d1e1a.zip
tk-a2b7afd83359a8b5149462e93b174ca5784d1e1a.tar.gz
tk-a2b7afd83359a8b5149462e93b174ca5784d1e1a.tar.bz2
Simpify determination whether we are running on cygwin.
Export Tk_GetHINSTANCE, TkSetPixmapColormap and TkpPrintWindowId on the Cygwin dll
Diffstat (limited to 'generic')
-rw-r--r--generic/tkInt.decls2
-rw-r--r--generic/tkMain.c22
-rw-r--r--generic/tkStubInit.c4
-rw-r--r--generic/tkTextDisp.c2
-rw-r--r--generic/tkWindow.c2
5 files changed, 29 insertions, 3 deletions
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 480f596..66a11c6 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -814,7 +814,7 @@ declare 36 win {
UINT message, WPARAM wParam, LPARAM lParam)
}
-# new for 8.4.20+, Cygwin only
+# new for 8.4.20+/8.5.12+, Cygwin only
declare 37 win {
void TkCreateXEventSource(void)
}
diff --git a/generic/tkMain.c b/generic/tkMain.c
index a48ddd4..4932d36 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -102,6 +102,7 @@ static int WinIsTty(int fd) {
* always claim to be running on a tty. This probably isn't the right way
* to do it.
*/
+
handle = GetStdHandle(STD_INPUT_HANDLE + fd);
/*
* If it's a bad or closed handle, then it's been connected to a wish
@@ -181,6 +182,27 @@ Tk_MainEx(
abort();
}
+#if defined(__WIN32__) && !defined(STATIC_BUILD)
+ if (tclStubsPtr->reserved9) {
+ /* We are running win32 Tk under Cygwin, so let's check
+ * whether the env("DISPLAY") variable or the -display
+ * argument is set. If so, we really want to run the
+ * Tk_MainEx function of libtk.dll, not this one. */
+ if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) {
+ loadCygwinTk:
+ Tcl_Panic("Should load libtk.dll now, not yet implemented");
+ } else {
+ int i;
+
+ for (i = 1; i < argc; ++i) {
+ if (!_tcscmp(argv[i], TEXT("-display"))) {
+ goto loadCygwinTk;
+ }
+ }
+ }
+ }
+#endif
+
Tcl_InitMemory(interp);
is.interp = interp;
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 34cf671..de5e00e 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -80,7 +80,9 @@ TkpSync(Display *display)
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
-static void *Tk_GetHINSTANCE()
+TkIntStubs tkIntStubs;
+
+void *Tk_GetHINSTANCE()
{
void *hInstance = NULL;
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index b66bf71..1b41e31 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -18,6 +18,8 @@
#ifdef __WIN32__
#include "tkWinInt.h"
+#elif defined(__CYGWIN__)
+#include "tkUnixInt.h"
#endif
#ifdef MAC_OSX_TK
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index b2c5310..90e53f0 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -16,7 +16,7 @@
#ifdef __WIN32__
#include "tkWinInt.h"
-#elif !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK))
+#elif !defined(MAC_OSX_TK)
#include "tkUnixInt.h"
#endif