summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tkInt.decls67
-rw-r--r--generic/tkIntDecls.h44
-rw-r--r--generic/tkIntXlibDecls.h126
-rw-r--r--generic/tkPointer.c6
-rw-r--r--generic/tkStubInit.c139
-rw-r--r--macosx/tkMacOSXClipboard.c8
-rw-r--r--macosx/tkMacOSXColor.c6
-rw-r--r--macosx/tkMacOSXDraw.c21
-rw-r--r--macosx/tkMacOSXKeyboard.c3
-rw-r--r--macosx/tkMacOSXXStubs.c6
-rw-r--r--unix/tkUnixPort.h4
-rw-r--r--win/stubs.c23
-rw-r--r--win/tkWinClipboard.c3
-rw-r--r--win/tkWinColor.c6
-rw-r--r--win/tkWinDraw.c15
-rw-r--r--win/tkWinKey.c3
-rw-r--r--win/tkWinPointer.c2
-rw-r--r--win/tkWinRegion.c7
-rw-r--r--win/tkWinX.c3
-rw-r--r--xlib/xdraw.c8
-rw-r--r--xlib/xgc.c8
22 files changed, 302 insertions, 212 deletions
diff --git a/ChangeLog b/ChangeLog
index fa73d52..04b0140 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkInt.decls: Change XSetDashes signature and many others
+ * generic/tkIntDecls.h: to match Xorg, needed for Cygwin.
+ * generic/tkIntXlibDeclsDecls.h
+
2012-05-30 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tkWindow.c: Simpify determination whether we are running on cygwin.
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 20d0dd4..f08c046 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -975,7 +975,7 @@ interface tkIntXlib
# X functions for Windows
declare 0 win {
- void XSetDashes(Display *display, GC gc, int dash_offset,
+ int XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n)
}
declare 1 win {
@@ -1005,7 +1005,8 @@ declare 7 win {
}
declare 8 win {
Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
- unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2)
+ unsigned int ui1, unsigned int ui2, XColor _Xconst *x1,
+ XColor _Xconst *x2)
}
declare 9 win {
GContext XGContextFromGC(GC g)
@@ -1039,7 +1040,7 @@ declare 18 win {
Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
declare 19 win {
- void XBell(Display *d, int i)
+ int XBell(Display *d, int i)
}
declare 20 win {
void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
@@ -1070,7 +1071,7 @@ declare 26 win {
_Xconst char *data, unsigned int width, unsigned int height)
}
declare 27 win {
- void XDefineCursor(Display *d, Window w, Cursor c)
+ int XDefineCursor(Display *d, Window w, Cursor c)
}
declare 28 win {
void XDeleteProperty(Display *d, Window w, Atom a)
@@ -1083,7 +1084,7 @@ declare 30 win {
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
declare 31 win {
- void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
+ int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
}
declare 32 win {
void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
@@ -1098,23 +1099,23 @@ declare 34 win {
int i1, int i2, int i3)
}
declare 35 win {
- void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
+ int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
}
declare 36 win {
void XForceScreenSaver(Display *d, int i)
}
declare 37 win {
- void XFreeColormap(Display *d, Colormap c)
+ int XFreeColormap(Display *d, Colormap c)
}
declare 38 win {
- void XFreeColors(Display *d, Colormap c,
+ int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul)
}
declare 39 win {
void XFreeCursor(Display *d, Cursor c)
}
declare 40 win {
- void XFreeModifiermap(XModifierKeymap *x)
+ int XFreeModifiermap(XModifierKeymap *x)
}
declare 41 win {
Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
@@ -1190,7 +1191,7 @@ declare 61 win {
Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x)
}
declare 62 win {
- void XSetCommand(Display *d, Window w, char **c, int i)
+ int XSetCommand(Display *d, Window w, char **c, int i)
}
declare 63 win {
void XSetIconName(Display *d, Window w, _Xconst char *c)
@@ -1199,7 +1200,7 @@ declare 64 win {
void XSetInputFocus(Display *d, Window w, int i, Time t)
}
declare 65 win {
- void XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
+ int XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
declare 66 win {
void XSetWindowBackground(Display *d, Window w, unsigned long ul)
@@ -1227,7 +1228,7 @@ declare 73 win {
void XUngrabKeyboard(Display *d, Time t)
}
declare 74 win {
- void XUngrabPointer(Display *d, Time t)
+ int XUngrabPointer(Display *d, Time t)
}
declare 75 win {
void XUnmapWindow(Display *d, Window w)
@@ -1246,7 +1247,7 @@ declare 79 win {
KeySym *k, Status *s)
}
declare 80 win {
- void TkPutImage(unsigned long *colors, int ncolors, Display *display,
+ int TkPutImage(unsigned long *colors, int ncolors, Display *display,
Drawable d, GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width, unsigned int height)
}
@@ -1332,23 +1333,23 @@ declare 103 win {
XTextProperty *text_prop_return)
}
declare 104 win {
- void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
+ int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
int x2, int y2)
}
-declare 106 win {
- void XFillRectangle(Display *display, Drawable d, GC gc,
- int x, int y, unsigned int width, unsigned int height)
-}
declare 105 win {
- void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
+ int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
unsigned int sw, unsigned int sh, int dx, int dy)
}
+declare 106 win {
+ int XFillRectangle(Display *display, Drawable d, GC gc,
+ int x, int y, unsigned int width, unsigned int height)
+}
################################
# X functions for Aqua
declare 0 aqua {
- void XSetDashes(Display *display, GC gc, int dash_offset,
+ int XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n)
}
declare 1 aqua {
@@ -1391,7 +1392,7 @@ declare 12 aqua {
Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
declare 13 aqua {
- void XBell(Display *d, int i)
+ int XBell(Display *d, int i)
}
declare 14 aqua {
void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
@@ -1419,7 +1420,7 @@ declare 19 aqua {
_Xconst char *data, unsigned int width, unsigned int height)
}
declare 20 aqua {
- void XDefineCursor(Display *d, Window w, Cursor c)
+ int XDefineCursor(Display *d, Window w, Cursor c)
}
declare 21 aqua {
void XDestroyWindow(Display *d, Window w)
@@ -1429,7 +1430,7 @@ declare 22 aqua {
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
declare 23 aqua {
- void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
+ int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
}
declare 24 aqua {
void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
@@ -1444,17 +1445,17 @@ declare 26 aqua {
int i1, int i2, int i3)
}
declare 27 aqua {
- void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
+ int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
}
declare 28 aqua {
- void XFreeColormap(Display *d, Colormap c)
+ int XFreeColormap(Display *d, Colormap c)
}
declare 29 aqua {
- void XFreeColors(Display *d, Colormap c,
+ int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul)
}
declare 30 aqua {
- void XFreeModifiermap(XModifierKeymap *x)
+ int XFreeModifiermap(XModifierKeymap *x)
}
declare 31 aqua {
Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
@@ -1513,7 +1514,7 @@ declare 46 aqua {
void XSetInputFocus(Display *d, Window w, int i, Time t)
}
declare 47 aqua {
- void XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
+ int XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
declare 48 aqua {
void XSetWindowBackground(Display *d, Window w, unsigned long ul)
@@ -1537,13 +1538,13 @@ declare 54 aqua {
void XUngrabKeyboard(Display *d, Time t)
}
declare 55 aqua {
- void XUngrabPointer(Display *d, Time t)
+ int XUngrabPointer(Display *d, Time t)
}
declare 56 aqua {
void XUnmapWindow(Display *d, Window w)
}
declare 57 aqua {
- void TkPutImage(unsigned long *colors, int ncolors, Display *display,
+ int TkPutImage(unsigned long *colors, int ncolors, Display *display,
Drawable d, GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width, unsigned int height)
}
@@ -1631,11 +1632,11 @@ declare 81 aqua {
void XForceScreenSaver(Display *display, int mode)
}
declare 82 aqua {
- void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
+ int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
int x2, int y2)
}
declare 83 aqua {
- void XFillRectangle(Display *display, Drawable d, GC gc,
+ int XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width, unsigned int height)
}
declare 84 aqua {
@@ -1649,7 +1650,7 @@ declare 86 aqua {
int npoints, int mode)
}
declare 87 aqua {
- void XWarpPointer(Display *display, Window src_w, Window dest_w,
+ int XWarpPointer(Display *display, Window src_w, Window dest_w,
int src_x, int src_y, unsigned int src_width,
unsigned int src_height, int dest_x, int dest_y)
}
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 7f1c096..eb224c8 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -1854,31 +1854,33 @@ extern TkIntStubs *tkIntStubsPtr;
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#ifndef __WIN32__
+#if !defined(__WIN32__) && !defined(MAC_OSX_TK)
+
/*
* These macros are just wrappers for the equivalent X Region calls.
*/
-#undef TkClipBox
-#undef TkCreateRegion
-#undef TkDestroyRegion
-#undef TkIntersectRegion
-#undef TkRectInRegion
-#undef TkSetRegion
-#undef TkSubtractRegion
-#undef TkUnionRectWithRegion
+# undef TkClipBox
+# undef TkCreateRegion
+# undef TkDestroyRegion
+# undef TkIntersectRegion
+# undef TkRectInRegion
+# undef TkSetRegion
+# undef TkSubtractRegion
+# undef TkUnionRectWithRegion
+
+# define TkClipBox(rgn, rect) XClipBox((Region) (rgn), (rect))
+# define TkCreateRegion() (TkRegion) XCreateRegion()
+# define TkDestroyRegion(rgn) XDestroyRegion((Region) (rgn))
+# define TkIntersectRegion(a, b, r) XIntersectRegion((Region) (a), \
+(Region) (b), (Region) (r))
+# define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) (r), (x), (y), (w), (h))
+# define TkSetRegion(d, gc, rgn) XSetRegion((d), (gc), (Region) (rgn))
+# define TkSubtractRegion(a, b, r) XSubtractRegion((Region) (a), \
+(Region) (b), (Region) (r))
+# define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion((rect), \
+(Region) (src), (Region) (ret))
+#endif /* !__CYGWIN__*/
-#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
-#define TkCreateRegion() (TkRegion) XCreateRegion()
-#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
-#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
- (Region) b, (Region) r)
-#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
-#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
-#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \
- (Region) b, (Region) r)
-#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
- (Region) src, (Region) ret)
-#endif /* __WIN32__ */
#endif /* _TKINTDECLS */
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index 0bc12e5..0e59123 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -32,11 +32,11 @@
* Exported function declarations:
*/
-#if defined(__WIN32__) /* WIN */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
#ifndef XSetDashes_TCL_DECLARED
#define XSetDashes_TCL_DECLARED
/* 0 */
-EXTERN void XSetDashes(Display *display, GC gc, int dash_offset,
+EXTERN int XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n);
#endif
#ifndef XGetModifierMapping_TCL_DECLARED
@@ -86,7 +86,7 @@ EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
/* 8 */
EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
unsigned int ui1, unsigned int ui2,
- XColor *x1, XColor *x2);
+ XColor _Xconst *x1, XColor _Xconst *x2);
#endif
#ifndef XGContextFromGC_TCL_DECLARED
#define XGContextFromGC_TCL_DECLARED
@@ -142,7 +142,7 @@ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
#ifndef XBell_TCL_DECLARED
#define XBell_TCL_DECLARED
/* 19 */
-EXTERN void XBell(Display *d, int i);
+EXTERN int XBell(Display *d, int i);
#endif
#ifndef XChangeProperty_TCL_DECLARED
#define XChangeProperty_TCL_DECLARED
@@ -193,7 +193,7 @@ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d,
#ifndef XDefineCursor_TCL_DECLARED
#define XDefineCursor_TCL_DECLARED
/* 27 */
-EXTERN void XDefineCursor(Display *d, Window w, Cursor c);
+EXTERN int XDefineCursor(Display *d, Window w, Cursor c);
#endif
#ifndef XDeleteProperty_TCL_DECLARED
#define XDeleteProperty_TCL_DECLARED
@@ -215,7 +215,7 @@ EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1,
#ifndef XDrawLines_TCL_DECLARED
#define XDrawLines_TCL_DECLARED
/* 31 */
-EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
+EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2);
#endif
#ifndef XDrawRectangle_TCL_DECLARED
@@ -240,7 +240,7 @@ EXTERN void XFillPolygon(Display *d, Drawable dr, GC g,
#ifndef XFillRectangles_TCL_DECLARED
#define XFillRectangles_TCL_DECLARED
/* 35 */
-EXTERN void XFillRectangles(Display *d, Drawable dr, GC g,
+EXTERN int XFillRectangles(Display *d, Drawable dr, GC g,
XRectangle *x, int i);
#endif
#ifndef XForceScreenSaver_TCL_DECLARED
@@ -251,12 +251,12 @@ EXTERN void XForceScreenSaver(Display *d, int i);
#ifndef XFreeColormap_TCL_DECLARED
#define XFreeColormap_TCL_DECLARED
/* 37 */
-EXTERN void XFreeColormap(Display *d, Colormap c);
+EXTERN int XFreeColormap(Display *d, Colormap c);
#endif
#ifndef XFreeColors_TCL_DECLARED
#define XFreeColors_TCL_DECLARED
/* 38 */
-EXTERN void XFreeColors(Display *d, Colormap c,
+EXTERN int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul);
#endif
#ifndef XFreeCursor_TCL_DECLARED
@@ -267,7 +267,7 @@ EXTERN void XFreeCursor(Display *d, Cursor c);
#ifndef XFreeModifiermap_TCL_DECLARED
#define XFreeModifiermap_TCL_DECLARED
/* 40 */
-EXTERN void XFreeModifiermap(XModifierKeymap *x);
+EXTERN int XFreeModifiermap(XModifierKeymap *x);
#endif
#ifndef XGetGeometry_TCL_DECLARED
#define XGetGeometry_TCL_DECLARED
@@ -395,7 +395,7 @@ EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l,
#ifndef XSetCommand_TCL_DECLARED
#define XSetCommand_TCL_DECLARED
/* 62 */
-EXTERN void XSetCommand(Display *d, Window w, char **c, int i);
+EXTERN int XSetCommand(Display *d, Window w, char **c, int i);
#endif
#ifndef XSetIconName_TCL_DECLARED
#define XSetIconName_TCL_DECLARED
@@ -410,7 +410,7 @@ EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t);
#ifndef XSetSelectionOwner_TCL_DECLARED
#define XSetSelectionOwner_TCL_DECLARED
/* 65 */
-EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w,
+EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w,
Time t);
#endif
#ifndef XSetWindowBackground_TCL_DECLARED
@@ -463,7 +463,7 @@ EXTERN void XUngrabKeyboard(Display *d, Time t);
#ifndef XUngrabPointer_TCL_DECLARED
#define XUngrabPointer_TCL_DECLARED
/* 74 */
-EXTERN void XUngrabPointer(Display *d, Time t);
+EXTERN int XUngrabPointer(Display *d, Time t);
#endif
#ifndef XUnmapWindow_TCL_DECLARED
#define XUnmapWindow_TCL_DECLARED
@@ -494,7 +494,7 @@ EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk,
#ifndef TkPutImage_TCL_DECLARED
#define TkPutImage_TCL_DECLARED
/* 80 */
-EXTERN void TkPutImage(unsigned long *colors, int ncolors,
+EXTERN int TkPutImage(unsigned long *colors, int ncolors,
Display *display, Drawable d, GC gc,
XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
@@ -629,20 +629,20 @@ EXTERN Status XStringListToTextProperty(char **list, int count,
#ifndef XDrawLine_TCL_DECLARED
#define XDrawLine_TCL_DECLARED
/* 104 */
-EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1,
+EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1,
int y1, int x2, int y2);
#endif
#ifndef XWarpPointer_TCL_DECLARED
#define XWarpPointer_TCL_DECLARED
/* 105 */
-EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx,
+EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx,
int sy, unsigned int sw, unsigned int sh,
int dx, int dy);
#endif
#ifndef XFillRectangle_TCL_DECLARED
#define XFillRectangle_TCL_DECLARED
/* 106 */
-EXTERN void XFillRectangle(Display *display, Drawable d, GC gc,
+EXTERN int XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height);
#endif
@@ -651,7 +651,7 @@ EXTERN void XFillRectangle(Display *display, Drawable d, GC gc,
#ifndef XSetDashes_TCL_DECLARED
#define XSetDashes_TCL_DECLARED
/* 0 */
-EXTERN void XSetDashes(Display *display, GC gc, int dash_offset,
+EXTERN int XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n);
#endif
#ifndef XGetModifierMapping_TCL_DECLARED
@@ -722,7 +722,7 @@ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
#ifndef XBell_TCL_DECLARED
#define XBell_TCL_DECLARED
/* 13 */
-EXTERN void XBell(Display *d, int i);
+EXTERN int XBell(Display *d, int i);
#endif
#ifndef XChangeProperty_TCL_DECLARED
#define XChangeProperty_TCL_DECLARED
@@ -768,7 +768,7 @@ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d,
#ifndef XDefineCursor_TCL_DECLARED
#define XDefineCursor_TCL_DECLARED
/* 20 */
-EXTERN void XDefineCursor(Display *d, Window w, Cursor c);
+EXTERN int XDefineCursor(Display *d, Window w, Cursor c);
#endif
#ifndef XDestroyWindow_TCL_DECLARED
#define XDestroyWindow_TCL_DECLARED
@@ -785,7 +785,7 @@ EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1,
#ifndef XDrawLines_TCL_DECLARED
#define XDrawLines_TCL_DECLARED
/* 23 */
-EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
+EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2);
#endif
#ifndef XDrawRectangle_TCL_DECLARED
@@ -810,24 +810,24 @@ EXTERN void XFillPolygon(Display *d, Drawable dr, GC g,
#ifndef XFillRectangles_TCL_DECLARED
#define XFillRectangles_TCL_DECLARED
/* 27 */
-EXTERN void XFillRectangles(Display *d, Drawable dr, GC g,
+EXTERN int XFillRectangles(Display *d, Drawable dr, GC g,
XRectangle *x, int i);
#endif
#ifndef XFreeColormap_TCL_DECLARED
#define XFreeColormap_TCL_DECLARED
/* 28 */
-EXTERN void XFreeColormap(Display *d, Colormap c);
+EXTERN int XFreeColormap(Display *d, Colormap c);
#endif
#ifndef XFreeColors_TCL_DECLARED
#define XFreeColors_TCL_DECLARED
/* 29 */
-EXTERN void XFreeColors(Display *d, Colormap c,
+EXTERN int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul);
#endif
#ifndef XFreeModifiermap_TCL_DECLARED
#define XFreeModifiermap_TCL_DECLARED
/* 30 */
-EXTERN void XFreeModifiermap(XModifierKeymap *x);
+EXTERN int XFreeModifiermap(XModifierKeymap *x);
#endif
#ifndef XGetGeometry_TCL_DECLARED
#define XGetGeometry_TCL_DECLARED
@@ -926,7 +926,7 @@ EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t);
#ifndef XSetSelectionOwner_TCL_DECLARED
#define XSetSelectionOwner_TCL_DECLARED
/* 47 */
-EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w,
+EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w,
Time t);
#endif
#ifndef XSetWindowBackground_TCL_DECLARED
@@ -972,7 +972,7 @@ EXTERN void XUngrabKeyboard(Display *d, Time t);
#ifndef XUngrabPointer_TCL_DECLARED
#define XUngrabPointer_TCL_DECLARED
/* 55 */
-EXTERN void XUngrabPointer(Display *d, Time t);
+EXTERN int XUngrabPointer(Display *d, Time t);
#endif
#ifndef XUnmapWindow_TCL_DECLARED
#define XUnmapWindow_TCL_DECLARED
@@ -982,7 +982,7 @@ EXTERN void XUnmapWindow(Display *d, Window w);
#ifndef TkPutImage_TCL_DECLARED
#define TkPutImage_TCL_DECLARED
/* 57 */
-EXTERN void TkPutImage(unsigned long *colors, int ncolors,
+EXTERN int TkPutImage(unsigned long *colors, int ncolors,
Display *display, Drawable d, GC gc,
XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
@@ -1127,13 +1127,13 @@ EXTERN void XForceScreenSaver(Display *display, int mode);
#ifndef XDrawLine_TCL_DECLARED
#define XDrawLine_TCL_DECLARED
/* 82 */
-EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1,
+EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1,
int y1, int x2, int y2);
#endif
#ifndef XFillRectangle_TCL_DECLARED
#define XFillRectangle_TCL_DECLARED
/* 83 */
-EXTERN void XFillRectangle(Display *display, Drawable d, GC gc,
+EXTERN int XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height);
#endif
@@ -1157,7 +1157,7 @@ EXTERN void XDrawPoints(Display *display, Drawable d, GC gc,
#ifndef XWarpPointer_TCL_DECLARED
#define XWarpPointer_TCL_DECLARED
/* 87 */
-EXTERN void XWarpPointer(Display *display, Window src_w,
+EXTERN int XWarpPointer(Display *display, Window src_w,
Window dest_w, int src_x, int src_y,
unsigned int src_width,
unsigned int src_height, int dest_x,
@@ -1192,8 +1192,8 @@ typedef struct TkIntXlibStubs {
int magic;
struct TkIntXlibStubHooks *hooks;
-#if defined(__WIN32__) /* WIN */
- void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
+ int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */
XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */
XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */
@@ -1201,7 +1201,7 @@ typedef struct TkIntXlibStubs {
char * (*xKeysymToString) (KeySym k); /* 5 */
Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */
Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */
- Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2); /* 8 */
+ Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */
GContext (*xGContextFromGC) (GC g); /* 9 */
XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */
KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */
@@ -1212,7 +1212,7 @@ typedef struct TkIntXlibStubs {
Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */
Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */
Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */
- void (*xBell) (Display *d, int i); /* 19 */
+ int (*xBell) (Display *d, int i); /* 19 */
void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */
void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */
void (*xClearWindow) (Display *d, Window w); /* 22 */
@@ -1220,20 +1220,20 @@ typedef struct TkIntXlibStubs {
void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */
void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */
Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */
- void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */
+ int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */
void (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */
void (*xDestroyWindow) (Display *d, Window w); /* 29 */
void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */
- void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */
+ int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */
void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */
void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */
void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */
- void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */
+ int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */
void (*xForceScreenSaver) (Display *d, int i); /* 36 */
- void (*xFreeColormap) (Display *d, Colormap c); /* 37 */
- void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */
+ int (*xFreeColormap) (Display *d, Colormap c); /* 37 */
+ int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */
void (*xFreeCursor) (Display *d, Cursor c); /* 39 */
- void (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */
+ int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */
Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */
void (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */
int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */
@@ -1255,10 +1255,10 @@ typedef struct TkIntXlibStubs {
void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */
void (*xSelectInput) (Display *d, Window w, long l); /* 60 */
Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */
- void (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */
+ int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */
void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */
void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */
- void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */
+ int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */
void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */
void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */
void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */
@@ -1267,13 +1267,13 @@ typedef struct TkIntXlibStubs {
void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */
Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */
void (*xUngrabKeyboard) (Display *d, Time t); /* 73 */
- void (*xUngrabPointer) (Display *d, Time t); /* 74 */
+ int (*xUngrabPointer) (Display *d, Time t); /* 74 */
void (*xUnmapWindow) (Display *d, Window w); /* 75 */
void (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */
void (*xDestroyIC) (XIC x); /* 77 */
Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */
int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */
- void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */
+ int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */
VOID *reserved81;
Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */
GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */
@@ -1297,12 +1297,12 @@ typedef struct TkIntXlibStubs {
XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */
void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */
Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */
- void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */
- void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */
- void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */
+ int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */
+ int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */
+ int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
+ int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */
XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */
XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */
@@ -1315,24 +1315,24 @@ typedef struct TkIntXlibStubs {
Window (*xRootWindow) (Display *d, int i); /* 10 */
XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */
Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */
- void (*xBell) (Display *d, int i); /* 13 */
+ int (*xBell) (Display *d, int i); /* 13 */
void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */
void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */
void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */
void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */
void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */
Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */
- void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */
+ int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */
void (*xDestroyWindow) (Display *d, Window w); /* 21 */
void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */
- void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */
+ int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */
void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */
void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */
void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */
- void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */
- void (*xFreeColormap) (Display *d, Colormap c); /* 28 */
- void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */
- void (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */
+ int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */
+ int (*xFreeColormap) (Display *d, Colormap c); /* 28 */
+ int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */
+ int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */
Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */
int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */
int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */
@@ -1349,7 +1349,7 @@ typedef struct TkIntXlibStubs {
Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */
void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */
void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */
- void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */
+ int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */
void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */
void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */
void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */
@@ -1357,9 +1357,9 @@ typedef struct TkIntXlibStubs {
void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */
void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */
void (*xUngrabKeyboard) (Display *d, Time t); /* 54 */
- void (*xUngrabPointer) (Display *d, Time t); /* 55 */
+ int (*xUngrabPointer) (Display *d, Time t); /* 55 */
void (*xUnmapWindow) (Display *d, Window w); /* 56 */
- void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */
+ int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */
Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */
GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */
void (*xFreeGC) (Display *display, GC gc); /* 60 */
@@ -1384,12 +1384,12 @@ typedef struct TkIntXlibStubs {
Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */
void (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */
void (*xForceScreenSaver) (Display *display, int mode); /* 81 */
- void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */
- void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */
+ int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */
+ int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */
void (*xClearWindow) (Display *d, Window w); /* 84 */
void (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */
void (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */
- void (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */
+ int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */
void (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */
void (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */
Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */
@@ -1411,7 +1411,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
* Inline function declarations:
*/
-#if defined(__WIN32__) /* WIN */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
#ifndef XSetDashes
#define XSetDashes \
(tkIntXlibStubsPtr->xSetDashes) /* 0 */
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 4051552..dd4f7e6 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -466,7 +466,7 @@ XGrabPointer(
*----------------------------------------------------------------------
*/
-void
+int
XUngrabPointer(
Display *display,
Time time)
@@ -479,6 +479,7 @@ XUngrabPointer(
tsdPtr->restrictWinPtr = NULL;
TkpSetCapture(NULL);
UpdateCursor(tsdPtr->lastWinPtr);
+ return Success;
}
/*
@@ -579,7 +580,7 @@ UpdateCursor(
*----------------------------------------------------------------------
*/
-void
+int
XDefineCursor(
Display *display,
Window w,
@@ -593,6 +594,7 @@ XDefineCursor(
UpdateCursor(winPtr);
}
display->request++;
+ return Success;
}
/*
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 4a4c3a6..342994a 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -39,13 +39,19 @@ doNothing(void)
return 0;
}
+#define TkCreateXEventSource TkPlatCreateXEventSource
+static void
+TkCreateXEventSource(void)
+{
+ TkWinXInit(Tk_GetHINSTANCE());
+}
+
/*
* Remove macros that will interfere with the definitions below.
*/
# undef TkpCmapStressed
# undef TkpSync
-# define TkCreateXEventSource (void (*) (void)) doNothing
# define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing
# define TkpSync (void (*) (Display *)) doNothing
# define TkUnixContainerId 0
@@ -57,24 +63,6 @@ doNothing(void)
#else /* !__WIN32__ */
-# undef TkClipBox
-# undef TkCreateRegion
-# undef TkDestroyRegion
-# undef TkIntersectRegion
-# undef TkRectInRegion
-# undef TkSetRegion
-# undef TkUnionRectWithRegion
-# undef TkSubtractRegion
-
-# 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
-
/*
* Make sure that extensions which call XParseColor through the stub
* table, call TkParseColor instead. [Bug 3486474]
@@ -83,25 +71,16 @@ doNothing(void)
# ifdef __CYGWIN__
- /*
- * Remove macros that will interfere with the definitions below.
- */
-# undef TkPutImage
-# undef TkSetPixmapColormap
-# undef TkpPrintWindowId
-# undef TkWinChildProc
+ TkIntStubs tkIntStubs;
+/*
+ * Trick, so we don't have to include <windows.h> here, which in any
+ * case lacks this function anyway.
+ */
- /*
- * 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
+#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
-TkIntStubs tkIntStubs;
-
void *Tk_GetHINSTANCE()
{
void *hInstance = NULL;
@@ -112,21 +91,78 @@ void *Tk_GetHINSTANCE()
}
void
-TkSetPixmapColormap(pixmap, colormap)
- Pixmap pixmap;
- Colormap colormap;
+TkSetPixmapColormap(
+ Pixmap pixmap,
+ Colormap colormap)
{
}
void
-TkpPrintWindowId(buf, window)
- char *buf; /* Pointer to string large enough to hold
+TkpPrintWindowId(
+ char *buf, /* Pointer to string large enough to hold
* the hex representation of a pointer. */
- Window window; /* Window to be printed into buffer. */
+ Window window) /* Window to be printed into buffer. */
{
sprintf(buf, "%#08lx", (unsigned long) (window));
}
+int
+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. */
+{
+ return 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
@@ -166,7 +202,26 @@ TkpPrintWindowId(buf, window)
# define TkWinGetPlatformTheme 0
# define TkWinChildProc 0
-# endif /* __CYGWIN__ */
+# elif !defined(MAC_TCL) && !defined(MAC_OSX_TK) /* UNIX */
+
+# undef TkClipBox
+# undef TkCreateRegion
+# undef TkDestroyRegion
+# undef TkIntersectRegion
+# undef TkRectInRegion
+# undef TkSetRegion
+# undef TkUnionRectWithRegion
+# undef TkSubtractRegion
+
+# 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
+# endif
#endif /* !__WIN32__ */
/*
@@ -518,7 +573,7 @@ TkIntPlatStubs tkIntPlatStubs = {
TkIntXlibStubs tkIntXlibStubs = {
TCL_STUB_MAGIC,
NULL,
-#if defined(__WIN32__) /* WIN */
+#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
XSetDashes, /* 0 */
XGetModifierMapping, /* 1 */
XCreateImage, /* 2 */
diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c
index b561244..ae56383 100644
--- a/macosx/tkMacOSXClipboard.c
+++ b/macosx/tkMacOSXClipboard.c
@@ -161,7 +161,7 @@ TkSelGetSelection(
*----------------------------------------------------------------------
*/
-void
+int
XSetSelectionOwner(
Display *display, /* X Display. */
Atom selection, /* What selection to own. */
@@ -185,11 +185,11 @@ XSetSelectionOwner(
*/
dispPtr = TkGetMainInfoList()->winPtr->dispPtr;
- if (dispPtr->clipboardActive) {
- return;
+ if (!dispPtr->clipboardActive) {
+ ClearCurrentScrap();
}
- ClearCurrentScrap();
}
+ return Success;
}
/*
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 359c8a6..4150846 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -713,14 +713,15 @@ XCreateColormap(
return index++;
}
-void
+int
XFreeColormap(
Display* display, /* Display. */
Colormap colormap) /* Colormap. */
{
+ return Success;
}
-void
+int
XFreeColors(
Display* display, /* Display. */
Colormap colormap, /* Colormap. */
@@ -733,4 +734,5 @@ XFreeColors(
* needs to be done to release colors as there really is
* no colormap in the Tk sense.
*/
+ return Success;
}
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index db498f9..f17bcee 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -338,7 +338,7 @@ end:
*----------------------------------------------------------------------
*/
-void
+int
TkPutImage(
unsigned long *colors, /* Unused on Macintosh. */
int ncolors, /* Unused on Macintosh. */
@@ -358,7 +358,7 @@ TkPutImage(
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
TkMacOSXDbgMsg("Ignored CG drawing of XImage");
@@ -530,6 +530,7 @@ TkPutImage(
}
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
/*
@@ -548,7 +549,7 @@ TkPutImage(
*----------------------------------------------------------------------
*/
-void
+int
XDrawLines(
Display *display, /* Display. */
Drawable d, /* Draw on this. */
@@ -562,16 +563,12 @@ XDrawLines(
int i, lw = gc->line_width;
if (npoints < 2) {
- /*
- * TODO: generate BadValue error.
- */
-
- return;
+ return BadValue;
}
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
double prevx, prevy;
@@ -612,6 +609,7 @@ XDrawLines(
}
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
/*
@@ -900,7 +898,7 @@ XDrawRectangles(
*----------------------------------------------------------------------
*/
-void
+int
XFillRectangles(
Display* display, /* Display. */
Drawable d, /* Draw on this. */
@@ -915,7 +913,7 @@ XFillRectangles(
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
CGRect rect;
@@ -942,6 +940,7 @@ XFillRectangles(
}
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
/*
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index b1e60bb..6bf3643 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -394,7 +394,7 @@ XGetModifierMapping(
*----------------------------------------------------------------------
*/
-void
+int
XFreeModifiermap(
XModifierKeymap *modmap)
{
@@ -402,6 +402,7 @@ XFreeModifiermap(
ckfree((char *) modmap->modifiermap);
}
ckfree((char *) modmap);
+ return Success;
}
/*
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index a09501b..6788bfd 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -469,12 +469,13 @@ XSelectInput(
Debugger();
}
-void
+int
XBell(
Display* display,
int percent)
{
SysBeep(percent);
+ return Success;
}
#if 0
@@ -554,7 +555,7 @@ XDrawPoints(
}
*/
-void
+int
XWarpPointer(
Display* display,
Window src_w,
@@ -566,6 +567,7 @@ XWarpPointer(
int dest_x,
int dest_y)
{
+ return Success;
}
void
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 4f530d2..8d8b050 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -141,7 +141,7 @@
# define WPARAM void *
# define LPARAM void *
# define LRESULT void *
-#endif
+#else /* !__CYGWIN__ */
/*
* The TkPutImage macro strips off the color table information, which isn't
* needed for X.
@@ -151,6 +151,8 @@
XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
desty, width, height);
+#endif /* !__CYGWIN__ */
+
/*
* Supply macros for seek offsets, if they're not already provided by
* an include file.
diff --git a/win/stubs.c b/win/stubs.c
index 00030d1..8381145 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -8,7 +8,7 @@ int
_XInitImageFuncPtrs(
XImage *image)
{
- return 0;
+ return Success;
}
/*
@@ -56,8 +56,8 @@ XCreateGlyphCursor(
Font mask_font,
unsigned int source_char,
unsigned int mask_char,
- XColor *foreground_color,
- XColor *background_color)
+ XColor _Xconst *foreground_color,
+ XColor _Xconst *background_color)
{
return 1;
}
@@ -138,7 +138,7 @@ XGetWindowAttributes(
Window w,
XWindowAttributes *window_attributes_return)
{
- return 0;
+ return Success;
}
Status
@@ -157,7 +157,7 @@ XIconifyWindow(
Window w,
int screen_number)
{
- return 0;
+ return Success;
}
XHostAddress *
@@ -177,7 +177,7 @@ XLookupColor(
XColor *exact_def_return,
XColor *screen_def_return)
{
- return 0;
+ return Success;
}
void
@@ -212,7 +212,7 @@ XQueryTree(
Window **children_return,
unsigned int *nchildren_return)
{
- return 0;
+ return Success;
}
void
@@ -245,16 +245,17 @@ XSendEvent(
long event_mask,
XEvent *event_send)
{
- return 0;
+ return Success;
}
-void
+int
XSetCommand(
Display *display,
Window w,
char **argv,
int argc)
{
+ return Success;
}
XErrorHandler
@@ -349,7 +350,7 @@ XWithdrawWindow(
Window w,
int screen_number)
{
- return 0;
+ return Success;
}
int
@@ -361,7 +362,7 @@ XmbLookupString(
KeySym *keysym_return,
Status *status_return)
{
- return 0;
+ return Success;
}
int
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c
index 6007e56..76711b5 100644
--- a/win/tkWinClipboard.c
+++ b/win/tkWinClipboard.c
@@ -185,7 +185,7 @@ TkSelGetSelection(
*----------------------------------------------------------------------
*/
-void
+int
XSetSelectionOwner(
Display *display,
Atom selection,
@@ -212,6 +212,7 @@ XSetSelectionOwner(
UpdateClipboard(hwnd);
}
}
+ return Success;
}
/*
diff --git a/win/tkWinColor.c b/win/tkWinColor.c
index f52f6ed..20ab2e0 100644
--- a/win/tkWinColor.c
+++ b/win/tkWinColor.c
@@ -426,7 +426,7 @@ XAllocColor(
*----------------------------------------------------------------------
*/
-void
+int
XFreeColors(
Display *display,
Colormap colormap,
@@ -479,6 +479,7 @@ XFreeColors(
}
}
ReleaseDC(NULL, dc);
+ return Success;
}
/*
@@ -560,7 +561,7 @@ XCreateColormap(
*----------------------------------------------------------------------
*/
-void
+int
XFreeColormap(
Display *display,
Colormap colormap)
@@ -572,6 +573,7 @@ XFreeColormap(
}
Tcl_DeleteHashTable(&cmap->refCounts);
ckfree((char *) cmap);
+ return Success;
}
/*
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 64f2c72..388fd14 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -499,7 +499,7 @@ XCopyPlane(
*----------------------------------------------------------------------
*/
-void
+int
TkPutImage(
unsigned long *colors, /* Array of pixel values used by this image.
* May be NULL. */
@@ -588,7 +588,7 @@ TkPutImage(
Tcl_Panic("Fail to allocate bitmap\n");
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
- return;
+ return BadValue;
}
bitmap = SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y,
@@ -596,6 +596,7 @@ TkPutImage(
DeleteObject(SelectObject(dcMem, bitmap));
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -614,7 +615,7 @@ TkPutImage(
*----------------------------------------------------------------------
*/
-void
+int
XFillRectangles(
Display *display,
Drawable d,
@@ -629,7 +630,7 @@ XFillRectangles(
HBRUSH brush, oldBrush;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -716,6 +717,7 @@ XFillRectangles(
}
DeleteObject(brush);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -865,7 +867,7 @@ RenderObject(
*----------------------------------------------------------------------
*/
-void
+int
XDrawLines(
Display *display,
Drawable d,
@@ -879,7 +881,7 @@ XDrawLines(
HDC dc;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -890,6 +892,7 @@ XDrawLines(
DeleteObject(pen);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 522bfba..daf2ecc 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -692,12 +692,13 @@ XGetModifierMapping(
*----------------------------------------------------------------------
*/
-void
+int
XFreeModifiermap(
XModifierKeymap *modmap)
{
ckfree((char *) modmap->modifiermap);
ckfree((char *) modmap);
+ return Success;
}
/*
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index d29e952..0136d36 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -343,7 +343,7 @@ XQueryPointer(
*----------------------------------------------------------------------
*/
-void
+int
XWarpPointer(
Display *display,
Window src_w,
diff --git a/win/tkWinRegion.c b/win/tkWinRegion.c
index a996ca5..d097047 100644
--- a/win/tkWinRegion.c
+++ b/win/tkWinRegion.c
@@ -11,6 +11,13 @@
#include "tkWinInt.h"
+#undef TkCreateRegion
+#undef TkDestroyRegion
+#undef TkClipBox
+#undef TkIntersectRegion
+#undef TkUnionRectWithRegion
+#undef TkRectInRegion
+#undef TkSubtractRegion
/*
*----------------------------------------------------------------------
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 2d5f5f5..1e218ec 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -767,12 +767,13 @@ TkClipCleanup(
*----------------------------------------------------------------------
*/
-void
+int
XBell(
Display *display,
int percent)
{
MessageBeep(MB_OK);
+ return Success;
}
/*
diff --git a/xlib/xdraw.c b/xlib/xdraw.c
index f8f035c..b8d7973 100644
--- a/xlib/xdraw.c
+++ b/xlib/xdraw.c
@@ -27,7 +27,7 @@
*----------------------------------------------------------------------
*/
-void
+int
XDrawLine(
Display *display,
Drawable d,
@@ -41,7 +41,7 @@ XDrawLine(
points[0].y = y1;
points[1].x = x2;
points[1].y = y2;
- XDrawLines(display, d, gc, points, 2, CoordModeOrigin);
+ return XDrawLines(display, d, gc, points, 2, CoordModeOrigin);
}
/*
@@ -61,7 +61,7 @@ XDrawLine(
*----------------------------------------------------------------------
*/
-void
+int
XFillRectangle(
Display *display,
Drawable d,
@@ -76,7 +76,7 @@ XFillRectangle(
rectangle.y = y;
rectangle.width = width;
rectangle.height = height;
- XFillRectangles(display, d, gc, &rectangle, 1);
+ return XFillRectangles(display, d, gc, &rectangle, 1);
}
/*
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 9fa8c4a..7722abd 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -24,6 +24,7 @@
# define Region XRegion
#endif
+#undef TkSetRegion
/*
*----------------------------------------------------------------------
@@ -43,7 +44,7 @@
static TkpClipMask *AllocClipMask(GC gc) {
TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask;
-
+
if (clip_mask == None) {
clip_mask = (TkpClipMask*) ckalloc(sizeof(TkpClipMask));
gc->clip_mask = (Pixmap) clip_mask;
@@ -154,7 +155,7 @@ XCreateGC(
gp->clip_mask = None;
if (mask & GCClipMask) {
TkpClipMask *clip_mask = AllocClipMask(gp);
-
+
clip_mask->type = TKP_CLIP_PIXMAP;
clip_mask->value.pixmap = values->clip_mask;
}
@@ -279,7 +280,7 @@ XSetBackground(
gc->background = background;
}
-void
+int
XSetDashes(
Display *display,
GC gc,
@@ -301,6 +302,7 @@ XSetDashes(
*p++ = *dash_list++;
}
*p = 0;
+ return Success;
}
void