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 4ee227410ecad38323de7b712664466afd06aab0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 9 May 2012 20:54:06 +0000 Subject: Change TkpWmSetState signature to match UNIX, needed for Cygwin Don't check for cygwin in win32 static build Some more useful #defines for Cygwin --- ChangeLog | 8 ++ generic/tkInt.decls | 2 +- generic/tkIntPlatDecls.h | 4 +- generic/tkWindow.c | 6 +- unix/tkUnixPort.h | 15 +++ win/tkWinWm.c | 289 ++++++++++++++++++++++++++--------------------- 6 files changed, 187 insertions(+), 137 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2823b44..38e1af5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-05-09 Jan Nijtmans + + * win/tkWinWm.c: Change TkpWmSetState signature to match UNIX, + * generic/tkInt.decls: needed for Cygwin. (not needed for Mac) + * generic/tkIntPlatDeclsDecls.h: + * generic/tkWindow.c: Don't check for cygwin in win32 static build. + * unix/tkUnixPort.h: Some more useful #defines for Cygwin + 2012-05-05 Jan Nijtmans * library/menu.tcl: [Bug 2768586]: Only do menu correction on Windows < Win7 diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 3453f88..3de82d7 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) 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/tkWindow.c b/generic/tkWindow.c index 98b89db..67db10c 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -852,7 +852,7 @@ TkCreateMainWindow(interp, screenName, baseName) Tk_Window tkwin; int dummy; int isSafe; -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(STATIC_BUILD) int isWin32 = 0; #endif Tcl_HashEntry *hPtr; @@ -862,7 +862,7 @@ TkCreateMainWindow(interp, screenName, baseName) ClientData clientData; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(STATIC_BUILD) Tcl_Obj *stringObjPtr = Tcl_GetVar2Ex(interp, "::tcl_platform", "platform", 0); if (stringObjPtr @@ -953,7 +953,7 @@ TkCreateMainWindow(interp, screenName, baseName) if (cmdPtr->objProc == NULL) { Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(STATIC_BUILD) if (!isWin32 && (cmdPtr->flags & WINMACONLY)) { continue; } diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 8445c82..f0affb8 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -150,6 +150,21 @@ XPutImage(display, pixels, gc, image, destx, desty, srcx, \ srcy, width, height); +#ifdef __CYGWIN__ +# define UINT unsigned int +# define HWND void * +# define HDC void * +# define HINSTANCE void * +# define COLORREF void * +# define HMENU void * +# define TkWinDCState void +# define HPALETTE void * +# define WNDPROC void * +# define WPARAM void * +# define LPARAM void * +# define LRESULT void * +#endif + /* * Supply macros for seek offsets, if they're not already provided by * an include file. diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 59287c8..ac4ea34 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -19,6 +19,7 @@ /* * These next two defines are only valid on Win2K/XP+. */ + #ifndef WS_EX_LAYERED #define WS_EX_LAYERED 0x00080000 #endif @@ -68,6 +69,7 @@ typedef struct ProtocolHandler { /* * Helper type passed via lParam to TkWmStackorderToplevelEnumProc */ + typedef struct TkWmStackorderToplevelPair { Tcl_HashTable *table; TkWindow **window_ptr; @@ -94,16 +96,19 @@ typedef struct { * items. We will reallocate these structures according to * how many images they need to contain. */ + typedef struct { int nNumImages; /* How many images? */ ICONIMAGE IconImages[1]; /* Image entries */ } BlockOfIconImages, *BlockOfIconImagesPtr; + /* * These two structures are used to read in icons from an * 'icon directory' (i.e. the contents of a .icr file, say). * We only use these structures temporarily, since we copy * the information we want into a BlockOfIconImages. */ + typedef struct { BYTE bWidth; /* Width of the image */ BYTE bHeight; /* Height of the image (times 2) */ @@ -114,6 +119,7 @@ typedef struct { DWORD dwBytesInRes; /* how many bytes in this resource? */ DWORD dwImageOffset; /* where in the file is this image */ } ICONDIRENTRY, *LPICONDIRENTRY; + typedef struct { WORD idReserved; /* Reserved */ WORD idType; /* resource type (1 for icons) */ @@ -137,6 +143,7 @@ typedef struct { * Icons loaded from .icr/.icr use the iconBlock field, icons * loaded from .exe/.dll use the hIcon field. */ + typedef struct WinIconInstance { int refCount; /* Number of instances that share this * data structure. */ @@ -258,7 +265,7 @@ typedef struct TkWmInfo { ProtocolHandler *protPtr; /* First in list of protocol handlers for * this window (NULL means none). */ int cmdArgc; /* Number of elements in cmdArgv below. */ - CONST char **cmdArgv; /* Array of strings to store in the + const char **cmdArgv; /* Array of strings to store in the * WM_COMMAND property. NULL means nothing * available. */ char *clientMachine; /* String to store in WM_CLIENT_MACHINE @@ -350,7 +357,7 @@ static void TopLevelReqProc(ClientData dummy, Tk_Window tkwin); static Tk_GeomMgr wmMgrType = { "wm", /* name */ TopLevelReqProc, /* requestProc */ - (Tk_GeomLostSlaveProc *) NULL, /* lostSlaveProc */ + (Tk_GeomLostSlaveProc *) NULL /* lostSlaveProc */ }; typedef struct ThreadSpecificData { @@ -383,7 +390,7 @@ static Tcl_ThreadDataKey dataKey; static int initialized; /* Flag indicating whether module has * been initialized. */ -/* +/* * A pointer to a shell proc which allows us to extract icons from * any file. We just initialize this when we start up (if we can) * and then it never changes @@ -450,9 +457,9 @@ static WinIconPtr GetIconFromPixmap _ANSI_ARGS_((Display *dsPtr, Pixmap pixmap)); static int ReadICOHeader _ANSI_ARGS_((Tcl_Channel channel)); static BOOL AdjustIconImagePointers _ANSI_ARGS_((LPICONIMAGE lpImage)); -static HICON MakeIconOrCursorFromResource +static HICON MakeIconOrCursorFromResource _ANSI_ARGS_((LPICONIMAGE lpIcon, BOOL isIcon)); -static HICON GetIcon _ANSI_ARGS_((WinIconPtr titlebaricon, +static HICON GetIcon _ANSI_ARGS_((WinIconPtr titlebaricon, int icon_size)); static int WinSetIcon _ANSI_ARGS_((Tcl_Interp *interp, WinIconPtr titlebaricon, Tk_Window tkw)); @@ -461,100 +468,100 @@ static void DecrIconRefCount _ANSI_ARGS_((WinIconPtr titlebaricon)); static int WmAspectCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmAttributesCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmClientCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmColormapwindowsCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmCommandCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmDeiconifyCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmFocusmodelCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmFrameCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmGeometryCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmGridCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmGroupCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconbitmapCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconifyCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconmaskCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconnameCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconphotoCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconpositionCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmIconwindowCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmMaxsizeCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmMinsizeCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmOverrideredirectCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmPositionfromCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmProtocolCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmResizableCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmSizefromCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmStackorderCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmStateCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmTitleCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmTransientCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static int WmWithdrawCmd _ANSI_ARGS_((Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); static void WmUpdateGeom _ANSI_ARGS_((WmInfo *wmPtr, TkWindow *winPtr)); /* Used in BytesPerLine */ #define WIDTHBYTES(bits) ((((bits) + 31)>>5)<<2) - + /* *---------------------------------------------------------------------- * @@ -573,7 +580,8 @@ static void WmUpdateGeom _ANSI_ARGS_((WmInfo *wmPtr, * *---------------------------------------------------------------------- */ -static WORD + +static WORD DIBNumColors( LPSTR lpbi ) { WORD wBitCount; @@ -612,7 +620,7 @@ DIBNumColors( LPSTR lpbi ) * *---------------------------------------------------------------------- */ -static WORD +static WORD PaletteSize( LPSTR lpbi ) { return ((WORD)( DIBNumColors( lpbi ) * sizeof( RGBQUAD )) ); @@ -635,7 +643,7 @@ PaletteSize( LPSTR lpbi ) * *---------------------------------------------------------------------- */ -static LPSTR +static LPSTR FindDIBBits( LPSTR lpbi ) { return ( lpbi + *(LPDWORD)lpbi + PaletteSize( lpbi ) ); @@ -658,7 +666,7 @@ FindDIBBits( LPSTR lpbi ) * *---------------------------------------------------------------------- */ -static DWORD +static DWORD BytesPerLine( LPBITMAPINFOHEADER lpBMIH ) { return WIDTHBYTES(lpBMIH->biWidth * lpBMIH->biPlanes * lpBMIH->biBitCount); @@ -681,7 +689,7 @@ BytesPerLine( LPBITMAPINFOHEADER lpBMIH ) * *---------------------------------------------------------------------- */ -static BOOL +static BOOL AdjustIconImagePointers( LPICONIMAGE lpImage ) { /* Sanity check */ @@ -691,13 +699,13 @@ AdjustIconImagePointers( LPICONIMAGE lpImage ) lpImage->lpbi = (LPBITMAPINFO)lpImage->lpBits; /* Width - simple enough */ lpImage->Width = lpImage->lpbi->bmiHeader.biWidth; - /* - * Icons are stored in funky format where height is doubled - * so account for that + /* + * Icons are stored in funky format where height is doubled + * so account for that */ lpImage->Height = (lpImage->lpbi->bmiHeader.biHeight)/2; /* How many colors? */ - lpImage->Colors = lpImage->lpbi->bmiHeader.biPlanes * + lpImage->Colors = lpImage->lpbi->bmiHeader.biPlanes * lpImage->lpbi->bmiHeader.biBitCount; /* XOR bits follow the header and color table */ lpImage->lpXOR = (LPBYTE)FindDIBBits(((LPSTR)lpImage->lpbi)); @@ -723,7 +731,8 @@ AdjustIconImagePointers( LPICONIMAGE lpImage ) * *---------------------------------------------------------------------- */ -static HICON + +static HICON MakeIconOrCursorFromResource(LPICONIMAGE lpIcon, BOOL isIcon) { HICON hIcon ; static FARPROC pfnCreateIconFromResourceEx=NULL; @@ -734,10 +743,10 @@ MakeIconOrCursorFromResource(LPICONIMAGE lpIcon, BOOL isIcon) { if (lpIcon->lpBits == NULL) return NULL; if (!initinfo) { - HMODULE hMod = GetModuleHandleA("USER32.DLL"); + HMODULE hMod = GetModuleHandle("USER32.DLL"); initinfo=1; if (hMod){ - pfnCreateIconFromResourceEx = + pfnCreateIconFromResourceEx = GetProcAddress(hMod, "CreateIconFromResourceEx"); } } @@ -754,7 +763,7 @@ MakeIconOrCursorFromResource(LPICONIMAGE lpIcon, BOOL isIcon) { if (hIcon == NULL) { /* We would break on NT if we try with a 16bpp image */ if (lpIcon->lpbi->bmiHeader.biBitCount != 16) { - hIcon = CreateIconFromResource(lpIcon->lpBits, lpIcon->dwNumBytes, + hIcon = CreateIconFromResource(lpIcon->lpBits, lpIcon->dwNumBytes, isIcon, 0x00030000); } } @@ -778,7 +787,7 @@ MakeIconOrCursorFromResource(LPICONIMAGE lpIcon, BOOL isIcon) { * *---------------------------------------------------------------------- */ -static int +static int ReadICOHeader( Tcl_Channel channel ) { WORD Input; @@ -824,10 +833,11 @@ ReadICOHeader( Tcl_Channel channel ) * *---------------------------------------------------------------------- */ -static int + +static int InitWindowClass(WinIconPtr titlebaricon) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (! tsdPtr->initialized) { @@ -843,17 +853,17 @@ InitWindowClass(WinIconPtr titlebaricon) initialized = 1; if (shgetfileinfoProc == NULL) { - HINSTANCE hInstance = LoadLibraryA("shell32"); + HINSTANCE hInstance = LoadLibrary("shell32"); if (hInstance != NULL) { - shgetfileinfoProc = + shgetfileinfoProc = (DWORD* (WINAPI *) (LPCTSTR pszPath, DWORD dwFileAttributes, - SHFILEINFO* psfi, UINT cbFileInfo, UINT uFlags)) GetProcAddress(hInstance, + SHFILEINFO* psfi, UINT cbFileInfo, UINT uFlags)) GetProcAddress(hInstance, "SHGetFileInfo"); FreeLibrary(hInstance); } } if (setLayeredWindowAttributesProc == NULL) { - HINSTANCE hInstance = LoadLibraryA("user32"); + HINSTANCE hInstance = LoadLibrary("user32"); if (hInstance != NULL) { setLayeredWindowAttributesProc = (BOOL (WINAPI *) (HWND hwnd, COLORREF crKey, @@ -915,6 +925,7 @@ InitWindowClass(WinIconPtr titlebaricon) * *---------------------------------------------------------------------- */ + static void InitWm(void) { @@ -949,6 +960,7 @@ InitWm(void) * *---------------------------------------------------------------------- */ + static int WinSetIcon(interp, titlebaricon, tkw) Tcl_Interp *interp; @@ -1109,7 +1121,7 @@ TkWinGetIcon(Tk_Window tkwin, DWORD iconsize) { WmInfo *wmPtr; HICON icon; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->iconPtr != NULL) { @@ -1167,7 +1179,7 @@ TkWinGetIcon(Tk_Window tkwin, DWORD iconsize) * icon assigned to the given file and use that. If both of those * fail, then NULL is returned, and an error message will already be * in the interpreter. - * + * * Results: * A WinIconPtr structure containing the icons in the file, with * its ref count already incremented. The calling procedure should @@ -1194,6 +1206,7 @@ TkWinGetIcon(Tk_Window tkwin, DWORD iconsize) * *---------------------------------------------------------------------- */ + static WinIconPtr ReadIconFromFile(interp, fileName) Tcl_Interp *interp; @@ -1219,7 +1232,7 @@ ReadIconFromFile(interp, fileName) SHFILEINFO sfiSM; Tcl_DString ds, ds2; DWORD *res; - CONST char *file; + const char *file; file = Tcl_TranslateFileName(interp, Tcl_GetString(fileName), &ds); if (file == NULL) { return NULL; } @@ -1289,7 +1302,7 @@ ReadIconFromFile(interp, fileName) * calling procedure should either place this structure inside a * WmInfo structure, or it should pass it on to DecrIconRefCount() * to ensure no memory leaks occur. - * + * * If the given pixmap did not contain a valid icon structure, * return NULL. * @@ -1298,7 +1311,7 @@ ReadIconFromFile(interp, fileName) * it contains. If the structure is not wanted, it should be * passed to DecrIconRefCount, and in any case a valid ref count * should be ensured to avoid memory leaks. - * + * * Currently icon resources are not shared, so the ref count of * one of these structures will always be 0 or 1. However all we * need do is implement some sort of lookup function between @@ -1307,18 +1320,19 @@ ReadIconFromFile(interp, fileName) * *---------------------------------------------------------------------- */ -static WinIconPtr + +static WinIconPtr GetIconFromPixmap(dsPtr, pixmap) Display *dsPtr; Pixmap pixmap; { WinIconPtr titlebaricon = NULL; TkWinDrawable* twdPtr = (TkWinDrawable*) pixmap; - + if (twdPtr == NULL) { return NULL; } - + if (0 /* If we already have an icon for this pixmap */) { titlebaricon = NULL; /* Get the real value from a lookup */ titlebaricon->refCount++; @@ -1383,7 +1397,8 @@ GetIconFromPixmap(dsPtr, pixmap) * *---------------------------------------------------------------------- */ -static void + +static void DecrIconRefCount(WinIconPtr titlebaricon) { titlebaricon->refCount--; @@ -1414,7 +1429,8 @@ DecrIconRefCount(WinIconPtr titlebaricon) { * *---------------------------------------------------------------------- */ -static void + +static void FreeIconBlock(BlockOfIconImagesPtr lpIR) { int i; @@ -1446,11 +1462,12 @@ FreeIconBlock(BlockOfIconImagesPtr lpIR) * *---------------------------------------------------------------------- */ -static HICON + +static HICON GetIcon(WinIconPtr titlebaricon, int icon_size) { BlockOfIconImagesPtr lpIR; - + if (titlebaricon == NULL) { return NULL; } @@ -1471,8 +1488,8 @@ GetIcon(WinIconPtr titlebaricon, int icon_size) } } - /* - * If we get here, then just return the first one, + /* + * If we get here, then just return the first one, * it will have to do! */ if (lpIR->nNumImages >= 1) { @@ -1499,7 +1516,8 @@ GetIcon(WinIconPtr titlebaricon, int icon_size) * *---------------------------------------------------------------------- */ -static BlockOfIconImagesPtr + +static BlockOfIconImagesPtr ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) { BlockOfIconImagesPtr lpIR, lpNew; @@ -1511,8 +1529,8 @@ ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) /* Open the file */ channel = Tcl_FSOpenFileChannel(interp, fileName, "r", 0); if (channel == NULL) { - Tcl_AppendResult(interp,"Error opening file \"", - Tcl_GetString(fileName), + Tcl_AppendResult(interp,"Error opening file \"", + Tcl_GetString(fileName), "\" for reading",(char*)NULL); return NULL; } @@ -1541,7 +1559,7 @@ ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) return NULL; } /* Adjust the size of the struct to account for the images */ - lpNew = (BlockOfIconImagesPtr) ckrealloc((char*)lpIR, + lpNew = (BlockOfIconImagesPtr) ckrealloc((char*)lpIR, sizeof(BlockOfIconImages) + ((lpIR->nNumImages-1) * sizeof(ICONIMAGE))); if (lpNew == NULL) { Tcl_AppendResult(interp,"Error allocating memory",(char*)NULL); @@ -1559,7 +1577,7 @@ ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) return NULL; } /* Read in the icon directory entries */ - dwBytesRead = Tcl_Read(channel, (char*)lpIDE, + dwBytesRead = Tcl_Read(channel, (char*)lpIDE, lpIR->nNumImages * sizeof( ICONDIRENTRY )); if (dwBytesRead != lpIR->nNumImages * sizeof( ICONDIRENTRY )) { Tcl_AppendResult(interp,"Error reading file",(char*)NULL); @@ -1586,7 +1604,7 @@ ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) goto readError; } /* Read it in */ - dwBytesRead = Tcl_Read(channel, (char *) lpIR->IconImages[i].lpBits, + dwBytesRead = Tcl_Read(channel, (char *) lpIR->IconImages[i].lpBits, lpIDE[i].dwBytesInRes); if (dwBytesRead != lpIDE[i].dwBytesInRes) { Tcl_AppendResult(interp,"Error reading file",(char*)NULL); @@ -1638,6 +1656,7 @@ ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) * *---------------------------------------------------------------------- */ + static TkWindow * GetTopLevel(hwnd) HWND hwnd; @@ -2347,7 +2366,7 @@ TkWmUnmapWindow(winPtr) *---------------------------------------------------------------------- */ -void +int TkpWmSetState(winPtr, state) TkWindow *winPtr; /* Toplevel window to operate on. */ int state; /* One of IconicState, ZoomState, NormalState, @@ -2358,22 +2377,22 @@ TkpWmSetState(winPtr, state) if (wmPtr->flags & WM_NEVER_MAPPED) { wmPtr->hints.initial_state = state; - return; - } - - wmPtr->flags |= WM_SYNC_PENDING; - if (state == WithdrawnState) { - cmd = SW_HIDE; - } else if (state == IconicState) { - cmd = SW_SHOWMINNOACTIVE; - } else if (state == NormalState) { - cmd = SW_SHOWNOACTIVATE; - } else if (state == ZoomState) { - cmd = SW_SHOWMAXIMIZED; + } else { + wmPtr->flags |= WM_SYNC_PENDING; + if (state == WithdrawnState) { + cmd = SW_HIDE; + } else if (state == IconicState) { + cmd = SW_SHOWMINNOACTIVE; + } else if (state == NormalState) { + cmd = SW_SHOWNOACTIVATE; + } else if (state == ZoomState) { + cmd = SW_SHOWMAXIMIZED; + } + + ShowWindow(wmPtr->wrapper, cmd); + wmPtr->flags &= ~WM_SYNC_PENDING; } - - ShowWindow(wmPtr->wrapper, cmd); - wmPtr->flags &= ~WM_SYNC_PENDING; + return 1; } /* @@ -2580,10 +2599,10 @@ Tk_WmObjCmd(clientData, interp, objc, objv) * interpreter. */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "frame", "geometry", "grid", "group", "iconbitmap", @@ -2748,7 +2767,7 @@ WmAspectCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int numer1, denom1, numer2, denom2; @@ -2817,7 +2836,7 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; LONG style, exStyle, styleBit, *stylePtr; @@ -3060,7 +3079,7 @@ WmClientCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -3131,7 +3150,7 @@ WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow **cmapList; @@ -3225,12 +3244,12 @@ WmCommandCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; int cmdArgc; - CONST char **cmdArgv; + const char **cmdArgv; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?value?"); @@ -3293,7 +3312,7 @@ WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -3379,10 +3398,10 @@ WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "active", "passive", (char *) NULL }; enum options { OPT_ACTIVE, OPT_PASSIVE }; @@ -3433,7 +3452,7 @@ WmFrameCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; HWND hwnd; @@ -3478,7 +3497,7 @@ WmGeometryCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char xSign, ySign; @@ -3541,7 +3560,7 @@ WmGridCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int reqWidth, reqHeight, widthInc, heightInc; @@ -3630,7 +3649,7 @@ WmGroupCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; @@ -3693,7 +3712,7 @@ WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */ @@ -3816,7 +3835,7 @@ WmIconifyCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc != 3) { @@ -3871,7 +3890,7 @@ WmIconmaskCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; @@ -3929,7 +3948,7 @@ WmIconnameCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -3982,7 +4001,7 @@ WmIconphotoCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */ Tk_PhotoHandle photo; @@ -4096,7 +4115,7 @@ WmIconpositionCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y; @@ -4152,7 +4171,7 @@ WmIconwindowCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; @@ -4260,7 +4279,7 @@ WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -4310,7 +4329,7 @@ WmMinsizeCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -4361,7 +4380,7 @@ WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int boolean, curValue; @@ -4419,10 +4438,10 @@ WmPositionfromCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "program", "user", (char *) NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -4482,7 +4501,7 @@ WmProtocolCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; register ProtocolHandler *protPtr, *prevPtr; @@ -4573,7 +4592,7 @@ WmResizableCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -4636,10 +4655,10 @@ WmSizefromCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "program", "user", (char *) NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -4700,10 +4719,10 @@ WmStackorderCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { TkWindow **windows, **window_ptr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "isabove", "isbelow", (char *) NULL }; enum options { OPT_ISABOVE, OPT_ISBELOW }; @@ -4817,10 +4836,10 @@ WmStateCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "normal", "iconic", "withdrawn", "zoomed", (char *) NULL }; enum options { OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED }; @@ -4926,7 +4945,7 @@ WmTitleCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -4983,7 +5002,7 @@ WmTransientCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *masterPtr = wmPtr->masterPtr; @@ -5109,7 +5128,7 @@ WmWithdrawCmd(tkwin, winPtr, interp, objc, objv) TkWindow *winPtr; /* Toplevel to work with */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ + Tcl_Obj *const objv[]; /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -6099,7 +6118,7 @@ TkWmProtocolEventProc(winPtr, eventPtr) * Cache atom name, as we might destroy the window as a * result of the eval. */ - CONST char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol); + const char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol); Tcl_Preserve((ClientData) protPtr); interp = protPtr->interp; @@ -7715,3 +7734,11 @@ TkWinSetForegroundWindow(winPtr) SetForegroundWindow(Tk_GetHWND(winPtr->window)); } } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ -- cgit v0.12 From 7450408d7048a34daf6788fc4501b58451bfa54b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 May 2012 13:34:36 +0000 Subject: implement TkSetPixmapColormap and TkpPrintWindowId for cygwin export TkWinChildProc for win32 backport TCHAR determination from tkWinPort.h --- generic/tk.decls | 25 -------- generic/tkInt.decls | 42 ++++++++++++++ generic/tkIntPlatDecls.h | 100 ++++++++++++++++++++++++++++++-- generic/tkPlatDecls.h | 58 +------------------ generic/tkStubInit.c | 147 +++++++++++++++++++++++++++++++++++++---------- win/tkWinDialog.c | 2 +- win/tkWinInt.h | 3 - win/tkWinPort.h | 24 ++++++-- 8 files changed, 274 insertions(+), 127 deletions(-) diff --git a/generic/tk.decls b/generic/tk.decls index 2fae0b8..400c415 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1025,31 +1025,6 @@ declare 264 { interface tkPlat ################################ -# Unix specific functions -# - -declare 0 unix { - Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd) -} -declare 1 unix { - void *Tk_GetHINSTANCE(void) -} -declare 2 unix { - void *Tk_GetHWND(Window window) -} -declare 3 unix { - Tk_Window Tk_HWNDToWindow(void *hwnd) -} -declare 4 unix { - void Tk_PointerEvent(void *hwnd, int x, int y) -} -declare 5 unix { - int Tk_TranslateWinEvent(void *hwnd, - unsigned int message, int wParam, int lParam, int *result) -} - - -################################ # Windows specific functions declare 0 win { diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 3de82d7..5338578 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -659,6 +659,48 @@ declare 35 win { int TkWinGetPlatformTheme(void) } +# Exported through stub table since Tk 8.4.20/8.5.9 + +declare 36 win { + LRESULT __stdcall TkWinChildProc(HWND hwnd, + UINT message, WPARAM wParam, LPARAM lParam) +} + +# new for 8.4.20+, Cygwin only +declare 37 win { + void TkCreateXEventSource(void) +} +declare 38 win { + void TkFreeWindowId(TkDisplay *dispPtr, Window w) +} +declare 39 win { + void TkInitXId(TkDisplay *dispPtr) +} +declare 40 win { + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +} +declare 41 win { + void TkpSync(Display *display) +} +declare 42 win { + Window TkUnixContainerId(TkWindow *winPtr) +} +declare 43 win { + int TkUnixDoOneXEvent(Tcl_Time *timePtr) +} +declare 44 win { + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) +} +declare 45 win { + void TkWmCleanup(TkDisplay *dispPtr) +} +declare 46 win { + void TkSendCleanup(TkDisplay *dispPtr) +} +declare 47 win { + void TkFreeXId(TkDisplay *dispPtr) +} + ################################ # Mac specific functions diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index e9f4256..dd1e899 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -30,7 +30,7 @@ * Exported function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* 0 */ EXTERN char * TkAlignImageData _ANSI_ARGS_((XImage *image, int alignment, int bitOrder)); @@ -123,6 +123,34 @@ EXTERN int TkWinGetPlatformId _ANSI_ARGS_((void)); EXTERN void TkWinSetHINSTANCE _ANSI_ARGS_((HINSTANCE hInstance)); /* 35 */ EXTERN int TkWinGetPlatformTheme _ANSI_ARGS_((void)); +/* 36 */ +EXTERN LRESULT __stdcall TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam)); +/* 37 */ +EXTERN void TkCreateXEventSource _ANSI_ARGS_((void)); +/* 38 */ +EXTERN void TkFreeWindowId _ANSI_ARGS_((TkDisplay *dispPtr, + Window w)); +/* 39 */ +EXTERN void TkInitXId _ANSI_ARGS_((TkDisplay *dispPtr)); +/* 40 */ +EXTERN int TkpCmapStressed _ANSI_ARGS_((Tk_Window tkwin, + Colormap colormap)); +/* 41 */ +EXTERN void TkpSync _ANSI_ARGS_((Display *display)); +/* 42 */ +EXTERN Window TkUnixContainerId _ANSI_ARGS_((TkWindow *winPtr)); +/* 43 */ +EXTERN int TkUnixDoOneXEvent _ANSI_ARGS_((Tcl_Time *timePtr)); +/* 44 */ +EXTERN void TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin, + Tk_Window menubar)); +/* 45 */ +EXTERN void TkWmCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); +/* 46 */ +EXTERN void TkSendCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); +/* 47 */ +EXTERN void TkFreeXId _ANSI_ARGS_((TkDisplay *dispPtr)); #endif /* __WIN32__ */ #ifdef MAC_TCL /* 0 */ @@ -385,7 +413,7 @@ EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin)); /* 53 */ EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void)); #endif /* MAC_OSX_TK */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource _ANSI_ARGS_((void)); /* 1 */ @@ -423,7 +451,7 @@ typedef struct TkIntPlatStubs { int magic; struct TkIntPlatStubHooks *hooks; -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) char * (*tkAlignImageData) _ANSI_ARGS_((XImage *image, int alignment, int bitOrder)); /* 0 */ VOID *reserved1; void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 2 */ @@ -460,6 +488,18 @@ typedef struct TkIntPlatStubs { int (*tkWinGetPlatformId) _ANSI_ARGS_((void)); /* 33 */ void (*tkWinSetHINSTANCE) _ANSI_ARGS_((HINSTANCE hInstance)); /* 34 */ int (*tkWinGetPlatformTheme) _ANSI_ARGS_((void)); /* 35 */ + LRESULT __stdcall (*tkWinChildProc) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); /* 36 */ + void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 37 */ + void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay *dispPtr, Window w)); /* 38 */ + void (*tkInitXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 39 */ + int (*tkpCmapStressed) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 40 */ + void (*tkpSync) _ANSI_ARGS_((Display *display)); /* 41 */ + Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow *winPtr)); /* 42 */ + int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time *timePtr)); /* 43 */ + void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 44 */ + void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 45 */ + void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 46 */ + void (*tkFreeXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 47 */ #endif /* __WIN32__ */ #ifdef MAC_TCL void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 0 */ @@ -586,7 +626,7 @@ typedef struct TkIntPlatStubs { VOID *reserved52; unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 53 */ #endif /* MAC_OSX_TK */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 0 */ void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay *dispPtr, Window w)); /* 1 */ void (*tkInitXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 2 */ @@ -617,7 +657,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) #ifndef TkAlignImageData #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ @@ -759,6 +799,54 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkWinGetPlatformTheme \ (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ #endif +#ifndef TkWinChildProc +#define TkWinChildProc \ + (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ +#endif +#ifndef TkCreateXEventSource +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +#endif +#ifndef TkFreeWindowId +#define TkFreeWindowId \ + (tkIntPlatStubsPtr->tkFreeWindowId) /* 38 */ +#endif +#ifndef TkInitXId +#define TkInitXId \ + (tkIntPlatStubsPtr->tkInitXId) /* 39 */ +#endif +#ifndef TkpCmapStressed +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 40 */ +#endif +#ifndef TkpSync +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 41 */ +#endif +#ifndef TkUnixContainerId +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 42 */ +#endif +#ifndef TkUnixDoOneXEvent +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 43 */ +#endif +#ifndef TkUnixSetMenubar +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 44 */ +#endif +#ifndef TkWmCleanup +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 45 */ +#endif +#ifndef TkSendCleanup +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 46 */ +#endif +#ifndef TkFreeXId +#define TkFreeXId \ + (tkIntPlatStubsPtr->tkFreeXId) /* 47 */ +#endif #endif /* __WIN32__ */ #ifdef MAC_TCL #ifndef TkGenerateActivateEvents @@ -1164,7 +1252,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ #endif #endif /* MAC_OSX_TK */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ #ifndef TkCreateXEventSource #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index f9bce86..cf1ec21 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -29,25 +29,7 @@ * Exported function declarations: */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 0 */ -EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, - VOID *hwnd)); -/* 1 */ -EXTERN VOID * Tk_GetHINSTANCE _ANSI_ARGS_((void)); -/* 2 */ -EXTERN VOID * Tk_GetHWND _ANSI_ARGS_((Window window)); -/* 3 */ -EXTERN Tk_Window Tk_HWNDToWindow _ANSI_ARGS_((VOID *hwnd)); -/* 4 */ -EXTERN void Tk_PointerEvent _ANSI_ARGS_((VOID *hwnd, int x, - int y)); -/* 5 */ -EXTERN int Tk_TranslateWinEvent _ANSI_ARGS_((VOID *hwnd, - unsigned int message, int wParam, int lParam, - int *result)); -#endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) /* 0 */ EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); @@ -135,15 +117,7 @@ typedef struct TkPlatStubs { int magic; struct TkPlatStubHooks *hooks; -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, VOID *hwnd)); /* 0 */ - VOID * (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */ - VOID * (*tk_GetHWND) _ANSI_ARGS_((Window window)); /* 2 */ - Tk_Window (*tk_HWNDToWindow) _ANSI_ARGS_((VOID *hwnd)); /* 3 */ - void (*tk_PointerEvent) _ANSI_ARGS_((VOID *hwnd, int x, int y)); /* 4 */ - int (*tk_TranslateWinEvent) _ANSI_ARGS_((VOID *hwnd, unsigned int message, int wParam, int lParam, int *result)); /* 5 */ -#endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */ HWND (*tk_GetHWND) _ANSI_ARGS_((Window window)); /* 2 */ @@ -193,33 +167,7 @@ extern TkPlatStubs *tkPlatStubsPtr; * Inline function declarations: */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tk_AttachHWND -#define Tk_AttachHWND \ - (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ -#endif -#ifndef Tk_GetHINSTANCE -#define Tk_GetHINSTANCE \ - (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ -#endif -#ifndef Tk_GetHWND -#define Tk_GetHWND \ - (tkPlatStubsPtr->tk_GetHWND) /* 2 */ -#endif -#ifndef Tk_HWNDToWindow -#define Tk_HWNDToWindow \ - (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ -#endif -#ifndef Tk_PointerEvent -#define Tk_PointerEvent \ - (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ -#endif -#ifndef Tk_TranslateWinEvent -#define Tk_TranslateWinEvent \ - (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ -#endif -#endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) #ifndef Tk_AttachHWND #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 22334bc..c533781 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -37,20 +37,52 @@ #include "tkIntPlatDecls.h" #include "tkIntXlibDecls.h" +#ifdef __WIN32__ + +static int +doNothing(void) +{ + /* dummy implementation, no need to do anything */ + return 0; +} + +/* + * Remove macros that will interfere with the definitions below. + */ +# undef TkFreeWindowId +# undef TkInitXId +# undef TkpCmapStressed +# undef TkpSync + +# define TkCreateXEventSource (void (*) ()) doNothing +# define TkFreeWindowId (void (*) _ANSI_ARGS_((TkDisplay *, Window))) doNothing +# define TkInitXId (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing +# define TkpCmapStressed (int (*) _ANSI_ARGS_((Tk_Window, Colormap))) doNothing +# define TkpSync (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing +# define TkUnixContainerId 0 +# define TkUnixDoOneXEvent 0 +# define TkUnixSetMenubar 0 +# define TkWmCleanup (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing +# define TkSendCleanup (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing +# define TkFreeXId (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing + +#else /* * Remove macros that will interfere with the definitions below. */ -#undef TkClipBox -#undef TkCreateRegion -#undef TkDestroyRegion -#undef TkIntersectRegion -#undef TkRectInRegion -#undef TkSetRegion -#undef TkUnionRectWithRegion -#undef TkSubtractRegion -#undef TkPutImage +# undef TkClipBox +# undef TkCreateRegion +# undef TkDestroyRegion +# undef TkIntersectRegion +# undef TkRectInRegion +# undef TkSetRegion +# undef TkUnionRectWithRegion +# undef TkSubtractRegion +# undef TkPutImage +# undef TkSetPixmapColormap +# undef TkpPrintWindowId +# undef TkWinChildProc 0 -#ifndef __WIN32__ /* * Make sure that extensions which call XParseColor through the stub * table, call TkParseColor instead. [Bug 3486474] @@ -76,14 +108,16 @@ # define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion # ifdef __CYGWIN__ -# define Tk_GetHINSTANCE TkPlatGetHINSTANCE -# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 +# define Tk_GetHINSTANCE TkPlatGetHINSTANCE +# define TkSetPixmapColormap TkPlatSetPixmapColormap +# define TkpPrintWindowId TkPlatpPrintWindowId /* * 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 int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); TkIntStubs tkIntStubs; @@ -96,15 +130,62 @@ static void *Tk_GetHINSTANCE() (const char *) &tkIntStubs, &hInstance); return hInstance; } - /* TODO: To be implemented for Cygwin */ -# define Tk_AttachHWND 0 -# define Tk_GetHWND 0 -# define Tk_HWNDToWindow 0 -# define Tk_PointerEvent 0 -# define Tk_TranslateWinEvent 0 -# else /* !__CYGWIN__ */ -# define TkPutImage 0 +static void +TkSetPixmapColormap(pixmap, colormap) + Pixmap pixmap; + Colormap colormap; +{ +} + +static void +TkpPrintWindowId(buf, window) + char *buf; /* Pointer to string large enough to hold + * the hex representation of a pointer. */ + Window window; /* Window to be printed into buffer. */ +{ + sprintf(buf, "%#08lx", (unsigned long) (window)); +} + + /* TODO: To be implemented for Cygwin */ +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 +# define TkAlignImageData 0 +# define TkGenerateActivateEvents 0 +# define TkpGetMS 0 +# define TkPointerDeadWindow 0 +# define TkpSetCapture 0 +# define TkpSetCursor 0 +# define TkWinCancelMouseTimer 0 +# define TkWinClipboardRender 0 +# define TkWinEmbeddedEventProc 0 +# define TkWinFillRect 0 +# define TkWinGetBorderPixels 0 +# define TkWinGetDrawableDC 0 +# define TkWinGetModifierState 0 +# define TkWinGetSystemPalette 0 +# define TkWinGetWrapperWindow 0 +# define TkWinHandleMenuEvent 0 +# define TkWinIndexOfColor 0 +# define TkWinReleaseDrawableDC 0 +# define TkWinResendEvent 0 +# define TkWinSelectPalette 0 +# define TkWinSetMenu 0 +# define TkWinSetWindowPos 0 +# define TkWinWmCleanup 0 +# define TkWinXCleanup 0 +# define TkWinXInit 0 +# define TkWinSetForegroundWindow 0 +# define TkWinDialogDebug 0 +# define TkWinGetMenuSystemDefault 0 +# define TkWinGetPlatformId 0 +# define TkWinSetHINSTANCE 0 +# define TkWinGetPlatformTheme 0 +# define TkWinChildProc 0 + # endif /* __CYGWIN__ */ # endif /* !MAC_TCL && !MACC_OSX_TCL */ #endif /* !__WIN32__ */ @@ -311,7 +392,7 @@ TkIntStubs tkIntStubs = { TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, NULL, -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) TkAlignImageData, /* 0 */ NULL, /* 1 */ TkGenerateActivateEvents, /* 2 */ @@ -348,6 +429,18 @@ TkIntPlatStubs tkIntPlatStubs = { TkWinGetPlatformId, /* 33 */ TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ + TkWinChildProc, /* 36 */ + TkCreateXEventSource, /* 37 */ + TkFreeWindowId, /* 38 */ + TkInitXId, /* 39 */ + TkpCmapStressed, /* 40 */ + TkpSync, /* 41 */ + TkUnixContainerId, /* 42 */ + TkUnixDoOneXEvent, /* 43 */ + TkUnixSetMenubar, /* 44 */ + TkWmCleanup, /* 45 */ + TkSendCleanup, /* 46 */ + TkFreeXId, /* 47 */ #endif /* __WIN32__ */ #ifdef MAC_TCL TkGenerateActivateEvents, /* 0 */ @@ -474,7 +567,7 @@ TkIntPlatStubs tkIntPlatStubs = { NULL, /* 52 */ TkpGetMS, /* 53 */ #endif /* MAC_OSX_TK */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ TkFreeWindowId, /* 1 */ TkInitXId, /* 2 */ @@ -795,15 +888,7 @@ TkIntXlibStubs tkIntXlibStubs = { TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - Tk_AttachHWND, /* 0 */ - Tk_GetHINSTANCE, /* 1 */ - Tk_GetHWND, /* 2 */ - Tk_HWNDToWindow, /* 3 */ - Tk_PointerEvent, /* 4 */ - Tk_TranslateWinEvent, /* 5 */ -#endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 775d06b..06f5a99 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -2426,7 +2426,7 @@ ChooseDirectoryHookProc( * Directory must exist. Complain, then rehighlight text. */ - wsprintf(tmp, _T("Cannot change directory to \"%.200s\"."), + wsprintf(tmp, "Cannot change directory to \"%.200s\".", cdPtr->path); MessageBox(hwnd, tmp, NULL, MB_OK); SendDlgItemMessage(hwnd, edt10, EM_SETSEL, 0, -1); diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 7ab4ff4..a1c50fe 100755 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -154,9 +154,6 @@ extern CONST int tkpWinBltModes[]; #define TCL_STORAGE_CLASS DLLEXPORT #endif -EXTERN LRESULT CALLBACK TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam)); - /* * Special proc needed as tsd accessor function between * tkWinX.c:GenerateXEvent and tkWinClipboard.c:UpdateClipboard diff --git a/win/tkWinPort.h b/win/tkWinPort.h index f991195..77408dc 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -40,16 +40,28 @@ #endif #include -#ifdef __CYGWIN__ -# define _T(x) L##x -#else -# include -#endif #ifdef _MSC_VER -# define hypot _hypot +# ifndef hypot +# define hypot _hypot +# endif #endif /* _MSC_VER */ +/* + * Pull in the typedef of TCHAR for windows. + */ +#include +#ifndef _TCHAR_DEFINED + /* Borland seems to forget to set this. */ + typedef _TCHAR TCHAR; +# define _TCHAR_DEFINED +#endif +#if defined(_MSC_VER) && defined(__STDC__) + /* VS2005 SP1 misses this. See [Bug #3110161] */ + typedef _TCHAR TCHAR; +#endif + + #ifndef __GNUC__ # define strncasecmp strnicmp # define strcasecmp stricmp -- cgit v0.12 From 83042abf39211173167e01577444d8b0df973678 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 May 2012 13:56:01 +0000 Subject: typo --- generic/tkStubInit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index c533781..01bda9e 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -81,7 +81,7 @@ doNothing(void) # undef TkPutImage # undef TkSetPixmapColormap # undef TkpPrintWindowId -# undef TkWinChildProc 0 +# undef TkWinChildProc /* * Make sure that extensions which call XParseColor through the stub -- cgit v0.12 From b6ab10bda69750ba403ab63c010db76cc35e6f49 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 May 2012 14:42:10 +0000 Subject: backport TCHAR determination from tkWinPort.h --- win/tkWinPort.h | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 9deefce..73a511c 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -50,33 +50,21 @@ /* * Pull in the typedef of TCHAR for windows. */ -#if !defined(_TCHAR_DEFINED) -# include -# ifndef _TCHAR_DEFINED - /* Borland seems to forget to set this. */ - typedef _TCHAR TCHAR; -# define _TCHAR_DEFINED -# endif -# if defined(_MSC_VER) && defined(__STDC__) - /* VS2005 SP1 misses this. See [Bug #3110161] */ - typedef _TCHAR TCHAR; -# endif +#include +#ifndef _TCHAR_DEFINED + /* Borland seems to forget to set this. */ + typedef _TCHAR TCHAR; +# define _TCHAR_DEFINED +#endif +#if defined(_MSC_VER) && defined(__STDC__) + /* VS2005 SP1 misses this. See [Bug #3110161] */ + typedef _TCHAR TCHAR; #endif -#ifdef __CYGWIN__ -# ifndef _vsnprintf -# define _vsnprintf vsnprintf -# endif -# ifndef _wcsicmp -# define _wcsicmp wcscasecmp -# endif -#else -# ifndef strncasecmp -# define strncasecmp strnicmp -# endif -# ifndef strcasecmp -# define strcasecmp stricmp -# endif + +#ifndef __GNUC__ +# define strncasecmp strnicmp +# define strcasecmp stricmp #endif #define NBBY 8 -- cgit v0.12 From f2a2b94b4ae2358ee22c3803dd8498480c9186a9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 May 2012 15:03:39 +0000 Subject: remove some unused CYGWIN stuff --- win/winMain.c | 134 +--------------------------------------------------------- 1 file changed, 2 insertions(+), 132 deletions(-) diff --git a/win/winMain.c b/win/winMain.c index 2883ad7..eea7004 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -16,7 +16,6 @@ #undef WIN32_LEAN_AND_MEAN #include - /* * The following declarations refer to internal Tk routines. These interfaces * are available for use, but are not supported. @@ -37,10 +36,6 @@ extern Tcl_PackageInitProc Dde_SafeInit; static void WishPanic(CONST char *format, ...); -#if defined(__CYGWIN__) -static void setargv(int *argcPtr, char ***argvPtr); -#endif /* __CYGWIN__ */ - static BOOL consoleRequired = TRUE; /* @@ -112,12 +107,8 @@ WinMain( * Get our args from the c-runtime. Ignore lpszCmdLine. */ -#if defined(__CYGWIN__) - setargv(&argc, &argv); -#else argc = __argc; argv = __argv; -#endif /* * Forward slashes substituted for backslashes. @@ -289,7 +280,7 @@ WishPanic( ExitProcess(1); } -#if !defined(__GNUC__) || defined(TK_TEST) +#if defined(TK_TEST) /* *---------------------------------------------------------------------- * @@ -331,128 +322,7 @@ main( Tk_Main(argc, argv, Tcl_AppInit); return 0; } -#endif /* !__GNUC__ || TK_TEST */ - - -/* - *------------------------------------------------------------------------- - * - * setargv -- - * - * Parse the Windows command line string into argc/argv. Done here - * because we don't trust the builtin argument parser in crt0. Windows - * applications are responsible for breaking their command line into - * arguments. - * - * 2N backslashes + quote -> N backslashes + begin quoted string - * 2N + 1 backslashes + quote -> literal - * N backslashes + non-quote -> literal - * quote + quote in a quoted string -> single quote - * quote + quote not in quoted string -> empty string - * quote -> begin quoted string - * - * Results: - * Fills argcPtr with the number of arguments and argvPtr with the array - * of arguments. - * - * Side effects: - * Memory allocated. - * - *-------------------------------------------------------------------------- - */ - -#if defined(__CYGWIN__) -static void -setargv( - int *argcPtr, /* Filled with number of argument strings. */ - char ***argvPtr) /* Filled with argument strings (malloc'd). */ -{ - char *cmdLine, *p, *arg, *argSpace; - char **argv; - int argc, size, inquote, copy, slashes; - - cmdLine = GetCommandLine(); /* INTL: BUG */ - - /* - * Precompute an overly pessimistic guess at the number of arguments in - * the command line by counting non-space spans. - */ - - size = 2; - for (p = cmdLine; *p != '\0'; p++) { - if ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ - size++; - while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ - p++; - } - if (*p == '\0') { - break; - } - } - } - argSpace = (char *) ckalloc( - (unsigned) (size * sizeof(char *) + strlen(cmdLine) + 1)); - argv = (char **) argSpace; - argSpace += size * sizeof(char *); - size--; - - p = cmdLine; - for (argc = 0; argc < size; argc++) { - argv[argc] = arg = argSpace; - while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ - p++; - } - if (*p == '\0') { - break; - } - - inquote = 0; - slashes = 0; - while (1) { - copy = 1; - while (*p == '\\') { - slashes++; - p++; - } - if (*p == '"') { - if ((slashes & 1) == 0) { - copy = 0; - if ((inquote) && (p[1] == '"')) { - p++; - copy = 1; - } else { - inquote = !inquote; - } - } - slashes >>= 1; - } - - while (slashes) { - *arg = '\\'; - arg++; - slashes--; - } - - if ((*p == '\0') || (!inquote && - ((*p == ' ') || (*p == '\t')))) { /* INTL: ISO space. */ - break; - } - if (copy != 0) { - *arg = *p; - arg++; - } - p++; - } - *arg = '\0'; - argSpace = arg + 1; - } - argv[argc] = NULL; - - *argcPtr = argc; - *argvPtr = argv; -} -#endif /* __CYGWIN__ */ - +#endif /* TK_TEST */ /* * Local Variables: * mode: c -- cgit v0.12 From 524f59a75aab742a5ce54b6497bec8e3bda8dced Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 May 2012 18:58:20 +0000 Subject: fix some visual studio warnings, eliminate some ANSI_ARGS --- generic/tkIntPlatDecls.h | 2 +- generic/tkStubInit.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index dd1e899..a2006d9 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -488,7 +488,7 @@ typedef struct TkIntPlatStubs { int (*tkWinGetPlatformId) _ANSI_ARGS_((void)); /* 33 */ void (*tkWinSetHINSTANCE) _ANSI_ARGS_((HINSTANCE hInstance)); /* 34 */ int (*tkWinGetPlatformTheme) _ANSI_ARGS_((void)); /* 35 */ - LRESULT __stdcall (*tkWinChildProc) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); /* 36 */ + LRESULT (__stdcall *tkWinChildProc) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); /* 36 */ void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 37 */ void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay *dispPtr, Window w)); /* 38 */ void (*tkInitXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 39 */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 01bda9e..ffa8c2b 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -54,17 +54,17 @@ doNothing(void) # undef TkpCmapStressed # undef TkpSync -# define TkCreateXEventSource (void (*) ()) doNothing -# define TkFreeWindowId (void (*) _ANSI_ARGS_((TkDisplay *, Window))) doNothing -# define TkInitXId (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing -# define TkpCmapStressed (int (*) _ANSI_ARGS_((Tk_Window, Colormap))) doNothing -# define TkpSync (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing +# define TkCreateXEventSource (void (*) (void)) doNothing +# define TkFreeWindowId (void (*) (TkDisplay *, Window)) doNothing +# define TkInitXId (void (*) (TkDisplay *)) doNothing +# define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing +# define TkpSync (void (*) (Display *)) doNothing # define TkUnixContainerId 0 # define TkUnixDoOneXEvent 0 # define TkUnixSetMenubar 0 -# define TkWmCleanup (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing -# define TkSendCleanup (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing -# define TkFreeXId (void (*) _ANSI_ARGS_((TkDisplay *))) doNothing +# define TkWmCleanup (void (*) (TkDisplay *)) doNothing +# define TkSendCleanup (void (*) (TkDisplay *)) doNothing +# define TkFreeXId (void (*) (TkDisplay *)) doNothing #else /* -- cgit v0.12 From 20eb2bdf3b3b8c32a82eded717c2383cf1746e46 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 May 2012 23:06:39 +0000 Subject: give tkWinWm.c access to SM_XVIRTUALSCREEN and friends --- win/tkWin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win/tkWin.h b/win/tkWin.h index d97adc7..00d3486 100644 --- a/win/tkWin.h +++ b/win/tkWin.h @@ -22,10 +22,10 @@ */ #ifndef WINVER -#define WINVER 0x0410 +#define WINVER 0x0500 #endif -#ifndef _WIN32_WINDOWS -#define _WIN32_WINDOWS 0x0410 +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 #endif #ifndef _TK -- cgit v0.12 From a6c84ba46ba6fdbc4d426916fae067f8af6ef1e4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 17 May 2012 14:30:38 +0000 Subject: [Bug 1630254]: missing scrolling of text widget when from a -startline == -endline initial state it is configured to display a non-empty part of it --- ChangeLog | 6 ++++++ generic/tkTextDisp.c | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2059ce..3668ef5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-05-?? Francois Vogel + + * generic/tkTextDisp.c: [Bug 1630254]: missing scrolling of text widget + when from a -startline == -endline initial state it is configured to display + a non-empty part of it + 2012-05-09 Jan Nijtmans * win/tkWinWm.c: Change TkpWmSetState signature to match UNIX, diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d0cd4d2..13695e8 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2005,8 +2005,21 @@ UpdateDisplayInfo( * widget. */ - lineNum = -1; - bytesToCount = 0; /* Stop compiler warning. */ + if (textPtr->start == textPtr->end) { + /* + * Empty peer widget. + */ + lineNum = -1; + bytesToCount = 0; /* Stop compiler warning. */ + } else { + /* + * Widget that was empty, but no longer is. + * (Bug 1630254) + */ + lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, + textPtr) - 1; + bytesToCount = INT_MAX; + } } else { lineNum = TkBTreeLinesTo(textPtr, dInfoPtr->dLinePtr->index.linePtr); -- cgit v0.12 From 80e6d08fdcb016f24f236760cef472a7465a12d5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 17 May 2012 18:28:39 +0000 Subject: Better fix for bug-1630254 --- generic/tkTextDisp.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 13695e8..7891a2c 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2005,21 +2005,9 @@ UpdateDisplayInfo( * widget. */ - if (textPtr->start == textPtr->end) { - /* - * Empty peer widget. - */ - lineNum = -1; - bytesToCount = 0; /* Stop compiler warning. */ - } else { - /* - * Widget that was empty, but no longer is. - * (Bug 1630254) - */ - lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, - textPtr) - 1; - bytesToCount = INT_MAX; - } + lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, + textPtr) - 1; + bytesToCount = INT_MAX; } else { lineNum = TkBTreeLinesTo(textPtr, dInfoPtr->dLinePtr->index.linePtr); -- cgit v0.12 From 89fbfd3436706b259edf41d9b4c5d5746e801d88 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 17 May 2012 18:44:02 +0000 Subject: Bug 1630251: Documentation for -endline option was wrong --- ChangeLog | 4 ++++ doc/text.n | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2059ce..facfbe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-05-?? Francois Vogel + + * doc/text.n: [Bug 1630251]: Documentation for -endline option was wrong + 2012-05-09 Jan Nijtmans * win/tkWinWm.c: Change TkpWmSetState signature to match UNIX, diff --git a/doc/text.n b/doc/text.n index 860bb89..cd595c8 100644 --- a/doc/text.n +++ b/doc/text.n @@ -40,8 +40,9 @@ should be drawn as a character-sized rectangular block. If false .VE 8.5 .OP \-endline endLine EndLine .VS 8.5 -Specifies an integer line index representing the last line of the -underlying textual data store that should be contained in the widget. +Specifies an integer line index representing the line of the underlying +textual data store that should be just after the last line contained in +the widget. This allows a text widget to reflect only a portion of a larger piece of text. Instead of an integer, the empty string can be provided to this configuration option, which will configure the widget to end -- cgit v0.12 From c6f6c74ebb2092a8b0b4b2e5c805d22253d19e33 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 24 May 2012 20:59:46 +0000 Subject: Change XSetCommand signature to match Xorg, needed for Cygwin --- ChangeLog | 9 ++++++++- generic/tkInt.decls | 2 +- generic/tkIntDecls.h | 48 ++++++++++++++++++++++++------------------------ generic/tkIntPlatDecls.h | 24 ++++++++++++------------ generic/tkIntXlibDecls.h | 28 ++++++++++++++-------------- generic/tkPlatDecls.h | 24 ++++++++++++------------ generic/tkStubInit.c | 48 ++++++++++++++++++++++++------------------------ win/stubs.c | 2 +- win/tkWinWm.c | 2 +- 9 files changed, 97 insertions(+), 90 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38e1af5..75cbd42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,13 @@ +2012-05-24 Jan Nijtmans + + * win/stubs.c: Change XSetCommand signature to match Xorg, + * win/tkWinWm.c: needed for Cygwin. + * generic/tkInt.decls + * generic/tk*Decls.h: re-generated + 2012-05-09 Jan Nijtmans - * win/tkWinWm.c: Change TkpWmSetState signature to match UNIX, + * win/tkWinWm.c: Change TkpWmSetState signature to match Xorg, * generic/tkInt.decls: needed for Cygwin. (not needed for Mac) * generic/tkIntPlatDeclsDecls.h: * generic/tkWindow.c: Don't check for cygwin in win32 static build. diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 5338578..61d5775 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1290,7 +1290,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, const char **c, int i) + void XSetCommand(Display *d, Window w, char **c, int i) } declare 63 win { void XSetIconName(Display *d, Window w, _Xconst char *c) diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 23dcda4..879c964 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -388,30 +388,30 @@ EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect, EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display *display, CONST char *source)); #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ /* 121 */ EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display *display, CONST char *source)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #ifdef MAC_TCL /* 122 */ EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void)); #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ /* 122 */ EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ /* Slot 123 is reserved */ #ifdef MAC_TCL /* 124 */ EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display *display, CONST char *name, int *width, int *height)); #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ /* 124 */ EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display *display, CONST char *name, int *width, int *height)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ @@ -597,40 +597,40 @@ typedef struct TkIntStubs { #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ VOID *reserved121; #endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ VOID *reserved121; -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display *display, CONST char *source)); /* 121 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display *display, CONST char *source)); /* 121 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ VOID *reserved122; #endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ VOID *reserved122; -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 122 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 122 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ VOID *reserved123; #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ VOID *reserved124; #endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ VOID *reserved124; -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display *display, CONST char *name, int *width, int *height)); /* 124 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display *display, CONST char *name, int *width, int *height)); /* 124 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ VOID *reserved125; VOID *reserved126; VOID *reserved127; @@ -1159,24 +1159,24 @@ extern TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */ #endif #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ #ifndef TkpCreateNativeBitmap #define TkpCreateNativeBitmap \ (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #ifdef MAC_TCL #ifndef TkpDefineNativeBitmaps #define TkpDefineNativeBitmaps \ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */ #endif #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ #ifndef TkpDefineNativeBitmaps #define TkpDefineNativeBitmaps \ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ /* Slot 123 is reserved */ #ifdef MAC_TCL #ifndef TkpGetNativeAppBitmap @@ -1184,12 +1184,12 @@ extern TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */ #endif #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ #ifndef TkpGetNativeAppBitmap #define TkpGetNativeAppBitmap \ (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index a2006d9..14a1f7d 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -30,7 +30,7 @@ * Exported function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN char * TkAlignImageData _ANSI_ARGS_((XImage *image, int alignment, int bitOrder)); @@ -151,7 +151,7 @@ EXTERN void TkWmCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); EXTERN void TkSendCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); /* 47 */ EXTERN void TkFreeXId _ANSI_ARGS_((TkDisplay *dispPtr)); -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL /* 0 */ EXTERN void TkGenerateActivateEvents _ANSI_ARGS_(( @@ -288,7 +288,7 @@ EXTERN void TkMacPreprocessMenu _ANSI_ARGS_((void)); /* 66 */ EXTERN int TkpIsWindowFloating _ANSI_ARGS_((WindowRef window)); #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ /* 0 */ EXTERN void TkGenerateActivateEvents _ANSI_ARGS_(( TkWindow *winPtr, int active)); @@ -412,7 +412,7 @@ EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin)); /* Slot 52 is reserved */ /* 53 */ EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource _ANSI_ARGS_((void)); @@ -451,7 +451,7 @@ typedef struct TkIntPlatStubs { int magic; struct TkIntPlatStubHooks *hooks; -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) _ANSI_ARGS_((XImage *image, int alignment, int bitOrder)); /* 0 */ VOID *reserved1; void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 2 */ @@ -500,7 +500,7 @@ typedef struct TkIntPlatStubs { void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 45 */ void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 46 */ void (*tkFreeXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 47 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 0 */ VOID *reserved1; @@ -570,7 +570,7 @@ typedef struct TkIntPlatStubs { void (*tkMacPreprocessMenu) _ANSI_ARGS_((void)); /* 65 */ int (*tkpIsWindowFloating) _ANSI_ARGS_((WindowRef window)); /* 66 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 0 */ VOID *reserved1; VOID *reserved2; @@ -625,7 +625,7 @@ typedef struct TkIntPlatStubs { void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 51 */ VOID *reserved52; unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 53 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 0 */ void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay *dispPtr, Window w)); /* 1 */ @@ -657,7 +657,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; * Inline function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef TkAlignImageData #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ @@ -847,7 +847,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkFreeXId \ (tkIntPlatStubsPtr->tkFreeXId) /* 47 */ #endif -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL #ifndef TkGenerateActivateEvents #define TkGenerateActivateEvents \ @@ -1058,7 +1058,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpIsWindowFloating) /* 66 */ #endif #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ #ifndef TkGenerateActivateEvents #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */ @@ -1251,7 +1251,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ #ifndef TkCreateXEventSource #define TkCreateXEventSource \ diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 77f6b4d..0ca0da4 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -36,7 +36,7 @@ * Exported function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ /* 0 */ EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, @@ -229,7 +229,7 @@ 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)); + char **c, int i)); /* 63 */ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); @@ -363,7 +363,7 @@ EXTERN void XWarpPointer _ANSI_ARGS_((Display *d, Window s, EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL /* 0 */ EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, @@ -654,7 +654,7 @@ EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ /* 0 */ EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, @@ -945,13 +945,13 @@ EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1, unsigned int *ui)); /* 91 */ EXTERN int XSync _ANSI_ARGS_((Display *display, Bool flag)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ typedef struct TkIntXlibStubs { int magic; struct TkIntXlibStubHooks *hooks; -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ void (*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 */ @@ -1014,7 +1014,7 @@ 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, CONST char **c, int i)); /* 62 */ + void (*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 */ @@ -1059,7 +1059,7 @@ typedef struct TkIntXlibStubs { 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 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */ @@ -1153,7 +1153,7 @@ typedef struct TkIntXlibStubs { 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 +#ifdef MAC_OSX_TK /* AQUA */ void (*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 */ @@ -1246,7 +1246,7 @@ typedef struct TkIntXlibStubs { 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 */ int (*xSync) _ANSI_ARGS_((Display *display, Bool flag)); /* 91 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ } TkIntXlibStubs; #ifdef __cplusplus @@ -1263,7 +1263,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ #ifndef XSetDashes #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ @@ -1689,7 +1689,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr; #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ #endif -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL #ifndef XSetDashes #define XSetDashes \ @@ -2056,7 +2056,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xQueryTree) /* 90 */ #endif #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ #ifndef XSetDashes #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ @@ -2425,7 +2425,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr; #define XSync \ (tkIntXlibStubsPtr->xSync) /* 91 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index cf1ec21..3d08790 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -29,7 +29,7 @@ * Exported function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); @@ -45,7 +45,7 @@ EXTERN void Tk_PointerEvent _ANSI_ARGS_((HWND hwnd, int x, int y)); EXTERN int Tk_TranslateWinEvent _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)); -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL /* 0 */ EXTERN void Tk_MacSetEmbedHandler _ANSI_ARGS_(( @@ -78,7 +78,7 @@ EXTERN int TkMacHaveAppearance _ANSI_ARGS_((void)); /* 10 */ EXTERN GWorldPtr TkMacGetDrawablePort _ANSI_ARGS_((Drawable drawable)); #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ /* 0 */ EXTERN void Tk_MacOSXSetEmbedHandler _ANSI_ARGS_(( Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, @@ -111,20 +111,20 @@ EXTERN ControlRef TkMacOSXGetRootControl _ANSI_ARGS_(( EXTERN void Tk_MacOSXSetupTkNotifier _ANSI_ARGS_((void)); /* 10 */ EXTERN int Tk_MacOSXIsAppInFront _ANSI_ARGS_((void)); -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ typedef struct TkPlatStubs { int magic; struct TkPlatStubHooks *hooks; -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */ HWND (*tk_GetHWND) _ANSI_ARGS_((Window window)); /* 2 */ Tk_Window (*tk_HWNDToWindow) _ANSI_ARGS_((HWND hwnd)); /* 3 */ void (*tk_PointerEvent) _ANSI_ARGS_((HWND hwnd, int x, int y)); /* 4 */ int (*tk_TranslateWinEvent) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)); /* 5 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL void (*tk_MacSetEmbedHandler) _ANSI_ARGS_((Tk_MacEmbedRegisterWinProc *registerWinProcPtr, Tk_MacEmbedGetGrafPortProc *getPortProcPtr, Tk_MacEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacEmbedGetClipProc *getClipProc, Tk_MacEmbedGetOffsetInParentProc *getOffsetProc)); /* 0 */ void (*tk_MacTurnOffMenus) _ANSI_ARGS_((void)); /* 1 */ @@ -138,7 +138,7 @@ typedef struct TkPlatStubs { int (*tkMacHaveAppearance) _ANSI_ARGS_((void)); /* 9 */ GWorldPtr (*tkMacGetDrawablePort) _ANSI_ARGS_((Drawable drawable)); /* 10 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ void (*tk_MacOSXSetEmbedHandler) _ANSI_ARGS_((Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)); /* 0 */ void (*tk_MacOSXTurnOffMenus) _ANSI_ARGS_((void)); /* 1 */ void (*tk_MacOSXTkOwnsCursor) _ANSI_ARGS_((int tkOwnsIt)); /* 2 */ @@ -150,7 +150,7 @@ typedef struct TkPlatStubs { ControlRef (*tkMacOSXGetRootControl) _ANSI_ARGS_((Drawable drawable)); /* 8 */ void (*tk_MacOSXSetupTkNotifier) _ANSI_ARGS_((void)); /* 9 */ int (*tk_MacOSXIsAppInFront) _ANSI_ARGS_((void)); /* 10 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ } TkPlatStubs; #ifdef __cplusplus @@ -167,7 +167,7 @@ extern TkPlatStubs *tkPlatStubsPtr; * Inline function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef Tk_AttachHWND #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ @@ -192,7 +192,7 @@ extern TkPlatStubs *tkPlatStubsPtr; #define Tk_TranslateWinEvent \ (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ #endif -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL #ifndef Tk_MacSetEmbedHandler #define Tk_MacSetEmbedHandler \ @@ -239,7 +239,7 @@ extern TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tkMacGetDrawablePort) /* 10 */ #endif #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ #ifndef Tk_MacOSXSetEmbedHandler #define Tk_MacOSXSetEmbedHandler \ (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */ @@ -284,7 +284,7 @@ extern TkPlatStubs *tkPlatStubsPtr; #define Tk_MacOSXIsAppInFront \ (tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */ #endif -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index ffa8c2b..e175a99 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -325,40 +325,40 @@ TkIntStubs tkIntStubs = { #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ NULL, /* 121 */ #endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ NULL, /* 121 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL TkpCreateNativeBitmap, /* 121 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ TkpCreateNativeBitmap, /* 121 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ NULL, /* 122 */ #endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ NULL, /* 122 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL TkpDefineNativeBitmaps, /* 122 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ TkpDefineNativeBitmaps, /* 122 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ NULL, /* 123 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ NULL, /* 124 */ #endif /* UNIX */ -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ NULL, /* 124 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL TkpGetNativeAppBitmap, /* 124 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ TkpGetNativeAppBitmap, /* 124 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ NULL, /* 125 */ NULL, /* 126 */ NULL, /* 127 */ @@ -392,7 +392,7 @@ TkIntStubs tkIntStubs = { TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, NULL, -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ NULL, /* 1 */ TkGenerateActivateEvents, /* 2 */ @@ -441,7 +441,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkWmCleanup, /* 45 */ TkSendCleanup, /* 46 */ TkFreeXId, /* 47 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL TkGenerateActivateEvents, /* 0 */ NULL, /* 1 */ @@ -511,7 +511,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkMacPreprocessMenu, /* 65 */ TkpIsWindowFloating, /* 66 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ TkGenerateActivateEvents, /* 0 */ NULL, /* 1 */ NULL, /* 2 */ @@ -566,7 +566,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkGenWMDestroyEvent, /* 51 */ NULL, /* 52 */ TkpGetMS, /* 53 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ TkFreeWindowId, /* 1 */ @@ -587,7 +587,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, NULL, -#ifdef __WIN32__ +#if defined(__WIN32__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -695,7 +695,7 @@ TkIntXlibStubs tkIntXlibStubs = { XDrawLine, /* 104 */ XWarpPointer, /* 105 */ XFillRectangle, /* 106 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ @@ -789,7 +789,7 @@ TkIntXlibStubs tkIntXlibStubs = { XQueryColors, /* 89 */ XQueryTree, /* 90 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -882,20 +882,20 @@ TkIntXlibStubs tkIntXlibStubs = { XQueryColors, /* 89 */ XQueryTree, /* 90 */ XSync, /* 91 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ }; TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ Tk_HWNDToWindow, /* 3 */ Tk_PointerEvent, /* 4 */ Tk_TranslateWinEvent, /* 5 */ -#endif /* __WIN32__ */ +#endif /* WIN */ #ifdef MAC_TCL Tk_MacSetEmbedHandler, /* 0 */ Tk_MacTurnOffMenus, /* 1 */ @@ -909,7 +909,7 @@ TkPlatStubs tkPlatStubs = { TkMacHaveAppearance, /* 9 */ TkMacGetDrawablePort, /* 10 */ #endif /* MAC_TCL */ -#ifdef MAC_OSX_TK +#ifdef MAC_OSX_TK /* AQUA */ Tk_MacOSXSetEmbedHandler, /* 0 */ Tk_MacOSXTurnOffMenus, /* 1 */ Tk_MacOSXTkOwnsCursor, /* 2 */ @@ -921,7 +921,7 @@ TkPlatStubs tkPlatStubs = { TkMacOSXGetRootControl, /* 8 */ Tk_MacOSXSetupTkNotifier, /* 9 */ Tk_MacOSXIsAppInFront, /* 10 */ -#endif /* MAC_OSX_TK */ +#endif /* AQUA */ }; static TkStubHooks tkStubHooks = { diff --git a/win/stubs.c b/win/stubs.c index 5fbc8d1..60d2dc8 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -253,7 +253,7 @@ void XSetCommand(display, w, argv, argc) Display* display; Window w; - CONST char** argv; + char** argv; int argc; { } diff --git a/win/tkWinWm.c b/win/tkWinWm.c index ac4ea34..32768cf 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -3284,7 +3284,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; } -- cgit v0.12 From d7e1d66497a877b980042968a57edd01d2840818 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 25 May 2012 12:19:47 +0000 Subject: Simpify determination whether we are running on cygwin. Export Tk_GetHINSTANCE, TkSetPixmapColormap and TkpPrintWindowId on the Cygwin dll. Fix "make genstubs" when cross-compiling on UNIX --- ChangeLog | 9 +++ generic/tkImgPhoto.c | 2 + generic/tkInt.decls | 24 ++----- generic/tkIntPlatDecls.h | 69 ++++++++----------- generic/tkMain.c | 105 ++++++++++++++++++---------- generic/tkStubInit.c | 174 +++++++++++++++++++++-------------------------- generic/tkTextDisp.c | 2 + generic/tkWindow.c | 20 ++---- unix/tkUnixPort.h | 53 ++++++++------- win/Makefile.in | 25 +++++-- 10 files changed, 251 insertions(+), 232 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75cbd42..0b7dcec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-05-25 Jan Nijtmans + + * generic/tkWindow.c: Simpify determination whether we are running on cygwin. + * generic/tkStubInit.c: Export Tk_GetHINSTANCE, TkSetPixmapColormap and + * generic/tkInt.decls: TkpPrintWindowId on the Cygwin dll, sync stub table + with Tk 8.6 win32 version. + * generic/tk*Decls.h: re-generated + * win/Makefile.in: Fix "make genstubs" when cross-compiling on UNIX + 2012-05-24 Jan Nijtmans * win/stubs.c: Change XSetCommand signature to match Xorg, diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index ffbb47c..23db11a 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -25,6 +25,8 @@ #ifdef __WIN32__ #include "tkWinInt.h" +#elif defined(__CYGWIN__) +#include "tkUnixInt.h" #endif /* diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 61d5775..df2ad29 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -666,41 +666,31 @@ declare 36 win { UINT message, WPARAM wParam, LPARAM lParam) } -# new for 8.4.20+, Cygwin only +# new for 8.4.20+/8.5.12+, Cygwin only declare 37 win { void TkCreateXEventSource(void) } declare 38 win { - void TkFreeWindowId(TkDisplay *dispPtr, Window w) -} -declare 39 win { - void TkInitXId(TkDisplay *dispPtr) -} -declare 40 win { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } -declare 41 win { +declare 39 win { void TkpSync(Display *display) } -declare 42 win { +declare 40 win { Window TkUnixContainerId(TkWindow *winPtr) } -declare 43 win { +declare 41 win { int TkUnixDoOneXEvent(Tcl_Time *timePtr) } -declare 44 win { +declare 42 win { void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } -declare 45 win { +declare 43 win { void TkWmCleanup(TkDisplay *dispPtr) } -declare 46 win { +declare 44 win { void TkSendCleanup(TkDisplay *dispPtr) } -declare 47 win { - void TkFreeXId(TkDisplay *dispPtr) -} - ################################ # Mac specific functions diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 14a1f7d..badb8b6 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -129,28 +129,21 @@ EXTERN LRESULT __stdcall TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message, /* 37 */ EXTERN void TkCreateXEventSource _ANSI_ARGS_((void)); /* 38 */ -EXTERN void TkFreeWindowId _ANSI_ARGS_((TkDisplay *dispPtr, - Window w)); -/* 39 */ -EXTERN void TkInitXId _ANSI_ARGS_((TkDisplay *dispPtr)); -/* 40 */ EXTERN int TkpCmapStressed _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); -/* 41 */ +/* 39 */ EXTERN void TkpSync _ANSI_ARGS_((Display *display)); -/* 42 */ +/* 40 */ EXTERN Window TkUnixContainerId _ANSI_ARGS_((TkWindow *winPtr)); -/* 43 */ +/* 41 */ EXTERN int TkUnixDoOneXEvent _ANSI_ARGS_((Tcl_Time *timePtr)); -/* 44 */ +/* 42 */ EXTERN void TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); -/* 45 */ +/* 43 */ EXTERN void TkWmCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); -/* 46 */ +/* 44 */ EXTERN void TkSendCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); -/* 47 */ -EXTERN void TkFreeXId _ANSI_ARGS_((TkDisplay *dispPtr)); #endif /* WIN */ #ifdef MAC_TCL /* 0 */ @@ -490,16 +483,13 @@ typedef struct TkIntPlatStubs { int (*tkWinGetPlatformTheme) _ANSI_ARGS_((void)); /* 35 */ LRESULT (__stdcall *tkWinChildProc) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); /* 36 */ void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 37 */ - void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay *dispPtr, Window w)); /* 38 */ - void (*tkInitXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 39 */ - int (*tkpCmapStressed) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 40 */ - void (*tkpSync) _ANSI_ARGS_((Display *display)); /* 41 */ - Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow *winPtr)); /* 42 */ - int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time *timePtr)); /* 43 */ - void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 44 */ - void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 45 */ - void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 46 */ - void (*tkFreeXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 47 */ + int (*tkpCmapStressed) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 38 */ + void (*tkpSync) _ANSI_ARGS_((Display *display)); /* 39 */ + Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow *winPtr)); /* 40 */ + int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time *timePtr)); /* 41 */ + void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 42 */ + void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 43 */ + void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 44 */ #endif /* WIN */ #ifdef MAC_TCL void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 0 */ @@ -807,45 +797,33 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ #endif -#ifndef TkFreeWindowId -#define TkFreeWindowId \ - (tkIntPlatStubsPtr->tkFreeWindowId) /* 38 */ -#endif -#ifndef TkInitXId -#define TkInitXId \ - (tkIntPlatStubsPtr->tkInitXId) /* 39 */ -#endif #ifndef TkpCmapStressed #define TkpCmapStressed \ - (tkIntPlatStubsPtr->tkpCmapStressed) /* 40 */ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #endif #ifndef TkpSync #define TkpSync \ - (tkIntPlatStubsPtr->tkpSync) /* 41 */ + (tkIntPlatStubsPtr->tkpSync) /* 39 */ #endif #ifndef TkUnixContainerId #define TkUnixContainerId \ - (tkIntPlatStubsPtr->tkUnixContainerId) /* 42 */ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ #endif #ifndef TkUnixDoOneXEvent #define TkUnixDoOneXEvent \ - (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 43 */ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ #endif #ifndef TkUnixSetMenubar #define TkUnixSetMenubar \ - (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 44 */ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ #endif #ifndef TkWmCleanup #define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 45 */ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ #endif #ifndef TkSendCleanup #define TkSendCleanup \ - (tkIntPlatStubsPtr->tkSendCleanup) /* 46 */ -#endif -#ifndef TkFreeXId -#define TkFreeXId \ - (tkIntPlatStubsPtr->tkFreeXId) /* 47 */ + (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #endif #endif /* WIN */ #ifdef MAC_TCL @@ -1314,4 +1292,11 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#ifdef __CYGWIN__ + void TkFreeXId(TkDisplay *dispPtr); + void TkFreeWindowId(TkDisplay *dispPtr, Window w); + void TkInitXId(TkDisplay *dispPtr); +#endif + + #endif /* _TKINTPLATDECLS */ diff --git a/generic/tkMain.c b/generic/tkMain.c index 65a42a6..af2448e 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -28,6 +28,7 @@ #endif #ifdef __WIN32__ #include "tkWinInt.h" +#include "../win/tclWinPort.h" #endif #ifdef MAC_OSX_TK #include "tkMacOSXInt.h" @@ -55,7 +56,45 @@ static Tcl_ThreadDataKey dataKey; * some systems. */ -#if !defined(__WIN32__) && !defined(_WIN32) +#if defined(__WIN32__) || defined(_WIN32) +#define isatty WinIsTty +static int WinIsTty(int fd) { + HANDLE handle; + + /* + * For now, under Windows, we assume we are not running as a console mode + * app, so we need to use the GUI console. In order to enable this, we + * always claim to be running on a tty. This probably isn't the right + * way to do it. + */ + +#if !defined(STATIC_BUILD) + if (tclStubsPtr->reserved9 && TclpIsAtty) { + /* We are running on Cygwin */ + return TclpIsAtty(fd); + } +#endif + handle = GetStdHandle(STD_INPUT_HANDLE + fd); + + if ((handle == INVALID_HANDLE_VALUE) || (handle == 0) + || (GetFileType(handle) == FILE_TYPE_UNKNOWN)) { + /* + * If it's a bad or closed handle, then it's been connected + * to a wish console window. + */ + + return 1; + } else if (GetFileType(handle) == FILE_TYPE_CHAR) { + /* + * A character file handle is a tty by definition. + */ + + return 1; + } else { + return 0; + } +} +#else #if !defined(MAC_TCL) extern int isatty _ANSI_ARGS_((int fd)); #else @@ -90,6 +129,8 @@ static void StdinProc _ANSI_ARGS_((ClientData clientData, * *---------------------------------------------------------------------- */ +int LoadCygwinTk(Tcl_Interp *interp); + void Tk_MainEx(argc, argv, appInitProc, interp) int argc; /* Number of arguments. */ @@ -106,9 +147,6 @@ Tk_MainEx(argc, argv, appInitProc, interp) Tcl_Channel inChannel, outChannel; Tcl_DString appName; ThreadSpecificData *tsdPtr; -#ifdef __WIN32__ - HANDLE handle; -#endif /* * Ensure that we are getting the matching version of Tcl. This is @@ -119,6 +157,27 @@ Tk_MainEx(argc, argv, appInitProc, interp) abort(); } +#if defined(__WIN32__) && !defined(STATIC_BUILD) + 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)) { + loadCygwinTk: + Tcl_Panic("Should load libtk.dll now, not yet implemented"); + } else { + int i; + + for (i = 1; i < argc; ++i) { + if (!strcmp(argv[i], "-display")) { + goto loadCygwinTk; + } + } + } + } +#endif + tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -126,7 +185,12 @@ Tk_MainEx(argc, argv, appInitProc, interp) tsdPtr->interp = interp; Tcl_Preserve((ClientData) interp); -#if ((defined(__WIN32__) && !defined(__CYGWIN__)) || defined(MAC_TCL)) +#if defined(__WIN32__) && !defined(STATIC_BUILD) + if (!tclStubsPtr->reserved9) { + /* Only initialize console when not running under cygwin */ + Tk_InitConsoleChannels(interp); + } +#elif defined(__WIN32__) || defined(MAC_TCL) Tk_InitConsoleChannels(interp); #endif @@ -194,37 +258,8 @@ Tk_MainEx(argc, argv, appInitProc, interp) * Set the "tcl_interactive" variable. */ -#ifdef __WIN32__ - /* - * For now, under Windows, we assume we are not running as a console mode - * app, so we need to use the GUI console. In order to enable this, we - * always claim to be running on a tty. This probably isn't the right - * way to do it. - */ - - handle = GetStdHandle(STD_INPUT_HANDLE); - - if ((handle == INVALID_HANDLE_VALUE) || (handle == 0) - || (GetFileType(handle) == FILE_TYPE_UNKNOWN)) { - /* - * If it's a bad or closed handle, then it's been connected - * to a wish console window. - */ - - tsdPtr->tty = 1; - } else if (GetFileType(handle) == FILE_TYPE_CHAR) { - /* - * A character file handle is a tty by definition. - */ - - tsdPtr->tty = 1; - } else { - tsdPtr->tty = 0; - } - -#else tsdPtr->tty = isatty(0); -#endif + #if defined(MAC_OSX_TK) /* * On TkAqua, if we don't have a TTY and stdin is a special character file diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index e175a99..adaf319 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -49,14 +49,10 @@ doNothing(void) /* * Remove macros that will interfere with the definitions below. */ -# undef TkFreeWindowId -# undef TkInitXId # undef TkpCmapStressed # undef TkpSync -# define TkCreateXEventSource (void (*) (void)) doNothing -# define TkFreeWindowId (void (*) (TkDisplay *, Window)) doNothing -# define TkInitXId (void (*) (TkDisplay *)) doNothing +# define TkCreateXEventSource (void (*) (void)) doNothing # define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing # define TkpSync (void (*) (Display *)) doNothing # define TkUnixContainerId 0 @@ -64,40 +60,18 @@ doNothing(void) # define TkUnixSetMenubar 0 # define TkWmCleanup (void (*) (TkDisplay *)) doNothing # define TkSendCleanup (void (*) (TkDisplay *)) doNothing -# define TkFreeXId (void (*) (TkDisplay *)) doNothing -#else -/* - * Remove macros that will interfere with the definitions below. - */ -# undef TkClipBox -# undef TkCreateRegion -# undef TkDestroyRegion -# undef TkIntersectRegion -# undef TkRectInRegion -# undef TkSetRegion -# undef TkUnionRectWithRegion -# undef TkSubtractRegion -# undef TkPutImage -# undef TkSetPixmapColormap -# undef TkpPrintWindowId -# undef TkWinChildProc +#else /* !__WIN32__ */ -/* - * Make sure that extensions which call XParseColor through the stub - * table, call TkParseColor instead. [Bug 3486474] - */ -# define XParseColor TkParseColor +# undef TkClipBox +# undef TkCreateRegion +# undef TkDestroyRegion +# undef TkIntersectRegion +# undef TkRectInRegion +# undef TkSetRegion +# undef TkUnionRectWithRegion +# undef TkSubtractRegion -# ifndef __CYGWIN__ -# define Tk_AttachHWND 0 -# define Tk_GetHWND 0 -# define Tk_HWNDToWindow 0 -# define Tk_PointerEvent 0 -# define Tk_TranslateWinEvent 0 -# define Tk_GetHINSTANCE 0 -# endif -# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL) # define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox # define TkCreateRegion (TkRegion (*) ()) XCreateRegion # define TkDestroyRegion (void (*) _ANSI_ARGS_((TkRegion))) XDestroyRegion @@ -107,22 +81,34 @@ doNothing(void) # define TkUnionRectWithRegion (void (*) _ANSI_ARGS_((XRectangle *, TkRegion, TkRegion))) XUnionRectWithRegion # define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion -# ifdef __CYGWIN__ -# define Tk_GetHINSTANCE TkPlatGetHINSTANCE -# define TkSetPixmapColormap TkPlatSetPixmapColormap -# define TkpPrintWindowId TkPlatpPrintWindowId - /* - * Trick, so we don't have to include here, which in any - * case lacks this function anyway. + * Make sure that extensions which call XParseColor through the stub + * table, call TkParseColor instead. [Bug 3486474] */ +# define XParseColor TkParseColor + +# ifdef __CYGWIN__ + + /* + * Remove macros that will interfere with the definitions below. + */ +# undef TkPutImage +# undef TkSetPixmapColormap +# undef TkpPrintWindowId +# undef TkWinChildProc + + + /* + * 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; -static void *Tk_GetHINSTANCE() +void *Tk_GetHINSTANCE() { void *hInstance = NULL; @@ -131,14 +117,14 @@ static void *Tk_GetHINSTANCE() return hInstance; } -static void +void TkSetPixmapColormap(pixmap, colormap) Pixmap pixmap; Colormap colormap; { } -static void +void TkpPrintWindowId(buf, window) char *buf; /* Pointer to string large enough to hold * the hex representation of a pointer. */ @@ -147,47 +133,46 @@ TkpPrintWindowId(buf, window) sprintf(buf, "%#08lx", (unsigned long) (window)); } - /* TODO: To be implemented for Cygwin */ -# define Tk_AttachHWND 0 -# define Tk_GetHWND 0 -# define Tk_HWNDToWindow 0 -# define Tk_PointerEvent 0 -# define Tk_TranslateWinEvent 0 -# define TkAlignImageData 0 -# define TkGenerateActivateEvents 0 -# define TkpGetMS 0 -# define TkPointerDeadWindow 0 -# define TkpSetCapture 0 -# define TkpSetCursor 0 -# define TkWinCancelMouseTimer 0 -# define TkWinClipboardRender 0 -# define TkWinEmbeddedEventProc 0 -# define TkWinFillRect 0 -# define TkWinGetBorderPixels 0 -# define TkWinGetDrawableDC 0 -# define TkWinGetModifierState 0 -# define TkWinGetSystemPalette 0 -# define TkWinGetWrapperWindow 0 -# define TkWinHandleMenuEvent 0 -# define TkWinIndexOfColor 0 -# define TkWinReleaseDrawableDC 0 -# define TkWinResendEvent 0 -# define TkWinSelectPalette 0 -# define TkWinSetMenu 0 -# define TkWinSetWindowPos 0 -# define TkWinWmCleanup 0 -# define TkWinXCleanup 0 -# define TkWinXInit 0 -# define TkWinSetForegroundWindow 0 -# define TkWinDialogDebug 0 -# define TkWinGetMenuSystemDefault 0 -# define TkWinGetPlatformId 0 -# define TkWinSetHINSTANCE 0 -# define TkWinGetPlatformTheme 0 -# define TkWinChildProc 0 + /* TODO: To be implemented for Cygwin */ +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 +# define TkAlignImageData 0 +# define TkGenerateActivateEvents 0 +# define TkpGetMS 0 +# define TkPointerDeadWindow 0 +# define TkpSetCapture 0 +# define TkpSetCursor 0 +# define TkWinCancelMouseTimer 0 +# define TkWinClipboardRender 0 +# define TkWinEmbeddedEventProc 0 +# define TkWinFillRect 0 +# define TkWinGetBorderPixels 0 +# define TkWinGetDrawableDC 0 +# define TkWinGetModifierState 0 +# define TkWinGetSystemPalette 0 +# define TkWinGetWrapperWindow 0 +# define TkWinHandleMenuEvent 0 +# define TkWinIndexOfColor 0 +# define TkWinReleaseDrawableDC 0 +# define TkWinResendEvent 0 +# define TkWinSelectPalette 0 +# define TkWinSetMenu 0 +# define TkWinSetWindowPos 0 +# define TkWinWmCleanup 0 +# define TkWinXCleanup 0 +# define TkWinXInit 0 +# define TkWinSetForegroundWindow 0 +# define TkWinDialogDebug 0 +# define TkWinGetMenuSystemDefault 0 +# define TkWinGetPlatformId 0 +# define TkWinSetHINSTANCE 0 +# define TkWinGetPlatformTheme 0 +# define TkWinChildProc 0 # endif /* __CYGWIN__ */ -# endif /* !MAC_TCL && !MACC_OSX_TCL */ #endif /* !__WIN32__ */ /* @@ -431,16 +416,13 @@ TkIntPlatStubs tkIntPlatStubs = { TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ TkCreateXEventSource, /* 37 */ - TkFreeWindowId, /* 38 */ - TkInitXId, /* 39 */ - TkpCmapStressed, /* 40 */ - TkpSync, /* 41 */ - TkUnixContainerId, /* 42 */ - TkUnixDoOneXEvent, /* 43 */ - TkUnixSetMenubar, /* 44 */ - TkWmCleanup, /* 45 */ - TkSendCleanup, /* 46 */ - TkFreeXId, /* 47 */ + TkpCmapStressed, /* 38 */ + TkpSync, /* 39 */ + TkUnixContainerId, /* 40 */ + TkUnixDoOneXEvent, /* 41 */ + TkUnixSetMenubar, /* 42 */ + TkWmCleanup, /* 43 */ + TkSendCleanup, /* 44 */ #endif /* WIN */ #ifdef MAC_TCL TkGenerateActivateEvents, /* 0 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 1e7ca88..cd5d90f 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -18,6 +18,8 @@ #ifdef __WIN32__ #include "tkWinInt.h" +#elif defined(__CYGWIN__) +#include "tkUnixInt.h" #endif #ifdef TK_NO_DOUBLE_BUFFERING diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 67db10c..21675d0 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -16,7 +16,9 @@ #include "tkPort.h" #include "tkInt.h" -#if !( defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !(defined(MAC_TCL) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif @@ -852,9 +854,6 @@ TkCreateMainWindow(interp, screenName, baseName) Tk_Window tkwin; int dummy; int isSafe; -#if defined(__WIN32__) && !defined(STATIC_BUILD) - int isWin32 = 0; -#endif Tcl_HashEntry *hPtr; register TkMainInfo *mainPtr; register TkWindow *winPtr; @@ -862,14 +861,6 @@ TkCreateMainWindow(interp, screenName, baseName) ClientData clientData; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); -#if defined(__WIN32__) && !defined(STATIC_BUILD) - Tcl_Obj *stringObjPtr = Tcl_GetVar2Ex(interp, "::tcl_platform", "platform", 0); - - if (stringObjPtr - && !strcmp(Tcl_GetString(stringObjPtr), "windows")) { - isWin32 = 1; - } -#endif /* * Panic if someone updated the TkWindow structure without @@ -954,7 +945,8 @@ TkCreateMainWindow(interp, screenName, baseName) Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } #if defined(__WIN32__) && !defined(STATIC_BUILD) - if (!isWin32 && (cmdPtr->flags & WINMACONLY)) { + if ((cmdPtr->flags & WINMACONLY) && tclStubsPtr->reserved9) { + /* We are running on Cygwin, so don't use the win32 dialogs */ continue; } #endif @@ -3209,9 +3201,7 @@ Initialize(interp) Tcl_SetMainLoop(Tk_MainLoop); } -#ifdef Tk_InitStubs #undef Tk_InitStubs -#endif Tk_InitStubs(interp, TK_VERSION, 1); diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index f0affb8..6e03287 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -125,6 +125,31 @@ # define NBBY 8 #endif +#ifdef __CYGWIN__ +# define UINT unsigned int +# define HWND void * +# define HDC void * +# define HINSTANCE void * +# define COLORREF void * +# define HMENU void * +# define TkWinDCState void +# define HPALETTE void * +# define WNDPROC void * +# 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. */ + /* + * The TkPutImage macro strips off the color table information, which isn't + * needed for X. + */ + +# define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ + XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ + desty, width, height); + +/* #endif */ + /* * These macros are just wrappers for the equivalent X Region calls. */ @@ -141,29 +166,7 @@ #define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \ (Region) src, (Region) ret) -/* - * The TkPutImage macro strips off the color table information, which isn't - * needed for X. - */ - -#define TkPutImage(colors, ncolors, display, pixels, gc, image, destx, desty, srcx, srcy, width, height) \ - XPutImage(display, pixels, gc, image, destx, desty, srcx, \ - srcy, width, height); - -#ifdef __CYGWIN__ -# define UINT unsigned int -# define HWND void * -# define HDC void * -# define HINSTANCE void * -# define COLORREF void * -# define HMENU void * -# define TkWinDCState void -# define HPALETTE void * -# define WNDPROC void * -# define WPARAM void * -# define LPARAM void * -# define LRESULT void * -#endif +/* #endif */ /* * Supply macros for seek offsets, if they're not already provided by @@ -195,7 +198,9 @@ #define TkpButtonSetDefaults(specPtr) {} #define TkpDestroyButton(butPtr) {} #define TkSelUpdateClipboard(a,b) {} +#ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} +#endif /* * These calls implement native bitmaps which are not supported under @@ -211,8 +216,10 @@ * This should perhaps use the real size of an XID. */ +#ifndef __CYGWIN__ #define TkpPrintWindowId(buf,w) \ sprintf((buf), "%#08lx", (unsigned long) (w)) +#endif /* * The following declaration is used to get access to a private Tcl interface diff --git a/win/Makefile.in b/win/Makefile.in index 9304b43..6612230 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -429,8 +429,13 @@ install-binaries: binaries @(\ echo "if {[package vcompare [package provide Tcl]\ $(TCLVERSION)] != 0} { return }";\ - echo "package ifneeded Tk $(VERSION)\ + 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 "} else {";\ + 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); \ do \ @@ -642,7 +647,19 @@ $(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \ @echo "This warning can be safely ignored, do not report as a bug!" genstubs: - $(TCL_EXE) "$(TCL_TOOL_DIR}\genStubs.tcl" \ + $(TCL_EXE) "$(TCL_TOOL_DIR)/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ - "$(GENERIC_DIR_NATIVE)\tk.decls" \ - "$(GENERIC_DIR_NATIVE)\tkInt.decls" + "$(GENERIC_DIR_NATIVE)/tk.decls" \ + "$(GENERIC_DIR_NATIVE)/tkInt.decls" +# +# 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 doc tkLibObjs objs tktest-real test test-classic +.PHONY: test-ttk testlang runtest shell demo gdb install install-strip +.PHONY: install-binaries install-libraries install-demos install-doc +.PHONY: install-private-headers clean distclean depend genstubs checkstubs +.PHONY: checkuchar checkexports rpm dist alldist allpatch html html-tcl html-tk + +# DO NOT DELETE THIS LINE -- make depend depends on it. -- cgit v0.12 From 6092901c18b64a83b6d7ccb7e4c63679afb801b1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 25 May 2012 14:42:24 +0000 Subject: this should fix the broken build, not yet tested on Unix --- generic/tkStubInit.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index c526a86..a0ab9e9 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -61,17 +61,6 @@ TkpSync(Display *display) # define TkpTestsendCmd 0 #else -# undef TkClipBox -# undef TkCreateRegion -# undef TkDestroyRegion -# undef TkIntersectRegion -# undef TkRectInRegion -# undef TkSetRegion -# undef TkUnionRectWithRegion -# undef TkSubtractRegion -# undef TkSetPixmapColormap -# undef TkpPrintWindowId -# undef TkWinChildProc /* * Make sure that extensions which call XParseColor through the stub @@ -211,7 +200,28 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c) # define TkWinSetHINSTANCE 0 # define TkWinGetPlatformTheme 0 # define TkWinChildProc 0 -# endif /* __CYGWIN__ */ + +#elif !defined(MAC_OSC_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__ */ /* -- cgit v0.12 From b4af65b9b3806189bdeb7f8abea1a1490fff67c4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 28 May 2012 20:46:02 +0000 Subject: Fixed merge error --- doc/text.n | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/text.n b/doc/text.n index 433c026..da16f9a 100644 --- a/doc/text.n +++ b/doc/text.n @@ -36,14 +36,12 @@ Specifies a boolean that says whether the blinking insertion cursor should be drawn as a character-sized rectangular block. If false (the default) a thin vertical line is used for the insertion cursor. .OP \-endline endLine EndLine -.VS 8.5 Specifies an integer line index representing the line of the underlying textual data store that should be just after the last line contained in the widget. This allows a text widget to reflect only a portion of a larger piece of text. Instead of an integer, the empty string can be provided to this configuration option, which will configure the widget to end at the very last line in the textual data store. -.VE 8.5 .OP \-height height Height Specifies the desired height for the window, in units of characters in the font given by the \fB\-font\fR option. Must be at least one. -- cgit v0.12 From c9b81d88741dc175b61b47fd0086e96ad479dcb5 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 29 May 2012 13:29:51 +0000 Subject: Unbreak the OSX build --- generic/tkIntXlibDecls.h | 6 +++--- generic/tkStubInit.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index a55ee53..bd899bf 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -36,7 +36,7 @@ * Exported function declarations: */ -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); @@ -602,7 +602,7 @@ typedef struct TkIntXlibStubs { int magic; const struct TkIntXlibStubHooks *hooks; -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ void (*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 */ @@ -821,7 +821,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 6ba0bda..66b1b80 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -201,7 +201,7 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c) # define TkWinGetPlatformTheme 0 # define TkWinChildProc 0 -#elif !defined(MAC_OSC_TK) /* UNIX */ +#elif !defined(MAC_OSX_TK) /* UNIX */ # undef TkClipBox # undef TkCreateRegion @@ -577,7 +577,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ -- cgit v0.12 From da68cb938e2bec4280883c4052906b9811aadf7c Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 29 May 2012 14:57:44 +0000 Subject: Added OSX-specific mechanism to allow retrieval of the drawing surface. --- ChangeLog | 6 ++++++ carbon/tkMacOSXSubwindows.c | 7 +++++++ generic/tkInt.decls | 5 +++++ generic/tkIntPlatDecls.h | 5 +++++ generic/tkStubInit.c | 1 + macosx/tkMacOSXSubwindows.c | 7 +++++++ 6 files changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 37dfceb..6bcd66c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-05-29 Donal K. Fellows + + * generic/tkInt.decls (TkMacOSXDrawable): Added OSX-specific mechanism + to allow retrieval of the drawing surface. Allows Canvas3d to be + adapted to 8.6. + 2012-05-28 Francois Vogel * doc/text.n: [Bug 1630251]: Documentation for -endline option was wrong diff --git a/carbon/tkMacOSXSubwindows.c b/carbon/tkMacOSXSubwindows.c index 23e73ff..437906f 100644 --- a/carbon/tkMacOSXSubwindows.c +++ b/carbon/tkMacOSXSubwindows.c @@ -1051,6 +1051,13 @@ TkMacOSXDrawableWindow( } return result; } + +void * +TkMacOSXDrawable( + Drawable drawable) +{ + return TkMacOSXDrawableWindow(drawable); +} /* *---------------------------------------------------------------------- diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 7e33de4..480f596 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1027,6 +1027,11 @@ declare 51 aqua { declare 53 aqua { unsigned long TkpGetMS(void) } + +# For Canvas3d, requested by Sean Woods +declare 54 aqua { + void *TkMacOSXDrawable(Drawable drawable) +} ############################################################################## diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index b940db9..e2528d8 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -249,6 +249,8 @@ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* Slot 52 is reserved */ /* 53 */ EXTERN unsigned long TkpGetMS(void); +/* 54 */ +EXTERN void * TkMacOSXDrawable(Drawable drawable); #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ @@ -388,6 +390,7 @@ typedef struct TkIntPlatStubs { void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ void (*reserved52)(void); unsigned long (*tkpGetMS) (void); /* 53 */ + void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ @@ -615,6 +618,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 52 is reserved */ #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +#define TkMacOSXDrawable \ + (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 66b1b80..34cf671 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -555,6 +555,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkGenWMDestroyEvent, /* 51 */ 0, /* 52 */ TkpGetMS, /* 53 */ + TkMacOSXDrawable, /* 54 */ #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2933876..8cf8d65 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -969,6 +969,13 @@ TkMacOSXDrawableWindow( } return result; } + +void * +TkMacOSXDrawable( + Drawable drawable) +{ + return TkMacOSXDrawableWindow(drawable); +} /* *---------------------------------------------------------------------- -- 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 0ad4cbd7bd60324dc875c7d8f472096589c2b024 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 31 May 2012 09:30:22 +0000 Subject: Implement XFlush and various others for win32 as stubs, so win32 extensions using those can run under CYGWIN as well. Allow tk86.dll to cooperate with the cygwin console. --- ChangeLog | 4 +++ generic/tk.h | 2 +- generic/tkInt.decls | 25 ++++++++++++++++++ generic/tkIntXlibDecls.h | 57 +++++++++++++++++++++++++++++++++++++--- generic/tkMain.c | 10 ++++++- generic/tkStubInit.c | 12 ++++++--- unix/tkUnixPort.h | 18 ------------- win/Makefile.in | 7 ++++- win/stubs.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ win/tkWinPort.h | 21 --------------- 10 files changed, 176 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index d43f6f6..66f2aac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ * generic/tk*Decls.h: re-generated * win/Makefile.in: Fix "make genstubs" when cross-compiling on UNIX + * win/stubs.c: Implement XFlush and various others for win32 as stubs, + * win/tkWinPort.h: so win32 extensions using those can run under CYGWIN as well. + * generic/tkMain.c: Allow tk86.dll to cooperate with the cygwin console. + 2012-05-29 Donal K. Fellows * generic/tkInt.decls (TkMacOSXDrawable): Added OSX-specific mechanism diff --git a/generic/tk.h b/generic/tk.h index a9b96e3..a44cfa8 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1471,7 +1471,7 @@ typedef struct Tk_ElementSpec { #define Tk_Release Tcl_Release /* Removed Tk_Main, use macro instead */ -#ifdef _WIN32 +#if defined(__WIN32__) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) #else diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 66a11c6..6709493 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1412,6 +1412,31 @@ 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) } +# New in Tk 8.6 +declare 107 win { + int XFlush(Display *display) +} +declare 108 win { + int XGrabServer(Display *display) +} +declare 109 win { + int XUngrabServer(Display *display) +} +declare 110 win { + int XFree(void *data) +} +declare 111 win { + int XNoOp(Display *display) +} +declare 112 win { + int XSynchronize(Display *display, Bool onoff) +} +declare 113 win { + int XSync(Display *display, Bool discard) +} +declare 114 win { + VisualID XVisualIDFromVisual(Visual *visual) +} ################################ # X functions for Aqua diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index bd899bf..a613cf1 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -36,7 +36,7 @@ * Exported function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ /* 0 */ EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); @@ -332,6 +332,22 @@ EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx, EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); +/* 107 */ +EXTERN int XFlush(Display *display); +/* 108 */ +EXTERN int XGrabServer(Display *display); +/* 109 */ +EXTERN int XUngrabServer(Display *display); +/* 110 */ +EXTERN int XFree(void *data); +/* 111 */ +EXTERN int XNoOp(Display *display); +/* 112 */ +EXTERN int XSynchronize(Display *display, Bool onoff); +/* 113 */ +EXTERN int XSync(Display *display, Bool discard); +/* 114 */ +EXTERN VisualID XVisualIDFromVisual(Visual *visual); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ @@ -602,7 +618,7 @@ typedef struct TkIntXlibStubs { int magic; const struct TkIntXlibStubHooks *hooks; -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*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 */ @@ -710,6 +726,14 @@ typedef struct TkIntXlibStubs { void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xFlush) (Display *display); /* 107 */ + int (*xGrabServer) (Display *display); /* 108 */ + int (*xUngrabServer) (Display *display); /* 109 */ + int (*xFree) (void *data); /* 110 */ + int (*xNoOp) (Display *display); /* 111 */ + int (*xSynchronize) (Display *display, Bool onoff); /* 112 */ + int (*xSync) (Display *display, Bool discard); /* 113 */ + VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ @@ -821,7 +845,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -1035,6 +1059,22 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xWarpPointer) /* 105 */ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define XSetDashes \ @@ -1230,4 +1270,15 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#if !(defined(__WIN32__) || defined(__CYGWIN__)) +/* + * The TkPutImage macro strips off the color table information, which isn't + * needed for X. + */ + +#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ + XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ + desty, width, height); +#endif + #endif /* _TKINTXLIBDECLS */ diff --git a/generic/tkMain.c b/generic/tkMain.c index 4932d36..03e74b0 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -53,6 +53,7 @@ * to strcmp here. */ #ifdef __WIN32__ +# include "tclInt.h" # include "tkWinInt.h" #else # define TCHAR char @@ -92,10 +93,11 @@ * it will conflict with a declaration elsewhere on some systems. */ -#if defined(_WIN32) +#if defined(__WIN32__) || defined(_WIN32) #define isatty WinIsTty static int WinIsTty(int fd) { HANDLE handle; + /* * For now, under Windows, we assume we are not running as a console mode * app, so we need to use the GUI console. In order to enable this, we @@ -103,6 +105,12 @@ static int WinIsTty(int fd) { * to do it. */ +#if !defined(STATIC_BUILD) + if (tclStubsPtr->reserved9 && TclpIsAtty) { + /* We are running on Cygwin */ + return TclpIsAtty(fd); + } +#endif handle = GetStdHandle(STD_INPUT_HANDLE + fd); /* * If it's a bad or closed handle, then it's been connected to a wish diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index de5e00e..13ab403 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -80,8 +80,6 @@ TkpSync(Display *display) #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; @@ -580,7 +578,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#if defined(__WIN32__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -688,6 +686,14 @@ static const TkIntXlibStubs tkIntXlibStubs = { XDrawLine, /* 104 */ XWarpPointer, /* 105 */ XFillRectangle, /* 106 */ + XFlush, /* 107 */ + XGrabServer, /* 108 */ + XUngrabServer, /* 109 */ + XFree, /* 110 */ + XNoOp, /* 111 */ + XSynchronize, /* 112 */ + XSync, /* 113 */ + XVisualIDFromVisual, /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ XSetDashes, /* 0 */ diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 12010f4..93422cf 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -126,25 +126,7 @@ # define WPARAM void * # define LPARAM void * # define LRESULT void * -#else -/* - * The TkPutImage macro strips off the color table information, which isn't - * needed for X. - */ - -#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ - XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ - desty, width, height); - #endif - /* - * The TkPutImage macro strips off the color table information, which isn't - * needed for X. - */ - -# define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ - XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ - desty, width, height); /* * Supply macros for seek offsets, if they're not already provided by diff --git a/win/Makefile.in b/win/Makefile.in index 247e183..04e3d85 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -94,6 +94,10 @@ TCL_BIN_DIR = @TCL_BIN_DIR@ # 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. @@ -120,6 +124,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@ @@ -208,7 +213,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} -DUSE_TCL_STUBS +-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ diff --git a/win/stubs.c b/win/stubs.c index 00030d1..3cd8327 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -386,3 +386,71 @@ XGetWindowProperty( *prop_return = NULL; return BadValue; } + +/* + * The following functions were implemented as macros under Windows. + */ + +int +XFlush( + Display *display) +{ + return 0; +} + +int +XGrabServer( + Display *display) +{ + return 0; +} + +int +XUngrabServer( + Display *display) +{ + return 0; +} + +int +XFree( + void *data) +{ + if ((data) != NULL) { + ckfree(data); + } + return 0; +} + +int +XNoOp( + Display *display) +{ + display->request++; + return 0; +} + +int +XSynchronize( + Display *display, + Bool bool) +{ + display->request++; + return 0; +} + +int +XSync( + Display *display, + Bool bool) +{ + display->request++; + return 0; +} + +VisualID +XVisualIDFromVisual( + Visual *visual) +{ + return visual->visualid; +} diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 75c7d22..fe31609 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -98,27 +98,6 @@ #endif /* _MSC_VER */ /* - * The following stubs implement various calls that don't do anything - * under Windows. - */ - -#define TkFreeWindowId(dispPtr,w) -#define TkInitXId(dispPtr) -#define XFlush(display) -#define XGrabServer(display) -#define XUngrabServer(display) - -/* - * The following functions are implemented as macros under Windows. - */ - -#define XFree(data) {if ((data) != NULL) ckfree(data);} -#define XNoOp(display) {display->request++;} -#define XSynchronize(display, bool) {display->request++;} -#define XSync(display, bool) {display->request++;} -#define XVisualIDFromVisual(visual) (visual->visualid) - -/* * The following Tk functions are implemented as macros under Windows. */ -- cgit v0.12 From 4deef3d6e9f16828bae60ad2862c9ef5fc6a5e88 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 31 May 2012 14:25:24 +0000 Subject: fix some minor failures due to Tcl's changed list of safe aliases --- tests/safe.test | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/safe.test b/tests/safe.test index 652e1a2..e7ed6c7 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -33,7 +33,7 @@ namespace import -force tcltest::test # The set of hidden commands is platform dependent: -set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source toplevel unload wm} +set hidden_cmds {bell cd clipboard encoding exec exit fconfigure glob grab load menu open pwd selection socket source toplevel unload wm} lappend hidden_cmds {*}[apply {{} { foreach cmd { atime attributes copy delete dirname executable exists extension @@ -42,10 +42,11 @@ lappend hidden_cmds {*}[apply {{} { volumes writable } {lappend result tcl:file:$cmd}; return $result }}] -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] ne "x11"} { lappend hidden_cmds tk_chooseColor tk_chooseDirectory tk_getOpenFile \ tk_getSaveFile tk_messageBox -} else { +} +if {[llength [info commands send]]} { lappend hidden_cmds send } @@ -78,7 +79,7 @@ test safe-1.3 {Safe Tk loading into an interpreter} -setup { lsort [interp aliases a] } -cleanup { safe::interpDelete a -} -match glob -result {*encoding*exit*file*load*source*} +} -match glob -result {*encoding*exit*glob*load*source*} test safe-2.1 {Unsafe commands not available} -setup { catch {safe::interpDelete a} @@ -187,20 +188,20 @@ test safe-5.1 {loading Tk in safe interps without master's clearance} -body { } -cleanup { safe::interpDelete $i } -returnCodes error -result {not allowed to start Tk by master's safe::TkInit} -test safe-5.2 {multi-level Tk loading with clearance} -body { +test safe-5.2 {multi-level Tk loading with clearance} -setup { + set safeParent [safe::interpCreate] +} -body { # No error shall occur in that test and no window shall remain at the end. - set i [safe::interpCreate] - set j [list $i x] - set j [safe::interpCreate $j] - safe::loadTk $j - interp eval $j { + set i [safe::interpCreate [list $safeParent x]] + safe::loadTk $i + interp eval $i { button .b -text Ok -command {destroy .} pack .b # tkwait window . ; # for interactive testing/debugging } } -cleanup { - safe::interpDelete $j - safe::interpDelete $i + catch {safe::interpDelete $i} + safe::interpDelete $safeParent } -result {} test safe-6.1 {loadTk -use windowPath} -setup { -- cgit v0.12 From 4609e36025d2dd05783233feac88c6cad06256df Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 Jun 2012 07:29:44 +0000 Subject: unbreak Linux build --- generic/tkIntXlibDecls.h | 11 ----------- unix/tkUnixPort.h | 9 +++++++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index a613cf1..f4aa5f9 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -1270,15 +1270,4 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -#if !(defined(__WIN32__) || defined(__CYGWIN__)) -/* - * The TkPutImage macro strips off the color table information, which isn't - * needed for X. - */ - -#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ - XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ - desty, width, height); -#endif - #endif /* _TKINTXLIBDECLS */ diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 93422cf..8118d95 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -126,6 +126,15 @@ # define WPARAM void * # define LPARAM void * # define LRESULT void * +#else +/* + * The TkPutImage macro strips off the color table information, which isn't + * needed for X. + */ + +#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ + XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ + desty, width, height); #endif /* -- 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 676eb78eadce63bc5b6a98b6c1f2d077b49a9869 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Jun 2012 09:11:27 +0000 Subject: [Bug 3532186] pkgIndex.tcl file complexity --- ChangeLog | 5 +++++ unix/Makefile.in | 68 +++++++++++++++++++++++++++++--------------------------- win/Makefile.in | 15 ++++++++----- 3 files changed, 49 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66f2aac..3e8a860 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-05-31 Jan Nijtmans * generic/tkWindow.c: Simpify determination whether we are running on cygwin. diff --git a/unix/Makefile.in b/unix/Makefile.in index bf523ea..52ad3be 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -210,6 +210,7 @@ BUILD_TCLSH = @BUILD_TCLSH@ EXE_SUFFIX = @EXEEXT@ TCL_EXE = @TCLSH_PROG@ WISH_EXE = wish${EXE_SUFFIX} +TKTEST_EXE = tktest${EXE_SUFFIX} # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of @@ -620,12 +621,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${EXE_SUFFIX}: $(TKTEST_OBJS) $(TK_LIB_FILE) +$(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${TK_STUB_LIB_FILE} ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest${EXE_SUFFIX} + $(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 lib location logic from @@ -645,26 +646,26 @@ tktest-real: ${TK_STUB_LIB_FILE} test: test-classic test-ttk -test-classic: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(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${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(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${EXE_SUFFIX} +testlang: $(TKTEST_EXE) $(SHELL_ENV) \ for lang in $(LOCALES) ; \ do \ LANG=$(lang); export LANG; \ - ./tktest${EXE_SUFFIX} $(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${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} +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` @@ -676,7 +677,7 @@ demo: # This target can be used to run wish inside either gdb or insight gdb: ${WISH_EXE} - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @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_EXE} --command=gdb.run @@ -684,11 +685,11 @@ gdb: ${WISH_EXE} VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v -valgrind: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(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${EXE_SUFFIX} $(SCRIPT) +valgrindshell: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT) INSTALL_BASE_TARGETS = install-binaries install-libraries INSTALL_DOC_TARGETS = install-doc @@ -725,24 +726,25 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} (\ echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} 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)/" @@INSTALL_LIB@ @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}" - @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)"/wish$(VERSION)${EXE_SUFFIX} + @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}" @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@ ; \ @@ -753,8 +755,8 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} @$(INSTALL_DATA) tk.pc $(LIB_INSTALL_DIR)/pkgconfig/tk.pc install-libraries: libraries - @for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"/images \ - "$(SCRIPT_INSTALL_DIR)"/msgs "$(SCRIPT_INSTALL_DIR)"/ttk; \ + @for i in "$(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"; \ @@ -772,21 +774,21 @@ install-libraries: libraries @for i in $(TOP_DIR)/library/ttk/*.tcl; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/ttk; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/ttk"; \ fi; \ done; @echo "Installing library image files to $(SCRIPT_INSTALL_DIR)/images/"; @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 message catalog files to $(SCRIPT_INSTALL_DIR)/msgs/"; @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; @@ -810,16 +812,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 to $(DEMO_INSTALL_DIR)/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; @@ -892,7 +894,7 @@ Makefile: $(UNIX_DIR)/Makefile.in clean: rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ - errors ${WISH_EXE} tktest${EXE_SUFFIX} 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 \ diff --git a/win/Makefile.in b/win/Makefile.in index 04e3d85..89f57bc 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -445,7 +445,7 @@ runtest: binaries $(TKTEST) $(TEST_DLL_FILE) shell: binaries $(SHELL_ENV) ./$(WISH) $(SCRIPT) -demo: +demo: $(WISH) $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight @@ -478,10 +478,13 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[catch {package present Tcl\ - $(TCLVERSION)$(TCLPATCHL)}]} { return }";\ - echo "package ifneeded Tk $(VERSION)$(PATCH_LEVEL)\ - [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} { return }";\ + 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 \ @@ -678,7 +681,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 $(CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME) -- 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 From b9eb35ddebc45ca5424bb3c24d03c3585ba6030f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jun 2012 22:11:29 +0000 Subject: function def in front --- generic/tkMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkMain.c b/generic/tkMain.c index 6b9a393..365e0d1 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -34,6 +34,7 @@ #include "tkMacOSXInt.h" #endif +extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); typedef struct ThreadSpecificData { Tcl_Interp *interp; /* Interpreter for this thread. */ @@ -156,7 +157,6 @@ Tk_MainEx(argc, argv, appInitProc, interp) } #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 -- cgit v0.12 From c8f0062c64f9fc019a92e9bbc8918aa3e4ba1571 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 10 Jun 2012 14:47:24 +0000 Subject: [Bug 3534137]: $tcl_platform(platform) != [tk windowingsystem] --- ChangeLog | 5 +++++ library/bgerror.tcl | 10 +++++----- library/button.tcl | 4 ++-- library/entry.tcl | 4 ++-- library/menu.tcl | 2 +- library/scale.tcl | 2 +- library/spinbox.tcl | 2 +- library/text.tcl | 6 +++--- library/tk.tcl | 4 ++-- 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index b119d67..5ed87a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-06-10 Jan Nijtmans + + * library/*.tcl: [Bug 3534137]: $tcl_platform(platform) != + [tk windowingsystem] + 2012-06-08 Jan Nijtmans * generic/tkMain.c: Implement TkCygwinMainEx for loading diff --git a/library/bgerror.tcl b/library/bgerror.tcl index 06c72a1..3372115 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -94,7 +94,7 @@ proc ::tk::dialog::error::bgerror err { # we use the default dialog then : set windowingsystem [tk windowingsystem] - if {($tcl_platform(platform) eq "macintosh") + if {($windowingsystem eq "classic") || ($windowingsystem eq "aqua")} { set ok [mc Ok] set messageFont system @@ -143,7 +143,7 @@ proc ::tk::dialog::error::bgerror err { wm iconname .bgerrorDialog ErrorDialog wm protocol .bgerrorDialog WM_DELETE_WINDOW { } - if {($tcl_platform(platform) eq "macintosh") + if {($windowingsystem eq "classic") || ($windowingsystem eq "aqua")} { ::tk::unsupported::MacWindowStyle style .bgerrorDialog moveableAlert {} } elseif {$windowingsystem eq "x11"} { @@ -190,7 +190,7 @@ proc ::tk::dialog::error::bgerror err { set wrapwidth [expr {$wrapwidth-60-[winfo pixels .bgerrorDialog 9m]}] label .bgerrorDialog.msg -justify left -text $text -font $messageFont \ -wraplength $wrapwidth - if {($tcl_platform(platform) eq "macintosh") + if {($windowingsystem eq "classic") || ($windowingsystem eq "aqua")} { # On the Macintosh, use the stop bitmap label .bgerrorDialog.bitmap -bitmap stop @@ -226,7 +226,7 @@ proc ::tk::dialog::error::bgerror err { -padx 10 grid columnconfigure .bgerrorDialog.bot $i -weight 1 # We boost the size of some Mac buttons for l&f - if {($tcl_platform(platform) eq "macintosh") + if {($windowingsystem eq "classic") || ($windowingsystem eq "aqua")} { if {($name eq "ok") || ($name eq "dismiss")} { grid columnconfigure .bgerrorDialog.bot $i -minsize 90 @@ -251,7 +251,7 @@ proc ::tk::dialog::error::bgerror err { # 7. Ensure that we are topmost. raise .bgerrorDialog - if {$tcl_platform(platform) eq "windows"} { + if {[tk windowingsystem] eq "win32"} { # Place it topmost if we aren't at the top of the stacking # order to ensure that it's seen if {[lindex [wm stackorder .] end] ne ".bgerrorDialog"} { diff --git a/library/button.tcl b/library/button.tcl index 0da95f0..195566e 100644 --- a/library/button.tcl +++ b/library/button.tcl @@ -36,7 +36,7 @@ if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { tk::ButtonUp %W } } -if {"windows" eq $tcl_platform(platform)} { +if {"win32" eq [tk windowingsystem]} { bind Checkbutton { tk::CheckRadioInvoke %W select } @@ -125,7 +125,7 @@ bind Radiobutton { tk::ButtonLeave %W } -if {"windows" eq $tcl_platform(platform)} { +if {"win32" eq [tk windowingsystem]} { ######################### # Windows implementation diff --git a/library/entry.tcl b/library/entry.tcl index bfbaccf..93812b7 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -209,7 +209,7 @@ if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { # On Windows, paste is done using Shift-Insert. Shift-Insert already # generates the <> event, so we don't need to do anything here. -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Entry { catch {tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]} } @@ -561,7 +561,7 @@ proc ::tk::EntryTranspose w { # w - The entry window in which the cursor is to move. # start - Position at which to start search. -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { proc ::tk::EntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0} { diff --git a/library/menu.tcl b/library/menu.tcl index 782a726..4ce0d8c 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -1189,7 +1189,7 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} { incr x [expr {-[winfo reqwidth $menu]/2}] } - if {$tcl_platform(platform) eq "windows"} { + if {[tk windowingsystem] eq "win32"} { # osVersion is not available in safe interps set ver 5 if {[info exists tcl_platform(osVersion)]} { diff --git a/library/scale.tcl b/library/scale.tcl index 41fd720..d5de754 100644 --- a/library/scale.tcl +++ b/library/scale.tcl @@ -60,7 +60,7 @@ bind Scale { tk::ScaleEndDrag %W tk::ScaleActivate %W %x %y } -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { # On Windows do the same with button 3, as that is the right mouse button bind Scale <3> [bind Scale <2>] bind Scale [bind Scale ] diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 933c25c..9b63e09 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -217,7 +217,7 @@ if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { # On Windows, paste is done using Shift-Insert. Shift-Insert already # generates the <> event, so we don't need to do anything here. -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Spinbox { catch {::tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]} } diff --git a/library/text.tcl b/library/text.tcl index 3f608f3..3b32991 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -345,7 +345,7 @@ bind Text <> { catch { %W edit redo } } -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Text { if {!$tk_strictMotif} { tk::TextScrollPages %W 1 @@ -530,7 +530,7 @@ proc ::tk::TextButton1 {w x y} { $w mark set anchor insert # Allow focus in any case on Windows, because that will let the # selection be displayed even for state disabled text widgets. - if {$::tcl_platform(platform) eq "windows" || [$w cget -state] eq "normal"} {focus $w} + if {[tk windowingsystem] eq "win32" || [$w cget -state] eq "normal"} {focus $w} if {[$w cget -autoseparators]} {$w edit separator} } @@ -1040,7 +1040,7 @@ proc ::tk_textPaste w { # w - The text window in which the cursor is to move. # start - Position at which to start search. -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { proc ::tk::TextNextWord {w start} { TextNextPos $w [TextNextPos $w $start tcl_endOfWord] \ tcl_startOfNextWord diff --git a/library/tk.tcl b/library/tk.tcl index 57525f1..a09cd9c 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -199,7 +199,7 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { # Results: # Returns the selection, or an error if none could be found # -if {$tcl_platform(platform) eq "unix"} { +if {[tk windowingsystem] ne "win32"} { proc ::tk::GetSelection {w {sel PRIMARY}} { if {[catch {selection get -displayof $w -selection $sel \ -type UTF8_STRING} txt] \ @@ -405,7 +405,7 @@ switch [tk windowingsystem] { # ---------------------------------------------------------------------- if {$::tk_library ne ""} { - if {$tcl_platform(platform) eq "macintosh"} { + if {[tk windowingsystem] eq "classic"} { proc ::tk::SourceLibFile {file} { if {[catch { namespace eval :: \ -- cgit v0.12 From 1c088c317f2e745d9cb6d114e8dd95a94ef8700f Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 11 Jun 2012 08:06:56 +0000 Subject: Fix broken commits so function definitions match declarations and returns are of values that should be produced. --- macosx/tkMacOSXClipboard.c | 3 +-- macosx/tkMacOSXDraw.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index d1f1baa..92d6590 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -198,14 +198,13 @@ XSetSelectionOwner( *---------------------------------------------------------------------- */ -int +void TkMacOSXSelDeadWindow( TkWindow *winPtr) { if (winPtr && winPtr == (TkWindow *)clipboardOwner) { clipboardOwner = NULL; } - return Success; } /* diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 9a49790..fd73b96 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -348,6 +348,7 @@ TkPutImage( TkMacOSXDbgMsg("Invalid destination drawable"); } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -731,7 +732,8 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, + 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); @@ -745,7 +747,6 @@ DrawCGImage( } else { TkMacOSXDbgMsg("Drawing of empty CGImage requested"); } - return Success; } /* -- cgit v0.12 From 38a06949798bf6ad09a37c512983274db9b4b195 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 11 Jun 2012 08:57:14 +0000 Subject: [Bug 3294450]: Do clipping of ttk text elements correctly. --- ChangeLog | 10 ++++++++++ generic/ttk/ttkLabel.c | 22 +++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c389c07..fac93a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-06-11 Donal K. Fellows + + * generic/ttk/ttkLabel.c (TextDraw): [Bug 3294450]: Get the clipping + of text in Ttk text elements (e.g., buttons, entries, etc.) correct. + Stops a whole range of visual problems, including loss of the second + and subsequent lines of a label when the first line doesn't entirely + fit, and failing to draw the last character of an entry at all if it + doesn't all exactly fit in the space available (a problem I've noticed + in tkchat, and been very frustrated with). + 2012-06-10 Jan Nijtmans * library/*.tcl: [Bug 3534137]: $tcl_platform(platform) != diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 0f773e7..df6a686 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include "ttkTheme.h" /*---------------------------------------------------------------------- @@ -128,7 +128,6 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, text->foregroundObj); int underline = -1; - int lastChar = -1; XGCValues gcValues; GC gc1, gc2; Tk_Anchor anchor = TK_ANCHOR_CENTER; @@ -147,21 +146,30 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) /* * Clip text if it's too wide: - * @@@ BUG: This will overclip multi-line text. */ if (b.width < text->width) { - lastChar = Tk_PointToChar(text->textLayout, b.width, 1) + 1; + TkRegion clipRegion = TkCreateRegion(); + XRectangle rect; + + rect.x = b.x; + rect.y = b.y; + rect.width = b.width + (text->embossed ? 1 : 0); + rect.height = b.height + (text->embossed ? 1 : 0); + TkUnionRectWithRegion(&rect, clipRegion, clipRegion); + TkSetRegion(Tk_Display(tkwin), gc1, clipRegion); + TkSetRegion(Tk_Display(tkwin), gc2, clipRegion); + TkDestroyRegion(clipRegion); } if (text->embossed) { Tk_DrawTextLayout(Tk_Display(tkwin), d, gc2, - text->textLayout, b.x+1, b.y+1, 0/*firstChar*/, lastChar); + text->textLayout, b.x+1, b.y+1, 0/*firstChar*/, -1/*lastChar*/); } Tk_DrawTextLayout(Tk_Display(tkwin), d, gc1, - text->textLayout, b.x, b.y, 0/*firstChar*/, lastChar); + text->textLayout, b.x, b.y, 0/*firstChar*/, -1/*lastChar*/); Tcl_GetIntFromObj(NULL, text->underlineObj, &underline); - if (underline >= 0 && (lastChar == -1 || underline <= lastChar)) { + if (underline >= 0) { if (text->embossed) { Tk_UnderlineTextLayout(Tk_Display(tkwin), d, gc2, text->textLayout, b.x+1, b.y+1, underline); -- cgit v0.12 From bf900a025e09fca253dd396abc9c29f1de5ae36a Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 11 Jun 2012 09:32:22 +0000 Subject: fix the clipping in entries too --- ChangeLog | 13 +++++++------ generic/ttk/ttkEntry.c | 32 +++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index fac93a0..7ac76d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,13 @@ 2012-06-11 Donal K. Fellows * generic/ttk/ttkLabel.c (TextDraw): [Bug 3294450]: Get the clipping - of text in Ttk text elements (e.g., buttons, entries, etc.) correct. - Stops a whole range of visual problems, including loss of the second - and subsequent lines of a label when the first line doesn't entirely - fit, and failing to draw the last character of an entry at all if it - doesn't all exactly fit in the space available (a problem I've noticed - in tkchat, and been very frustrated with). + * generic/ttk/ttkEntry.c (EntryDisplay): of text in Ttk various text + elements (e.g., buttons, entries, etc.) correct. Stops a whole range + of visual problems, including loss of the second and subsequent lines + of a label when the first line doesn't entirely fit, and failing to + draw the last character of an entry at all if it doesn't all exactly + fit in the space available (a problem I've noticed in tkchat, and been + very frustrated with). 2012-06-10 Jan Nijtmans diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index c4b1b6a..410c60c 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include "ttkTheme.h" @@ -1123,7 +1123,7 @@ EntryDoLayout(void *recordPtr) * rightIndex is set to one past the last fully-visible character. */ Tk_CharBbox(textLayout, leftIndex, &leftX, NULL, NULL, NULL); - rightIndex = Tk_PointToChar(textLayout, leftX + textarea.width, 0); + rightIndex = Tk_PointToChar(textLayout, leftX + textarea.width, 0)+1; entryPtr->entry.layoutX = textarea.x - leftX; } @@ -1135,13 +1135,14 @@ EntryDoLayout(void *recordPtr) * Get a GC using the specified foreground color and the entry's font. * Result must be freed with Tk_FreeGC(). */ -static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj) +static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj, TkRegion clip) { Tk_Window tkwin = entryPtr->core.tkwin; Tk_Font font = Tk_GetFontFromObj(tkwin, entryPtr->entry.fontObj); XColor *colorPtr; unsigned long mask = 0ul; XGCValues gcValues; + GC gc; gcValues.line_width = 1; mask |= GCLineWidth; gcValues.font = Tk_FontId(font); mask |= GCFont; @@ -1149,7 +1150,9 @@ static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj) gcValues.foreground = colorPtr->pixel; mask |= GCForeground; } - return Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); + gc = Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); + TkSetRegion(Tk_Display(entryPtr->core.tkwin), gc, clip); + return gc; } /* EntryDisplay -- @@ -1166,9 +1169,13 @@ static void EntryDisplay(void *clientData, Drawable d) EntryStyleData es; GC gc; int showSelection, showCursor; + Ttk_Box textarea; + TkRegion clipRegion; + XRectangle rect; EntryInitStyleData(entryPtr, &es); + textarea = Ttk_ClientRegion(corePtr->layout, "textarea"); showCursor = (entryPtr->core.flags & CURSOR_ON) != 0 && EntryEditable(entryPtr) @@ -1214,6 +1221,16 @@ static void EntryDisplay(void *clientData, Drawable d) } } + /* Initialize the clip region: + */ + + rect.x = textarea.x; + rect.y = textarea.y; + rect.width = textarea.width; + rect.height = textarea.height; + clipRegion = TkCreateRegion(); + TkUnionRectWithRegion(&rect, clipRegion, clipRegion); + /* Draw cursor: */ if (showCursor) { @@ -1230,7 +1247,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* @@@ should: maybe: SetCaretPos even when blinked off */ Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight); - gc = EntryGetGC(entryPtr, es.insertColorObj); + gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion); XFillRectangle(Tk_Display(tkwin), d, gc, cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight); Tk_FreeGC(Tk_Display(tkwin), gc); @@ -1238,7 +1255,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* Draw the text: */ - gc = EntryGetGC(entryPtr, es.foregroundObj); + gc = EntryGetGC(entryPtr, es.foregroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, @@ -1248,13 +1265,14 @@ static void EntryDisplay(void *clientData, Drawable d) /* Overwrite the selected portion (if any) in the -selectforeground color: */ if (showSelection) { - gc = EntryGetGC(entryPtr, es.selForegroundObj); + gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, selFirst, selLast); Tk_FreeGC(Tk_Display(tkwin), gc); } + TkDestroyRegion(clipRegion); } /*------------------------------------------------------------------------ -- cgit v0.12 From bac8a500d4926440f129c1ae37245e5a5bfcd997 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 11 Jun 2012 10:20:34 +0000 Subject: make it build --- generic/ttk/ttkEntry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 410c60c..044369c 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1175,7 +1175,7 @@ static void EntryDisplay(void *clientData, Drawable d) EntryInitStyleData(entryPtr, &es); - textarea = Ttk_ClientRegion(corePtr->layout, "textarea"); + textarea = Ttk_ClientRegion(entryPtr->core.layout, "textarea"); showCursor = (entryPtr->core.flags & CURSOR_ON) != 0 && EntryEditable(entryPtr) -- cgit v0.12 From 725e61cc4033c4fd2cccb831bac3c997fa61e712 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 11 Jun 2012 13:06:34 +0000 Subject: fix test failure --- generic/ttk/ttkEntry.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 044369c..e5d0ef2 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1123,7 +1123,7 @@ EntryDoLayout(void *recordPtr) * rightIndex is set to one past the last fully-visible character. */ Tk_CharBbox(textLayout, leftIndex, &leftX, NULL, NULL, NULL); - rightIndex = Tk_PointToChar(textLayout, leftX + textarea.width, 0)+1; + rightIndex = Tk_PointToChar(textLayout, leftX + textarea.width, 0); entryPtr->entry.layoutX = textarea.x - leftX; } @@ -1163,7 +1163,7 @@ static void EntryDisplay(void *clientData, Drawable d) Entry *entryPtr = clientData; Tk_Window tkwin = entryPtr->core.tkwin; int leftIndex = entryPtr->entry.xscroll.first, - rightIndex = entryPtr->entry.xscroll.last, + rightIndex = entryPtr->entry.xscroll.last + 1, selFirst = entryPtr->entry.selectFirst, selLast = entryPtr->entry.selectLast; EntryStyleData es; @@ -1265,7 +1265,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* Overwrite the selected portion (if any) in the -selectforeground color: */ if (showSelection) { - gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion); + gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, -- cgit v0.12