summaryrefslogtreecommitdiffstats
path: root/generic/tkStubInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-26 11:02:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-26 11:02:29 (GMT)
commit6953f9dc57f63fe39701cd4e62ad03259e36c371 (patch)
tree083f2cf73199b4e7ae476283fdb3589d19566885 /generic/tkStubInit.c
parentbcc1d86678bcd77495a02ca7b58041f6c9ff3d1a (diff)
parentdf66b47acfd0644c7cda898c0c3c60d8e99dacd8 (diff)
downloadtk-6953f9dc57f63fe39701cd4e62ad03259e36c371.zip
tk-6953f9dc57f63fe39701cd4e62ad03259e36c371.tar.gz
tk-6953f9dc57f63fe39701cd4e62ad03259e36c371.tar.bz2
[Bug 3508771]: Implement TkClipBox, Tk*Region and Tk_GetHINSTANCE for Cygwin
[Bug 3519917]: Snow Leopard unix/Makefile `make test` fail
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r--generic/tkStubInit.c147
1 files changed, 63 insertions, 84 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 170ada7..4762b12 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -34,22 +34,65 @@
* Remove macros that will interfere with the definitions below.
*/
-#define Tk_CreateCanvasVisitor \
- ((void (*)(Tcl_Interp * interp, VOID * typePtr)) NULL)
-#define Tk_GetCanvasVisitor \
- ((VOID * (*)(Tcl_Interp * interp, CONST char * name)) NULL)
-
MODULE_SCOPE TkIntStubs tkIntStubs;
MODULE_SCOPE TkIntPlatStubs tkIntPlatStubs;
MODULE_SCOPE TkIntXlibStubs tkIntXlibStubs;
MODULE_SCOPE TkPlatStubs tkPlatStubs;
MODULE_SCOPE TkStubs tkStubs;
+#undef TkClipBox
+#undef TkCreateRegion
+#undef TkDestroyRegion
+#undef TkIntersectRegion
+#undef TkRectInRegion
+#undef TkSetRegion
+#undef TkUnionRectWithRegion
+#undef TkSubtractRegion
+#undef TkPutImage
+
#ifndef __WIN32__
/* Make sure that extensions which call XParseColor through
* the stub table, call TkParseColor in stead. See bug #3486474 */
# define XParseColor TkParseColor
-#endif
+
+# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL)
+# define Tk_AttachHWND 0
+# define Tk_GetHWND 0
+# define Tk_HWNDToWindow 0
+# define Tk_PointerEvent 0
+# define Tk_TranslateWinEvent 0
+# define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox
+# define TkCreateRegion (TkRegion (*) ()) XCreateRegion
+# define TkDestroyRegion (void (*) _ANSI_ARGS_((TkRegion))) XDestroyRegion
+# define TkIntersectRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XIntersectRegion
+# define TkRectInRegion (int (*) _ANSI_ARGS_((TkRegion, int, int, unsigned int, unsigned int))) XRectInRegion
+# define TkSetRegion (void (*) _ANSI_ARGS_((Display *, GC, TkRegion))) XSetRegion
+# define TkUnionRectWithRegion (void (*) _ANSI_ARGS_((XRectangle *, TkRegion, TkRegion))) XUnionRectWithRegion
+# define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion
+
+#ifdef __CYGWIN__
+/* Trick, so we don't have to include <windows.h> here, which
+ * - b.t.w. - lacks this function anyway */
+#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
+int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
+
+#define Tk_GetHINSTANCE TkPlatGetHINSTANCE
+static void *Tk_GetHINSTANCE()
+{
+ void *hInstance = NULL;
+ GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ (const char *)&tkIntStubs, &hInstance);
+ return hInstance;
+}
+
+#else /* __CYGWIN__ */
+# define Tk_GetHINSTANCE 0
+# define TkPutImage 0
+#endif /* __CYGWIN__ */
+
+# endif /* !MAC_TCL && !MACC_OSX_TCL */
+
+#endif /* !__WIN32__ */
/*
* WARNING: The contents of this file is automatically generated by the
@@ -175,76 +218,13 @@ TkIntStubs tkIntStubs = {
TkpGetSubFonts, /* 110 */
TkpGetSystemDefault, /* 111 */
TkpMenuThreadInit, /* 112 */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 113 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
- TkClipBox, /* 113 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 113 */ /* Dummy entry for stubs table backwards compatibility */
TkClipBox, /* 113 */
-#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 114 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
TkCreateRegion, /* 114 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 114 */ /* Dummy entry for stubs table backwards compatibility */
- TkCreateRegion, /* 114 */
-#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 115 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
TkDestroyRegion, /* 115 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 115 */ /* Dummy entry for stubs table backwards compatibility */
- TkDestroyRegion, /* 115 */
-#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 116 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
TkIntersectRegion, /* 116 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 116 */ /* Dummy entry for stubs table backwards compatibility */
- TkIntersectRegion, /* 116 */
-#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 117 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
TkRectInRegion, /* 117 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 117 */ /* Dummy entry for stubs table backwards compatibility */
- TkRectInRegion, /* 117 */
-#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 118 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
TkSetRegion, /* 118 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 118 */ /* Dummy entry for stubs table backwards compatibility */
- TkSetRegion, /* 118 */
-#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 119 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
TkUnionRectWithRegion, /* 119 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 119 */ /* Dummy entry for stubs table backwards compatibility */
- TkUnionRectWithRegion, /* 119 */
-#endif /* AQUA */
NULL, /* 120 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
NULL, /* 121 */
@@ -297,16 +277,7 @@ TkIntStubs tkIntStubs = {
TkFocusFree, /* 142 */
TkClipCleanup, /* 143 */
TkGCCleanup, /* 144 */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 145 */
-#endif /* X11 */
-#ifdef __WIN32__ /* WIN */
- TkSubtractRegion, /* 145 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 145 */ /* Dummy entry for stubs table backwards compatibility */
TkSubtractRegion, /* 145 */
-#endif /* AQUA */
TkStylePkgInit, /* 146 */
TkStylePkgFree, /* 147 */
TkToplevelWindowForCommand, /* 148 */
@@ -671,6 +642,14 @@ TkIntXlibStubs tkIntXlibStubs = {
TkPlatStubs tkPlatStubs = {
TCL_STUB_MAGIC,
NULL,
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
+ Tk_AttachHWND, /* 0 */
+ Tk_GetHINSTANCE, /* 1 */
+ Tk_GetHWND, /* 2 */
+ Tk_HWNDToWindow, /* 3 */
+ Tk_PointerEvent, /* 4 */
+ Tk_TranslateWinEvent, /* 5 */
+#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
Tk_AttachHWND, /* 0 */
Tk_GetHINSTANCE, /* 1 */
@@ -680,12 +659,12 @@ TkPlatStubs tkPlatStubs = {
Tk_TranslateWinEvent, /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- Tk_MacOSXSetEmbedHandler, /* 0 */
- Tk_MacOSXTurnOffMenus, /* 1 */
- Tk_MacOSXTkOwnsCursor, /* 2 */
- TkMacOSXInitMenus, /* 3 */
- TkMacOSXInitAppleEvents, /* 4 */
- TkGenWMConfigureEvent, /* 5 */
+ Tk_AttachHWND, /* 0 */
+ Tk_GetHINSTANCE, /* 1 */
+ Tk_GetHWND, /* 2 */
+ Tk_HWNDToWindow, /* 3 */
+ Tk_PointerEvent, /* 4 */
+ Tk_TranslateWinEvent, /* 5 */
TkMacOSXInvalClipRgns, /* 6 */
TkMacOSXGetDrawablePort, /* 7 */
TkMacOSXGetRootControl, /* 8 */