summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-04 12:33:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-04 12:33:23 (GMT)
commit65a269fcf2363cf08ce16e09eb22da3a67474820 (patch)
treedb14ace0d9937f7cc569e241d71d9b303a8e0aa5
parent011f3123c085bb3512cc68548ad9246b0a31debf (diff)
parentfe17c3aa28ea1dc45df04bbfd1d31f157df7b9eb (diff)
downloadtk-65a269fcf2363cf08ce16e09eb22da3a67474820.zip
tk-65a269fcf2363cf08ce16e09eb22da3a67474820.tar.gz
tk-65a269fcf2363cf08ce16e09eb22da3a67474820.tar.bz2
Add various X11 stub functions, Cygwin only
remove TkBindDeadWindow from Cygwin stub table [Bug 3540127]: filebox.test fails on win32
-rw-r--r--ChangeLog4
-rw-r--r--generic/tkInt.decls26
-rw-r--r--generic/tkIntDecls.h4
-rw-r--r--generic/tkIntXlibDecls.h130
-rw-r--r--generic/tkStubInit.c41
-rw-r--r--win/tkWinDialog.c21
-rw-r--r--win/tkWinPort.h13
7 files changed, 211 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d8e888..d2481b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-07-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinDialog.c: [Bug 3540127]: filebox.test fails on win32
+
2012-06-26 Jan Nijtmans <nijtmans@users.sf.net>
* unix/configure.in: Link cygwin wish.exe with win32 tk.dll, only
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 45cc31b..c6e4bc7 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -1345,6 +1345,32 @@ declare 106 win {
int x, int y, unsigned int width, unsigned int height)
}
+# new for 8.4.20+/8.5.12+ Cygwin only
+declare 107 win {
+ int XFlush(Display *display)
+}
+declare 108 win {
+ int XGrabServer(Display *display)
+}
+declare 109 win {
+ int XUngrabServer(Display *display)
+}
+declare 110 win {
+ int XFree(void *data)
+}
+declare 111 win {
+ int XNoOp(Display *display)
+}
+declare 112 win {
+ XAfterFunction XSynchronize(Display *display, Bool onoff)
+}
+declare 113 win {
+ int XSync(Display *display, Bool discard)
+}
+declare 114 win {
+ VisualID XVisualIDFromVisual(Visual *visual)
+}
+
################################
# X functions for Aqua
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 59e7e30..5fcce30 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -1881,6 +1881,10 @@ extern TkIntStubs *tkIntStubsPtr;
(Region) (src), (Region) (ret))
#endif /* !__CYGWIN__*/
+#if defined(__CYGWIN__) && defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+# undef TkBindDeadWindow
+# define TkBindDeadWindow(winPtr) /* Removed from Cygwins stub table, just do nothing */
+#endif
#endif /* _TKINTDECLS */
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index 9ccfe8d..9844ac5 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -13,18 +13,26 @@
#ifndef _TKINTXLIBDECLS
#define _TKINTXLIBDECLS
+/*
+ * WARNING: This file is automatically generated by the tools/genStubs.tcl
+ * script. Any modifications to the function declarations below should be made
+ * in the generic/tkInt.decls script.
+ */
+
+#ifdef MAC_TCL
+#include "Xutil.h"
+#else
#include "X11/Xutil.h"
+#endif
#ifdef BUILD_tk
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT
#endif
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tkInt.decls script.
- */
+typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */
+ Display* /* display */
+);
/* !BEGIN!: Do not edit below this line. */
@@ -646,6 +654,46 @@ EXTERN int XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height);
#endif
+#ifndef XFlush_TCL_DECLARED
+#define XFlush_TCL_DECLARED
+/* 107 */
+EXTERN int XFlush(Display *display);
+#endif
+#ifndef XGrabServer_TCL_DECLARED
+#define XGrabServer_TCL_DECLARED
+/* 108 */
+EXTERN int XGrabServer(Display *display);
+#endif
+#ifndef XUngrabServer_TCL_DECLARED
+#define XUngrabServer_TCL_DECLARED
+/* 109 */
+EXTERN int XUngrabServer(Display *display);
+#endif
+#ifndef XFree_TCL_DECLARED
+#define XFree_TCL_DECLARED
+/* 110 */
+EXTERN int XFree(VOID *data);
+#endif
+#ifndef XNoOp_TCL_DECLARED
+#define XNoOp_TCL_DECLARED
+/* 111 */
+EXTERN int XNoOp(Display *display);
+#endif
+#ifndef XSynchronize_TCL_DECLARED
+#define XSynchronize_TCL_DECLARED
+/* 112 */
+EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff);
+#endif
+#ifndef XSync_TCL_DECLARED
+#define XSync_TCL_DECLARED
+/* 113 */
+EXTERN int XSync(Display *display, Bool discard);
+#endif
+#ifndef XVisualIDFromVisual_TCL_DECLARED
+#define XVisualIDFromVisual_TCL_DECLARED
+/* 114 */
+EXTERN VisualID XVisualIDFromVisual(Visual *visual);
+#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#ifndef XSetDashes_TCL_DECLARED
@@ -1300,6 +1348,14 @@ typedef struct TkIntXlibStubs {
int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */
int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */
int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */
+ int (*xFlush) (Display *display); /* 107 */
+ int (*xGrabServer) (Display *display); /* 108 */
+ int (*xUngrabServer) (Display *display); /* 109 */
+ int (*xFree) (VOID *data); /* 110 */
+ int (*xNoOp) (Display *display); /* 111 */
+ XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */
+ int (*xSync) (Display *display, Bool discard); /* 113 */
+ VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
@@ -1837,6 +1893,38 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
#define XFillRectangle \
(tkIntXlibStubsPtr->xFillRectangle) /* 106 */
#endif
+#ifndef XFlush
+#define XFlush \
+ (tkIntXlibStubsPtr->xFlush) /* 107 */
+#endif
+#ifndef XGrabServer
+#define XGrabServer \
+ (tkIntXlibStubsPtr->xGrabServer) /* 108 */
+#endif
+#ifndef XUngrabServer
+#define XUngrabServer \
+ (tkIntXlibStubsPtr->xUngrabServer) /* 109 */
+#endif
+#ifndef XFree
+#define XFree \
+ (tkIntXlibStubsPtr->xFree) /* 110 */
+#endif
+#ifndef XNoOp
+#define XNoOp \
+ (tkIntXlibStubsPtr->xNoOp) /* 111 */
+#endif
+#ifndef XSynchronize
+#define XSynchronize \
+ (tkIntXlibStubsPtr->xSynchronize) /* 112 */
+#endif
+#ifndef XSync
+#define XSync \
+ (tkIntXlibStubsPtr->xSync) /* 113 */
+#endif
+#ifndef XVisualIDFromVisual
+#define XVisualIDFromVisual \
+ (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */
+#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#ifndef XSetDashes
@@ -2216,4 +2304,36 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
+#if defined(__WIN32__)
+
+#undef XFlush
+#undef XGrabServer
+#undef XUngrabServer
+#undef XFree
+#undef XNoOp
+#undef XSynchronize
+#undef XSync
+#undef XVisualIDFromVisual
+
+/*
+ * The following stubs implement various calls that don't do anything
+ * under Windows.
+ */
+
+#define XFlush(display)
+#define XGrabServer(display)
+#define XUngrabServer(display)
+
+/*
+ * The following functions are implemented as macros under Windows.
+ */
+
+#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
+#define XNoOp(display) {display->request++;}
+#define XSynchronize(display, bool) {display->request++;}
+#define XSync(display, bool) {display->request++;}
+#define XVisualIDFromVisual(visual) (visual->visualid)
+
+#endif
+
#endif /* _TKINTXLIBDECLS */
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 477e5d8c..cee9133 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -46,11 +46,36 @@ TkCreateXEventSource(void)
TkWinXInit(Tk_GetHINSTANCE());
}
+#undef XFree
+#define XFree TkPlatXFree
+static int
+XFree(void *data)
+{
+ if (data != NULL) {
+ ckfree((char *) data);
+ }
+ return 0;
+}
+
+#undef XVisualIDFromVisual
+#define XVisualIDFromVisual TkPlatXVisualIDFromVisual
+static VisualID
+XVisualIDFromVisual(Visual *visual)
+{
+ return visual->visualid;
+}
+
/*
* Remove macros that will interfere with the definitions below.
*/
# undef TkpCmapStressed
# undef TkpSync
+# undef XFlush
+# undef XGrabServer
+# undef XUngrabServer
+# undef XNoOp
+# undef XSynchronize
+# undef XSync
# define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing
# define TkpSync (void (*) (Display *)) doNothing
@@ -60,6 +85,12 @@ TkCreateXEventSource(void)
# define TkWmCleanup (void (*) (TkDisplay *)) doNothing
# define TkSendCleanup (void (*) (TkDisplay *)) doNothing
# define TkpTestsendCmd 0
+# define XFlush (int (*) (Display *)) doNothing
+# define XGrabServer (int (*) (Display *)) doNothing
+# define XUngrabServer (int (*) (Display *)) doNothing
+# define XNoOp (int (*) (Display *)) doNothing
+# define XSynchronize (XAfterFunction (*) (Display *, Bool)) doNothing
+# define XSync (int (*) (Display *, Bool)) doNothing
#else /* !__WIN32__ */
@@ -202,6 +233,8 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c)
# define TkWinGetPlatformTheme 0
# define TkWinChildProc 0
+# define TkBindDeadWindow 0 /* On purpose not in Cygwin's stub table */
+
# elif !defined(MAC_OSX_TK) /* UNIX */
# undef TkClipBox
@@ -681,6 +714,14 @@ TkIntXlibStubs tkIntXlibStubs = {
XDrawLine, /* 104 */
XWarpPointer, /* 105 */
XFillRectangle, /* 106 */
+ XFlush, /* 107 */
+ XGrabServer, /* 108 */
+ XUngrabServer, /* 109 */
+ XFree, /* 110 */
+ XNoOp, /* 111 */
+ XSynchronize, /* 112 */
+ XSync, /* 113 */
+ XVisualIDFromVisual, /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
XSetDashes, /* 0 */
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 55152e9..5d9d82f 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -603,21 +603,16 @@ GetFileNameW(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
static CONST char *saveOptionStrings[] = {
- "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", "-typevariable",
- "-confirmoverwrite",
- NULL
+ "-confirmoverwrite", "-defaultextension", "-filetypes", "-initialdir",
+ "-initialfile", "-parent", "-title", "-typevariable", NULL
};
static CONST char *openOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", "-typevariable",
- "-multiple",
- NULL
+ "-multiple", "-parent", "-title", "-typevariable", NULL
};
enum options {
- FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE,
- FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE,
- FILE_MULTIPLE_OR_CONFIRMOW
+ FILE_MULTIPLE_OR_CONFIRMOW, FILE_DEFAULT, FILE_TYPES, FILE_INITDIR,
+ FILE_INITFILE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE
};
file[0] = '\0';
@@ -638,6 +633,12 @@ GetFileNameW(
"option", 0, &index) != TCL_OK) {
goto end;
}
+ /* Compensate for the "openOptionStrings" having different ordering [Bug #3540127] */
+ if (open && (index < FILE_PARENT)) {
+ if (++index > FILE_INITFILE) {
+ index = FILE_MULTIPLE_OR_CONFIRMOW;
+ }
+ }
if (i + 1 == objc) {
string = Tcl_GetString(optionPtr);
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 83b67c6..14f949c 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -97,19 +97,6 @@
#define TkFreeWindowId(dispPtr,w)
#define TkInitXId(dispPtr)
-#define XFlush(display)
-#define XGrabServer(display)
-#define XUngrabServer(display)
-
-/*
- * The following functions are implemented as macros under Windows.
- */
-
-#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
-#define XNoOp(display) {display->request++;}
-#define XSynchronize(display, bool) {display->request++;}
-#define XSync(display, bool) {display->request++;}
-#define XVisualIDFromVisual(visual) (visual->visualid)
/*
* The following Tk functions are implemented as macros under Windows.