summaryrefslogtreecommitdiffstats
path: root/generic/tkStubInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-16 13:31:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-16 13:31:48 (GMT)
commit31f8fd62815ade2416fca697fea79938ab61d230 (patch)
tree34f7f531464329534828bc183ab4079b2de3a103 /generic/tkStubInit.c
parent1781ae2223312ebc0d57a9861834a2be6904b53b (diff)
parentc29a2d58d9c3de29bcd7e88011aea2b9c1bcd92e (diff)
downloadtk-31f8fd62815ade2416fca697fea79938ab61d230.zip
tk-31f8fd62815ade2416fca697fea79938ab61d230.tar.gz
tk-31f8fd62815ade2416fca697fea79938ab61d230.tar.bz2
implement TkSetPixmapColormap and TkpPrintWindowId for cygwin
cleanup some more unused CYGWIN stuff
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r--generic/tkStubInit.c240
1 files changed, 175 insertions, 65 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index e19180f..499dfd4 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -30,12 +30,6 @@
#include "tkPlatDecls.h"
#include "tkIntXlibDecls.h"
-/*
- * WARNING: The contents of this file is automatically generated by the
- * tools/genStubs.tcl script. Any modifications to the function declarations
- * below should be made in the generic/tk.decls script.
- */
-
static const TkIntStubs tkIntStubs;
/*
@@ -44,50 +38,57 @@ static const TkIntStubs tkIntStubs;
#undef Tk_MainEx
-#undef TkClipBox
-#undef TkCreateRegion
-#undef TkDestroyRegion
-#undef TkIntersectRegion
-#undef TkRectInRegion
-#undef TkSetRegion
-#undef TkUnionRectWithRegion
-#undef TkSubtractRegion
-#undef TkPutImage
-
-#ifndef __WIN32__
+#ifdef __WIN32__
+
+int
+TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
+{
+ /* dummy implementation, no need to do anything */
+ return 0;
+}
+void
+TkpSync(Display *display)
+{
+ /* dummy implementation, no need to do anything */
+}
+
+# define TkCreateXEventSource (void (*) (void)) TkpSync
+# define TkUnixContainerId 0
+# define TkUnixDoOneXEvent 0
+# define TkUnixSetMenubar 0
+# define TkWmCleanup (void (*) (TkDisplay *)) TkpSync
+# define TkSendCleanup (void (*) (TkDisplay *)) TkpSync
+# define TkpTestsendCmd 0
+
+#else
+# undef TkClipBox
+# undef TkCreateRegion
+# undef TkDestroyRegion
+# undef TkIntersectRegion
+# undef TkRectInRegion
+# undef TkSetRegion
+# undef TkUnionRectWithRegion
+# undef TkSubtractRegion
+# undef TkSetPixmapColormap
+# undef TkpPrintWindowId
+# undef TkWinChildProc
+
/*
* 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 (*) (TkRegion, XRectangle *)) XClipBox
-# define TkCreateRegion (TkRegion (*) ()) XCreateRegion
-# define TkDestroyRegion (void (*) (TkRegion)) XDestroyRegion
-# define TkIntersectRegion (void (*) (TkRegion, TkRegion, TkRegion)) XIntersectRegion
-# define TkRectInRegion (int (*) (TkRegion, int, int, unsigned int, unsigned int)) XRectInRegion
-# define TkSetRegion (void (*) (Display *, GC, TkRegion)) XSetRegion
-# define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion
-# define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion
-
-# ifdef __CYGWIN__
-# define Tk_GetHINSTANCE TkPlatGetHINSTANCE
-# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
+# ifdef __CYGWIN__
+
+# 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()
@@ -98,19 +99,127 @@ 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 pixmap,
+ Colormap colormap)
+{
+}
+
+void
+TkpPrintWindowId(
+ 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));
+}
+
+void
+TkPutImage(
+ unsigned long *colors, /* Array of pixel values used by this image.
+ * May be NULL. */
+ int ncolors, /* Number of colors used, or 0. */
+ Display *display,
+ Drawable d, /* Destination drawable. */
+ GC gc,
+ XImage *image, /* Source image. */
+ int src_x, int src_y, /* Offset of subimage. */
+ int dest_x, int dest_y, /* Position of subimage origin in drawable. */
+ unsigned int width, unsigned int height)
+ /* Dimensions of subimage. */
+{
+ XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height);
+}
+
+TkRegion TkCreateRegion()
+{
+ return (TkRegion) XCreateRegion();
+}
+
+void TkDestroyRegion(TkRegion r)
+{
+ XDestroyRegion((Region)r);
+}
+
+void TkSetRegion(Display *d, GC g, TkRegion r)
+{
+ XSetRegion(d, g, (Region)r);
+}
+
+void TkUnionRectWithRegion(XRectangle *a, TkRegion b, TkRegion c)
+{
+ XUnionRectWithRegion(a, (Region) b, (Region) c);
+}
+
+void TkClipBox(TkRegion a, XRectangle *b)
+{
+ XClipBox((Region) a, b);
+}
+
+void TkIntersectRegion(TkRegion a, TkRegion b, TkRegion c)
+{
+ XIntersectRegion((Region) a, (Region) b, (Region) c);
+}
+
+int TkRectInRegion (TkRegion r, int a, int b, unsigned int c, unsigned int d)
+{
+ return XRectInRegion((Region) r, a, b, c, d);
+}
+
+void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c)
+{
+ XSubtractRegion((Region) a, (Region) b, (Region) c);
+}
+
+ /* 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__ */
+/*
+ * WARNING: The contents of this file is automatically generated by the
+ * tools/genStubs.tcl script. Any modifications to the function declarations
+ * below should be made in the generic/tk.decls script.
+ */
+
/* !BEGIN!: Do not edit below this line. */
static const TkIntStubs tkIntStubs = {
@@ -333,7 +442,7 @@ static const TkIntStubs tkIntStubs = {
static const TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
0,
-#ifdef __WIN32__ /* WIN */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
TkAlignImageData, /* 0 */
0, /* 1 */
TkGenerateActivateEvents, /* 2 */
@@ -371,6 +480,15 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkWinSetHINSTANCE, /* 34 */
TkWinGetPlatformTheme, /* 35 */
TkWinChildProc, /* 36 */
+ TkCreateXEventSource, /* 37 */
+ TkpCmapStressed, /* 38 */
+ TkpSync, /* 39 */
+ TkUnixContainerId, /* 40 */
+ TkUnixDoOneXEvent, /* 41 */
+ TkUnixSetMenubar, /* 42 */
+ TkWmCleanup, /* 43 */
+ TkSendCleanup, /* 44 */
+ TkpTestsendCmd, /* 45 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
TkGenerateActivateEvents, /* 0 */
@@ -428,7 +546,7 @@ static const TkIntPlatStubs tkIntPlatStubs = {
0, /* 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 */
0, /* 1 */
0, /* 2 */
@@ -657,15 +775,7 @@ static const TkIntXlibStubs tkIntXlibStubs = {
static const TkPlatStubs tkPlatStubs = {
TCL_STUB_MAGIC,
0,
-#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 */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
Tk_AttachHWND, /* 0 */
Tk_GetHINSTANCE, /* 1 */
Tk_GetHWND, /* 2 */
@@ -674,12 +784,12 @@ static const 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 */