diff options
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r-- | generic/tkStubInit.c | 171 |
1 files changed, 74 insertions, 97 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index a82e044..22334bc 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -40,17 +40,74 @@ /* * Remove macros that will interfere with the definitions below. */ - -#define Tk_CreateCanvasVisitor ((void (*) _ANSI_ARGS_((Tcl_Interp * interp, \ - VOID * typePtr))) NULL) -#define Tk_GetCanvasVisitor ((VOID * (*) _ANSI_ARGS_((Tcl_Interp * interp, \ - CONST char * name))) NULL) +#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 +/* + * 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 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__ +# 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 *); + +TkIntStubs tkIntStubs; + +static void *Tk_GetHINSTANCE() +{ + void *hInstance = NULL; + + GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + (const char *) &tkIntStubs, &hInstance); + return hInstance; +} + /* TODO: To be implemented for Cygwin */ +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 + +# else /* !__CYGWIN__ */ +# define TkPutImage 0 +# endif /* __CYGWIN__ */ +# endif /* !MAC_TCL && !MACC_OSX_TCL */ +#endif /* !__WIN32__ */ /* * WARNING: The contents of this file is automatically generated by the @@ -176,90 +233,13 @@ TkIntStubs tkIntStubs = { TkpGetSubFonts, /* 110 */ TkpGetSystemDefault, /* 111 */ TkpMenuThreadInit, /* 112 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 113 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkClipBox, /* 113 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL TkClipBox, /* 113 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkClipBox, /* 113 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 114 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkCreateRegion, /* 114 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkCreateRegion, /* 114 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkCreateRegion, /* 114 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 115 */ -#endif /* UNIX */ -#ifdef __WIN32__ TkDestroyRegion, /* 115 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkDestroyRegion, /* 115 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkDestroyRegion, /* 115 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 116 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkIntersectRegion, /* 116 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkIntersectRegion, /* 116 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkIntersectRegion, /* 116 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 117 */ -#endif /* UNIX */ -#ifdef __WIN32__ TkRectInRegion, /* 117 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkRectInRegion, /* 117 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkRectInRegion, /* 117 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 118 */ -#endif /* UNIX */ -#ifdef __WIN32__ TkSetRegion, /* 118 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkSetRegion, /* 118 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkSetRegion, /* 118 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 119 */ -#endif /* UNIX */ -#ifdef __WIN32__ TkUnionRectWithRegion, /* 119 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkUnionRectWithRegion, /* 119 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkUnionRectWithRegion, /* 119 */ -#endif /* MAC_OSX_TK */ NULL, /* 120 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ NULL, /* 121 */ @@ -318,18 +298,7 @@ TkIntStubs tkIntStubs = { TkFocusFree, /* 142 */ TkClipCleanup, /* 143 */ TkGCCleanup, /* 144 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 145 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkSubtractRegion, /* 145 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL TkSubtractRegion, /* 145 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkSubtractRegion, /* 145 */ -#endif /* MAC_OSX_TK */ TkStylePkgInit, /* 146 */ TkStylePkgFree, /* 147 */ TkToplevelWindowForCommand, /* 148 */ @@ -826,6 +795,14 @@ TkIntXlibStubs tkIntXlibStubs = { TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, +#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ + Tk_AttachHWND, /* 0 */ + Tk_GetHINSTANCE, /* 1 */ + Tk_GetHWND, /* 2 */ + Tk_HWNDToWindow, /* 3 */ + Tk_PointerEvent, /* 4 */ + Tk_TranslateWinEvent, /* 5 */ +#endif /* UNIX */ #ifdef __WIN32__ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ |