summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog9
-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
-rw-r--r--unix/tkUnixPort.h9
-rw-r--r--win/tkWinPort.h2
8 files changed, 49 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6bcd66c..d43f6f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-31 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkWindow.c: Simpify determination whether we are running on cygwin.
+ * generic/tkStubInit.c: Export Tk_GetHINSTANCE, TkSetPixmapColormap and
+ * generic/tkInt.decls: TkpPrintWindowId on the Cygwin dll, sync stub table
+ with Tk 8.6 win32 version.
+ * generic/tk*Decls.h: re-generated
+ * win/Makefile.in: Fix "make genstubs" when cross-compiling on UNIX
+
2012-05-29 Donal K. Fellows <dkf@users.sf.net>
* generic/tkInt.decls (TkMacOSXDrawable): Added OSX-specific mechanism
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
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index bc432e7..12010f4 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -137,6 +137,14 @@
desty, width, height);
#endif
+ /*
+ * The TkPutImage macro strips off the color table information, which isn't
+ * needed for X.
+ */
+
+# define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \
+ XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
+ desty, width, height);
/*
* Supply macros for seek offsets, if they're not already provided by
@@ -185,6 +193,7 @@
* This macro stores a representation of the window handle in a string.
* This should perhaps use the real size of an XID.
*/
+
#ifndef __CYGWIN__
#define TkpPrintWindowId(buf,w) \
sprintf((buf), "%#08lx", (unsigned long) (w))
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 1b999ab..75c7d22 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -102,6 +102,8 @@
* under Windows.
*/
+#define TkFreeWindowId(dispPtr,w)
+#define TkInitXId(dispPtr)
#define XFlush(display)
#define XGrabServer(display)
#define XUngrabServer(display)