summaryrefslogtreecommitdiffstats
path: root/generic/tkStubInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-26 14:32:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-26 14:32:43 (GMT)
commitf82df37a90029d95b86d6fad1d14ddb3323419dd (patch)
tree6386cbce29e1fb3a7c9d6b60c1e4e35533d26650 /generic/tkStubInit.c
parent75d0d5da127d9d9b7fbc4b5989c6510eb950e402 (diff)
parent92dc17bde5685c5249794b0ef519d9597139c5f4 (diff)
downloadtk-f82df37a90029d95b86d6fad1d14ddb3323419dd.zip
tk-f82df37a90029d95b86d6fad1d14ddb3323419dd.tar.gz
tk-f82df37a90029d95b86d6fad1d14ddb3323419dd.tar.bz2
merge trunk
shorten command table, and make sure that tk.dll, when loaded in cygwin, doesn't use the win32 file dialogs
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r--generic/tkStubInit.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 89ae433..6b36f7b 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -48,20 +48,24 @@
#undef TkSetRegion
#undef TkUnionRectWithRegion
#undef TkSubtractRegion
-
-TkIntStubs tkIntStubs;
+#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
+/*
+ * Make sure that extensions which call XParseColor through the stub
+ * table, call TkParseColor instead. [Bug 3486474]
+ */
+# define XParseColor TkParseColor
+# ifndef __CYGWIN__
+# define Tk_AttachHWND 0
+# define Tk_GetHWND 0
+# define Tk_HWNDToWindow 0
+# define Tk_PointerEvent 0
+# define Tk_TranslateWinEvent 0
+# define Tk_GetHINSTANCE 0
+# 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
@@ -71,26 +75,32 @@ TkIntStubs tkIntStubs;
# 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
+# ifdef __CYGWIN__
+# define Tk_GetHINSTANCE TkPlatGetHINSTANCE
+# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
+
+/*
+ * Trick, so we don't have to include <windows.h> here, which in any
+ * case lacks this function anyway.
+ */
+
int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
-#define Tk_GetHINSTANCE TkPlatGetHINSTANCE
+TkIntStubs tkIntStubs;
+
static void *Tk_GetHINSTANCE()
{
void *hInstance = NULL;
+
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- (const char *)&tkIntStubs, &hInstance);
+ (const char *) &tkIntStubs, &hInstance);
return hInstance;
}
-#else
-# define Tk_GetHINSTANCE 0
-#endif
+# else /* !__CYGWIN__ */
+# define TkPutImage 0
+# endif /* __CYGWIN__ */
# endif /* !MAC_TCL && !MACC_OSX_TCL */
-
#endif /* !__WIN32__ */
/*