From c7759d4c7d331a7db4a2b4d9cf0444cd9bcf1702 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 May 2012 11:09:33 +0000 Subject: change signature of all X11 functions to match those of CYGWIN --- generic/tkInt.decls | 182 ++++++++++---------- generic/tkIntPlatDecls.h | 4 +- generic/tkIntXlibDecls.h | 426 +++++++++++++++++++++++------------------------ generic/tkPointer.c | 6 +- win/stubs.c | 62 ++++--- win/tkWinClipboard.c | 3 +- win/tkWinColor.c | 6 +- win/tkWinDraw.c | 41 +++-- win/tkWinKey.c | 3 +- win/tkWinPointer.c | 14 +- win/tkWinWindow.c | 32 ++-- win/tkWinWm.c | 7 +- win/tkWinX.c | 3 +- xlib/xdraw.c | 6 +- xlib/xgc.c | 45 +++-- 15 files changed, 452 insertions(+), 388 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 3453f88..1a62c47 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -568,7 +568,7 @@ declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - void TkpWmSetState(TkWindow *winPtr, int state) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) @@ -1033,7 +1033,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 { @@ -1063,7 +1063,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) @@ -1097,82 +1098,82 @@ 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, + int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } declare 21 win { - void XChangeWindowAttributes(Display *d, Window w, unsigned long ul, + int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } declare 22 win { - void XClearWindow(Display *d, Window w) + int XClearWindow(Display *d, Window w) } declare 23 win { - void XConfigureWindow(Display *d, Window w, unsigned int i, + int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } declare 24 win { - void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 25 win { - 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) + int 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) } declare 26 win { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _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) + int XDeleteProperty(Display *d, Window w, Atom a) } declare 29 win { - void XDestroyWindow(Display *d, Window w) + int XDestroyWindow(Display *d, Window w) } declare 30 win { - void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, + int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, 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, + int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 33 win { - void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, + int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 34 win { - void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, + int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, 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) + int 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) + int 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, @@ -1180,7 +1181,7 @@ declare 41 win { unsigned int *ui4) } declare 42 win { - void XGetInputFocus(Display *d, Window *w, int *i) + int XGetInputFocus(Display *d, Window *w, int *i) } declare 43 win { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, @@ -1205,23 +1206,23 @@ declare 48 win { XColor *x1, XColor *x2) } declare 49 win { - void XMapWindow(Display *d, Window w) + int XMapWindow(Display *d, Window w) } declare 50 win { - void XMoveResizeWindow(Display *d, Window w, int i1, int i2, + int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 51 win { - void XMoveWindow(Display *d, Window w, int i1, int i2) + int XMoveWindow(Display *d, Window w, int i1, int i2) } declare 52 win { - void XNextEvent(Display *d, XEvent *x) + int XNextEvent(Display *d, XEvent *x) } declare 53 win { - void XPutBackEvent(Display *d, XEvent *x) + int XPutBackEvent(Display *d, XEvent *x) } declare 54 win { - void XQueryColors(Display *d, Colormap c, XColor *x, int i) + int XQueryColors(Display *d, Colormap c, XColor *x, int i) } declare 55 win { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, @@ -1232,66 +1233,66 @@ declare 56 win { Window **w4, unsigned int *ui) } declare 57 win { - void XRaiseWindow(Display *d, Window w) + int XRaiseWindow(Display *d, Window w) } declare 58 win { - void XRefreshKeyboardMapping(XMappingEvent *x) + int XRefreshKeyboardMapping(XMappingEvent *x) } declare 59 win { - void XResizeWindow(Display *d, Window w, unsigned int ui1, + int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } declare 60 win { - void XSelectInput(Display *d, Window w, long l) + int XSelectInput(Display *d, Window w, long l) } declare 61 win { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } declare 62 win { - void XSetCommand(Display *d, Window w, const 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) + int XSetIconName(Display *d, Window w, _Xconst char *c) } declare 64 win { - void XSetInputFocus(Display *d, Window w, int i, Time t) + int 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) + int XSetWindowBackground(Display *d, Window w, unsigned long ul) } declare 67 win { - void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) + int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } declare 68 win { - void XSetWindowBorder(Display *d, Window w, unsigned long ul) + int XSetWindowBorder(Display *d, Window w, unsigned long ul) } declare 69 win { - void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) + int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } declare 70 win { - void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) + int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } declare 71 win { - void XSetWindowColormap(Display *d, Window w, Colormap c) + int XSetWindowColormap(Display *d, Window w, Colormap c) } declare 72 win { Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3) } declare 73 win { - void XUngrabKeyboard(Display *d, Time t) + int 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) + int XUnmapWindow(Display *d, Window w) } declare 76 win { - void XWindowEvent(Display *d, Window w, long l, XEvent *x) + int XWindowEvent(Display *d, Window w, long l, XEvent *x) } declare 77 win { void XDestroyIC(XIC x) @@ -1323,59 +1324,59 @@ declare 83 win { unsigned long valuemask, XGCValues *values) } declare 84 win { - void XFreeGC(Display *display, GC gc) + int XFreeGC(Display *display, GC gc) } declare 85 win { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 86 win { - void XSetBackground(Display *display, GC gc, unsigned long foreground) + int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 87 win { - void XSetForeground(Display *display, GC gc, unsigned long foreground) + int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 88 win { - void XSetClipMask(Display *display, GC gc, Pixmap pixmap) + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 89 win { - void XSetClipOrigin(Display *display, GC gc, + int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 90 win { - void XSetTSOrigin(Display *display, GC gc, + int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 91 win { - void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 92 win { - void XSetFont(Display *display, GC gc, Font font) + int XSetFont(Display *display, GC gc, Font font) } declare 93 win { - void XSetArcMode(Display *display, GC gc, int arc_mode) + int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 94 win { - void XSetStipple(Display *display, GC gc, Pixmap stipple) + int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 95 win { - void XSetFillRule(Display *display, GC gc, int fill_rule) + int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 96 win { - void XSetFillStyle(Display *display, GC gc, int fill_style) + int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 97 win { - void XSetFunction(Display *display, GC gc, int function) + int XSetFunction(Display *display, GC gc, int function) } declare 98 win { - void XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } declare 99 win { int _XInitImageFuncPtrs(XImage *image) } declare 100 win { - XIC XCreateIC(void) + XIC XCreateIC(XIM xim, ...) } declare 101 win { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, @@ -1390,15 +1391,15 @@ 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 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) } @@ -1406,7 +1407,7 @@ declare 105 win { # X functions for Mac and Aqua declare 0 {mac 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 {mac aqua} { @@ -1477,7 +1478,7 @@ declare 19 {mac aqua} { _Xconst char *data, unsigned int width, unsigned int height) } declare 20 {mac aqua} { - void XDefineCursor(Display *d, Window w, Cursor c) + int XDefineCursor(Display *d, Window w, Cursor c) } declare 21 {mac aqua} { void XDestroyWindow(Display *d, Window w) @@ -1595,7 +1596,7 @@ declare 54 {mac aqua} { void XUngrabKeyboard(Display *d, Time t) } declare 55 {mac aqua} { - void XUngrabPointer(Display *d, Time t) + int XUngrabPointer(Display *d, Time t) } declare 56 {mac aqua} { void XUnmapWindow(Display *d, Window w) @@ -1614,54 +1615,53 @@ declare 59 {mac aqua} { unsigned long valuemask, XGCValues *values) } declare 60 {mac aqua} { - void XFreeGC(Display *display, GC gc) + int XFreeGC(Display *display, GC gc) } declare 61 {mac aqua} { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 62 {mac aqua} { - void XSetBackground(Display *display, GC gc, unsigned long foreground) + int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 63 {mac aqua} { - void XSetForeground(Display *display, GC gc, unsigned long foreground) + int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 64 {mac aqua} { - void XSetClipMask(Display *display, GC gc, Pixmap pixmap) + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 65 {mac aqua} { - void XSetClipOrigin(Display *display, GC gc, + int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 66 {mac aqua} { - void XSetTSOrigin(Display *display, GC gc, + int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 67 {mac aqua} { - void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 68 {mac aqua} { - void XSetFont(Display *display, GC gc, Font font) + int XSetFont(Display *display, GC gc, Font font) } declare 69 {mac aqua} { - void XSetArcMode(Display *display, GC gc, int arc_mode) + int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 70 {mac aqua} { - void XSetStipple(Display *display, GC gc, Pixmap stipple) + int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 71 {mac aqua} { - void XSetFillRule(Display *display, GC gc, int fill_rule) + int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 72 {mac aqua} { - void XSetFillStyle(Display *display, GC gc, int fill_style) + int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 73 {mac aqua} { - void XSetFunction(Display *display, GC gc, int function) + int XSetFunction(Display *display, GC gc, int function) } declare 74 {mac aqua} { - void XSetLineAttributes(Display *display, GC gc, - unsigned int line_width, int line_style, - int cap_style, int join_style) + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style) } declare 75 {mac aqua} { int _XInitImageFuncPtrs(XImage *image) @@ -1686,14 +1686,14 @@ declare 80 {mac aqua} { XSegment *segments, int nsegments) } declare 81 {mac aqua} { - void XForceScreenSaver(Display *display, int mode) + int XForceScreenSaver(Display *display, int mode) } declare 82 {mac 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 {mac 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 {mac aqua} { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index b59ab19..e9f4256 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -53,7 +53,7 @@ EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow *winPtr)); /* 8 */ EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor)); /* 9 */ -EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow *winPtr, +EXTERN int TkpWmSetState _ANSI_ARGS_((TkWindow *winPtr, int state)); /* 10 */ EXTERN void TkSetPixmapColormap _ANSI_ARGS_((Pixmap pixmap, @@ -433,7 +433,7 @@ typedef struct TkIntPlatStubs { int (*tkpScanWindowId) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *string, Window *idPtr)); /* 6 */ void (*tkpSetCapture) _ANSI_ARGS_((TkWindow *winPtr)); /* 7 */ void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 8 */ - void (*tkpWmSetState) _ANSI_ARGS_((TkWindow *winPtr, int state)); /* 9 */ + int (*tkpWmSetState) _ANSI_ARGS_((TkWindow *winPtr, int state)); /* 9 */ void (*tkSetPixmapColormap) _ANSI_ARGS_((Pixmap pixmap, Colormap colormap)); /* 10 */ void (*tkWinCancelMouseTimer) _ANSI_ARGS_((void)); /* 11 */ void (*tkWinClipboardRender) _ANSI_ARGS_((TkDisplay *dispPtr, UINT format)); /* 12 */ diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 77f6b4d..a79278d 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -38,7 +38,7 @@ #ifdef __WIN32__ /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ @@ -66,7 +66,7 @@ EXTERN Cursor XCreatePixmapCursor _ANSI_ARGS_((Display *d, /* 8 */ EXTERN Cursor XCreateGlyphCursor _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, - XColor *x1, XColor *x2)); + XColor _Xconst *x1, XColor _Xconst *x2)); /* 9 */ EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g)); /* 10 */ @@ -93,27 +93,27 @@ EXTERN Status XGetWMColormapWindows _ANSI_ARGS_((Display *d, EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 19 */ -EXTERN void XBell _ANSI_ARGS_((Display *d, int i)); +EXTERN int XBell _ANSI_ARGS_((Display *d, int i)); /* 20 */ -EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w, +EXTERN int XChangeProperty _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 21 */ -EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display *d, +EXTERN int XChangeWindowAttributes _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 22 */ -EXTERN void XClearWindow _ANSI_ARGS_((Display *d, Window w)); +EXTERN int XClearWindow _ANSI_ARGS_((Display *d, Window w)); /* 23 */ -EXTERN void XConfigureWindow _ANSI_ARGS_((Display *d, Window w, +EXTERN int XConfigureWindow _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 24 */ -EXTERN void XCopyArea _ANSI_ARGS_((Display *d, Drawable dr1, +EXTERN int XCopyArea _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ -EXTERN void XCopyPlane _ANSI_ARGS_((Display *d, Drawable dr1, +EXTERN int XCopyPlane _ANSI_ARGS_((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)); @@ -122,52 +122,52 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 27 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 28 */ -EXTERN void XDeleteProperty _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDeleteProperty _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 29 */ -EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); +EXTERN int XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); /* 30 */ -EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 31 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 32 */ -EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 33 */ -EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 34 */ -EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 35 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 36 */ -EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *d, int i)); +EXTERN int XForceScreenSaver _ANSI_ARGS_((Display *d, int i)); /* 37 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); +EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); /* 38 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c, +EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 39 */ -EXTERN void XFreeCursor _ANSI_ARGS_((Display *d, Cursor c)); +EXTERN int XFreeCursor _ANSI_ARGS_((Display *d, Cursor c)); /* 40 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); +EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); /* 41 */ EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4)); /* 42 */ -EXTERN void XGetInputFocus _ANSI_ARGS_((Display *d, Window *w, +EXTERN int XGetInputFocus _ANSI_ARGS_((Display *d, Window *w, int *i)); /* 43 */ EXTERN int XGetWindowProperty _ANSI_ARGS_((Display *d, Window w, @@ -190,20 +190,20 @@ EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display *d, KeySym k)); EXTERN Status XLookupColor _ANSI_ARGS_((Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2)); /* 49 */ -EXTERN void XMapWindow _ANSI_ARGS_((Display *d, Window w)); +EXTERN int XMapWindow _ANSI_ARGS_((Display *d, Window w)); /* 50 */ -EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display *d, Window w, +EXTERN int XMoveResizeWindow _ANSI_ARGS_((Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 51 */ -EXTERN void XMoveWindow _ANSI_ARGS_((Display *d, Window w, +EXTERN int XMoveWindow _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 52 */ -EXTERN void XNextEvent _ANSI_ARGS_((Display *d, XEvent *x)); +EXTERN int XNextEvent _ANSI_ARGS_((Display *d, XEvent *x)); /* 53 */ -EXTERN void XPutBackEvent _ANSI_ARGS_((Display *d, XEvent *x)); +EXTERN int XPutBackEvent _ANSI_ARGS_((Display *d, XEvent *x)); /* 54 */ -EXTERN void XQueryColors _ANSI_ARGS_((Display *d, Colormap c, +EXTERN int XQueryColors _ANSI_ARGS_((Display *d, Colormap c, XColor *x, int i)); /* 55 */ EXTERN Bool XQueryPointer _ANSI_ARGS_((Display *d, Window w1, @@ -214,61 +214,61 @@ EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 57 */ -EXTERN void XRaiseWindow _ANSI_ARGS_((Display *d, Window w)); +EXTERN int XRaiseWindow _ANSI_ARGS_((Display *d, Window w)); /* 58 */ -EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_(( +EXTERN int XRefreshKeyboardMapping _ANSI_ARGS_(( XMappingEvent *x)); /* 59 */ -EXTERN void XResizeWindow _ANSI_ARGS_((Display *d, Window w, +EXTERN int XResizeWindow _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 60 */ -EXTERN void XSelectInput _ANSI_ARGS_((Display *d, Window w, +EXTERN int XSelectInput _ANSI_ARGS_((Display *d, Window w, long l)); /* 61 */ EXTERN Status XSendEvent _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 62 */ -EXTERN void XSetCommand _ANSI_ARGS_((Display *d, Window w, - CONST char **c, int i)); +EXTERN int XSetCommand _ANSI_ARGS_((Display *d, Window w, + char **c, int i)); /* 63 */ -EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, +EXTERN int XSetIconName _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 64 */ -EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w, +EXTERN int XSetInputFocus _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 65 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, +EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 66 */ -EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d, +EXTERN int XSetWindowBackground _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 67 */ -EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display *d, +EXTERN int XSetWindowBackgroundPixmap _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 68 */ -EXTERN void XSetWindowBorder _ANSI_ARGS_((Display *d, Window w, +EXTERN int XSetWindowBorder _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 69 */ -EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display *d, +EXTERN int XSetWindowBorderPixmap _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 70 */ -EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display *d, +EXTERN int XSetWindowBorderWidth _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 71 */ -EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, +EXTERN int XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 72 */ EXTERN Bool XTranslateCoordinates _ANSI_ARGS_((Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3)); /* 73 */ -EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 74 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 75 */ -EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); +EXTERN int XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 76 */ -EXTERN void XWindowEvent _ANSI_ARGS_((Display *d, Window w, +EXTERN int XWindowEvent _ANSI_ARGS_((Display *d, Window w, long l, XEvent *x)); /* 77 */ EXTERN void XDestroyIC _ANSI_ARGS_((XIC x)); @@ -293,55 +293,55 @@ EXTERN Status XParseColor _ANSI_ARGS_((Display *display, EXTERN GC XCreateGC _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 84 */ -EXTERN void XFreeGC _ANSI_ARGS_((Display *display, GC gc)); +EXTERN int XFreeGC _ANSI_ARGS_((Display *display, GC gc)); /* 85 */ EXTERN Atom XInternAtom _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 86 */ -EXTERN void XSetBackground _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetBackground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 87 */ -EXTERN void XSetForeground _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetForeground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 88 */ -EXTERN void XSetClipMask _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetClipMask _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 89 */ -EXTERN void XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 90 */ -EXTERN void XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 91 */ -EXTERN void XChangeGC _ANSI_ARGS_((Display *d, GC gc, +EXTERN int XChangeGC _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 92 */ -EXTERN void XSetFont _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFont _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 93 */ -EXTERN void XSetArcMode _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetArcMode _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 94 */ -EXTERN void XSetStipple _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetStipple _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 95 */ -EXTERN void XSetFillRule _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFillRule _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 96 */ -EXTERN void XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 97 */ -EXTERN void XSetFunction _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFunction _ANSI_ARGS_((Display *display, GC gc, int function)); /* 98 */ -EXTERN void XSetLineAttributes _ANSI_ARGS_((Display *display, +EXTERN int XSetLineAttributes _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 99 */ EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image)); /* 100 */ -EXTERN XIC XCreateIC _ANSI_ARGS_((void)); +EXTERN XIC XCreateIC _ANSI_ARGS_(TCL_VARARGS(XIM,xim)); /* 101 */ EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, @@ -353,20 +353,20 @@ EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display *display, EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 104 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 105 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display *d, Window s, +EXTERN int XWarpPointer _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 106 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); #endif /* __WIN32__ */ #ifdef MAC_TCL /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ @@ -429,7 +429,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 20 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 21 */ EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); @@ -537,7 +537,7 @@ EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, /* 54 */ EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 55 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 56 */ EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 57 */ @@ -554,48 +554,48 @@ EXTERN Status XParseColor _ANSI_ARGS_((Display *display, EXTERN GC XCreateGC _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 60 */ -EXTERN void XFreeGC _ANSI_ARGS_((Display *display, GC gc)); +EXTERN int XFreeGC _ANSI_ARGS_((Display *display, GC gc)); /* 61 */ EXTERN Atom XInternAtom _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 62 */ -EXTERN void XSetBackground _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetBackground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ -EXTERN void XSetForeground _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetForeground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 64 */ -EXTERN void XSetClipMask _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetClipMask _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 65 */ -EXTERN void XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 66 */ -EXTERN void XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 67 */ -EXTERN void XChangeGC _ANSI_ARGS_((Display *d, GC gc, +EXTERN int XChangeGC _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 68 */ -EXTERN void XSetFont _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFont _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 69 */ -EXTERN void XSetArcMode _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetArcMode _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 70 */ -EXTERN void XSetStipple _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetStipple _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 71 */ -EXTERN void XSetFillRule _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFillRule _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 72 */ -EXTERN void XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 73 */ -EXTERN void XSetFunction _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFunction _ANSI_ARGS_((Display *display, GC gc, int function)); /* 74 */ -EXTERN void XSetLineAttributes _ANSI_ARGS_((Display *display, +EXTERN int XSetLineAttributes _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); @@ -618,13 +618,13 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 81 */ -EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, +EXTERN int XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ @@ -656,7 +656,7 @@ EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, #endif /* MAC_TCL */ #ifdef MAC_OSX_TK /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ @@ -719,7 +719,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 20 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 21 */ EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); @@ -827,7 +827,7 @@ EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, /* 54 */ EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 55 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 56 */ EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 57 */ @@ -844,48 +844,48 @@ EXTERN Status XParseColor _ANSI_ARGS_((Display *display, EXTERN GC XCreateGC _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 60 */ -EXTERN void XFreeGC _ANSI_ARGS_((Display *display, GC gc)); +EXTERN int XFreeGC _ANSI_ARGS_((Display *display, GC gc)); /* 61 */ EXTERN Atom XInternAtom _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 62 */ -EXTERN void XSetBackground _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetBackground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ -EXTERN void XSetForeground _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetForeground _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 64 */ -EXTERN void XSetClipMask _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetClipMask _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 65 */ -EXTERN void XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetClipOrigin _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 66 */ -EXTERN void XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetTSOrigin _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 67 */ -EXTERN void XChangeGC _ANSI_ARGS_((Display *d, GC gc, +EXTERN int XChangeGC _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 68 */ -EXTERN void XSetFont _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFont _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 69 */ -EXTERN void XSetArcMode _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetArcMode _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 70 */ -EXTERN void XSetStipple _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetStipple _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 71 */ -EXTERN void XSetFillRule _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFillRule _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 72 */ -EXTERN void XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFillStyle _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 73 */ -EXTERN void XSetFunction _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetFunction _ANSI_ARGS_((Display *display, GC gc, int function)); /* 74 */ -EXTERN void XSetLineAttributes _ANSI_ARGS_((Display *display, +EXTERN int XSetLineAttributes _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); @@ -908,13 +908,13 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 81 */ -EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, +EXTERN int XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ @@ -952,7 +952,7 @@ typedef struct TkIntXlibStubs { struct TkIntXlibStubHooks *hooks; #ifdef __WIN32__ - void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ XImage * (*xCreateImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ @@ -960,7 +960,7 @@ typedef struct TkIntXlibStubs { char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */ Colormap (*xCreateColormap) _ANSI_ARGS_((Display *d, Window w, Visual *v, int i)); /* 6 */ Cursor (*xCreatePixmapCursor) _ANSI_ARGS_((Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)); /* 7 */ - Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2)); /* 8 */ + Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2)); /* 8 */ GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 9 */ XHostAddress * (*xListHosts) _ANSI_ARGS_((Display *d, int *i, Bool *b)); /* 10 */ KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display *d, unsigned int k, int i)); /* 11 */ @@ -971,64 +971,64 @@ typedef struct TkIntXlibStubs { Status (*xWithdrawWindow) _ANSI_ARGS_((Display *d, Window w, int i)); /* 16 */ Status (*xGetWMColormapWindows) _ANSI_ARGS_((Display *d, Window w, Window **wpp, int *ip)); /* 17 */ Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 18 */ - void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */ - void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 20 */ - void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 21 */ - void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 22 */ - void (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 23 */ - void (*xCopyArea) _ANSI_ARGS_((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) _ANSI_ARGS_((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 */ + int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */ + int (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 20 */ + int (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 21 */ + int (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 22 */ + int (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 23 */ + int (*xCopyArea) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 24 */ + int (*xCopyPlane) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 26 */ - void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */ - void (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */ - void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */ - void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ - void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */ - void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */ - void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ - void (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */ - void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ - void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ - void (*xFreeCursor) _ANSI_ARGS_((Display *d, Cursor c)); /* 39 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */ + int (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */ + int (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */ + int (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ + int (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */ + int (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */ + int (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ + int (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */ + int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ + int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ + int (*xFreeCursor) _ANSI_ARGS_((Display *d, Cursor c)); /* 39 */ + int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */ Status (*xGetGeometry) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Window *w, int *i)); /* 42 */ + int (*xGetInputFocus) _ANSI_ARGS_((Display *d, Window *w, int *i)); /* 42 */ int (*xGetWindowProperty) _ANSI_ARGS_((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 */ Status (*xGetWindowAttributes) _ANSI_ARGS_((Display *d, Window w, XWindowAttributes *x)); /* 44 */ int (*xGrabKeyboard) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 45 */ int (*xGrabPointer) _ANSI_ARGS_((Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 46 */ KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display *d, KeySym k)); /* 47 */ Status (*xLookupColor) _ANSI_ARGS_((Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2)); /* 48 */ - void (*xMapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 49 */ - void (*xMoveResizeWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 50 */ - void (*xMoveWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 51 */ - void (*xNextEvent) _ANSI_ARGS_((Display *d, XEvent *x)); /* 52 */ - void (*xPutBackEvent) _ANSI_ARGS_((Display *d, XEvent *x)); /* 53 */ - void (*xQueryColors) _ANSI_ARGS_((Display *d, Colormap c, XColor *x, int i)); /* 54 */ + int (*xMapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 49 */ + int (*xMoveResizeWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 50 */ + int (*xMoveWindow) _ANSI_ARGS_((Display *d, Window w, int i1, int i2)); /* 51 */ + int (*xNextEvent) _ANSI_ARGS_((Display *d, XEvent *x)); /* 52 */ + int (*xPutBackEvent) _ANSI_ARGS_((Display *d, XEvent *x)); /* 53 */ + int (*xQueryColors) _ANSI_ARGS_((Display *d, Colormap c, XColor *x, int i)); /* 54 */ Bool (*xQueryPointer) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui)); /* 55 */ Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 56 */ - void (*xRaiseWindow) _ANSI_ARGS_((Display *d, Window w)); /* 57 */ - void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent *x)); /* 58 */ - void (*xResizeWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */ - void (*xSelectInput) _ANSI_ARGS_((Display *d, Window w, long l)); /* 60 */ + int (*xRaiseWindow) _ANSI_ARGS_((Display *d, Window w)); /* 57 */ + int (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent *x)); /* 58 */ + int (*xResizeWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */ + int (*xSelectInput) _ANSI_ARGS_((Display *d, Window w, long l)); /* 60 */ Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 61 */ - void (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, CONST char **c, int i)); /* 62 */ - void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 63 */ - void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 64 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */ - void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 66 */ - void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 67 */ - void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 68 */ - void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 69 */ - void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 70 */ - void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 71 */ + int (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 62 */ + int (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 63 */ + int (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 64 */ + int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */ + int (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 66 */ + int (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 67 */ + int (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 68 */ + int (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 69 */ + int (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 70 */ + int (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 71 */ Bool (*xTranslateCoordinates) _ANSI_ARGS_((Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3)); /* 72 */ - void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 73 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */ - void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 75 */ - void (*xWindowEvent) _ANSI_ARGS_((Display *d, Window w, long l, XEvent *x)); /* 76 */ + int (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 73 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */ + int (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 75 */ + int (*xWindowEvent) _ANSI_ARGS_((Display *d, Window w, long l, XEvent *x)); /* 76 */ void (*xDestroyIC) _ANSI_ARGS_((XIC x)); /* 77 */ Bool (*xFilterEvent) _ANSI_ARGS_((XEvent *x, Window w)); /* 78 */ int (*xmbLookupString) _ANSI_ARGS_((XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s)); /* 79 */ @@ -1036,32 +1036,32 @@ typedef struct TkIntXlibStubs { VOID *reserved81; Status (*xParseColor) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 82 */ GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 83 */ - void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 84 */ + int (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 84 */ Atom (*xInternAtom) _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 85 */ - void (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 86 */ - void (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 87 */ - void (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 88 */ - void (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 89 */ - void (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 90 */ - void (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 91 */ - void (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 92 */ - void (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 93 */ - void (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 94 */ - void (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 95 */ - void (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 96 */ - void (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 97 */ - void (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 98 */ + int (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 86 */ + int (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 87 */ + int (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 88 */ + int (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 89 */ + int (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 90 */ + int (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 91 */ + int (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 92 */ + int (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 93 */ + int (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 94 */ + int (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 95 */ + int (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 96 */ + int (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 97 */ + int (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 98 */ int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage *image)); /* 99 */ - XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 100 */ + XIC (*xCreateIC) _ANSI_ARGS_(TCL_VARARGS(XIM,xim)); /* 100 */ XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 101 */ void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 102 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 103 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ - void (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ + int (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ #endif /* __WIN32__ */ #ifdef MAC_TCL - void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ XImage * (*xCreateImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ @@ -1081,7 +1081,7 @@ typedef struct TkIntXlibStubs { void (*xCopyArea) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */ - void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ @@ -1116,35 +1116,35 @@ typedef struct TkIntXlibStubs { void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */ void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */ void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */ void (*tkPutImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */ GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */ - void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ + int (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ Atom (*xInternAtom) _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 61 */ - void (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 62 */ - void (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ - void (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 64 */ - void (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ - void (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ - void (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 67 */ - void (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 68 */ - void (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 69 */ - void (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 70 */ - void (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 71 */ - void (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 72 */ - void (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 73 */ - void (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ + int (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 62 */ + int (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ + int (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 64 */ + int (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ + int (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ + int (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 67 */ + int (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 68 */ + int (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 69 */ + int (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 70 */ + int (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 71 */ + int (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 72 */ + int (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 73 */ + int (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage *image)); /* 75 */ XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */ XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 77 */ void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 78 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ - void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + int (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ @@ -1154,7 +1154,7 @@ typedef struct TkIntXlibStubs { Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 90 */ #endif /* MAC_TCL */ #ifdef MAC_OSX_TK - void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ XImage * (*xCreateImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ @@ -1174,7 +1174,7 @@ typedef struct TkIntXlibStubs { void (*xCopyArea) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */ - void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ @@ -1209,35 +1209,35 @@ typedef struct TkIntXlibStubs { void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */ void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */ void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */ void (*tkPutImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */ GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */ - void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ + int (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ Atom (*xInternAtom) _ANSI_ARGS_((Display *display, _Xconst char *atom_name, Bool only_if_exists)); /* 61 */ - void (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 62 */ - void (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ - void (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 64 */ - void (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ - void (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ - void (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 67 */ - void (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 68 */ - void (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 69 */ - void (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 70 */ - void (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 71 */ - void (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 72 */ - void (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 73 */ - void (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ + int (*xSetBackground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 62 */ + int (*xSetForeground) _ANSI_ARGS_((Display *display, GC gc, unsigned long foreground)); /* 63 */ + int (*xSetClipMask) _ANSI_ARGS_((Display *display, GC gc, Pixmap pixmap)); /* 64 */ + int (*xSetClipOrigin) _ANSI_ARGS_((Display *display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */ + int (*xSetTSOrigin) _ANSI_ARGS_((Display *display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */ + int (*xChangeGC) _ANSI_ARGS_((Display *d, GC gc, unsigned long mask, XGCValues *values)); /* 67 */ + int (*xSetFont) _ANSI_ARGS_((Display *display, GC gc, Font font)); /* 68 */ + int (*xSetArcMode) _ANSI_ARGS_((Display *display, GC gc, int arc_mode)); /* 69 */ + int (*xSetStipple) _ANSI_ARGS_((Display *display, GC gc, Pixmap stipple)); /* 70 */ + int (*xSetFillRule) _ANSI_ARGS_((Display *display, GC gc, int fill_rule)); /* 71 */ + int (*xSetFillStyle) _ANSI_ARGS_((Display *display, GC gc, int fill_style)); /* 72 */ + int (*xSetFunction) _ANSI_ARGS_((Display *display, GC gc, int function)); /* 73 */ + int (*xSetLineAttributes) _ANSI_ARGS_((Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */ int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage *image)); /* 75 */ XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */ XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 77 */ void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 78 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ - void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + int (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 17c7424..8a8efdc 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -475,7 +475,7 @@ XGrabPointer(display, grab_window, owner_events, event_mask, pointer_mode, *---------------------------------------------------------------------- */ -void +int XUngrabPointer(display, time) Display* display; Time time; @@ -488,6 +488,7 @@ XUngrabPointer(display, time) tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); UpdateCursor(tsdPtr->lastWinPtr); + return 0; } /* @@ -590,7 +591,7 @@ UpdateCursor(winPtr) *---------------------------------------------------------------------- */ -void +int XDefineCursor(display, w, cursor) Display* display; Window w; @@ -604,6 +605,7 @@ XDefineCursor(display, w, cursor) UpdateCursor(winPtr); } display->request++; + return 0; } /* diff --git a/win/stubs.c b/win/stubs.c index 5fbc8d1..93daf8d 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -34,7 +34,7 @@ XStringListToTextProperty(list, count, text_prop_return) * From Xlib.h */ -void +int XChangeProperty(display, w, property, type, format, mode, data, nelements) Display* display; Window w; @@ -45,6 +45,7 @@ XChangeProperty(display, w, property, type, format, mode, data, nelements) _Xconst unsigned char* data; int nelements; { + return 0; } Cursor @@ -55,14 +56,14 @@ XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char, 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; } XIC -XCreateIC() +XCreateIC TCL_VARARGS_DEF(XIM,xim) { return NULL; } @@ -81,12 +82,13 @@ XCreatePixmapCursor(display, source, mask, foreground_color, return (Cursor) NULL; } -void +int XDeleteProperty(display, w, property) Display* display; Window w; Atom property; { + return 0; } void @@ -103,17 +105,19 @@ XFilterEvent(event, window) return 0; } -extern void XForceScreenSaver(display, mode) +int XForceScreenSaver(display, mode) Display* display; int mode; { + return 0; } -void +int XFreeCursor(display, cursor) Display* display; Cursor cursor; { + return 0; } GContext @@ -180,27 +184,30 @@ XLookupColor(display, colormap, color_name, exact_def_return, return 0; } -void +int XNextEvent(display, event_return) Display* display; XEvent* event_return; { + return 0; } -void +int XPutBackEvent(display, event) Display* display; XEvent* event; { + return 0; } -void +int XQueryColors(display, colormap, defs_in_out, ncolors) Display* display; Colormap colormap; XColor* defs_in_out; int ncolors; { + return 0; } int @@ -216,10 +223,11 @@ XQueryTree(display, w, root_return, parent_return, children_return, return 0; } -void +int XRefreshKeyboardMapping(event_map) XMappingEvent* event_map; { + return 0; } Window @@ -230,12 +238,13 @@ XRootWindow(display, screen_number) return (Window) NULL; } -void +int XSelectInput(display, w, event_mask) Display* display; Window w; long event_mask; { + return 0; } int @@ -249,13 +258,14 @@ XSendEvent(display, w, propagate, event_mask, event_send) return 0; } -void +int XSetCommand(display, w, argv, argc) Display* display; Window w; - CONST char** argv; + char** argv; int argc; { + return 0; } XErrorHandler @@ -265,60 +275,67 @@ XSetErrorHandler (handler) return NULL; } -void +int XSetIconName(display, w, icon_name) Display* display; Window w; _Xconst char* icon_name; { + return 0; } -void +int XSetWindowBackground(display, w, background_pixel) Display* display; Window w; unsigned long background_pixel; { + return 0; } -void +int XSetWindowBackgroundPixmap(display, w, background_pixmap) Display* display; Window w; Pixmap background_pixmap; { + return 0; } -void +int XSetWindowBorder(display, w, border_pixel) Display* display; Window w; unsigned long border_pixel; { + return 0; } -void +int XSetWindowBorderPixmap(display, w, border_pixmap) Display* display; Window w; Pixmap border_pixmap; { + return 0; } -void +int XSetWindowBorderWidth(display, w, width) Display* display; Window w; unsigned int width; { + return 0; } -void +int XSetWindowColormap(display, w, colormap) Display* display; Window w; Colormap colormap; { + return 0; } Bool @@ -336,13 +353,14 @@ XTranslateCoordinates(display, src_w, dest_w, src_x, src_y, dest_x_return, return 0; } -void +int XWindowEvent(display, w, event_mask, event_return) Display* display; Window w; long event_mask; XEvent* event_return; { + return 0; } int diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 19dcc11..97d809c 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -190,7 +190,7 @@ error: *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner(display, selection, owner, time) Display* display; Atom selection; @@ -218,6 +218,7 @@ XSetSelectionOwner(display, selection, owner, time) UpdateClipboard(hwnd); } } + return 0; } /* diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 088c216..1c7eb7a 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -430,7 +430,7 @@ XAllocColor(display, colormap, color) *---------------------------------------------------------------------- */ -void +int XFreeColors(display, colormap, pixels, npixels, planes) Display* display; Colormap colormap; @@ -485,6 +485,7 @@ XFreeColors(display, colormap, pixels, npixels, planes) } } ReleaseDC(NULL, dc); + return 0; } /* @@ -567,7 +568,7 @@ XCreateColormap(display, w, visual, alloc) *---------------------------------------------------------------------- */ -void +int XFreeColormap(display, colormap) Display* display; Colormap colormap; @@ -578,6 +579,7 @@ XFreeColormap(display, colormap) } Tcl_DeleteHashTable(&cmap->refCounts); ckfree((char *) cmap); + return 0; } /* diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 805dde3..9130e39 100755 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -117,7 +117,7 @@ static Tcl_ThreadDataKey dataKey; static POINT * ConvertPoints _ANSI_ARGS_((XPoint *points, int npoints, int mode, RECT *bbox)); -static void DrawOrFillArc _ANSI_ARGS_((Display *display, +static int DrawOrFillArc _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height, int start, int extent, int fill)); @@ -299,7 +299,7 @@ ConvertPoints(points, npoints, mode, bbox) *---------------------------------------------------------------------- */ -void +int XCopyArea(display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y) Display* display; Drawable src; @@ -335,6 +335,7 @@ XCopyArea(display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y) TkWinReleaseDrawableDC(dest, destDC, &destState); } TkWinReleaseDrawableDC(src, srcDC, &srcState); + return 0; } /* @@ -356,7 +357,7 @@ XCopyArea(display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y) *---------------------------------------------------------------------- */ -void +int XCopyPlane(display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y, plane) Display* display; @@ -486,6 +487,7 @@ XCopyPlane(display, src, dest, gc, src_x, src_y, width, height, dest_x, TkWinReleaseDrawableDC(dest, destDC, &destState); } TkWinReleaseDrawableDC(src, srcDC, &srcState); + return 0; } /* @@ -620,7 +622,7 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, *---------------------------------------------------------------------- */ -void +int XFillRectangles(display, d, gc, rectangles, nrectangles) Display* display; Drawable d; @@ -635,7 +637,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HBRUSH brush, oldBrush; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -722,6 +724,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); + return 0; } /* @@ -871,7 +874,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) *---------------------------------------------------------------------- */ -void +int XDrawLines(display, d, gc, points, npoints, mode) Display* display; Drawable d; @@ -885,7 +888,7 @@ XDrawLines(display, d, gc, points, npoints, mode) HDC dc; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -896,6 +899,7 @@ XDrawLines(display, d, gc, points, npoints, mode) DeleteObject(pen); TkWinReleaseDrawableDC(d, dc, &state); + return 0; } /* @@ -914,7 +918,7 @@ XDrawLines(display, d, gc, points, npoints, mode) *---------------------------------------------------------------------- */ -void +int XFillPolygon(display, d, gc, points, npoints, shape, mode) Display* display; Drawable d; @@ -929,7 +933,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode) HDC dc; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -938,6 +942,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode) RenderObject(dc, gc, points, npoints, mode, pen, Polygon); TkWinReleaseDrawableDC(d, dc, &state); + return 0; } /* @@ -956,7 +961,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode) *---------------------------------------------------------------------- */ -void +int XDrawRectangle(display, d, gc, x, y, width, height) Display* display; Drawable d; @@ -972,7 +977,7 @@ XDrawRectangle(display, d, gc, x, y, width, height) HDC dc; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -988,6 +993,7 @@ XDrawRectangle(display, d, gc, x, y, width, height) DeleteObject(SelectObject(dc, oldPen)); SelectObject(dc, oldBrush); TkWinReleaseDrawableDC(d, dc, &state); + return 0; } /* @@ -1006,7 +1012,7 @@ XDrawRectangle(display, d, gc, x, y, width, height) *---------------------------------------------------------------------- */ -void +int XDrawArc(display, d, gc, x, y, width, height, start, extent) Display* display; Drawable d; @@ -1020,7 +1026,7 @@ XDrawArc(display, d, gc, x, y, width, height, start, extent) { display->request++; - DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0); + return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0); } /* @@ -1039,7 +1045,7 @@ XDrawArc(display, d, gc, x, y, width, height, start, extent) *---------------------------------------------------------------------- */ -void +int XFillArc(display, d, gc, x, y, width, height, start, extent) Display* display; Drawable d; @@ -1053,7 +1059,7 @@ XFillArc(display, d, gc, x, y, width, height, start, extent) { display->request++; - DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1); + return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1); } /* @@ -1073,7 +1079,7 @@ XFillArc(display, d, gc, x, y, width, height, start, extent) *---------------------------------------------------------------------- */ -static void +static int DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill) Display *display; Drawable d; @@ -1093,7 +1099,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill) double radian_start, radian_end, xr, yr; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -1163,6 +1169,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill) } DeleteObject(SelectObject(dc, oldPen)); TkWinReleaseDrawableDC(d, dc, &state); + return 0; } /* diff --git a/win/tkWinKey.c b/win/tkWinKey.c index aa532bf..9b78ee4 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -690,12 +690,13 @@ XGetModifierMapping(display) *---------------------------------------------------------------------- */ -void +int XFreeModifiermap(modmap) XModifierKeymap* modmap; { ckfree((char *) modmap->modifiermap); ckfree((char *) modmap); + return 0; } /* diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 0d9ed61..de812ba 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -195,12 +195,13 @@ XGrabKeyboard(display, grab_window, owner_events, pointer_mode, *---------------------------------------------------------------------- */ -void +int XUngrabKeyboard(display, time) Display* display; Time time; { keyboardWinPtr = NULL; + return 0; } /* @@ -347,7 +348,7 @@ XQueryPointer(display, w, root_return, child_return, root_x_return, *---------------------------------------------------------------------- */ -void +int XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, dest_y) Display* display; @@ -363,7 +364,8 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, RECT r; GetWindowRect(Tk_GetHWND(dest_w), &r); - SetCursorPos(r.left+dest_x, r.top+dest_y); + SetCursorPos(r.left+dest_x, r.top+dest_y); + return 0; } /* @@ -382,7 +384,7 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, *---------------------------------------------------------------------- */ -void +int XGetInputFocus(display, focus_return, revert_to_return) Display *display; Window *focus_return; @@ -392,6 +394,7 @@ XGetInputFocus(display, focus_return, revert_to_return) *focus_return = tkwin ? Tk_WindowId(tkwin) : None; *revert_to_return = RevertToParent; display->request++; + return 0; } /* @@ -411,7 +414,7 @@ XGetInputFocus(display, focus_return, revert_to_return) *---------------------------------------------------------------------- */ -void +int XSetInputFocus(display, focus, revert_to, time) Display* display; Window focus; @@ -422,6 +425,7 @@ XSetInputFocus(display, focus, revert_to, time) if (focus != None) { SetFocus(Tk_GetHWND(focus)); } + return 0; } /* diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index 8d76289..2e5b97e 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -294,7 +294,7 @@ TkpMakeWindow(winPtr, parent) *---------------------------------------------------------------------- */ -void +int XDestroyWindow(display, w) Display* display; Window w; @@ -330,6 +330,7 @@ XDestroyWindow(display, w) if (hwnd != NULL && !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) { DestroyWindow(hwnd); } + return 0; } /* @@ -349,7 +350,7 @@ XDestroyWindow(display, w) *---------------------------------------------------------------------- */ -void +int XMapWindow(display, w) Display* display; Window w; @@ -373,7 +374,7 @@ XMapWindow(display, w) for (parentPtr = winPtr->parentPtr; ; parentPtr = parentPtr->parentPtr) { if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) { - return; + return 0; } if (parentPtr->flags & TK_TOP_HIERARCHY) { break; @@ -402,6 +403,7 @@ XMapWindow(display, w) event.xvisibility.window = winPtr->window; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(&event, winPtr); + return 0; } /* @@ -458,7 +460,7 @@ NotifyVisibility(eventPtr, winPtr) *---------------------------------------------------------------------- */ -void +int XUnmapWindow(display, w) Display* display; Window w; @@ -486,6 +488,7 @@ XUnmapWindow(display, w) event.xunmap.from_configure = False; Tk_HandleEvent(&event); } + return 0; } /* @@ -504,7 +507,7 @@ XUnmapWindow(display, w) *---------------------------------------------------------------------- */ -void +int XMoveResizeWindow(display, w, x, y, width, height) Display* display; Window w; @@ -515,6 +518,7 @@ XMoveResizeWindow(display, w, x, y, width, height) { display->request++; MoveWindow(Tk_GetHWND(w), x, y, width, height, TRUE); + return 0; } /* @@ -533,7 +537,7 @@ XMoveResizeWindow(display, w, x, y, width, height) *---------------------------------------------------------------------- */ -void +int XMoveWindow(display, w, x, y) Display* display; Window w; @@ -546,6 +550,7 @@ XMoveWindow(display, w, x, y) MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width, winPtr->changes.height, TRUE); + return 0; } /* @@ -564,7 +569,7 @@ XMoveWindow(display, w, x, y) *---------------------------------------------------------------------- */ -void +int XResizeWindow(display, w, width, height) Display* display; Window w; @@ -577,6 +582,7 @@ XResizeWindow(display, w, width, height) MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, width, height, TRUE); + return 0; } /* @@ -595,7 +601,7 @@ XResizeWindow(display, w, width, height) *---------------------------------------------------------------------- */ -void +int XRaiseWindow(display, w) Display* display; Window w; @@ -605,6 +611,7 @@ XRaiseWindow(display, w) display->request++; SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + return 0; } /* @@ -626,7 +633,7 @@ XRaiseWindow(display, w) *---------------------------------------------------------------------- */ -void +int XConfigureWindow(display, w, value_mask, values) Display* display; Window w; @@ -660,6 +667,7 @@ XConfigureWindow(display, w, value_mask, values) } TkWinSetWindowPos(hwnd, sibling, values->stack_mode); } + return 0; } /* @@ -678,7 +686,7 @@ XConfigureWindow(display, w, value_mask, values) *---------------------------------------------------------------------- */ -void +int XClearWindow(display, w) Display* display; Window w; @@ -706,6 +714,7 @@ XClearWindow(display, w) DeleteObject(brush); SelectPalette(dc, oldPalette, TRUE); ReleaseDC(hwnd, dc); + return 0; } /* @@ -726,7 +735,7 @@ XClearWindow(display, w) *---------------------------------------------------------------------- */ -void +int XChangeWindowAttributes(display, w, valueMask, attributes) Display* display; Window w; @@ -736,6 +745,7 @@ XChangeWindowAttributes(display, w, valueMask, attributes) if (valueMask & CWCursor) { XDefineCursor(display, w, attributes->cursor); } + return 0; } /* diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 2097938..2ec1729 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2347,7 +2347,7 @@ TkWmUnmapWindow(winPtr) *---------------------------------------------------------------------- */ -void +int TkpWmSetState(winPtr, state) TkWindow *winPtr; /* Toplevel window to operate on. */ int state; /* One of IconicState, ZoomState, NormalState, @@ -2358,7 +2358,7 @@ TkpWmSetState(winPtr, state) if (wmPtr->flags & WM_NEVER_MAPPED) { wmPtr->hints.initial_state = state; - return; + return 1; } wmPtr->flags |= WM_SYNC_PENDING; @@ -2374,6 +2374,7 @@ TkpWmSetState(winPtr, state) ShowWindow(wmPtr->wrapper, cmd); wmPtr->flags &= ~WM_SYNC_PENDING; + return 1; } /* @@ -3265,7 +3266,7 @@ WmCommandCmd(tkwin, winPtr, interp, objc, objv) wmPtr->cmdArgc = cmdArgc; wmPtr->cmdArgv = cmdArgv; if (!(wmPtr->flags & WM_NEVER_MAPPED)) { - XSetCommand(winPtr->display, winPtr->window, cmdArgv, cmdArgc); + XSetCommand(winPtr->display, winPtr->window, (char **)cmdArgv, cmdArgc); } return TCL_OK; } diff --git a/win/tkWinX.c b/win/tkWinX.c index cdbdc84..5d53714 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -759,12 +759,13 @@ TkClipCleanup(dispPtr) *---------------------------------------------------------------------- */ -void +int XBell(display, percent) Display* display; int percent; { MessageBeep(MB_OK); + return 0; } /* diff --git a/xlib/xdraw.c b/xlib/xdraw.c index 281a7e8..6c405ad 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- */ -void +int XDrawLine(display, d, gc, x1, y1, x2, y2) Display* display; Drawable d; @@ -42,6 +42,7 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) points[1].x = x2; points[1].y = y2; XDrawLines(display, d, gc, points, 2, CoordModeOrigin); + return 0; } /* @@ -61,7 +62,7 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) *---------------------------------------------------------------------- */ -void +int XFillRectangle(display, d, gc, x, y, width, height) Display* display; Drawable d; @@ -77,4 +78,5 @@ XFillRectangle(display, d, gc, x, y, width, height) rectangle.width = width; rectangle.height = height; XFillRectangles(display, d, gc, &rectangle, 1); + return 0; } diff --git a/xlib/xgc.c b/xlib/xgc.c index 76828b1..b0a1894 100644 --- a/xlib/xgc.c +++ b/xlib/xgc.c @@ -181,7 +181,7 @@ XCreateGC(display, d, mask, values) *---------------------------------------------------------------------- */ -void +int XChangeGC(d, gc, mask, values) Display * d; GC gc; @@ -211,6 +211,7 @@ XChangeGC(d, gc, mask, values) if (mask & GCClipMask) { XSetClipMask(d, gc, values->clip_mask); } if (mask & GCDashOffset) { gc->dash_offset = values->dash_offset; } if (mask & GCDashList) { gc->dashes = values->dashes; (&(gc->dashes))[1] = 0;} + return 0; } /* @@ -229,7 +230,7 @@ XChangeGC(d, gc, mask, values) *---------------------------------------------------------------------- */ -void XFreeGC(d, gc) +int XFreeGC(d, gc) Display * d; GC gc; { @@ -237,6 +238,7 @@ void XFreeGC(d, gc) FreeClipMask(gc); ckfree((char *) gc); } + return 0; } /* @@ -256,25 +258,27 @@ void XFreeGC(d, gc) *---------------------------------------------------------------------- */ -void +int XSetForeground(display, gc, foreground) Display *display; GC gc; unsigned long foreground; { gc->foreground = foreground; + return 0; } -void +int XSetBackground(display, gc, background) Display *display; GC gc; unsigned long background; { gc->background = background; + return 0; } -void +int XSetDashes(display, gc, dash_offset, dash_list, n) Display* display; GC gc; @@ -296,36 +300,40 @@ XSetDashes(display, gc, dash_offset, dash_list, n) *p++ = *dash_list++; } *p = 0; + return 0; } -void +int XSetFunction(display, gc, function) Display *display; GC gc; int function; { gc->function = function; + return 0; } -void +int XSetFillRule(display, gc, fill_rule) Display *display; GC gc; int fill_rule; { gc->fill_rule = fill_rule; + return 0; } -void +int XSetFillStyle(display, gc, fill_style) Display *display; GC gc; int fill_style; { gc->fill_style = fill_style; + return 0; } -void +int XSetTSOrigin(display, gc, x, y) Display *display; GC gc; @@ -333,36 +341,40 @@ XSetTSOrigin(display, gc, x, y) { gc->ts_x_origin = x; gc->ts_y_origin = y; + return 0; } -void +int XSetFont(display, gc, font) Display *display; GC gc; Font font; { gc->font = font; + return 0; } -void +int XSetArcMode(display, gc, arc_mode) Display *display; GC gc; int arc_mode; { gc->arc_mode = arc_mode; + return 0; } -void +int XSetStipple(display, gc, stipple) Display *display; GC gc; Pixmap stipple; { gc->stipple = stipple; + return 0; } -void +int XSetLineAttributes(display, gc, line_width, line_style, cap_style, join_style) Display *display; @@ -376,9 +388,10 @@ XSetLineAttributes(display, gc, line_width, line_style, cap_style, gc->line_style = line_style; gc->cap_style = cap_style; gc->join_style = join_style; + return 0; } -void +int XSetClipOrigin(display, gc, clip_x_origin, clip_y_origin) Display* display; GC gc; @@ -387,6 +400,7 @@ XSetClipOrigin(display, gc, clip_x_origin, clip_y_origin) { gc->clip_x_origin = clip_x_origin; gc->clip_y_origin = clip_y_origin; + return 0; } /* @@ -429,7 +443,7 @@ TkSetRegion(display, gc, r) } } -void +int XSetClipMask(display, gc, pixmap) Display* display; GC gc; @@ -443,6 +457,7 @@ XSetClipMask(display, gc, pixmap) clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = pixmap; } + return 0; } /* -- cgit v0.12 From c985425b2f03e2e14bf3f7ee9884cd74c184373e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 29 May 2012 15:08:30 +0000 Subject: Change XFillRectangle(s)/XDrawLines(s) signature to match Xorg, needed for Cygwin. Generate same pkgIndex.tcl file for win32 and cygwin, one that is equally useable for both. --- ChangeLog | 11 +++++++++++ generic/tk.decls | 2 +- generic/tkInt.decls | 18 +++++++++--------- generic/tkIntXlibDecls.h | 48 ++++++++++++++++++++++++------------------------ generic/tkMain.c | 2 -- mac/tkMacDraw.c | 8 +++++--- macosx/tkMacOSXDraw.c | 12 +++++++----- unix/Makefile.in | 15 ++++++++------- win/Makefile.in | 12 +++++------- win/tkWinDraw.c | 10 ++++++---- xlib/xdraw.c | 8 ++++---- 11 files changed, 80 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b7dcec..7577bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-05-09 Jan Nijtmans + + * generic/tkInt.decls: Change XFillRectangle(s)/XDrawLines(s) signature + * generic/tkIntXlibDeclsDecls.h: to match Xorg, needed for Cygwin. + * xlib/xdraw.c: + * mac/tkMacDraw.c: + * macosx/tkMacOSXDraw.c: + * win/tkWinDraw.c: + * win/Makefile.in: Generate same pkgIndex.tcl file for win32 and + * unix/Makefile.in: cygwin, one that is equally useable for both. + 2012-05-25 Jan Nijtmans * generic/tkWindow.c: Simpify determination whether we are running on cygwin. diff --git a/generic/tk.decls b/generic/tk.decls index 400c415..f752151 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1057,7 +1057,7 @@ declare 0 mac { Tk_MacEmbedGetClipProc *getClipProc, Tk_MacEmbedGetOffsetInParentProc *getOffsetProc) } - + declare 1 mac { void Tk_MacTurnOffMenus(void) } diff --git a/generic/tkInt.decls b/generic/tkInt.decls index df2ad29..3084743 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -427,7 +427,7 @@ declare 119 { TkRegion src, TkRegion dr_return) } declare 121 {mac aqua} { - Pixmap TkpCreateNativeBitmap(Display *display, const char *source) + Pixmap TkpCreateNativeBitmap(Display *display, const char *source) } declare 122 {mac aqua} { void TkpDefineNativeBitmaps(void) @@ -1173,7 +1173,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, @@ -1188,7 +1188,7 @@ 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) @@ -1422,11 +1422,11 @@ 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 XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 105 win { @@ -1519,7 +1519,7 @@ declare 22 {mac aqua} { unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 23 {mac 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 {mac aqua} { void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, @@ -1534,7 +1534,7 @@ declare 26 {mac aqua} { int i1, int i2, int i3) } declare 27 {mac 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 {mac aqua} { void XFreeColormap(Display *d, Colormap c) @@ -1721,11 +1721,11 @@ declare 81 {mac aqua} { void XForceScreenSaver(Display *display, int mode) } declare 82 {mac 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 {mac 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 {mac aqua} { diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 0ca0da4..c3e5d6a 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -134,7 +134,7 @@ EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 31 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 32 */ EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, @@ -148,7 +148,7 @@ EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 35 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 36 */ EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *d, int i)); @@ -353,14 +353,14 @@ EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display *display, EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 104 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 105 */ EXTERN void XWarpPointer _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 106 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); #endif /* WIN */ @@ -438,7 +438,7 @@ EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 23 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 24 */ EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, @@ -452,7 +452,7 @@ EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 27 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 28 */ EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); @@ -621,10 +621,10 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ @@ -728,7 +728,7 @@ EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 23 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 24 */ EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, @@ -742,7 +742,7 @@ EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 27 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 28 */ EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); @@ -911,10 +911,10 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ @@ -983,11 +983,11 @@ typedef struct TkIntXlibStubs { void (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */ void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */ void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ @@ -1056,9 +1056,9 @@ typedef struct TkIntXlibStubs { XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 101 */ void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 102 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 103 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ void (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ #endif /* WIN */ #ifdef MAC_TCL void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ @@ -1084,11 +1084,11 @@ typedef struct TkIntXlibStubs { void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ @@ -1143,8 +1143,8 @@ typedef struct TkIntXlibStubs { Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ @@ -1177,11 +1177,11 @@ typedef struct TkIntXlibStubs { void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ @@ -1236,8 +1236,8 @@ typedef struct TkIntXlibStubs { Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ diff --git a/generic/tkMain.c b/generic/tkMain.c index af2448e..f400c05 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -129,8 +129,6 @@ static void StdinProc _ANSI_ARGS_((ClientData clientData, * *---------------------------------------------------------------------- */ -int LoadCygwinTk(Tcl_Interp *interp); - void Tk_MainEx(argc, argv, appInitProc, interp) int argc; /* Number of arguments. */ diff --git a/mac/tkMacDraw.c b/mac/tkMacDraw.c index ddf23d2..720dd71 100644 --- a/mac/tkMacDraw.c +++ b/mac/tkMacDraw.c @@ -399,7 +399,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -433,6 +433,7 @@ XFillRectangles( } SetGWorld(saveWorld, saveDevice); + return 1; } /* @@ -451,7 +452,7 @@ XFillRectangles( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -470,7 +471,7 @@ XDrawLines( display->request++; if (npoints < 2) { - return; /* TODO: generate BadValue error. */ + return 0; /* TODO: generate BadValue error. */ } GetGWorld(&saveWorld, &saveDevice); SetGWorld(destPort, NULL); @@ -495,6 +496,7 @@ XDrawLines( } SetGWorld(saveWorld, saveDevice); + return 1; } /* diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 63e26a1..6805f28 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -550,7 +550,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -568,12 +568,12 @@ XDrawLines( * TODO: generate BadValue error. */ - return; + return 0; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return 0; } if (dc.context) { double prevx, prevy; @@ -614,6 +614,7 @@ XDrawLines( } } TkMacOSXRestoreDrawingContext(&dc); + return 1; } /* @@ -902,7 +903,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -917,7 +918,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return 0; } if (dc.context) { CGRect rect; @@ -944,6 +945,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return 1; } /* diff --git a/unix/Makefile.in b/unix/Makefile.in index 8a3856b..80dd6a0 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -633,15 +633,16 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish (\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ - echo "if {[string match CYGWIN* \$$::tcl_platform(os)]} {";\ - echo " if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ - echo " } else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ - echo " }";\ + if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + else \ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ echo "}";\ + fi \ ) > $(PKG_INDEX); \ fi @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" diff --git a/win/Makefile.in b/win/Makefile.in index 6612230..714b0e9 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -427,14 +427,12 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[package vcompare [package provide Tcl]\ - $(TCLVERSION)] != 0} { return }";\ - echo "if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ - echo " package ifneeded Tk $(VERSION)\ - [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(VERSION)\ - [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 805dde3..fea17d3 100755 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -620,7 +620,7 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, *---------------------------------------------------------------------- */ -void +int XFillRectangles(display, d, gc, rectangles, nrectangles) Display* display; Drawable d; @@ -635,7 +635,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HBRUSH brush, oldBrush; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -722,6 +722,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); + return 1; } /* @@ -871,7 +872,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) *---------------------------------------------------------------------- */ -void +int XDrawLines(display, d, gc, points, npoints, mode) Display* display; Drawable d; @@ -885,7 +886,7 @@ XDrawLines(display, d, gc, points, npoints, mode) HDC dc; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -896,6 +897,7 @@ XDrawLines(display, d, gc, points, npoints, mode) DeleteObject(pen); TkWinReleaseDrawableDC(d, dc, &state); + return 1; } /* diff --git a/xlib/xdraw.c b/xlib/xdraw.c index 281a7e8..8ec924a 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- */ -void +int XDrawLine(display, d, gc, x1, y1, x2, y2) Display* display; Drawable d; @@ -41,7 +41,7 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) 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(display, d, gc, x1, y1, x2, y2) *---------------------------------------------------------------------- */ -void +int XFillRectangle(display, d, gc, x, y, width, height) Display* display; Drawable d; @@ -76,5 +76,5 @@ XFillRectangle(display, d, gc, x, y, width, height) rectangle.y = y; rectangle.width = width; rectangle.height = height; - XFillRectangles(display, d, gc, &rectangle, 1); + return XFillRectangles(display, d, gc, &rectangle, 1); } -- cgit v0.12 From e35d614587b25a1a03ededdf2d04bcbfca86be70 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 Jun 2012 22:29:19 +0000 Subject: Change XSetDashes signature and many others to match Xorg, needed for Cygwin. Add .PHONY targets, and various quoting issues (Makefile.in) --- ChangeLog | 9 +- generic/tkInt.decls | 51 +++++------ generic/tkIntXlibDecls.h | 128 +++++++++++++-------------- generic/tkPointer.c | 6 +- generic/tkStubInit.c | 143 ++++++++++++++++++++---------- mac/tkMacClipboard.c | 8 +- mac/tkMacColor.c | 6 +- mac/tkMacDraw.c | 5 +- mac/tkMacKeyboard.c | 3 +- mac/tkMacXStubs.c | 6 +- macosx/tkMacOSXClipboard.c | 8 +- macosx/tkMacOSXColor.c | 6 +- macosx/tkMacOSXDraw.c | 19 ++-- macosx/tkMacOSXKeyboard.c | 3 +- macosx/tkMacOSXXStubs.c | 6 +- unix/Makefile.in | 212 +++++++++++++++++++++++---------------------- unix/tkUnixPort.h | 36 ++++---- win/Makefile.in | 51 ++++++----- win/stubs.c | 23 ++--- win/tkWinClipboard.c | 16 ++-- win/tkWinColor.c | 26 +++--- win/tkWinDraw.c | 69 +++++++-------- win/tkWinKey.c | 17 ++-- win/tkWinPointer.c | 13 +-- win/tkWinX.c | 69 +++++++-------- xlib/xdraw.c | 4 +- xlib/xgc.c | 21 ++--- xlib/ximage.c | 2 +- xlib/xutil.c | 6 +- 29 files changed, 535 insertions(+), 437 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7577bdd..d90693a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2012-05-09 Jan Nijtmans +2012-06-02 Jan Nijtmans + + * generic/tkInt.decls: Change XSetDashes signature and many others + * generic/tkIntXlibDeclsDecls.h: to match Xorg, needed for Cygwin. + * unix/Makefile.in: Add .PHONY targets, and various quoting issues + * win/Makefile.in: (Backported from Tcl 8.5) + +2012-05-29 Jan Nijtmans * generic/tkInt.decls: Change XFillRectangle(s)/XDrawLines(s) signature * generic/tkIntXlibDeclsDecls.h: to match Xorg, needed for Cygwin. diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 3084743..b20a46e 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1065,7 +1065,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 { @@ -1095,7 +1095,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) @@ -1129,7 +1130,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, @@ -1160,7 +1161,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) @@ -1194,17 +1195,17 @@ 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, @@ -1280,7 +1281,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) @@ -1289,7 +1290,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) @@ -1317,7 +1318,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) @@ -1336,7 +1337,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) } @@ -1425,20 +1426,20 @@ declare 104 win { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } +declare 105 win { + 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) } -declare 105 win { - void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, - unsigned int sw, unsigned int sh, int dx, int dy) -} ################################ # X functions for Mac and Aqua declare 0 {mac 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 {mac aqua} { @@ -1481,7 +1482,7 @@ declare 12 {mac aqua} { Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 13 {mac aqua} { - void XBell(Display *d, int i) + int XBell(Display *d, int i) } declare 14 {mac aqua} { void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, @@ -1509,7 +1510,7 @@ declare 19 {mac aqua} { _Xconst char *data, unsigned int width, unsigned int height) } declare 20 {mac aqua} { - void XDefineCursor(Display *d, Window w, Cursor c) + int XDefineCursor(Display *d, Window w, Cursor c) } declare 21 {mac aqua} { void XDestroyWindow(Display *d, Window w) @@ -1537,14 +1538,14 @@ declare 27 {mac aqua} { int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 28 {mac aqua} { - void XFreeColormap(Display *d, Colormap c) + int XFreeColormap(Display *d, Colormap c) } declare 29 {mac aqua} { - void XFreeColors(Display *d, Colormap c, + int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } declare 30 {mac aqua} { - void XFreeModifiermap(XModifierKeymap *x) + int XFreeModifiermap(XModifierKeymap *x) } declare 31 {mac aqua} { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, @@ -1603,7 +1604,7 @@ declare 46 {mac aqua} { void XSetInputFocus(Display *d, Window w, int i, Time t) } declare 47 {mac aqua} { - void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) + int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } declare 48 {mac aqua} { void XSetWindowBackground(Display *d, Window w, unsigned long ul) @@ -1627,13 +1628,13 @@ declare 54 {mac aqua} { void XUngrabKeyboard(Display *d, Time t) } declare 55 {mac aqua} { - void XUngrabPointer(Display *d, Time t) + int XUngrabPointer(Display *d, Time t) } declare 56 {mac aqua} { void XUnmapWindow(Display *d, Window w) } declare 57 {mac 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) } @@ -1739,7 +1740,7 @@ declare 86 {mac aqua} { int npoints, int mode) } declare 87 {mac 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/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index c3e5d6a..cdb88f0 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -38,7 +38,7 @@ #if defined(__WIN32__) /* WIN */ /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ @@ -66,7 +66,7 @@ EXTERN Cursor XCreatePixmapCursor _ANSI_ARGS_((Display *d, /* 8 */ EXTERN Cursor XCreateGlyphCursor _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, - XColor *x1, XColor *x2)); + XColor _Xconst *x1, XColor _Xconst *x2)); /* 9 */ EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g)); /* 10 */ @@ -93,7 +93,7 @@ EXTERN Status XGetWMColormapWindows _ANSI_ARGS_((Display *d, EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 19 */ -EXTERN void XBell _ANSI_ARGS_((Display *d, int i)); +EXTERN int XBell _ANSI_ARGS_((Display *d, int i)); /* 20 */ EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, @@ -122,7 +122,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 27 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 28 */ EXTERN void XDeleteProperty _ANSI_ARGS_((Display *d, Window w, @@ -153,14 +153,14 @@ EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, /* 36 */ EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *d, int i)); /* 37 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); +EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); /* 38 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c, +EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 39 */ EXTERN void XFreeCursor _ANSI_ARGS_((Display *d, Cursor c)); /* 40 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); +EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); /* 41 */ EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, @@ -228,7 +228,7 @@ EXTERN void XSelectInput _ANSI_ARGS_((Display *d, Window w, EXTERN Status XSendEvent _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 62 */ -EXTERN void XSetCommand _ANSI_ARGS_((Display *d, Window w, +EXTERN int XSetCommand _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 63 */ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, @@ -237,7 +237,7 @@ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 65 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, +EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 66 */ EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d, @@ -264,7 +264,7 @@ EXTERN Bool XTranslateCoordinates _ANSI_ARGS_((Display *d, /* 73 */ EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 74 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 75 */ EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 76 */ @@ -279,7 +279,7 @@ EXTERN int XmbLookupString _ANSI_ARGS_((XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s)); /* 80 */ -EXTERN void TkPutImage _ANSI_ARGS_((unsigned long *colors, +EXTERN int TkPutImage _ANSI_ARGS_((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, @@ -356,7 +356,7 @@ EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list, EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 105 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display *d, Window s, +EXTERN int XWarpPointer _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 106 */ @@ -366,7 +366,7 @@ EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, #endif /* WIN */ #ifdef MAC_TCL /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ @@ -402,7 +402,7 @@ EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x)); EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 13 */ -EXTERN void XBell _ANSI_ARGS_((Display *d, int i)); +EXTERN int XBell _ANSI_ARGS_((Display *d, int i)); /* 14 */ EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, @@ -429,7 +429,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 20 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 21 */ EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); @@ -455,12 +455,12 @@ EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 28 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); +EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); /* 29 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c, +EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 30 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); +EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); /* 31 */ EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, @@ -514,7 +514,7 @@ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 47 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, +EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 48 */ EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d, @@ -537,11 +537,11 @@ EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, /* 54 */ EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 55 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 56 */ EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 57 */ -EXTERN void TkPutImage _ANSI_ARGS_((unsigned long *colors, +EXTERN int TkPutImage _ANSI_ARGS_((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, @@ -637,7 +637,7 @@ EXTERN void XDrawPoints _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 87 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display *display, +EXTERN int XWarpPointer _ANSI_ARGS_((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, @@ -656,7 +656,7 @@ EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, #endif /* MAC_TCL */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ -EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, +EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 1 */ @@ -692,7 +692,7 @@ EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x)); EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 13 */ -EXTERN void XBell _ANSI_ARGS_((Display *d, int i)); +EXTERN int XBell _ANSI_ARGS_((Display *d, int i)); /* 14 */ EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, @@ -719,7 +719,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 20 */ -EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w, +EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 21 */ EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w)); @@ -745,12 +745,12 @@ EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 28 */ -EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); +EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); /* 29 */ -EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c, +EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 30 */ -EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); +EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x)); /* 31 */ EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, @@ -804,7 +804,7 @@ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 47 */ -EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, +EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 48 */ EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d, @@ -827,11 +827,11 @@ EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w, /* 54 */ EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t)); /* 55 */ -EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); +EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t)); /* 56 */ EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w)); /* 57 */ -EXTERN void TkPutImage _ANSI_ARGS_((unsigned long *colors, +EXTERN int TkPutImage _ANSI_ARGS_((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, @@ -927,7 +927,7 @@ EXTERN void XDrawPoints _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 87 */ -EXTERN void XWarpPointer _ANSI_ARGS_((Display *display, +EXTERN int XWarpPointer _ANSI_ARGS_((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, @@ -952,7 +952,7 @@ typedef struct TkIntXlibStubs { struct TkIntXlibStubHooks *hooks; #if defined(__WIN32__) /* WIN */ - void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ XImage * (*xCreateImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ @@ -960,7 +960,7 @@ typedef struct TkIntXlibStubs { char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */ Colormap (*xCreateColormap) _ANSI_ARGS_((Display *d, Window w, Visual *v, int i)); /* 6 */ Cursor (*xCreatePixmapCursor) _ANSI_ARGS_((Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)); /* 7 */ - Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2)); /* 8 */ + Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2)); /* 8 */ GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 9 */ XHostAddress * (*xListHosts) _ANSI_ARGS_((Display *d, int *i, Bool *b)); /* 10 */ KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display *d, unsigned int k, int i)); /* 11 */ @@ -971,7 +971,7 @@ typedef struct TkIntXlibStubs { Status (*xWithdrawWindow) _ANSI_ARGS_((Display *d, Window w, int i)); /* 16 */ Status (*xGetWMColormapWindows) _ANSI_ARGS_((Display *d, Window w, Window **wpp, int *ip)); /* 17 */ Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 18 */ - void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */ + int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */ void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 20 */ void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 21 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 22 */ @@ -979,7 +979,7 @@ typedef struct TkIntXlibStubs { void (*xCopyArea) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 26 */ - void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */ void (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ @@ -989,10 +989,10 @@ typedef struct TkIntXlibStubs { void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */ int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */ - void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ - void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ + int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ + int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ void (*xFreeCursor) _ANSI_ARGS_((Display *d, Cursor c)); /* 39 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */ + int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */ Status (*xGetGeometry) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Window *w, int *i)); /* 42 */ int (*xGetWindowProperty) _ANSI_ARGS_((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 */ @@ -1014,10 +1014,10 @@ typedef struct TkIntXlibStubs { void (*xResizeWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */ void (*xSelectInput) _ANSI_ARGS_((Display *d, Window w, long l)); /* 60 */ Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 61 */ - void (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 62 */ + int (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 62 */ void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 63 */ void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 64 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */ + int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */ void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 66 */ void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 67 */ void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 68 */ @@ -1026,13 +1026,13 @@ typedef struct TkIntXlibStubs { void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 71 */ Bool (*xTranslateCoordinates) _ANSI_ARGS_((Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3)); /* 72 */ void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 73 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */ void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 75 */ void (*xWindowEvent) _ANSI_ARGS_((Display *d, Window w, long l, XEvent *x)); /* 76 */ void (*xDestroyIC) _ANSI_ARGS_((XIC x)); /* 77 */ Bool (*xFilterEvent) _ANSI_ARGS_((XEvent *x, Window w)); /* 78 */ int (*xmbLookupString) _ANSI_ARGS_((XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s)); /* 79 */ - void (*tkPutImage) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 82 */ GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 83 */ @@ -1057,11 +1057,11 @@ typedef struct TkIntXlibStubs { void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 102 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 103 */ int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ - void (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ + int (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ #endif /* WIN */ #ifdef MAC_TCL - void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ XImage * (*xCreateImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ @@ -1074,14 +1074,14 @@ typedef struct TkIntXlibStubs { Window (*xRootWindow) _ANSI_ARGS_((Display *d, int i)); /* 10 */ XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */ Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 12 */ - void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */ + int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */ void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 14 */ void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 15 */ void (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 16 */ void (*xCopyArea) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */ - void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ @@ -1089,9 +1089,9 @@ typedef struct TkIntXlibStubs { void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ - void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ - void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ + int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ + int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ + int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ Status (*xGetGeometry) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */ @@ -1108,7 +1108,7 @@ typedef struct TkIntXlibStubs { Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 44 */ void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 45 */ void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 46 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */ + int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */ void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 48 */ void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 49 */ void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 50 */ @@ -1116,9 +1116,9 @@ typedef struct TkIntXlibStubs { void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */ void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */ void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */ - void (*tkPutImage) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */ GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */ void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ @@ -1148,13 +1148,13 @@ typedef struct TkIntXlibStubs { void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ - void (*xWarpPointer) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *def_in_out)); /* 88 */ void (*xQueryColors) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *defs_in_out, int ncolors)); /* 89 */ Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 90 */ #endif /* MAC_TCL */ #ifdef MAC_OSX_TK /* AQUA */ - void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ + int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ XImage * (*xCreateImage) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */ @@ -1167,14 +1167,14 @@ typedef struct TkIntXlibStubs { Window (*xRootWindow) _ANSI_ARGS_((Display *d, int i)); /* 10 */ XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */ Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 12 */ - void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */ + int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */ void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 14 */ void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 15 */ void (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 16 */ void (*xCopyArea) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */ - void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ + int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ @@ -1182,9 +1182,9 @@ typedef struct TkIntXlibStubs { void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ - void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ - void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ - void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ + int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ + int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ + int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ Status (*xGetGeometry) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */ @@ -1201,7 +1201,7 @@ typedef struct TkIntXlibStubs { Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 44 */ void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 45 */ void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 46 */ - void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */ + int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */ void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 48 */ void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 49 */ void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 50 */ @@ -1209,9 +1209,9 @@ typedef struct TkIntXlibStubs { void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */ void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */ void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ - void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ + int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */ void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */ - void (*tkPutImage) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */ GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */ void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ @@ -1241,7 +1241,7 @@ typedef struct TkIntXlibStubs { void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ - void (*xWarpPointer) _ANSI_ARGS_((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) _ANSI_ARGS_((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) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *def_in_out)); /* 88 */ void (*xQueryColors) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *defs_in_out, int ncolors)); /* 89 */ Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 90 */ diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 17c7424..949dcee 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -475,7 +475,7 @@ XGrabPointer(display, grab_window, owner_events, event_mask, pointer_mode, *---------------------------------------------------------------------- */ -void +int XUngrabPointer(display, time) Display* display; Time time; @@ -488,6 +488,7 @@ XUngrabPointer(display, time) tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); UpdateCursor(tsdPtr->lastWinPtr); + return Success; } /* @@ -590,7 +591,7 @@ UpdateCursor(winPtr) *---------------------------------------------------------------------- */ -void +int XDefineCursor(display, w, cursor) Display* display; Window w; @@ -604,6 +605,7 @@ XDefineCursor(display, w, cursor) UpdateCursor(winPtr); } display->request++; + return Success; } /* diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index adaf319..02ab98b 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -1,12 +1,12 @@ -/* +/* * tkStubInit.c -- * * This file contains the initializers for the Tk stub vectors. * * Copyright (c) 1998-1999 by Scriptics Corporation. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkInt.h" @@ -46,13 +46,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 @@ -63,24 +69,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] @@ -89,25 +77,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 here, which in any - * case lacks this function anyway. - */ +/* + * Trick, so we don't have to include 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; @@ -118,21 +97,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 @@ -172,7 +208,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__ */ /* diff --git a/mac/tkMacClipboard.c b/mac/tkMacClipboard.c index 953ae23..c25dc69 100644 --- a/mac/tkMacClipboard.c +++ b/mac/tkMacClipboard.c @@ -107,7 +107,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display* display, /* X Display. */ Atom selection, /* What selection to own. */ @@ -132,11 +132,11 @@ XSetSelectionOwner( */ dispPtr = TkGetMainInfoList()->winPtr->dispPtr; - if (dispPtr->clipboardActive) { - return; + if (!dispPtr->clipboardActive) { + ZeroScrap(); } - ZeroScrap(); } + return Success; } /* diff --git a/mac/tkMacColor.c b/mac/tkMacColor.c index 6c3c230..dad7396 100644 --- a/mac/tkMacColor.c +++ b/mac/tkMacColor.c @@ -141,14 +141,15 @@ XCreateColormap( return index++; } -void +int XFreeColormap( Display* display, /* Display. */ Colormap colormap) /* Colormap. */ { + return Success; } -void +int XFreeColors( Display* display, /* Display. */ Colormap colormap, /* Colormap. */ @@ -161,6 +162,7 @@ XFreeColors( * needs to be done to release colors as there really is * no colormap in the Tk sense. */ + return Success; } /* diff --git a/mac/tkMacDraw.c b/mac/tkMacDraw.c index 720dd71..5fd718e 100644 --- a/mac/tkMacDraw.c +++ b/mac/tkMacDraw.c @@ -276,7 +276,7 @@ XCopyPlane( *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ int ncolors, /* Unused on Macintosh. */ @@ -381,6 +381,7 @@ TkPutImage( ckfree(newData); } SetGWorld(saveWorld, saveDevice); + return Success; } /* @@ -433,7 +434,7 @@ XFillRectangles( } SetGWorld(saveWorld, saveDevice); - return 1; + return Success; } /* diff --git a/mac/tkMacKeyboard.c b/mac/tkMacKeyboard.c index 07b57c0..a79d813 100644 --- a/mac/tkMacKeyboard.c +++ b/mac/tkMacKeyboard.c @@ -293,7 +293,7 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { @@ -301,6 +301,7 @@ XFreeModifiermap( ckfree((char *) modmap->modifiermap); } ckfree((char *) modmap); + return Success; } /* diff --git a/mac/tkMacXStubs.c b/mac/tkMacXStubs.c index 1e0ad51..aff29dc 100644 --- a/mac/tkMacXStubs.c +++ b/mac/tkMacXStubs.c @@ -395,12 +395,13 @@ XSelectInput( Debugger(); } -void +int XBell( Display* display, int percent) { SysBeep(percent); + return Success; } void @@ -528,7 +529,7 @@ XDrawPoints( } */ -void +int XWarpPointer( Display* display, Window src_w, @@ -540,6 +541,7 @@ XWarpPointer( int dest_x, int dest_y) { + return Success; } void 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 9520a77..22686a3 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 6805f28..5c36967 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -340,7 +340,7 @@ end: *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ int ncolors, /* Unused on Macintosh. */ @@ -360,7 +360,7 @@ TkPutImage( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) { - return; + return BadDrawable; } if (dc.context) { TkMacOSXDbgMsg("Ignored CG drawing of XImage"); @@ -532,6 +532,7 @@ TkPutImage( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -564,16 +565,12 @@ XDrawLines( int i, lw = gc->line_width; if (npoints < 2) { - /* - * TODO: generate BadValue error. - */ - - return 0; + return BadValue; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return 0; + return BadDrawable; } if (dc.context) { double prevx, prevy; @@ -614,7 +611,7 @@ XDrawLines( } } TkMacOSXRestoreDrawingContext(&dc); - return 1; + return Success; } /* @@ -918,7 +915,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return 0; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -945,7 +942,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); - return 1; + 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 8bf57fa..4845454 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -464,12 +464,13 @@ XSelectInput( Debugger(); } -void +int XBell( Display* display, int percent) { SysBeep(percent); + return Success; } #if 0 @@ -549,7 +550,7 @@ XDrawPoints( } */ -void +int XWarpPointer( Display* display, Window src_w, @@ -561,6 +562,7 @@ XWarpPointer( int dest_x, int dest_y) { + return Success; } void diff --git a/unix/Makefile.in b/unix/Makefile.in index 80dd6a0..1e963d4 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -34,6 +34,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ +datarootdir = @datarootdir@ mandir = @mandir@ # The following definition can be set to non-null for special systems @@ -90,11 +91,21 @@ HTML_DIR = @HTML_DIR@ # Directory in which to install html documentation: HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR) +# Directory in which to install the configuration file tkConfig.sh: +CONFIG_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) + +# Directory in which to install the demo files: +DEMO_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY)/demos + # The directory containing the Tcl sources and headers appropriate # for this version of Tk ("srcdir" will be replaced or has already # been replaced by the configure script): TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic +# The directory containing the platform specific Tcl sources and headers +# appropriate for this version of Tk: +TCL_PLATFORM_DIR = @TCL_SRC_DIR@/unix + # The directory containing the Tcl library archive file appropriate # for this version of Tk: TCL_BIN_DIR = @TCL_BIN_DIR@ @@ -200,6 +211,7 @@ BUILD_TCLSH = @BUILD_TCLSH@ # required just to do a normal build although it can be required to run # make dist. This variable is set to "" if no tclsh is available. TCL_EXE = @TCLSH_PROG@ +WISH_EXE = wish # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of @@ -207,7 +219,7 @@ TCL_EXE = @TCLSH_PROG@ # with the distribution, which is slower but guaranteed to work. INSTALL_STRIP_PROGRAM = -s -INSTALL_STRIP_LIBRARY = -S -S +INSTALL_STRIP_LIBRARY = -S -x INSTALL = @srcdir@/install-sh -c INSTALL_PROGRAM = ${INSTALL} @@ -293,9 +305,10 @@ RANLIB = @RANLIB@ SRC_DIR = @srcdir@ TOP_DIR = $(SRC_DIR)/.. GENERIC_DIR = $(TOP_DIR)/generic -UNIX_DIR = $(SRC_DIR) +UNIX_DIR = $(TOP_DIR)/unix BMAP_DIR = $(TOP_DIR)/bitmaps TOOL_DIR = @TCL_SRC_DIR@/tools +TEST_DIR = $(TOP_DIR)/tests MAC_OSX_DIR = $(TOP_DIR)/macosx XLIB_DIR = $(TOP_DIR)/xlib @@ -305,8 +318,8 @@ XLIB_DIR = $(TOP_DIR)/xlib # either. #---------------------------------------------------------------- -# Flags to be passed to installManPage to control whether the manpages -# should be compressed and linked with softlinks +# Flags to be passed to installManPage to control how the manpages +# should be installed (symlinks, compression, package name suffix). MAN_FLAGS = @MAN_FLAGS@ CC = @CC@ @@ -477,11 +490,25 @@ HDRS = bltList.h \ default.h ks_names.h tkPatch.h tk.h tkButton.h tkCanvas.h tkInt.h \ tkPort.h tkScrollbar.h tkText.h +PUBLIC_HDRS = $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \ + $(GENERIC_DIR)/tkPlatDecls.h $(@TK_WINDOWINGSYSTEM@_HDRS) + +# The private headers we want installed for install-private-headers +PRIVATE_HDRS = $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ + $(GENERIC_DIR)/tkIntPlatDecls.h \ + $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS) + DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget +SHELL_ENV = \ + @LD_LIBRARY_PATH_VAR@="`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}"; \ + export @LD_LIBRARY_PATH_VAR@; \ + TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ + TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; + all: binaries libraries doc -binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish +binaries: ${LIB_FILE} ${STUB_LIB_FILE} ${WISH_EXE} libraries: @@ -522,9 +549,9 @@ tkLibObjs: objs: ${OBJS} -wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ +${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ ${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE} # Resetting the LIB_RUNTIME_DIR below is required so that # the generated tktest executable gets the build directory @@ -533,7 +560,7 @@ wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ # Tk shared libraries. tktest: $(TKTEST_OBJS) $(TK_LIB_FILE) - $(MAKE) tktest-real LIB_RUNTIME_DIR=`pwd`:$(TCL_BIN_DIR) + $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \ @@ -555,52 +582,50 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) # args to tcltest, ie: # % make test TESTFLAGS="-verbose bps -file fileName.test" -test: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ - export @LD_LIBRARY_PATH_VAR@; \ - TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ - TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ - ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \ +test: test-classic + +test-classic: tktest + $(SHELL_ENV) ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS) $(TCLTESTARGS) # Tests with different languages testlang: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ - export @LD_LIBRARY_PATH_VAR@; \ - TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ - TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ + $(SHELL_ENV) \ for lang in $(LOCALES) ; \ do \ LANG=$(lang); export LANG; \ - ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \ + ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS) $(TCLTESTARGS); \ done # Useful target to launch a built tktest with the proper path,... runtest: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ - export @LD_LIBRARY_PATH_VAR@; \ - TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ - TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ - ./tktest + $(SHELL_ENV) ./tktest # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` -shell: wish - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ - export @LD_LIBRARY_PATH_VAR@; \ - TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ - TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ - ./wish $(SCRIPT) +shell: ${WISH_EXE} + $(SHELL_ENV) ./${WISH_EXE} $(SCRIPT) + +demo: + $(SHELL_ENV) ./${WISH_EXE} $(TOP_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight -gdb: wish - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run +gdb: ${WISH_EXE} + @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run - gdb ./wish --command=gdb.run + gdb ./${WISH_EXE} --command=gdb.run rm gdb.run +VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v + +valgrind: tktest + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) + +valgrindshell: tktest + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest $(SCRIPT) + INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@ install: $(INSTALL_TARGETS) @@ -614,13 +639,13 @@ install-strip: # some ranlibs write to current directory, and this might not always be # possible (e.g. if installing as root). -install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish - @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) $(PKG_INSTALL_DIR); \ +install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH_EXE} + @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" "$(PKG_INSTALL_DIR)"; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @@ -629,7 +654,7 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish fi @if test "x$(TK_SHARED_BUILD)" = "x1"; then \ echo "Creating package index $(PKG_INDEX)"; \ - rm -f $(PKG_INDEX); \ + rm -f "$(PKG_INDEX)"; \ (\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ @@ -653,10 +678,10 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \ $(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \ fi - @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)" - @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION) - @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/" - @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh + @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)" + @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)" + @echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/" + @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)/tkConfig.sh" @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ @@ -665,15 +690,15 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish install-libraries: libraries @if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \ - XLIB_INCLUDE_INSTALL_DIR=$(INCLUDE_INSTALL_DIR)/X11; fi; \ - for i in $(INCLUDE_INSTALL_DIR) $${XLIB_INCLUDE_INSTALL_DIR} \ - $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \ - $(SCRIPT_INSTALL_DIR)/msgs; \ + XLIB_INCLUDE_INSTALL_DIR="$(INCLUDE_INSTALL_DIR)/X11"; fi; \ + for i in "$(INCLUDE_INSTALL_DIR)" "$${XLIB_INCLUDE_INSTALL_DIR}" \ + "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)/images" \ + "$(SCRIPT_INSTALL_DIR)/msgs"; \ do \ - if [ ! -d $$i ] ; then \ + if [ -n "$$i" -a ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @@ -681,8 +706,7 @@ install-libraries: libraries chmod +x $(SRC_DIR)/install-sh; \ fi @echo "Installing header files"; - @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \ - $(GENERIC_DIR)/tkPlatDecls.h $(@TK_WINDOWINGSYSTEM@_HDRS) ; \ + @for i in $(PUBLIC_HDRS); \ do \ $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ done; @@ -779,25 +803,23 @@ install-doc: install-private-headers: libraries @for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @if test ! -x $(SRC_DIR)/install-sh; then \ chmod +x $(SRC_DIR)/install-sh; \ fi - @echo "Installing private header files"; - @for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ - $(GENERIC_DIR)/tkIntPlatDecls.h \ - $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS); \ + @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/"; + @for i in $(PRIVATE_HDRS); \ do \ - $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \ + $(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ done; @sed -e 's#\.\./unix/##' $(GENERIC_DIR)/tkPort.h > tkPort.h; \ - $(INSTALL_DATA) tkPort.h $(PRIVATE_INCLUDE_INSTALL_DIR); \ + $(INSTALL_DATA) tkPort.h "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ rm -f tkPort.h Makefile: $(UNIX_DIR)/Makefile.in @@ -805,7 +827,7 @@ Makefile: $(UNIX_DIR)/Makefile.in clean: rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ - errors wish tktest lib.exp Tk *.rsrc + errors ${WISH_EXE} tktest lib.exp Tk *.rsrc distclean: clean rm -rf Makefile config.status config.cache config.log tkConfig.sh \ @@ -822,7 +844,7 @@ depend: # execute concurrently with the renaming and recompiling of that same object # file in the target below. -tkTestInit.o: $(UNIX_DIR)/tkAppInit.c wish +tkTestInit.o: $(UNIX_DIR)/tkAppInit.c ${WISH_EXE} @if test -f tkAppInit.o ; then \ rm -f tkAppInit.sav; \ mv tkAppInit.o tkAppInit.sav; \ @@ -1169,7 +1191,7 @@ tkMacOSXHLEvents.o: $(MAC_OSX_DIR)/tkMacOSXHLEvents.c $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXHLEvents.c tkMacOSXInit.o: $(MAC_OSX_DIR)/tkMacOSXInit.c $(GENERIC_DIR)/tkInitScript.h tkConfig.sh - $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \ + $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \ $(MAC_OSX_DIR)/tkMacOSXInit.c tkMacOSXKeyboard.o: $(MAC_OSX_DIR)/tkMacOSXKeyboard.c @@ -1298,13 +1320,13 @@ checkexports: $(TK_LIB_FILE) # system. # -rpm: all /bin/rpm +rpm: all rm -f THIS.TCL.SPEC echo "%define _builddir `pwd`" > THIS.TK.SPEC echo "%define _rpmdir `pwd`/RPMS" >> THIS.TK.SPEC cat tk.spec >> THIS.TK.SPEC mkdir -p RPMS/i386 - rpm -bb THIS.TK.SPEC + rpmbuild -bb THIS.TK.SPEC mv RPMS/i386/*.rpm . rm -rf RPMS THIS.TK.SPEC @@ -1340,7 +1362,7 @@ dist: fi; \ done;) mkdir $(DISTDIR)/generic - cp -p $(GENERIC_DIR)/*.c $(GENERIC_DIR)/*.h $(GENERIC_DIR)/prolog.ps \ + cp -p $(GENERIC_DIR)/*.[ch] $(GENERIC_DIR)/prolog.ps \ $(DISTDIR)/generic cp -p $(GENERIC_DIR)/*.decls $(DISTDIR)/generic cp -p $(GENERIC_DIR)/README $(DISTDIR)/generic @@ -1354,8 +1376,7 @@ dist: $(TOP_DIR)/win/tkConfig.sh.in \ $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \ $(DISTDIR)/win - cp -p $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.h $(DISTDIR)/win - cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win + cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.bat $(DISTDIR)/win $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/*.bat cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/makefile.* @@ -1366,9 +1387,7 @@ dist: cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win mkdir $(DISTDIR)/win/rc cp -p $(TOP_DIR)/win/wish.exe.manifest.in $(DISTDIR)/win/ - cp -p $(TOP_DIR)/win/rc/*.rc $(TOP_DIR)/win/rc/*.cur \ - $(TOP_DIR)/win/rc/*.ico $(TOP_DIR)/win/rc/*.bmp \ - $(DISTDIR)/win/rc + cp -p $(TOP_DIR)/win/rc/*.{rc,cur,ico,bmp} $(DISTDIR)/win/rc $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/*.rc $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/wish.exe.manifest.in mkdir $(DISTDIR)/mac @@ -1393,7 +1412,7 @@ dist: $(TCLDIR)/compat/stdlib.h $(TCLDIR)/compat/limits.h \ $(DISTDIR)/compat mkdir $(DISTDIR)/xlib - cp -p $(XLIB_DIR)/*.h $(XLIB_DIR)/*.c $(DISTDIR)/xlib + cp -p $(XLIB_DIR)/*.[ch] $(DISTDIR)/xlib cp -p $(TOP_DIR)/license.terms $(DISTDIR)/xlib mkdir $(DISTDIR)/xlib/X11 cp -p $(XLIB_DIR)/X11/*.h $(DISTDIR)/xlib/X11 @@ -1436,14 +1455,9 @@ dist: cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \ $(TCLDIR)/doc/man.macros $(DISTDIR)/doc mkdir $(DISTDIR)/tests - cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/tests/*.test \ - $(TOP_DIR)/tests/*.tcl $(TOP_DIR)/tests/README \ - $(TOP_DIR)/tests/option.file* $(DISTDIR)/tests - -# -# The following target can only be used for non-patch releases. Use -# the "allpatch" target below for patch releases. -# + cp -p $(TOP_DIR)/license.terms $(TEST_DIR)/*.{test,tcl} \ + $(TEST_DIR)/README \ + $(TEST_DIR)/option.file* $(DISTDIR)/tests alldist: dist rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME) @@ -1451,23 +1465,6 @@ alldist: dist gzip -9 $(DISTNAME)-src.tar; zip -qr8 $(ZIPNAME) $(DISTNAME) # -# The target below is similar to "alldist" except it works for patch -# releases. It is needed because patch releases are peculiar: the -# patch designation appears in the name of the compressed file -# (e.g. tk8.0p1.tar.gz) but the extracted source directory doesn't -# include the patch designation (e.g. tk8.0). -# - -allpatch: dist - rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME) - mv $(DISTROOT)/tk${VERSION} $(DISTROOT)/old - mv $(DISTROOT)/$(DISTNAME) $(DISTROOT)/tk${VERSION} - cd $(DISTROOT); tar cf $(DISTNAME)-src.tar tk${VERSION}; \ - gzip -9 $(DISTNAME)-src.tar; zip -r8 $(ZIPNAME) tk${VERSION} - mv $(DISTROOT)/tk${VERSION} $(DISTROOT)/$(DISTNAME) - mv $(DISTROOT)/old $(DISTROOT)/tk${VERSION} - -# # This target creates the HTML folder for Tcl & Tk and places it # in DISTDIR/html. It uses the tcltk-man2html.tcl tool from # the Tcl group's tool workspace. It depends on the Tcl & Tk being @@ -1487,11 +1484,9 @@ html-tk: BUILD_HTML = \ @if test -f "$(BUILD_TCLSH)"; then \ - @LD_LIBRARY_PATH_VAR@=$(TCL_BIN_DIR):$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ - TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ - TCLSH="$(BUILD_TCLSH)"; else \ + $(SHELL_ENV) TCLSH="$(BUILD_TCLSH)"; else \ TCLSH="$(TCL_EXE)"; fi ;\ - $${TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \ + "$${TCLSH}" $(TOOL_DIR)/tcltk-man2html.tcl --htmldir="$(HTML_INSTALL_DIR)" \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) # @@ -1591,4 +1586,17 @@ package-generate: pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE) rm -rf $(PACKAGE) +# +# The list of all the targets that do not correspond to real files. This stops +# 'make' from getting confused when someone makes an error in a rule. +# + +.PHONY: all binaries libraries objs doc html html-tcl html-tk test runtest +.PHONY: install install-strip install-binaries install-libraries +.PHONY: install-headers install-private-headers install-doc +.PHONY: clean distclean depend genstubs checkstubs checkexports checkuchar +.PHONY: shell gdb valgrind valgrindshell dist alldist rpm +.PHONY: tkLibObjs tktest-real test-classic test-ttk testlang +.PHONY: demo install-demos + # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 6e03287..c4053b9 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -138,7 +138,7 @@ # define WPARAM void * # define LPARAM void * # define LRESULT void * -#endif /* This really should be an #else, as soon as the Xlib stubs are enabled for Cygwin. */ +#else /* !__CYGWIN__ */ /* * The TkPutImage macro strips off the color table information, which isn't * needed for X. @@ -148,25 +148,23 @@ XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ desty, width, height); -/* #endif */ - -/* - * These macros are just wrappers for the equivalent X Region calls. - */ + /* + * These macros are just wrappers for the equivalent X Region calls. + */ -#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 */ +# 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__ */ /* * Supply macros for seek offsets, if they're not already provided by diff --git a/win/Makefile.in b/win/Makefile.in index 714b0e9..6e48f01 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -92,6 +92,11 @@ TCL_BIN_DIR = @TCL_BIN_DIR@ # for this version of Tk ("srcdir" will be replaced or has already # been replaced by the configure script): TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic + +# The directory containing the platform specific Tcl sources and headers +# appropriate for this version of Tk: +TCL_PLATFORM_DIR = @TCL_SRC_DIR@/win + TCL_TOOL_DIR = @TCL_SRC_DIR@/tools # Converts a POSIX path to a Windows native path. @@ -117,6 +122,7 @@ BITMAP_DIR_NATIVE = $(ROOT_DIR_NATIVE)/bitmaps XLIB_DIR_NATIVE = $(ROOT_DIR_NATIVE)/xlib RC_DIR_NATIVE = $(WIN_DIR_NATIVE)/rc TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)' | sed 's!\\!/!g') +TCL_PLATFORM_NATIVE = $(shell $(CYGPATH) '$(TCL_PLATFORM_DIR)' | sed 's!\\!/!g') TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)' | sed 's!\\!/!g') DLLSUFFIX = @DLLSUFFIX@ @@ -203,7 +209,7 @@ TCL_EXE = @TCLSH_PROG@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ - -I"${TCL_GENERIC_NATIVE}" ${AC_FLAGS} +-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS} CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ @@ -349,6 +355,11 @@ CORE_DOCS = $(TCL_DOCS) $(TK_DOCS) DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget +SHELL_ENV = \ + @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ + TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ + PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; + # Main targets. The default target -- all -- builds the binaries, # performs any post processing on libraries or documents. @@ -376,26 +387,22 @@ $(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c # args to tcltest, ie: # % make test TESTFLAGS="-verbose bps -file fileName.test" -test: binaries $(TKTEST) - @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ - PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \ - ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \ - | ./$(CAT32) +test: test-classic + +test-classic: binaries $(TKTEST) + $(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" \ + $(TESTFLAGS) | ./$(CAT32) runtest: binaries $(TKTEST) - @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ - PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \ - ./$(TKTEST) $(TESTFLAGS) $(SCRIPT) + $(SHELL_ENV) ./$(TKTEST) $(TESTFLAGS) $(SCRIPT) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=foo.tcl` shell: binaries - @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ - PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \ - ./$(WISH) $(SCRIPT) + $(SHELL_ENV) ./$(WISH) $(SCRIPT) + +demo: $(WISH) + $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight gdb: binaries @@ -539,8 +546,7 @@ install-private-headers: libraries @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/"; @for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ $(GENERIC_DIR)/tkIntPlatDecls.h $(GENERIC_DIR)/tkPort.h \ - $(WIN_DIR)/tkWinPort.h $(WIN_DIR)/tkWinInt.h \ - $(WIN_DIR)/tkWin.h; \ + $(WIN_DIR)/tkWinPort.h $(WIN_DIR)/tkWinInt.h $(WIN_DIR)/tkWin.h; \ do \ $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \ done; @@ -562,7 +568,7 @@ $(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32) $(TCL_SRC_DIR)/win/cat.c: cat32.${OBJEXT}: $(TCL_SRC_DIR)/win/cat.c - $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) + $(CC) -c $(CC_SWITCHES) "$(TCL_SRC_DIR)/win/cat.c" $(CC_OBJNAME) $(CAT32): cat32.${OBJEXT} $(CC) $(CFLAGS) cat32.$(OBJEXT) $(CC_EXENAME) $(LIBS) $(LDFLAGS_CONSOLE) @@ -602,6 +608,11 @@ tkWinTest.$(OBJEXT): tkWinTest.c tkSquare.$(OBJEXT): tkSquare.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) +# Extra dependency info +tkConsole.$(OBJEXT): configure Makefile +tkMain.$(OBJEXT): configure Makefile +tkWindow.$(OBJEXT): configure Makefile + # Add the object extension to the implicit rules. By default .obj is not # automatically added. @@ -609,9 +620,9 @@ tkSquare.$(OBJEXT): tkSquare.c .SUFFIXES: .$(RES) .SUFFIXES: .rc -# Implicit rule for all object files that will end up in the Tcl library +# Implicit rule for all object files that will end up in the Tk library -.c.$(OBJEXT): +%.$(OBJEXT): %.c $(CC) -c $(STUB_CC_SWITCHES) -DBUILD_tk @DEPARG@ $(CC_OBJNAME) .rc.$(RES): diff --git a/win/stubs.c b/win/stubs.c index 60d2dc8..5977a2b 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -6,7 +6,7 @@ int _XInitImageFuncPtrs(XImage *image) { - return 0; + return Success; } /* @@ -55,8 +55,8 @@ XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char, 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; } @@ -137,7 +137,7 @@ XGetWindowAttributes(display, w, window_attributes_return) Window w; XWindowAttributes* window_attributes_return; { - return 0; + return Success; } Status @@ -156,7 +156,7 @@ XIconifyWindow(display, w, screen_number) Window w; int screen_number; { - return 0; + return Success; } XHostAddress * @@ -177,7 +177,7 @@ XLookupColor(display, colormap, color_name, exact_def_return, XColor* exact_def_return; XColor* screen_def_return; { - return 0; + return Success; } void @@ -213,7 +213,7 @@ XQueryTree(display, w, root_return, parent_return, children_return, Window** children_return; unsigned int* nchildren_return; { - return 0; + return Success; } void @@ -246,16 +246,17 @@ XSendEvent(display, w, propagate, event_mask, event_send) long event_mask; XEvent* event_send; { - return 0; + return Success; } -void +int XSetCommand(display, w, argv, argc) Display* display; Window w; char** argv; int argc; { + return Success; } XErrorHandler @@ -351,7 +352,7 @@ XWithdrawWindow(display, w, screen_number) Window w; int screen_number; { - return 0; + return Success; } int @@ -364,7 +365,7 @@ XmbLookupString(ic, event, buffer_return, bytes_buffer, keysym_return, KeySym* keysym_return; Status* status_return; { - return 0; + return Success; } int diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 19dcc11..38037c2 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -1,4 +1,4 @@ -/* +/* * tkWinClipboard.c -- * * This file contains functions for managing the clipboard. @@ -23,7 +23,7 @@ static void UpdateClipboard _ANSI_ARGS_((HWND hwnd)); * Retrieve the specified selection from another process. For * now, only fetching XA_STRING from CLIPBOARD is supported. * Eventually other types should be allowed. - * + * * Results: * The return value is a standard Tcl return value. * If an error occurs (such as no selection exists) @@ -98,10 +98,9 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData) Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "cp######", -1); data = GlobalLock(handle); - /* - * Even though the documentation claims that GetLocaleInfo + * Even though the documentation claims that GetLocaleInfo * expects an LCID, on Windows 9x it really seems to expect * a LanguageID. */ @@ -144,7 +143,7 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData) /* * Translate CR/LF to LF. */ - + data = destPtr = Tcl_DStringValue(&ds); while (*data) { if (data[0] == '\r' && data[1] == '\n') { @@ -163,7 +162,7 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData) Tcl_DStringFree(&ds); CloseClipboard(); return result; - + error: Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection), " selection doesn't exist or form \"", @@ -190,7 +189,7 @@ error: *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner(display, selection, owner, time) Display* display; Atom selection; @@ -218,6 +217,7 @@ XSetSelectionOwner(display, selection, owner, time) UpdateClipboard(hwnd); } } + return Success; } /* @@ -403,7 +403,7 @@ UpdateClipboard(hwnd) * TkSelEventProc -- * * This procedure is invoked whenever a selection-related - * event occurs. + * event occurs. * * Results: * None. diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 088c216..ffb4bd1 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -1,4 +1,4 @@ -/* +/* * tkWinColor.c -- * * Functions to map color names to system color values. @@ -67,7 +67,7 @@ static SystemColorEntry sysColors[] = { {NULL, 0} }; -typedef struct ThreadSpecificData { +typedef struct ThreadSpecificData { int ncolors; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -104,7 +104,7 @@ FindSystemColor(name, colorPtr, indexPtr) int *indexPtr; /* Out parameter to store color index. */ { int l, u, r, i; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -209,7 +209,7 @@ TkpGetColor(tkwin, name) XAllocColor(Tk_Display(tkwin), Tk_Colormap(tkwin), &winColPtr->info.color); - return (TkColor *) winColPtr; + return (TkColor *) winColPtr; } return (TkColor *) NULL; } @@ -308,7 +308,7 @@ TkWinIndexOfColor(colorPtr) register WinColor *winColPtr = (WinColor *) colorPtr; if (winColPtr->info.magic == COLOR_MAGIC) { return winColPtr->index; - } + } return -1; } @@ -354,7 +354,7 @@ XAllocColor(display, colormap, color) /* * Find the nearest existing palette entry. */ - + newPixel = RGB(entry.peRed, entry.peGreen, entry.peBlue); index = GetNearestPaletteIndex(cmap->palette, newPixel); GetPaletteEntries(cmap->palette, index, 1, &closeEntry); @@ -370,7 +370,7 @@ XAllocColor(display, colormap, color) * those values and just put the new color in as if the colors * had not matched. */ - + if ((index >= cmap->size) || (newPixel != closePixel)) { if (cmap->size == sizePalette) { color->red = closeEntry.peRed * 257; @@ -397,11 +397,11 @@ XAllocColor(display, colormap, color) } Tcl_SetHashValue(entryPtr, (ClientData)refCount); } else { - + /* * Determine what color will actually be used on non-colormap systems. */ - + color->pixel = GetNearestColor(dc, RGB(entry.peRed, entry.peGreen, entry.peBlue)); color->red = GetRValue(color->pixel) * 257; @@ -430,7 +430,7 @@ XAllocColor(display, colormap, color) *---------------------------------------------------------------------- */ -void +int XFreeColors(display, colormap, pixels, npixels, planes) Display* display; Colormap colormap; @@ -449,7 +449,7 @@ XFreeColors(display, colormap, pixels, npixels, planes) /* * We don't have to do anything for non-palette devices. */ - + if (GetDeviceCaps(dc, RASTERCAPS) & RC_PALETTE) { /* @@ -485,6 +485,7 @@ XFreeColors(display, colormap, pixels, npixels, planes) } } ReleaseDC(NULL, dc); + return Success; } /* @@ -567,7 +568,7 @@ XCreateColormap(display, w, visual, alloc) *---------------------------------------------------------------------- */ -void +int XFreeColormap(display, colormap) Display* display; Colormap colormap; @@ -578,6 +579,7 @@ XFreeColormap(display, colormap) } Tcl_DeleteHashTable(&cmap->refCounts); ckfree((char *) cmap); + return Success; } /* diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index fea17d3..26d73e8 100755 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -1,4 +1,4 @@ -/* +/* * tkWinDraw.c -- * * This file contains the Xlib emulation functions pertaining to @@ -156,7 +156,7 @@ TkWinGetDrawableDC(display, d, state) if (twdPtr->type == TWD_WINDOW) { TkWindow *winPtr = twdPtr->window.winPtr; - + dc = GetDC(twdPtr->window.handle); if (winPtr == NULL) { cmap = DefaultColormap(display, DefaultScreen(display)); @@ -220,7 +220,7 @@ TkWinReleaseDrawableDC(d, dc, state) * Returns the converted array of POINTs. * * Side effects: - * Allocates a block of memory in thread local storage that + * Allocates a block of memory in thread local storage that * should not be freed. * *---------------------------------------------------------------------- @@ -233,7 +233,7 @@ ConvertPoints(points, npoints, mode, bbox) int mode; /* CoordModeOrigin or CoordModePrevious. */ RECT *bbox; /* Bounding box of points. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int i; @@ -256,7 +256,7 @@ ConvertPoints(points, npoints, mode, bbox) bbox->left = bbox->right = points[0].x; bbox->top = bbox->bottom = points[0].y; - + if (mode == CoordModeOrigin) { for (i = 0; i < npoints; i++) { tsdPtr->winPoints[i].x = points[i].x; @@ -505,7 +505,7 @@ XCopyPlane(display, src, dest, gc, src_x, src_y, width, height, dest_x, *---------------------------------------------------------------------- */ -void +int TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height) unsigned long *colors; /* Array of pixel values used by this @@ -515,7 +515,7 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, Drawable d; /* Destination drawable. */ GC gc; XImage* image; /* Source image. */ - int src_x, src_y; /* Offset of subimage. */ + int src_x, src_y; /* Offset of subimage. */ int dest_x, dest_y; /* Position of subimage origin in * drawable. */ unsigned int width, height; /* Dimensions of subimage. */ @@ -549,22 +549,22 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, } SetTextColor(dc, gc->foreground); SetBkColor(dc, gc->background); - } else { + } else { int i, usePalette; /* * Do not use a palette for TrueColor images. */ - + usePalette = (image->bits_per_pixel < 16); - + if (usePalette) { infoPtr = (BITMAPINFO*) ckalloc(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*ncolors); } else { infoPtr = (BITMAPINFO*) ckalloc(sizeof(BITMAPINFOHEADER)); } - + infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); infoPtr->bmiHeader.biWidth = image->width; infoPtr->bmiHeader.biHeight = -image->height; /* Top-down order */ @@ -595,13 +595,14 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, 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, width, height, dcMem, src_x, src_y, SRCCOPY); DeleteObject(SelectObject(dcMem, bitmap)); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -635,7 +636,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HBRUSH brush, oldBrush; if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -658,7 +659,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) /* * Select stipple pattern into destination dc. */ - + stipple = CreatePatternBrush(twdPtr->bitmap.handle); SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL); oldBrush = SelectObject(dc, stipple); @@ -690,7 +691,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) SelectObject(dcMem, oldBitmap); DeleteObject(bitmap); } - + DeleteDC(dcMem); SelectObject(dc, oldBrush); DeleteObject(stipple); @@ -708,7 +709,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HPEN newPen = CreatePen(PS_NULL, 0, gc->foreground); HPEN oldPen = SelectObject(dc, newPen); oldBrush = SelectObject(dc, brush); - + for (i = 0; i < nrectangles; i++) { Rectangle(dc, rectangles[i].x, rectangles[i].y, rectangles[i].x + rectangles[i].width + 1, @@ -722,7 +723,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); - return 1; + return Success; } /* @@ -756,7 +757,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) HPEN oldPen; HBRUSH oldBrush; POINT *winPoints = ConvertPoints(points, npoints, mode, &rect); - + if ((gc->fill_style == FillStippled || gc->fill_style == FillOpaqueStippled) && gc->stipple != None) { @@ -767,7 +768,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) HBITMAP oldBitmap; int i; HBRUSH oldMemBrush; - + if (twdPtr->type != TWD_BITMAP) { panic("unexpected drawable type in stipple"); } @@ -787,7 +788,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) /* * Select stipple pattern into destination dc. */ - + SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL); oldBrush = SelectObject(dc, CreatePatternBrush(twdPtr->bitmap.handle)); @@ -795,7 +796,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) * Create temporary drawing surface containing a copy of the * destination equal in size to the bounding box of the object. */ - + dcMem = CreateCompatibleDC(dc); oldBitmap = SelectObject(dcMem, CreateCompatibleBitmap(dc, width, height)); @@ -804,7 +805,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) /* * Translate the object for rendering in the temporary drawing - * surface. + * surface. */ for (i = 0; i < npoints; i++) { @@ -884,9 +885,9 @@ XDrawLines(display, d, gc, points, npoints, mode) HPEN pen; TkWinDCState state; HDC dc; - + if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -895,9 +896,9 @@ XDrawLines(display, d, gc, points, npoints, mode) SetBkMode(dc, TRANSPARENT); RenderObject(dc, gc, points, npoints, mode, pen, Polyline); DeleteObject(pen); - + TkWinReleaseDrawableDC(d, dc, &state); - return 1; + return Success; } /* @@ -1229,24 +1230,24 @@ SetUpGraphicsPort(gc) switch (gc->cap_style) { case CapNotLast: case CapButt: - style |= PS_ENDCAP_FLAT; + style |= PS_ENDCAP_FLAT; break; case CapRound: - style |= PS_ENDCAP_ROUND; + style |= PS_ENDCAP_ROUND; break; default: - style |= PS_ENDCAP_SQUARE; + style |= PS_ENDCAP_SQUARE; break; } switch (gc->join_style) { - case JoinMiter: - style |= PS_JOIN_MITER; + case JoinMiter: + style |= PS_JOIN_MITER; break; case JoinRound: - style |= PS_JOIN_ROUND; + style |= PS_JOIN_ROUND; break; default: - style |= PS_JOIN_BEVEL; + style |= PS_JOIN_BEVEL; break; } return ExtCreatePen(style, gc->line_width, &lb, 0, NULL); @@ -1350,7 +1351,7 @@ TkWinFillRect(dc, x, y, width, height, pixel) *---------------------------------------------------------------------- */ -void +void TkpDrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, drawable) Tk_Window tkwin; GC fgGC; diff --git a/win/tkWinKey.c b/win/tkWinKey.c index aa532bf..07bdaf6 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -94,7 +94,7 @@ TkpGetString(winPtr, eventPtr, dsPtr) } } else if (eventPtr->xkey.send_event == -2) { /* - * Special case for win2000 multi-lingal IME input. + * Special case for win2000 multi-lingal IME input. * xkey.trans_chars[] already contains a UNICODE char. */ @@ -119,12 +119,12 @@ TkpGetString(winPtr, eventPtr, dsPtr) } else { /* * This is an event generated from generic code. It has no - * nchars or trans_chars members. + * nchars or trans_chars members. */ keysym = KeycodeToKeysym(eventPtr->xkey.keycode, eventPtr->xkey.state, 0); - if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) + if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { char buf[TCL_UTF_MAX]; @@ -226,7 +226,7 @@ KeycodeToKeysym(keycode, state, noascii) if (state & Mod2Mask) keys[VK_MENU] = 0x80; - /* + /* * Make sure all lock button info is correct so we don't mess up the * lights */ @@ -260,7 +260,7 @@ KeycodeToKeysym(keycode, state, noascii) * Call ToAscii() again with proper parameters to restore it. */ - /* + /* * Get information about the old char */ @@ -557,7 +557,7 @@ TkpSetKeycodeAndState(tkwin, keySym, eventPtr) int i; SHORT result; int shift; - + eventPtr->xkey.keycode = 0; if (keySym == NoSymbol) { return; @@ -690,12 +690,13 @@ XGetModifierMapping(display) *---------------------------------------------------------------------- */ -void +int XFreeModifiermap(modmap) XModifierKeymap* modmap; { ckfree((char *) modmap->modifiermap); ckfree((char *) modmap); + return Success; } /* @@ -703,7 +704,7 @@ XFreeModifiermap(modmap) * * XStringToKeysym -- * - * Translate a keysym name to the matching keysym. + * Translate a keysym name to the matching keysym. * * Results: * Returns the keysym. Since this is already handled by diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 0d9ed61..42e6e49 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -1,4 +1,4 @@ -/* +/* * tkWinPointer.c -- * * Windows specific mouse tracking code. @@ -208,7 +208,7 @@ XUngrabKeyboard(display, time) * * MouseTimerProc -- * - * Check the current mouse position and look for enter/leave + * Check the current mouse position and look for enter/leave * events. * * Results: @@ -347,7 +347,7 @@ XQueryPointer(display, w, root_return, child_return, root_x_return, *---------------------------------------------------------------------- */ -void +int XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, dest_y) Display* display; @@ -363,7 +363,8 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, RECT r; GetWindowRect(Tk_GetHWND(dest_w), &r); - SetCursorPos(r.left+dest_x, r.top+dest_y); + SetCursorPos(r.left+dest_x, r.top+dest_y); + return Success; } /* @@ -469,7 +470,7 @@ TkpChangeFocus(winPtr, force) if (winPtr->window == None) { panic("ChangeXFocus got null X window"); } - + /* * Change the foreground window so the focus window is raised to the top of * the system stacking order and gets the keyboard focus. @@ -501,7 +502,7 @@ TkpChangeFocus(winPtr, force) * This function captures the mouse so that all future events * will be reported to this window, even if the mouse is outside * the window. If the specified window is NULL, then the mouse - * is released. + * is released. * * Results: * None. diff --git a/win/tkWinX.c b/win/tkWinX.c index cdbdc84..48fedea 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -1,7 +1,7 @@ -/* +/* * tkWinX.c -- * - * This file contains Windows emulation procedures for X routines. + * This file contains Windows emulation procedures for X routines. * * Copyright (c) 1995-1996 Sun Microsystems, Inc. * Copyright (c) 1994 Software Research Associates, Inc. @@ -317,7 +317,7 @@ TkWinXCleanup(clientData) /* * Clean up our own class. */ - + if (childClassInitialized) { childClassInitialized = 0; UnregisterClass(TK_WIN_CHILD_CLASS_NAME, hInstance); @@ -331,7 +331,7 @@ TkWinXCleanup(clientData) /* * And let the window manager clean up its own class(es). */ - + TkWinWmCleanup(hInstance); } @@ -340,12 +340,12 @@ TkWinXCleanup(clientData) * * TkWinGetPlatformId -- * - * Determines whether running under NT, 95, or Win32s, to allow + * Determines whether running under NT, 95, or Win32s, to allow * runtime conditional code. Win32s is no longer supported. * * Results: * The return value is one of: - * VER_PLATFORM_WIN32s Win32s on Windows 3.1. + * VER_PLATFORM_WIN32s Win32s on Windows 3.1. * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95. * VER_PLATFORM_WIN32_NT Win32 on Windows NT * @@ -364,10 +364,10 @@ TkWinGetPlatformId() os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&os); tkPlatformId = os.dwPlatformId; - - /* Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC. - * The TK_THEME_WIN_CLASSIC could be set even when running - * under XP if the windows classic theme was selected. */ + + /* Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC. + * The TK_THEME_WIN_CLASSIC could be set even when running + * under XP if the windows classic theme was selected. */ if ((os.dwPlatformId == VER_PLATFORM_WIN32_NT) && (os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) { HKEY hKey; @@ -568,11 +568,11 @@ TkpOpenDisplay(display_name) Screen *screen; TkWinDrawable *twdPtr; Display *display; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->winDisplay != NULL) { - if (strcmp(tsdPtr->winDisplay->display->display_name, display_name) + if (strcmp(tsdPtr->winDisplay->display->display_name, display_name) == 0) { return tsdPtr->winDisplay; } else { @@ -653,7 +653,7 @@ TkpCloseDisplay(dispPtr) { Display *display = dispPtr->display; HWND hwnd; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (dispPtr != tsdPtr->winDisplay) { @@ -664,7 +664,7 @@ TkpCloseDisplay(dispPtr) /* * Force the clipboard to be rendered if we are the clipboard owner. */ - + if (dispPtr->clipWindow) { hwnd = Tk_GetHWND(Tk_WindowId(dispPtr->clipWindow)); if (GetClipboardOwner() == hwnd) { @@ -759,12 +759,13 @@ TkClipCleanup(dispPtr) *---------------------------------------------------------------------- */ -void +int XBell(display, percent) Display* display; int percent; { MessageBeep(MB_OK); + return Success; } /* @@ -832,7 +833,7 @@ TkWinChildProc(hwnd, message, wParam, lParam) result = TkWinEmbeddedEventProc(hwnd, message, wParam, lParam); break; - case WM_UNICHAR: + case WM_UNICHAR: if (wParam == UNICODE_NOCHAR) { /* If wParam is UNICODE_NOCHAR and the application processes * this message, then return TRUE. */ @@ -981,7 +982,7 @@ GenerateXEvent(hwnd, message, wParam, lParam) { XEvent event; TkWindow *winPtr = (TkWindow *)Tk_HWNDToWindow(hwnd); - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!winPtr || winPtr->window == None) { @@ -1176,31 +1177,31 @@ GenerateXEvent(hwnd, message, wParam, lParam) * Synthesize both a KeyPress and a KeyRelease. * Strings generated by Input Method Editor are handled * in the following manner: - * 1. A series of WM_KEYDOWN & WM_KEYUP messages that + * 1. A series of WM_KEYDOWN & WM_KEYUP messages that * cause GetTranslatedKey() to be called and return - * immediately because the WM_KEYDOWNs have no - * associated WM_CHAR messages -- the IME window is - * accumulating the characters and translating them + * immediately because the WM_KEYDOWNs have no + * associated WM_CHAR messages -- the IME window is + * accumulating the characters and translating them * itself. In the "bind" command, you get an event - * with a mystery keysym and %A == "" for each + * with a mystery keysym and %A == "" for each * WM_KEYDOWN that actually was meant for the IME. * 2. A WM_KEYDOWN corresponding to the "confirm typing" - * character. This causes GetTranslatedKey() to be + * character. This causes GetTranslatedKey() to be * called. - * 3. A WM_IME_NOTIFY message saying that the IME is - * done. A side effect of this message is that + * 3. A WM_IME_NOTIFY message saying that the IME is + * done. A side effect of this message is that * GetTranslatedKey() thinks this means that there * are no WM_CHAR messages and returns immediately. * In the "bind" command, you get an another event * with a mystery keysym and %A == "". - * 4. A sequence of WM_CHAR messages that correspond to - * the characters in the IME window. A bunch of - * simulated KeyPress/KeyRelease events will be - * generated, one for each character. Adjacent + * 4. A sequence of WM_CHAR messages that correspond to + * the characters in the IME window. A bunch of + * simulated KeyPress/KeyRelease events will be + * generated, one for each character. Adjacent * WM_CHAR messages may actually specify the high * and low bytes of a multi-byte character -- in that * case the two WM_CHAR messages will be combined into - * one event. It is the event-consumer's + * one event. It is the event-consumer's * responsibility to convert the string returned from * XLookupString from system encoding to UTF-8. * 5. And finally we get the WM_KEYUP for the "confirm @@ -1256,7 +1257,7 @@ GenerateXEvent(hwnd, message, wParam, lParam) * * GetState -- * - * This function constructs a state mask for the mouse buttons + * This function constructs a state mask for the mouse buttons * and modifier keys as they were before the event occured. * * Results: @@ -1350,7 +1351,7 @@ GetTranslatedKey(xkey) XKeyEvent *xkey; { MSG msg; - + xkey->nbytes = 0; while ((xkey->nbytes < XMaxTransChars) @@ -1514,7 +1515,7 @@ TkWinGetUnicodeEncoding() * * This function correctly processes the composition data and * sends the UNICODE values of the composed characters to - * TK's event queue. + * TK's event queue. * * Results: * If this function has processed the composition data, returns 1. @@ -1763,7 +1764,7 @@ TkpGetMS() void TkWinUpdatingClipboard(int mode) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->updatingClipboard = mode; diff --git a/xlib/xdraw.c b/xlib/xdraw.c index 8ec924a..8523df7 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -1,4 +1,4 @@ -/* +/* * xdraw.c -- * * This file contains generic procedures related to X drawing @@ -17,7 +17,7 @@ * * XDrawLine -- * - * Draw a single line between two points in a given drawable. + * Draw a single line between two points in a given drawable. * * Results: * None. diff --git a/xlib/xgc.c b/xlib/xgc.c index 76828b1..a741b76 100644 --- a/xlib/xgc.c +++ b/xlib/xgc.c @@ -1,8 +1,8 @@ -/* +/* * xgc.c -- * * This file contains generic routines for manipulating X graphics - * contexts. + * contexts. * * Copyright (c) 1995-1996 Sun Microsystems, Inc. * Copyright (c) 2002-2007 Daniel A. Steffen @@ -49,7 +49,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; @@ -97,7 +97,7 @@ static void FreeClipMask(GC gc) { * Allocate a new GC, and initialize the specified fields. * * Results: - * Returns a newly allocated GC. + * Returns a newly allocated GC. * * Side effects: * None. @@ -133,7 +133,7 @@ XCreateGC(display, d, mask, values) BlackPixelOfScreen(DefaultScreenOfDisplay(display)); gp->background = (mask & GCBackground) ?values->background : WhitePixelOfScreen(DefaultScreenOfDisplay(display)); - gp->line_width = (mask & GCLineWidth) ?values->line_width :1; + gp->line_width = (mask & GCLineWidth) ?values->line_width :1; gp->line_style = (mask & GCLineStyle) ?values->line_style :LineSolid; gp->cap_style = (mask & GCCapStyle) ?values->cap_style :0; gp->join_style = (mask & GCJoinStyle) ?values->join_style :0; @@ -156,7 +156,7 @@ XCreateGC(display, d, mask, values) 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; } @@ -192,7 +192,7 @@ XChangeGC(d, gc, mask, values) if (mask & GCPlaneMask) { gc->plane_mask = values->plane_mask; } if (mask & GCForeground) { gc->foreground = values->foreground; } if (mask & GCBackground) { gc->background = values->background; } - if (mask & GCLineWidth) { gc->line_width = values->line_width; } + if (mask & GCLineWidth) { gc->line_width = values->line_width; } if (mask & GCLineStyle) { gc->line_style = values->line_style; } if (mask & GCCapStyle) { gc->cap_style = values->cap_style; } if (mask & GCJoinStyle) { gc->join_style = values->join_style; } @@ -256,7 +256,7 @@ void XFreeGC(d, gc) *---------------------------------------------------------------------- */ -void +void XSetForeground(display, gc, foreground) Display *display; GC gc; @@ -265,7 +265,7 @@ XSetForeground(display, gc, foreground) gc->foreground = foreground; } -void +void XSetBackground(display, gc, background) Display *display; GC gc; @@ -274,7 +274,7 @@ XSetBackground(display, gc, background) gc->background = background; } -void +int XSetDashes(display, gc, dash_offset, dash_list, n) Display* display; GC gc; @@ -296,6 +296,7 @@ XSetDashes(display, gc, dash_offset, dash_list, n) *p++ = *dash_list++; } *p = 0; + return Success; } void diff --git a/xlib/ximage.c b/xlib/ximage.c index de3bb1e..e7ac86c 100644 --- a/xlib/ximage.c +++ b/xlib/ximage.c @@ -1,4 +1,4 @@ -/* +/* * ximage.c -- * * X bitmap and image routines. diff --git a/xlib/xutil.c b/xlib/xutil.c index db9d35e..23b589c 100644 --- a/xlib/xutil.c +++ b/xlib/xutil.c @@ -1,4 +1,4 @@ -/* +/* * xutil.c -- * * This function contains generic X emulation routines. @@ -46,7 +46,7 @@ XInternAtom(display, atom_name, only_if_exists) Bool only_if_exists; { static Atom atom = XA_LAST_PREDEFINED; - + display->request++; return ++atom; } @@ -85,7 +85,7 @@ XGetVisualInfo(display, vinfo_mask, vinfo_template, nitems_return) info->red_mask = info->visual->red_mask; info->green_mask = info->visual->green_mask; info->blue_mask = info->visual->blue_mask; - + if (((vinfo_mask & VisualIDMask) && (vinfo_template->visualid != info->visualid)) || ((vinfo_mask & VisualScreenMask) -- cgit v0.12 From de76506f536b8af35a1cc81597de6c691e105248 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 5 Jun 2012 11:11:21 +0000 Subject: Generate same pkgIndex.tcl file for win32 and cygwin, one that is equally useable for both --- ChangeLog | 2 ++ generic/tkIntDecls.h | 2 +- generic/tkIntXlibDecls.h | 6 ++-- generic/tkStubInit.c | 2 +- unix/Makefile.in | 78 +++++++++++++++++++++++++----------------------- win/Makefile.in | 10 +++++-- 6 files changed, 54 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04b0140..0c45255 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * generic/tkInt.decls: Change XSetDashes signature and many others * generic/tkIntDecls.h: to match Xorg, needed for Cygwin. * generic/tkIntXlibDeclsDecls.h + * win/Makefile.in: Generate same pkgIndex.tcl file for win32 and + * unix/Makefile.in: cygwin, one that is equally useable for both. 2012-05-30 Jan Nijtmans diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index eb224c8..59e7e30 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -1854,7 +1854,7 @@ extern TkIntStubs *tkIntStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#if !defined(__WIN32__) && !defined(MAC_OSX_TK) +#if !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(MAC_OSX_TK) /* * These macros are just wrappers for the equivalent X Region calls. diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 0e59123..5f1b3ad 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -32,7 +32,7 @@ * Exported function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ #ifndef XSetDashes_TCL_DECLARED #define XSetDashes_TCL_DECLARED /* 0 */ @@ -1192,7 +1192,7 @@ typedef struct TkIntXlibStubs { int magic; struct TkIntXlibStubHooks *hooks; -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* 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 */ @@ -1411,7 +1411,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ #ifndef XSetDashes #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 342994a..42bb3f1 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -573,7 +573,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, NULL, -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ diff --git a/unix/Makefile.in b/unix/Makefile.in index 4e83c09..406eeac 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -208,6 +208,8 @@ BUILD_TCLSH = @BUILD_TCLSH@@EXEEXT@ # required just to do a normal build although it can be required to run # make dist. This variable is set to "" if no tclsh is available. TCL_EXE = @TCLSH_PROG@ +WISH_EXE = wish@EXEEXT@ +TKTEST_EXE = tktest@EXEEXT@ # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of @@ -563,7 +565,7 @@ SHELL_ENV = \ all: binaries libraries doc -binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish@EXEEXT@ +binaries: ${LIB_FILE} ${STUB_LIB_FILE} ${WISH_EXE} libraries: @@ -604,9 +606,9 @@ tkLibObjs: objs: ${OBJS} -wish@EXEEXT@: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ +${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ ${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish@EXEEXT@ + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE} # Resetting the LIB_RUNTIME_DIR below is required so that # the generated tktest executable gets the build directory @@ -614,12 +616,12 @@ wish@EXEEXT@: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ # picking up an already installed version of the Tcl or # Tk shared libraries. -tktest@EXEEXT@: $(TKTEST_OBJS) $(TK_LIB_FILE) +$(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest@EXEEXT@ + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE) # FIXME: This xttest rule seems to be broken in a number of ways. # It should use CC_SEARCH_FLAGS, it does not include the shared @@ -639,50 +641,50 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) test: test-classic test-ttk -test-classic: tktest@EXEEXT@ - $(SHELL_ENV) ./tktest@EXEEXT@ $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS) +test-classic: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS) -test-ttk: tktest@EXEEXT@ - $(SHELL_ENV) ./tktest@EXEEXT@ $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \ +test-ttk: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \ $(TESTFLAGS) # Tests with different languages -testlang: tktest@EXEEXT@ +testlang: $(TKTEST_EXE) $(SHELL_ENV) \ for lang in $(LOCALES) ; \ do \ LANG=$(lang); export LANG; \ - ./tktest@EXEEXT@ $(TEST_DIR)/all.tcl -geometry +0+0 \ + ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS); \ done # Useful target to launch a built tktest with the proper path,... -runtest: tktest@EXEEXT@ - $(SHELL_ENV) ./tktest@EXEEXT@ +runtest: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` -shell: wish@EXEEXT@ - $(SHELL_ENV) ./wish@EXEEXT@ $(SCRIPT) +shell: ${WISH_EXE} + $(SHELL_ENV) ./${WISH_EXE} $(SCRIPT) demo: - $(SHELL_ENV) ./wish@EXEEXT@ $(TOP_DIR)/library/demos/widget + $(SHELL_ENV) ./${WISH_EXE} $(TOP_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight -gdb: wish@EXEEXT@ +gdb: ${WISH_EXE} @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run - gdb ./wish@EXEEXT@ --command=gdb.run + gdb ./${WISH_EXE} --command=gdb.run rm gdb.run VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v -valgrind: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest@EXEEXT@ $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) +valgrind: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) -valgrindshell: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest@EXEEXT@ $(SCRIPT) +valgrindshell: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT) INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@ @@ -697,7 +699,7 @@ install-strip: # some ranlibs write to current directory, and this might not always be # possible (e.g. if installing as root). -install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) wish@EXEEXT@ +install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \ "$(PKG_INSTALL_DIR)" "$(CONFIG_INSTALL_DIR)" ; \ do \ @@ -731,10 +733,10 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) wish@EXEEXT@ @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" - @echo "Installing wish@EXEEXT@ as $(BIN_INSTALL_DIR)/wish$(VERSION)@EXEEXT@" - @$(INSTALL_PROGRAM) wish@EXEEXT@ "$(BIN_INSTALL_DIR)"/wish$(VERSION)@EXEEXT@ + @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)@EXEEXT@" + @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)@EXEEXT@" @echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/" - @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)"/tkConfig.sh + @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)/tkConfig.sh" @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ @@ -743,10 +745,10 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) wish@EXEEXT@ install-libraries: libraries @if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \ - XLIB_INCLUDE_INSTALL_DIR="$(INCLUDE_INSTALL_DIR)"/X11; fi; \ + XLIB_INCLUDE_INSTALL_DIR="$(INCLUDE_INSTALL_DIR)/X11"; fi; \ for i in "$(INCLUDE_INSTALL_DIR)" "$${XLIB_INCLUDE_INSTALL_DIR}" \ - "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"/images \ - "$(SCRIPT_INSTALL_DIR)"/msgs "$(SCRIPT_INSTALL_DIR)"/ttk; \ + "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)/images" \ + "$(SCRIPT_INSTALL_DIR)/msgs" "$(SCRIPT_INSTALL_DIR)/ttk"; \ do \ if [ -n "$$i" -a ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ @@ -765,7 +767,7 @@ install-libraries: libraries done; @list='$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)'; for i in $$list ; \ do \ - $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"/X11; \ + $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)/X11"; \ done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; @for i in $(TOP_DIR)/library/*.tcl \ @@ -784,19 +786,19 @@ install-libraries: libraries @for i in $(TOP_DIR)/library/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/images; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/images"; \ fi; \ done; @echo "Installing translation directory"; @for i in $(TOP_DIR)/library/msgs/*.msg; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/msgs; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/msgs"; \ fi; \ done; install-demos: - @for i in "$(DEMO_INSTALL_DIR)" "$(DEMO_INSTALL_DIR)"/images ; \ + @for i in "$(DEMO_INSTALL_DIR)" "$(DEMO_INSTALL_DIR)/images" ; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ @@ -816,16 +818,16 @@ install-demos: @for i in $(DEMOPROGS); \ do \ if test $$i = "square"; then \ - rm -f "$(DEMO_INSTALL_DIR)"/$$i; \ + rm -f "$(DEMO_INSTALL_DIR)/$$i"; \ else \ - chmod 755 "$(DEMO_INSTALL_DIR)"/$$i; \ + chmod 755 "$(DEMO_INSTALL_DIR)/$$i"; \ fi; \ done; @echo "Installing demo images"; @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)"/images; \ + $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)/images"; \ fi; \ done; @@ -884,7 +886,7 @@ Makefile: $(UNIX_DIR)/Makefile.in clean: rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ - errors wish@EXEEXT@ tktest@EXEEXT@ lib.exp Tk *.rsrc + errors ${WISH_EXE} $(TKTEST_EXE) lib.exp Tk *.rsrc distclean: clean rm -rf Makefile config.status config.cache config.log tkConfig.sh \ @@ -901,7 +903,7 @@ depend: # execute concurrently with the renaming and recompiling of that same object # file in the target below. -tkTestInit.o: $(UNIX_DIR)/tkAppInit.c wish@EXEEXT@ +tkTestInit.o: $(UNIX_DIR)/tkAppInit.c ${WISH_EXE} @if test -f tkAppInit.o ; then \ rm -f tkAppInit.sav; \ mv tkAppInit.o tkAppInit.sav; \ diff --git a/win/Makefile.in b/win/Makefile.in index 89b61cd..6bfa4ad 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -478,8 +478,12 @@ install-binaries: binaries @$(RM) $(PKG_INDEX); @(\ echo "if {[catch {package present Tcl 8.5.0}]} { return }";\ - echo "package ifneeded Tk $(VERSION)$(PATCH_LEVEL)\ - [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo "} else {";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ do \ @@ -669,7 +673,7 @@ tkWindow.$(OBJEXT): configure Makefile .SUFFIXES: .$(RES) .SUFFIXES: .rc -# Implicit rule for all object files that will end up in the Tcl library +# Implicit rule for all object files that will end up in the Tk library %.$(OBJEXT): %.c $(CC) -c $(STUB_CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME) -- cgit v0.12 From 30a0f07209b1340b0060d238a1ec0bd3365f5692 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Jun 2012 08:16:36 +0000 Subject: [Bug 3532186] pkgIndex.tcl file complexity --- ChangeLog | 5 +++++ unix/Makefile.in | 15 ++++++++------- win/Makefile.in | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c45255..d11c59d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-06-06 Jan Nijtmans + + * unix/Makefile.in: [Bug 3532186] pkgIndex.tcl file complexity + * win/Makefile.in: + 2012-06-02 Jan Nijtmans * generic/tkInt.decls: Change XSetDashes signature and many others diff --git a/unix/Makefile.in b/unix/Makefile.in index 406eeac..9d4646a 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -719,15 +719,16 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} (\ echo "if {[catch {package present Tcl 8.5.0}]} { return }";\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ - echo "if {[string match CYGWIN* \$$::tcl_platform(os)]} {";\ - echo " if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ - echo " } else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ - echo " }";\ + if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + else \ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ echo "}";\ + fi \ ) > "$(PKG_INDEX)"; \ fi @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" diff --git a/win/Makefile.in b/win/Makefile.in index 6bfa4ad..80c818c 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -606,7 +606,7 @@ $(WISH): $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(WISH_OBJS) wish.$(RES) wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW) @VC_MANIFEST_EMBED_EXE@ -tktest : $(TKTEST) +tktest: $(TKTEST) $(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32) $(CC) $(CFLAGS) $(TKTEST_OBJS) $(TCL_LIB_FILE) \ -- cgit v0.12 From 3aa2c84455d3f19dcc554b7d45caa624f3f53e60 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 Jun 2012 08:23:36 +0000 Subject: eliminate some warnings, caused by previous merge --- generic/tkIntPlatDecls.h | 2 ++ win/tkWinPointer.c | 1 + 2 files changed, 3 insertions(+) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 1e0a758..d0753f1 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -1191,6 +1191,8 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #endif #ifdef __WIN32__ +#undef TkpCmapStressed +#undef TkpSync #define TkpCmapStressed(tkwin,colormap) (0) #define TkpSync(display) #endif diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 7aec2b4..dcddb8f 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -360,6 +360,7 @@ XWarpPointer( GetWindowRect(Tk_GetHWND(dest_w), &r); SetCursorPos(r.left+dest_x, r.top+dest_y); + return Success; } /* -- cgit v0.12 From e05ce20958cb001bed972573c9e8b7bcc8d0904f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 Jun 2012 09:26:11 +0000 Subject: some more quoting issues --- unix/Makefile.in | 58 ++++++++++++++++++++++++++++---------------------------- win/Makefile.in | 10 +++++----- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 1e963d4..765bdc1 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -668,11 +668,11 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ echo "}";\ fi \ - ) > $(PKG_INDEX); \ + ) > "$(PKG_INDEX)"; \ fi @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ - @chmod 555 $(DLL_INSTALL_DIR)/$(LIB_FILE) + @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" @if test "$(TK_BUILD_EXP_FILE)" != ""; then \ echo "Installing $(TK_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \ $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \ @@ -708,66 +708,66 @@ install-libraries: libraries @echo "Installing header files"; @for i in $(PUBLIC_HDRS); \ do \ - $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ + $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \ done; @list='$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)'; for i in $$list ; \ do \ - $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR)/X11; \ + $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)/X11"; \ done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; @for i in $(TOP_DIR)/library/*.tcl $(GENERIC_DIR)/prolog.ps \ $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \ do \ - $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done; @echo "Installing library images directory"; @for i in $(TOP_DIR)/library/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/images; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/images"; \ fi; \ done; @echo "Installing translation directory"; @for i in $(TOP_DIR)/library/msgs/*.msg; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/msgs; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/msgs"; \ fi; \ done; install-demos: - @for i in $(SCRIPT_INSTALL_DIR) \ - $(SCRIPT_INSTALL_DIR)/demos \ - $(SCRIPT_INSTALL_DIR)/demos/images ; \ + @for i in "$(SCRIPT_INSTALL_DIR)" \ + "$(DEMO_INSTALL_DIR)" \ + "$(DEMO_INSTALL_DIR)/images" ; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; - @echo "Installing demos to $(SCRIPT_INSTALL_DIR)/demos/"; + @echo "Installing demos to $(DEMO_INSTALL_DIR)/"; @for i in $(TOP_DIR)/library/demos/*; \ do \ if [ -f $$i ] ; then \ sed -e '3 s|exec wish|exec wish$(VERSION)|' \ - $$i > $(SCRIPT_INSTALL_DIR)/demos/`basename $$i`; \ + $$i > "$(DEMO_INSTALL_DIR)"/`basename $$i`; \ fi; \ done; @for i in $(DEMOPROGS); \ do \ if test $$i = "square"; then \ - rm -f $(SCRIPT_INSTALL_DIR)/demos/$$i; \ + rm -f "$(DEMO_INSTALL_DIR)/$$i"; \ else \ - chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \ + chmod 755 "$(DEMO_INSTALL_DIR)/$$i"; \ fi; \ done; @echo "Installing demo images"; @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/demos/images; \ + $(INSTALL_DATA) $$i $(DEMO_INSTALL_DIR)/images; \ fi; \ done; @@ -775,33 +775,33 @@ install-doc: @if test ! -x $(UNIX_DIR)/installManPage; then \ chmod +x $(UNIX_DIR)/installManPage; \ fi - @for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \ + @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)" ; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @echo "Installing and cross-linking top-level (.1) docs"; @for i in $(TOP_DIR)/doc/*.1; do \ - $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN1_INSTALL_DIR); \ + $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN1_INSTALL_DIR)"; \ done @echo "Installing and cross-linking C API (.3) docs"; @for i in $(TOP_DIR)/doc/*.3; do \ - $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN3_INSTALL_DIR); \ + $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN3_INSTALL_DIR)"; \ done @echo "Installing and cross-linking command (.n) docs"; @for i in $(TOP_DIR)/doc/*.n; do \ - $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MANN_INSTALL_DIR); \ + $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MANN_INSTALL_DIR)"; \ done # Optional target to install private headers install-private-headers: libraries - @for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \ + @for i in "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ @@ -813,7 +813,7 @@ install-private-headers: libraries @if test ! -x $(SRC_DIR)/install-sh; then \ chmod +x $(SRC_DIR)/install-sh; \ fi - @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/"; + @echo "Installing private header files"; @for i in $(PRIVATE_HDRS); \ do \ $(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ @@ -827,11 +827,11 @@ Makefile: $(UNIX_DIR)/Makefile.in clean: rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ - errors ${WISH_EXE} tktest lib.exp Tk *.rsrc + errors ${WISH_EXE} $(TKTEST_EXE) lib.exp Tk *.rsrc distclean: clean rm -rf Makefile config.status config.cache config.log tkConfig.sh \ - $(PACKAGE).* prototype *.plist Tk.framework + $(PACKAGE).* prototype tkConfig.h *.plist Tk.framework depend: makedepend -- $(DEPEND_SWITCHES) -- $(SRCS) diff --git a/win/Makefile.in b/win/Makefile.in index 6e48f01..fad8a8d 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -349,8 +349,8 @@ STUB_OBJS = \ tkStubLib.$(OBJEXT) \ tkStubImg.$(OBJEXT) -TCL_DOCS = "$(TCL_SRC_DIR_NATIVE)"/doc/*.[13n] -TK_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n] +TCL_DOCS = "$(TCL_SRC_DIR_NATIVE)/doc/*.[13n]" +TK_DOCS = "$(ROOT_DIR_NATIVE)/doc/*.[13n]" CORE_DOCS = $(TCL_DOCS) $(TK_DOCS) DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget @@ -376,12 +376,12 @@ doc: $(ROOT_DIR)/doc/man.macros winhelp: $(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl $(MAN2TCL) $(TCL_EXE) "$(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl" tcl "$(VER)" $(CORE_DOCS) - $(COPY) "$(TCL_BIN_DIR)"/tcl.hpj ./ + $(COPY) "$(TCL_BIN_DIR)/tcl.hpj" ./ hcw /c /e tcl.hpj - $(COPY) ./tcl$(VER).cnt ./TCL$(VER).HLP "$(TCL_SRC_DIR_NATIVE)"/tools/ + $(COPY) ./tcl$(VER).cnt ./TCL$(VER).HLP "$(TCL_SRC_DIR_NATIVE)/tools/" $(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c - $(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(TCL_SRC_DIR_NATIVE)"/tools/man2tcl.c + $(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c" # Specifying TESTFLAGS on the command line is the standard way to pass # args to tcltest, ie: -- cgit v0.12 From 38172ef34fbe08d6cfd4eb8e4ed8d1fa21d69c8f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jun 2012 20:45:42 +0000 Subject: OXS Tiger Breakage --- generic/tkInt.decls | 2 +- generic/tkIntXlibDecls.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 091bb50..6f5ff57 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1718,7 +1718,7 @@ declare 80 {mac aqua} { XSegment *segments, int nsegments) } declare 81 {mac aqua} { - int XForceScreenSaver(Display *display, int mode) + void XForceScreenSaver(Display *display, int mode) } declare 82 {mac aqua} { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index fb3153d..30470ab 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -618,7 +618,7 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 81 */ -EXTERN int XForceScreenSaver _ANSI_ARGS_((Display *display, +EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, @@ -908,7 +908,7 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 81 */ -EXTERN int XForceScreenSaver _ANSI_ARGS_((Display *display, +EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, @@ -1142,7 +1142,7 @@ typedef struct TkIntXlibStubs { void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 78 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ - int (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ + void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ @@ -1235,7 +1235,7 @@ typedef struct TkIntXlibStubs { void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 78 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ - int (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ + void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ -- cgit v0.12 From fdeacfff80a809cc26b4720c429274a5ed6331b4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jun 2012 20:53:38 +0000 Subject: Implement TkCygwinMainEx for loading Cygwin's Tk_MainEx from the Tk dll --- ChangeLog | 5 ++ generic/tkMain.c | 35 +++++++------ generic/tkWindow.c | 147 ++++++++++++++++++++++++++++++++++++++--------------- unix/Makefile.in | 27 +++++----- 4 files changed, 145 insertions(+), 69 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2d7e85..b119d67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-06-08 Jan Nijtmans + + * generic/tkMain.c: Implement TkCygwinMainEx for loading + * generic/tkWindow.c: Cygwin's Tk_MainEx from the Tk dll. + 2012-06-07 Jan Nijtmans * generic/tkInt.decls: Change XChangeWindowAttributes signature and diff --git a/generic/tkMain.c b/generic/tkMain.c index f400c05..6b9a393 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -1,4 +1,4 @@ -/* +/* * tkMain.c -- * * This file contains a generic main program for Tk-based applications. @@ -41,7 +41,7 @@ typedef struct ThreadSpecificData { * into Tcl commands. */ Tcl_DString line; /* Used to read the next line from the * terminal input. */ - int tty; /* Non-zero means standard input is a + int tty; /* Non-zero means standard input is a * terminal-like device. Zero means it's * a file. */ } ThreadSpecificData; @@ -155,15 +155,20 @@ Tk_MainEx(argc, argv, appInitProc, interp) abort(); } -#if defined(__WIN32__) && !defined(STATIC_BUILD) +#if defined(__WIN32__) && !defined(__WIN64__) && !defined(STATIC_BUILD) + extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); + if (tclStubsPtr->reserved9) { /* We are running win32 Tk under Cygwin, so let's check * whether the env("DISPLAY") variable or the -display * argument is set. If so, we really want to run the - * Tk_MainEx function of libtk.dll, not this one. */ - if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { + * Tk_MainEx function of libtk8.?.dll, not this one. */ + if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { loadCygwinTk: - Tcl_Panic("Should load libtk.dll now, not yet implemented"); + if (TkCygwinMainEx(argc, argv, appInitProc, interp)) { + /* Should never reach here. */ + return; + } } else { int i; @@ -176,9 +181,9 @@ Tk_MainEx(argc, argv, appInitProc, interp) } #endif - tsdPtr = (ThreadSpecificData *) + tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - + Tcl_FindExecutable(argv[0]); tsdPtr->interp = interp; Tcl_Preserve((ClientData) interp); @@ -197,7 +202,7 @@ Tk_MainEx(argc, argv, appInitProc, interp) TkMacOSXDefaultStartupScript(); } #endif - + #ifdef TCL_MEM_DEBUG Tcl_InitMemory(interp); #endif @@ -223,7 +228,7 @@ Tk_MainEx(argc, argv, appInitProc, interp) argv++; } } - + /* * Make command-line arguments available in the Tcl variables "argc" * and "argv". @@ -264,7 +269,7 @@ Tk_MainEx(argc, argv, appInitProc, interp) * of length 0, (e.g. /dev/null, which is what Finder sets when double * clicking Wish) then use the GUI console. */ - + if (!tsdPtr->tty) { struct stat st; @@ -375,7 +380,7 @@ StdinProc(clientData, mask) char *cmd; int code, count; Tcl_Channel chan = (Tcl_Channel) clientData; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Interp *interp = tsdPtr->interp; @@ -389,7 +394,7 @@ StdinProc(clientData, mask) Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan); } return; - } + } } (void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue( @@ -412,7 +417,7 @@ StdinProc(clientData, mask) Tcl_CreateChannelHandler(chan, 0, StdinProc, (ClientData) chan); code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL); - + chan = Tcl_GetStdChannel(TCL_STDIN); if (chan) { Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, @@ -496,7 +501,7 @@ defaultPrompt: * is possible that someone has transferred stderr out of * this interpreter with "interp transfer". */ - + errChannel = Tcl_GetChannel(interp, "stderr", NULL); if (errChannel != (Tcl_Channel) NULL) { Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp)); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 21675d0..c442ef4 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -1,4 +1,4 @@ -/* +/* * tkWindow.c -- * * This file provides basic window-manipulation procedures, @@ -24,7 +24,7 @@ #include "tclInt.h" /* for Tcl_CreateNamespace() */ -/* +/* * Type used to keep track of Window objects that were * only partically deallocated by Tk_DestroyWindow. */ @@ -52,15 +52,15 @@ typedef struct ThreadSpecificData { /* First in list of partially deallocated * windows. */ TkDisplay *displayList; - /* List of all displays currently in use by + /* List of all displays currently in use by * the current thread. */ - int initialized; /* 0 means the structures above need + int initialized; /* 0 means the structures above need * initializing. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; -/* - * The Mutex below is used to lock access to the Tk_Uid structs above. +/* + * The Mutex below is used to lock access to the Tk_Uid structs above. */ TCL_DECLARE_MUTEX(windowMutex) @@ -222,7 +222,7 @@ static Tk_ArgvInfo argTable[] = { */ static Tk_Window CreateTopLevelWindow _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Window parent, CONST char *name, + Tk_Window parent, CONST char *name, CONST char *screenName, unsigned int flags)); static void DeleteWindowsExitProc _ANSI_ARGS_(( ClientData clientData)); @@ -335,7 +335,7 @@ CreateTopLevelWindow(interp, parent, name, screenName, flags) register TkWindow *winPtr; register TkDisplay *dispPtr; int screenId; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { @@ -382,9 +382,9 @@ CreateTopLevelWindow(interp, parent, name, screenName, flags) * Set the flags specified in the call. */ winPtr->flags |= flags; - + /* - * Force the window to use a border pixel instead of border pixmap. + * Force the window to use a border pixel instead of border pixmap. * This is needed for the case where the window doesn't use the * default visual. In this case, the default border is a pixmap * inherited from the root window, which won't work because it will @@ -447,7 +447,7 @@ GetScreen(interp, screenName, screenPtr) CONST char *p; int screenId; size_t length; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -523,7 +523,7 @@ GetScreen(interp, screenName, screenPtr) } if (screenId >= ScreenCount(dispPtr->display)) { char buf[32 + TCL_INTEGER_SPACE]; - + sprintf(buf, "bad screen number \"%d\"", screenId); Tcl_SetResult(interp, buf, TCL_VOLATILE); return (TkDisplay *) NULL; @@ -537,7 +537,7 @@ GetScreen(interp, screenName, screenPtr) * * TkGetDisplay -- * - * Given an X display, TkGetDisplay returns the TkDisplay + * Given an X display, TkGetDisplay returns the TkDisplay * structure for the display. * * Results: @@ -555,7 +555,7 @@ TkGetDisplay(display) Display *display; /* X's display pointer */ { TkDisplay *dispPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (dispPtr = tsdPtr->displayList; dispPtr != NULL; @@ -587,9 +587,9 @@ TkGetDisplay(display) TkDisplay * TkGetDisplayList() { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - + return tsdPtr->displayList; } @@ -614,9 +614,9 @@ TkGetDisplayList() TkMainInfo * TkGetMainInfoList() { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - + return tsdPtr->mainWindowList; } /* @@ -859,7 +859,7 @@ TkCreateMainWindow(interp, screenName, baseName) register TkWindow *winPtr; register CONST TkCmd *cmdPtr; ClientData clientData; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -880,7 +880,7 @@ TkCreateMainWindow(interp, screenName, baseName) if (tkwin == NULL) { return NULL; } - + /* * Create the TkMainInfo structure for this application, and set * up name-related information for the new window. @@ -1208,11 +1208,11 @@ Tk_CreateWindowFromPath(interp, tkwin, pathName, screenName) return NULL; } if (((TkWindow *) parent)->flags & TK_ALREADY_DEAD) { - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "can't create window: parent has been destroyed", (char *) NULL); return NULL; } else if (((TkWindow *) parent)->flags & TK_CONTAINER) { - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "can't create window: its parent has -container = yes", (char *) NULL); return NULL; @@ -1269,7 +1269,7 @@ Tk_DestroyWindow(tkwin) TkDisplay *dispPtr = winPtr->dispPtr; XEvent event; TkHalfdeadWindow *halfdeadPtr, *prev_halfdeadPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->flags & TK_ALREADY_DEAD) { @@ -1541,12 +1541,12 @@ Tk_DestroyWindow(tkwin) (void (*) _ANSI_ARGS_((ClientData))) NULL); } Tcl_CreateCommand(winPtr->mainPtr->interp, "send", - TkDeadAppCmd, (ClientData) NULL, + TkDeadAppCmd, (ClientData) NULL, (void (*) _ANSI_ARGS_((ClientData))) NULL); Tcl_UnlinkVar(winPtr->mainPtr->interp, "tk_strictMotif"); Tcl_UnlinkVar(winPtr->mainPtr->interp, "::tk::AlwaysShowSelection"); } - + Tcl_DeleteHashTable(&winPtr->mainPtr->nameTable); TkBindFree(winPtr->mainPtr); TkDeleteAllImages(winPtr->mainPtr); @@ -1555,14 +1555,14 @@ Tk_DestroyWindow(tkwin) TkStylePkgFree(winPtr->mainPtr); /* - * When embedding Tk into other applications, make sure + * When embedding Tk into other applications, make sure * that all destroy events reach the server. Otherwise * the embedding application may also attempt to destroy * the windows, resulting in an X error */ if (winPtr->flags & TK_EMBEDDED) { - XSync(winPtr->display, False); + XSync(winPtr->display, False); } ckfree((char *) winPtr->mainPtr); @@ -1586,13 +1586,13 @@ Tk_DestroyWindow(tkwin) * addressed before this can be enabled. The current cleanup * works except for send event issues. -- hobbs 04/2002 */ - + TkDisplay *theDispPtr, *backDispPtr; - + /* * Splice this display out of the list of displays. */ - + for (theDispPtr = tsdPtr->displayList, backDispPtr = NULL; (theDispPtr != winPtr->dispPtr) && (theDispPtr != NULL); @@ -2118,7 +2118,7 @@ Tk_DefineCursor(tkwin, cursor) #else winPtr->atts.cursor = (Cursor) cursor; #endif - + if (winPtr->window != None) { XDefineCursor(winPtr->display, winPtr->window, winPtr->atts.cursor); } else { @@ -2346,7 +2346,7 @@ Tk_NameToWindow(interp, pathName, tkwin) Tcl_AppendResult(interp, "NULL main window", (char *)NULL); return NULL; } - + hPtr = Tcl_FindHashEntry(&((TkWindow *) tkwin)->mainPtr->nameTable, pathName); if (hPtr == NULL) { @@ -2635,7 +2635,7 @@ Tk_MainWindow(interp) return NULL; } #endif - tsdPtr = (ThreadSpecificData *) + tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (mainPtr = tsdPtr->mainWindowList; mainPtr != NULL; @@ -2704,7 +2704,7 @@ Tk_GetNumMainWindows() } #endif - tsdPtr = (ThreadSpecificData *) + tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return tsdPtr->numMainWindows; @@ -2789,7 +2789,7 @@ DeleteWindowsExitProc(clientData) * Destroy any remaining main windows. */ - while (tsdPtr->mainWindowList != NULL) { + while (tsdPtr->mainWindowList != NULL) { interp = tsdPtr->mainWindowList->interp; Tcl_Preserve((ClientData) interp); Tk_DestroyWindow((Tk_Window) tsdPtr->mainWindowList->winPtr); @@ -2815,7 +2815,7 @@ DeleteWindowsExitProc(clientData) * if it needs to dispatch a message. */ - for (tsdPtr->displayList = NULL; dispPtr != NULL; + for (tsdPtr->displayList = NULL; dispPtr != NULL; dispPtr = nextPtr) { nextPtr = dispPtr->nextPtr; TkCloseDisplay(dispPtr); @@ -2827,6 +2827,51 @@ DeleteWindowsExitProc(clientData) tsdPtr->initialized = 0; } +#if defined(__WIN32__) && !defined(__WIN64__) + +static HMODULE tkcygwindll = NULL; + +/* + * Run Tk_MainEx from libtk8.?.dll + * + * This function is only ever called from wish8.4.exe, the cygwin + * port of Tcl. This means that the system encoding is utf-8, + * so we don't have to do any encoding conversions. + */ +int +TkCygwinMainEx(argc, argv, appInitProc, interp) + int argc; /* Number of arguments. */ + char **argv; /* Array of argument strings. */ + Tcl_AppInitProc *appInitProc; /* Application-specific initialization + * procedure to call after most + * initialization but before starting + * to execute commands. */ + Tcl_Interp *interp; +{ + char name[MAX_PATH]; + int len; + void (*sym)(int, char **, Tcl_AppInitProc *, Tcl_Interp *); + + /* construct "/libtk8.?.dll", from "/tk8?.dll" */ + len = GetModuleFileName(Tk_GetHINSTANCE(), name, MAX_PATH); + name[len-2] = '.'; + name[len-1] = name[len-5]; + strcpy(name+len, ".dll"); + memcpy(name+len-8, "libtk8", 6); + + tkcygwindll = LoadLibrary(name); + if (!tkcygwindll) { + /* dll is not present */ + return 0; + } + sym = (void (*)(int, char **, Tcl_AppInitProc *, Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_MainEx"); + if (!sym) { + return 0; + } + sym(argc, argv, appInitProc, interp); + return 1; +} +#endif /* *---------------------------------------------------------------------- * @@ -2855,6 +2900,16 @@ int Tk_Init(interp) Tcl_Interp *interp; /* Interpreter to initialize. */ { +#if defined(__WIN32__) && !defined(__WIN64__) + if (tkcygwindll) { + int (*sym)(Tcl_Interp *); + + sym = (int (*)(Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_Init"); + if (sym) { + return sym(interp); + } + } +#endif return Initialize(interp); } @@ -2917,6 +2972,16 @@ Tk_SafeInit(interp) * is checked at several places to differentiate the two initialisations. */ +#if defined(__WIN32__) && !defined(__WIN64__) + if (tkcygwindll) { + int (*sym)(Tcl_Interp *); + + sym = (int (*)(Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_SafeInit"); + if (sym) { + return sym(interp); + } + } +#endif return Initialize(interp); } @@ -2945,12 +3010,12 @@ Initialize(interp) { char *p; int argc, code; - CONST char **argv; + CONST char **argv; char *args[20]; CONST char *argString = NULL; Tcl_DString class; ThreadSpecificData *tsdPtr; - + /* * Ensure that we are getting the matching version of Tcl. This is * really only an issue when Tk is loaded dynamically. @@ -2965,7 +3030,7 @@ Initialize(interp) */ TkRegisterObjTypes(); - tsdPtr = (ThreadSpecificData *) + tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -3043,13 +3108,13 @@ Initialize(interp) * We don't. (no API to do it and maybe security reasons). */ Tcl_DStringFree(&ds); - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "not allowed to start Tk by master's safe::TkInit", (char *) NULL); goto done; } Tcl_DStringFree(&ds); - /* + /* * Use the master's result as argv. * Note: We don't use the Obj interfaces to avoid dealing with * cross interp refcounting and changing the code below. diff --git a/unix/Makefile.in b/unix/Makefile.in index 765bdc1..2aff5cc 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -212,6 +212,7 @@ BUILD_TCLSH = @BUILD_TCLSH@ # make dist. This variable is set to "" if no tclsh is available. TCL_EXE = @TCLSH_PROG@ WISH_EXE = wish +TKTEST_EXE = tktest # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of @@ -559,12 +560,12 @@ ${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ # picking up an already installed version of the Tcl or # Tk shared libraries. -tktest: $(TKTEST_OBJS) $(TK_LIB_FILE) +$(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE) # FIXME: This xttest rule seems to be broken in a number of ways. # It should use CC_SEARCH_FLAGS, it does not include the shared @@ -584,23 +585,23 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) test: test-classic -test-classic: tktest - $(SHELL_ENV) ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 \ +test-classic: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS) $(TCLTESTARGS) # Tests with different languages -testlang: tktest +testlang: $(TKTEST_EXE) $(SHELL_ENV) \ for lang in $(LOCALES) ; \ do \ LANG=$(lang); export LANG; \ - ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 \ + ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS) $(TCLTESTARGS); \ done # Useful target to launch a built tktest with the proper path,... -runtest: tktest - $(SHELL_ENV) ./tktest +runtest: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` @@ -620,11 +621,11 @@ gdb: ${WISH_EXE} VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v -valgrind: tktest - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) +valgrind: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) -valgrindshell: tktest - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest $(SCRIPT) +valgrindshell: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT) INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@ @@ -767,7 +768,7 @@ install-demos: @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i $(DEMO_INSTALL_DIR)/images; \ + $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)/images"; \ fi; \ done; -- cgit v0.12