summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-09 21:30:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-09 21:30:17 (GMT)
commit1781ae2223312ebc0d57a9861834a2be6904b53b (patch)
tree910f808d33b01cb133375f4d3021107f0fc845dc
parent302dfe1be6830add9d1bd8b57b4bc6c00fc609b3 (diff)
parent7da887fc2b6f0c7e19b48fbb6b464b35d31aad24 (diff)
downloadtk-1781ae2223312ebc0d57a9861834a2be6904b53b.zip
tk-1781ae2223312ebc0d57a9861834a2be6904b53b.tar.gz
tk-1781ae2223312ebc0d57a9861834a2be6904b53b.tar.bz2
Change TkpWmSetState signature to match UNIX, needed for Cygwin
Don't check for cygwin in win32 static build Some more useful #defines for Cygwin
-rw-r--r--ChangeLog8
-rw-r--r--generic/tkInt.decls2
-rw-r--r--generic/tkIntPlatDecls.h4
-rw-r--r--generic/tkWindow.c6
-rw-r--r--unix/tkUnixPort.h15
-rw-r--r--win/tkWinWm.c8
6 files changed, 34 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c9c5fce..6c97514 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinWm.c: Change TkpWmSetState signature to match UNIX,
+ * generic/tkInt.decls: needed for Cygwin. (not needed for Mac)
+ * generic/tkIntPlatDeclsDecls.h:
+ * generic/tkWindow.c: Don't check for cygwin in win32 static build.
+ * unix/tkUnixPort.h: Some more useful #defines for Cygwin
+
2012-05-05 Jan Nijtmans <nijtmans@users.sf.net>
* xlib/xcolors.c: Single "const" addition
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 7a69e50..2d67616 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -706,7 +706,7 @@ declare 8 win {
void TkpSetCursor(TkpCursor cursor)
}
declare 9 win {
- void TkpWmSetState(TkWindow *winPtr, int state)
+ int TkpWmSetState(TkWindow *winPtr, int state)
}
declare 10 win {
void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap)
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index f681397..9ad8a4f 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -52,7 +52,7 @@ EXTERN void TkpSetCapture(TkWindow *winPtr);
/* 8 */
EXTERN void TkpSetCursor(TkpCursor cursor);
/* 9 */
-EXTERN void TkpWmSetState(TkWindow *winPtr, int state);
+EXTERN int TkpWmSetState(TkWindow *winPtr, int state);
/* 10 */
EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap);
/* 11 */
@@ -275,7 +275,7 @@ typedef struct TkIntPlatStubs {
int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */
void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */
void (*tkpSetCursor) (TkpCursor cursor); /* 8 */
- void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */
+ int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */
void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */
void (*tkWinCancelMouseTimer) (void); /* 11 */
void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 4d5e895..278c8bc 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -859,7 +859,7 @@ TkCreateMainWindow(
{
Tk_Window tkwin;
int dummy, isSafe;
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(STATIC_BUILD)
int isWin32 = 0;
#endif
Tcl_HashEntry *hPtr;
@@ -869,7 +869,7 @@ TkCreateMainWindow(
ClientData clientData;
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(STATIC_BUILD)
Tcl_Obj *stringObjPtr = Tcl_GetVar2Ex(interp, "::tcl_platform", "platform", 0);
if (stringObjPtr
@@ -961,7 +961,7 @@ TkCreateMainWindow(
if ((cmdPtr->objProc == NULL)) {
Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs");
}
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(STATIC_BUILD)
if (!isWin32 && (cmdPtr->flags & WINMACONLY)) {
continue;
}
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 0076e5d..601ef57 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -122,6 +122,21 @@
XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
desty, width, height);
+#ifdef __CYGWIN__
+# define UINT unsigned int
+# define HWND void *
+# define HDC void *
+# define HINSTANCE void *
+# define COLORREF void *
+# define HMENU void *
+# define TkWinDCState void
+# define HPALETTE void *
+# define WNDPROC void *
+# define WPARAM void *
+# define LPARAM void *
+# define LRESULT void *
+#endif
+
/*
* Supply macros for seek offsets, if they're not already provided by
* an include file.
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 2aa251c..1dd2bcd 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -2436,7 +2436,7 @@ TkWmUnmapWindow(
*----------------------------------------------------------------------
*/
-void
+int
TkpWmSetState(
TkWindow *winPtr, /* Toplevel window to operate on. */
int state) /* One of IconicState, ZoomState, NormalState,
@@ -2447,7 +2447,7 @@ TkpWmSetState(
if (wmPtr->flags & WM_NEVER_MAPPED) {
wmPtr->hints.initial_state = state;
- return;
+ goto setStateEnd;
}
wmPtr->flags |= WM_SYNC_PENDING;
@@ -2460,11 +2460,13 @@ TkpWmSetState(
} else if (state == ZoomState) {
cmd = SW_SHOWMAXIMIZED;
} else {
- return;
+ goto setStateEnd;
}
ShowWindow(wmPtr->wrapper, cmd);
wmPtr->flags &= ~WM_SYNC_PENDING;
+setStateEnd:
+ return 1;
}
/*