summaryrefslogtreecommitdiffstats
path: root/generic/tkStubInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2012-05-16 04:43:33 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2012-05-16 04:43:33 (GMT)
commit5668666cb48b5738cf6cfb74b80ae1240f5ea191 (patch)
tree3226d16f16893c081407f46d5428da95599d1df2 /generic/tkStubInit.c
parent704dfde80dd82532809511f107a82dfa326ffb88 (diff)
parent23b052e6e0e30539d958bd61e2f6a87dd3c2b982 (diff)
downloadtk-5668666cb48b5738cf6cfb74b80ae1240f5ea191.zip
tk-5668666cb48b5738cf6cfb74b80ae1240f5ea191.tar.gz
tk-5668666cb48b5738cf6cfb74b80ae1240f5ea191.tar.bz2
implement TkSetPixmapColormap and TkpPrintWindowId for cygwin
FossilOrigin-Name: bc99a26ca2589f456f2a8c793865835a3ed5552f
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r--generic/tkStubInit.c159
1 files changed, 121 insertions, 38 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 02038a8..63250c5 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -30,6 +30,37 @@
#include "tkPlatDecls.h"
#include "tkIntXlibDecls.h"
+#ifdef __WIN32__
+
+static int
+doNothing(void)
+{
+ /* dummy implementation, no need to do anything */
+ return 0;
+}
+
+/*
+ * Remove macros that will interfere with the definitions below.
+ */
+# undef TkFreeWindowId
+# undef TkInitXId
+# undef TkpCmapStressed
+# undef TkpSync
+
+# define TkCreateXEventSource (void (*) (void)) doNothing
+# define TkFreeWindowId (void (*) (TkDisplay *, Window)) doNothing
+# define TkInitXId (void (*) (TkDisplay *)) doNothing
+# define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing
+# define TkpSync (void (*) (Display *)) doNothing
+# define TkUnixContainerId 0
+# define TkUnixDoOneXEvent 0
+# define TkUnixSetMenubar 0
+# define TkWmCleanup (void (*) (TkDisplay *)) doNothing
+# define TkSendCleanup (void (*) (TkDisplay *)) doNothing
+# define TkFreeXId (void (*) (TkDisplay *)) doNothing
+# define TkpTestsendCmd 0
+
+#else
/*
* Remove macros that will interfere with the definitions below.
*/
@@ -40,17 +71,19 @@ 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__
+# undef TkClipBox
+# undef TkCreateRegion
+# undef TkDestroyRegion
+# undef TkIntersectRegion
+# undef TkRectInRegion
+# undef TkSetRegion
+# undef TkUnionRectWithRegion
+# undef TkSubtractRegion
+# undef TkPutImage
+# undef TkSetPixmapColormap
+# undef TkpPrintWindowId
+# undef TkWinChildProc
+
/*
* Make sure that extensions which call XParseColor through the stub
* table, call TkParseColor instead. [Bug 3486474]
@@ -76,14 +109,14 @@ MODULE_SCOPE TkStubs tkStubs;
# define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion
# ifdef __CYGWIN__
-# define Tk_GetHINSTANCE TkPlatGetHINSTANCE
-# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
+# define Tk_GetHINSTANCE TkPlatGetHINSTANCE
/*
* Trick, so we don't have to include <windows.h> here, which in any
* case lacks this function anyway.
*/
+#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
static void *Tk_GetHINSTANCE()
@@ -94,15 +127,61 @@ static void *Tk_GetHINSTANCE()
(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
+
+void
+TkSetPixmapColormap(pixmap, colormap)
+ Pixmap pixmap;
+ Colormap colormap;
+{
+}
+
+void
+TkpPrintWindowId(buf, window)
+ char *buf; /* Pointer to string large enough to hold
+ * the hex representation of a pointer. */
+ Window window; /* Window to be printed into buffer. */
+{
+ sprintf(buf, "%#08lx", (unsigned long) (window));
+}
+
+ /* 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
+# define TkAlignImageData 0
+# define TkGenerateActivateEvents 0
+# define TkpGetMS 0
+# define TkPointerDeadWindow 0
+# define TkpSetCapture 0
+# define TkpSetCursor 0
+# define TkWinCancelMouseTimer 0
+# define TkWinClipboardRender 0
+# define TkWinEmbeddedEventProc 0
+# define TkWinFillRect 0
+# define TkWinGetBorderPixels 0
+# define TkWinGetDrawableDC 0
+# define TkWinGetModifierState 0
+# define TkWinGetSystemPalette 0
+# define TkWinGetWrapperWindow 0
+# define TkWinHandleMenuEvent 0
+# define TkWinIndexOfColor 0
+# define TkWinReleaseDrawableDC 0
+# define TkWinResendEvent 0
+# define TkWinSelectPalette 0
+# define TkWinSetMenu 0
+# define TkWinSetWindowPos 0
+# define TkWinWmCleanup 0
+# define TkWinXCleanup 0
+# define TkWinXInit 0
+# define TkWinSetForegroundWindow 0
+# define TkWinDialogDebug 0
+# define TkWinGetMenuSystemDefault 0
+# define TkWinGetPlatformId 0
+# define TkWinSetHINSTANCE 0
+# define TkWinGetPlatformTheme 0
+# define TkWinChildProc 0
# endif /* __CYGWIN__ */
# endif /* !MAC_TCL && !MACC_OSX_TCL */
#endif /* !__WIN32__ */
@@ -331,7 +410,7 @@ TkIntStubs tkIntStubs = {
TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
NULL,
-#ifdef __WIN32__ /* WIN */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
TkAlignImageData, /* 0 */
NULL, /* 1 */
TkGenerateActivateEvents, /* 2 */
@@ -369,6 +448,18 @@ TkIntPlatStubs tkIntPlatStubs = {
TkWinSetHINSTANCE, /* 34 */
TkWinGetPlatformTheme, /* 35 */
TkWinChildProc, /* 36 */
+ TkCreateXEventSource, /* 37 */
+ TkFreeWindowId, /* 38 */
+ TkInitXId, /* 39 */
+ TkpCmapStressed, /* 40 */
+ TkpSync, /* 41 */
+ TkUnixContainerId, /* 42 */
+ TkUnixDoOneXEvent, /* 43 */
+ TkUnixSetMenubar, /* 44 */
+ TkWmCleanup, /* 45 */
+ TkSendCleanup, /* 46 */
+ TkFreeXId, /* 47 */
+ TkpTestsendCmd, /* 48 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
TkGenerateActivateEvents, /* 0 */
@@ -426,7 +517,7 @@ TkIntPlatStubs tkIntPlatStubs = {
NULL, /* 52 */
TkpGetMS, /* 53 */
#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
TkCreateXEventSource, /* 0 */
TkFreeWindowId, /* 1 */
TkInitXId, /* 2 */
@@ -655,14 +746,6 @@ 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 */
@@ -672,12 +755,12 @@ TkPlatStubs tkPlatStubs = {
Tk_TranslateWinEvent, /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- Tk_AttachHWND, /* 0 */
- Tk_GetHINSTANCE, /* 1 */
- Tk_GetHWND, /* 2 */
- Tk_HWNDToWindow, /* 3 */
- Tk_PointerEvent, /* 4 */
- Tk_TranslateWinEvent, /* 5 */
+ Tk_MacOSXSetEmbedHandler, /* 0 */
+ Tk_MacOSXTurnOffMenus, /* 1 */
+ Tk_MacOSXTkOwnsCursor, /* 2 */
+ TkMacOSXInitMenus, /* 3 */
+ TkMacOSXInitAppleEvents, /* 4 */
+ TkGenWMConfigureEvent, /* 5 */
TkMacOSXInvalClipRgns, /* 6 */
TkMacOSXGetDrawablePort, /* 7 */
TkMacOSXGetRootControl, /* 8 */