diff options
-rwxr-xr-x | ChangeLog | 9 | ||||
-rw-r--r-- | generic/tkInt.decls | 24 | ||||
-rw-r--r-- | generic/tkIntXlibDecls.h | 60 | ||||
-rw-r--r-- | generic/tkPointer.c | 4 | ||||
-rw-r--r-- | generic/tkStubInit.c | 145 | ||||
-rw-r--r-- | mac/tkMacClipboard.c | 8 | ||||
-rw-r--r-- | mac/tkMacColor.c | 6 | ||||
-rw-r--r-- | mac/tkMacDraw.c | 5 | ||||
-rw-r--r-- | mac/tkMacKeyboard.c | 3 | ||||
-rw-r--r-- | mac/tkMacXStubs.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXClipboard.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXDraw.c | 19 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyboard.c | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 6 | ||||
-rw-r--r-- | unix/Makefile.in | 212 | ||||
-rw-r--r-- | unix/tkUnixPort.h | 36 | ||||
-rw-r--r-- | win/Makefile.in | 51 | ||||
-rw-r--r-- | win/stubs.c | 56 | ||||
-rw-r--r-- | win/tkWinClipboard.c | 15 | ||||
-rw-r--r-- | win/tkWinColor.c | 24 | ||||
-rwxr-xr-x | win/tkWinDraw.c | 85 | ||||
-rw-r--r-- | win/tkWinKey.c | 16 | ||||
-rw-r--r-- | win/tkWinPointer.c | 16 | ||||
-rw-r--r-- | win/tkWinWindow.c | 22 | ||||
-rw-r--r-- | win/tkWinX.c | 68 | ||||
-rw-r--r-- | xlib/xdraw.c | 6 | ||||
-rw-r--r-- | xlib/xgc.c | 44 | ||||
-rw-r--r-- | xlib/ximage.c | 2 | ||||
-rw-r--r-- | xlib/xutil.c | 6 |
30 files changed, 528 insertions, 443 deletions
@@ -1,4 +1,11 @@ -2012-05-09 Jan Nijtmans <nijtmans@users.sf.net> +2012-06-02 Jan Nijtmans <nijtmans@users.sf.net> + + * 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 <nijtmans@users.sf.net> * 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 f88186a..091bb50 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1337,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) } @@ -1426,14 +1426,14 @@ declare 104 win { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } -declare 106 win { - int XFillRectangle(Display *display, Drawable d, GC gc, - int x, int y, unsigned int width, unsigned int height) -} 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) +} ################################ # X functions for Mac and Aqua @@ -1482,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, @@ -1538,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, @@ -1604,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) @@ -1634,7 +1634,7 @@ 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 +1739,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 06bb0f0..fb3153d 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -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, @@ -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, @@ -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, @@ -541,7 +541,7 @@ 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, @@ -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, @@ -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, @@ -831,7 +831,7 @@ 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, @@ -1032,7 +1032,7 @@ typedef struct TkIntXlibStubs { 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 */ @@ -1074,7 +1074,7 @@ 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 */ @@ -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 */ @@ -1118,7 +1118,7 @@ typedef struct TkIntXlibStubs { void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ 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 */ int (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */ @@ -1148,7 +1148,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 */ @@ -1167,7 +1167,7 @@ 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 */ @@ -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 */ @@ -1211,7 +1211,7 @@ typedef struct TkIntXlibStubs { void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */ 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 */ int (*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 8a8efdc..949dcee 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -488,7 +488,7 @@ XUngrabPointer(display, time) tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); UpdateCursor(tsdPtr->lastWinPtr); - return 0; + return Success; } /* @@ -605,7 +605,7 @@ XDefineCursor(display, w, cursor) UpdateCursor(winPtr); } display->request++; - return 0; + return Success; } /* diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index adaf319..24478e4 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 <windows.h> here, which in any + * case lacks this function anyway. + */ - /* - * Trick, so we don't have to include <windows.h> here, which in any - * case lacks this function anyway. - */ - -# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 +#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); -TkIntStubs tkIntStubs; - void *Tk_GetHINSTANCE() { void *hInstance = NULL; @@ -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__ */ /* @@ -569,7 +624,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, NULL, -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ diff --git a/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 93daf8d..8f70da6 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -6,7 +6,7 @@ int _XInitImageFuncPtrs(XImage *image) { - return 0; + return Success; } /* @@ -45,7 +45,7 @@ XChangeProperty(display, w, property, type, format, mode, data, nelements) _Xconst unsigned char* data; int nelements; { - return 0; + return Success; } Cursor @@ -56,8 +56,8 @@ XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char, Font mask_font; unsigned int source_char; unsigned int mask_char; - XColor _Xconst *foreground_color; - XColor _Xconst *background_color; + XColor _Xconst* foreground_color; + XColor _Xconst* background_color; { return 1; } @@ -88,7 +88,7 @@ XDeleteProperty(display, w, property) Window w; Atom property; { - return 0; + return Success; } void @@ -109,7 +109,7 @@ int XForceScreenSaver(display, mode) Display* display; int mode; { - return 0; + return Success; } int @@ -117,7 +117,7 @@ XFreeCursor(display, cursor) Display* display; Cursor cursor; { - return 0; + return Success; } GContext @@ -141,7 +141,7 @@ XGetWindowAttributes(display, w, window_attributes_return) Window w; XWindowAttributes* window_attributes_return; { - return 0; + return Success; } Status @@ -160,7 +160,7 @@ XIconifyWindow(display, w, screen_number) Window w; int screen_number; { - return 0; + return Success; } XHostAddress * @@ -181,7 +181,7 @@ XLookupColor(display, colormap, color_name, exact_def_return, XColor* exact_def_return; XColor* screen_def_return; { - return 0; + return Success; } int @@ -189,7 +189,7 @@ XNextEvent(display, event_return) Display* display; XEvent* event_return; { - return 0; + return Success; } int @@ -197,7 +197,7 @@ XPutBackEvent(display, event) Display* display; XEvent* event; { - return 0; + return Success; } int @@ -207,7 +207,7 @@ XQueryColors(display, colormap, defs_in_out, ncolors) XColor* defs_in_out; int ncolors; { - return 0; + return Success; } int @@ -220,14 +220,14 @@ XQueryTree(display, w, root_return, parent_return, children_return, Window** children_return; unsigned int* nchildren_return; { - return 0; + return Success; } int XRefreshKeyboardMapping(event_map) XMappingEvent* event_map; { - return 0; + return Success; } Window @@ -244,7 +244,7 @@ XSelectInput(display, w, event_mask) Window w; long event_mask; { - return 0; + return Success; } int @@ -255,7 +255,7 @@ XSendEvent(display, w, propagate, event_mask, event_send) long event_mask; XEvent* event_send; { - return 0; + return Success; } int @@ -265,7 +265,7 @@ XSetCommand(display, w, argv, argc) char** argv; int argc; { - return 0; + return Success; } XErrorHandler @@ -281,7 +281,7 @@ XSetIconName(display, w, icon_name) Window w; _Xconst char* icon_name; { - return 0; + return Success; } int @@ -290,7 +290,7 @@ XSetWindowBackground(display, w, background_pixel) Window w; unsigned long background_pixel; { - return 0; + return Success; } int @@ -299,7 +299,7 @@ XSetWindowBackgroundPixmap(display, w, background_pixmap) Window w; Pixmap background_pixmap; { - return 0; + return Success; } int @@ -308,7 +308,7 @@ XSetWindowBorder(display, w, border_pixel) Window w; unsigned long border_pixel; { - return 0; + return Success; } int @@ -317,7 +317,7 @@ XSetWindowBorderPixmap(display, w, border_pixmap) Window w; Pixmap border_pixmap; { - return 0; + return Success; } int @@ -326,7 +326,7 @@ XSetWindowBorderWidth(display, w, width) Window w; unsigned int width; { - return 0; + return Success; } int @@ -335,7 +335,7 @@ XSetWindowColormap(display, w, colormap) Window w; Colormap colormap; { - return 0; + return Success; } Bool @@ -360,7 +360,7 @@ XWindowEvent(display, w, event_mask, event_return) long event_mask; XEvent* event_return; { - return 0; + return Success; } int @@ -369,7 +369,7 @@ XWithdrawWindow(display, w, screen_number) Window w; int screen_number; { - return 0; + return Success; } int @@ -382,7 +382,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 97d809c..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 \"", @@ -218,7 +217,7 @@ XSetSelectionOwner(display, selection, owner, time) UpdateClipboard(hwnd); } } - return 0; + return Success; } /* @@ -404,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 1c7eb7a..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; @@ -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,7 +485,7 @@ XFreeColors(display, colormap, pixels, npixels, planes) } } ReleaseDC(NULL, dc); - return 0; + return Success; } /* @@ -579,7 +579,7 @@ XFreeColormap(display, colormap) } Tcl_DeleteHashTable(&cmap->refCounts); ckfree((char *) cmap); - return 0; + return Success; } /* diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 9bdeec1..04a27c4 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; @@ -335,7 +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; + return Success; } /* @@ -487,7 +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; + return Success; } /* @@ -507,7 +507,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 @@ -517,7 +517,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. */ @@ -551,22 +551,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 */ @@ -597,13 +597,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; } /* @@ -637,7 +638,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HBRUSH brush, oldBrush; if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -660,7 +661,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); @@ -692,7 +693,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) SelectObject(dcMem, oldBitmap); DeleteObject(bitmap); } - + DeleteDC(dcMem); SelectObject(dc, oldBrush); DeleteObject(stipple); @@ -710,7 +711,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, @@ -724,7 +725,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); - return 1; + return Success; } /* @@ -758,7 +759,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) { @@ -769,7 +770,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"); } @@ -789,7 +790,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)); @@ -797,7 +798,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)); @@ -806,7 +807,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++) { @@ -886,9 +887,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); @@ -897,9 +898,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; } /* @@ -933,7 +934,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode) HDC dc; if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -942,7 +943,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode) RenderObject(dc, gc, points, npoints, mode, pen, Polygon); TkWinReleaseDrawableDC(d, dc, &state); - return 0; + return Success; } /* @@ -977,7 +978,7 @@ XDrawRectangle(display, d, gc, x, y, width, height) HDC dc; if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -993,7 +994,7 @@ XDrawRectangle(display, d, gc, x, y, width, height) DeleteObject(SelectObject(dc, oldPen)); SelectObject(dc, oldBrush); TkWinReleaseDrawableDC(d, dc, &state); - return 0; + return Success; } /* @@ -1099,7 +1100,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill) double radian_start, radian_end, xr, yr; if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -1169,7 +1170,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill) } DeleteObject(SelectObject(dc, oldPen)); TkWinReleaseDrawableDC(d, dc, &state); - return 0; + return Success; } /* @@ -1234,24 +1235,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); @@ -1355,7 +1356,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 9b78ee4..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; @@ -696,7 +696,7 @@ XFreeModifiermap(modmap) { ckfree((char *) modmap->modifiermap); ckfree((char *) modmap); - return 0; + return Success; } /* @@ -704,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 de812ba..bac6e18 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -1,4 +1,4 @@ -/* +/* * tkWinPointer.c -- * * Windows specific mouse tracking code. @@ -201,7 +201,7 @@ XUngrabKeyboard(display, time) Time time; { keyboardWinPtr = NULL; - return 0; + return Success; } /* @@ -209,7 +209,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: @@ -365,7 +365,7 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, GetWindowRect(Tk_GetHWND(dest_w), &r); SetCursorPos(r.left+dest_x, r.top+dest_y); - return 0; + return Success; } /* @@ -394,7 +394,7 @@ XGetInputFocus(display, focus_return, revert_to_return) *focus_return = tkwin ? Tk_WindowId(tkwin) : None; *revert_to_return = RevertToParent; display->request++; - return 0; + return Success; } /* @@ -425,7 +425,7 @@ XSetInputFocus(display, focus, revert_to, time) if (focus != None) { SetFocus(Tk_GetHWND(focus)); } - return 0; + return Success; } /* @@ -473,7 +473,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. @@ -505,7 +505,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/tkWinWindow.c b/win/tkWinWindow.c index 2e5b97e..ef14604 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -330,7 +330,7 @@ XDestroyWindow(display, w) if (hwnd != NULL && !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) { DestroyWindow(hwnd); } - return 0; + return Success; } /* @@ -374,7 +374,7 @@ XMapWindow(display, w) for (parentPtr = winPtr->parentPtr; ; parentPtr = parentPtr->parentPtr) { if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) { - return 0; + return Success; } if (parentPtr->flags & TK_TOP_HIERARCHY) { break; @@ -403,7 +403,7 @@ XMapWindow(display, w) event.xvisibility.window = winPtr->window; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(&event, winPtr); - return 0; + return Success; } /* @@ -488,7 +488,7 @@ XUnmapWindow(display, w) event.xunmap.from_configure = False; Tk_HandleEvent(&event); } - return 0; + return Success; } /* @@ -518,7 +518,7 @@ XMoveResizeWindow(display, w, x, y, width, height) { display->request++; MoveWindow(Tk_GetHWND(w), x, y, width, height, TRUE); - return 0; + return Success; } /* @@ -550,7 +550,7 @@ XMoveWindow(display, w, x, y) MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width, winPtr->changes.height, TRUE); - return 0; + return Success; } /* @@ -582,7 +582,7 @@ XResizeWindow(display, w, width, height) MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, width, height, TRUE); - return 0; + return Success; } /* @@ -611,7 +611,7 @@ XRaiseWindow(display, w) display->request++; SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - return 0; + return Success; } /* @@ -667,7 +667,7 @@ XConfigureWindow(display, w, value_mask, values) } TkWinSetWindowPos(hwnd, sibling, values->stack_mode); } - return 0; + return Success; } /* @@ -714,7 +714,7 @@ XClearWindow(display, w) DeleteObject(brush); SelectPalette(dc, oldPalette, TRUE); ReleaseDC(hwnd, dc); - return 0; + return Success; } /* @@ -745,7 +745,7 @@ XChangeWindowAttributes(display, w, valueMask, attributes) if (valueMask & CWCursor) { XDefineCursor(display, w, attributes->cursor); } - return 0; + return Success; } /* diff --git a/win/tkWinX.c b/win/tkWinX.c index 5d53714..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) { @@ -765,7 +765,7 @@ XBell(display, percent) int percent; { MessageBeep(MB_OK); - return 0; + return Success; } /* @@ -833,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. */ @@ -982,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) { @@ -1177,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 @@ -1257,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: @@ -1351,7 +1351,7 @@ GetTranslatedKey(xkey) XKeyEvent *xkey; { MSG msg; - + xkey->nbytes = 0; while ((xkey->nbytes < XMaxTransChars) @@ -1515,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. @@ -1764,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 46eee3e..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. @@ -42,7 +42,6 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) points[1].x = x2; points[1].y = y2; return XDrawLines(display, d, gc, points, 2, CoordModeOrigin); - return 0; } /* @@ -78,5 +77,4 @@ XFillRectangle(display, d, gc, x, y, width, height) rectangle.width = width; rectangle.height = height; return XFillRectangles(display, d, gc, &rectangle, 1); - return 0; } @@ -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 <das@users.sourceforge.net> @@ -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; } @@ -211,7 +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; + return Success; } /* @@ -238,7 +238,7 @@ int XFreeGC(d, gc) FreeClipMask(gc); ckfree((char *) gc); } - return 0; + return Success; } /* @@ -265,7 +265,7 @@ XSetForeground(display, gc, foreground) unsigned long foreground; { gc->foreground = foreground; - return 0; + return Success; } int @@ -275,7 +275,7 @@ XSetBackground(display, gc, background) unsigned long background; { gc->background = background; - return 0; + return Success; } int @@ -300,7 +300,7 @@ XSetDashes(display, gc, dash_offset, dash_list, n) *p++ = *dash_list++; } *p = 0; - return 0; + return Success; } int @@ -310,7 +310,7 @@ XSetFunction(display, gc, function) int function; { gc->function = function; - return 0; + return Success; } int @@ -320,7 +320,7 @@ XSetFillRule(display, gc, fill_rule) int fill_rule; { gc->fill_rule = fill_rule; - return 0; + return Success; } int @@ -330,7 +330,7 @@ XSetFillStyle(display, gc, fill_style) int fill_style; { gc->fill_style = fill_style; - return 0; + return Success; } int @@ -341,7 +341,7 @@ XSetTSOrigin(display, gc, x, y) { gc->ts_x_origin = x; gc->ts_y_origin = y; - return 0; + return Success; } int @@ -351,7 +351,7 @@ XSetFont(display, gc, font) Font font; { gc->font = font; - return 0; + return Success; } int @@ -361,7 +361,7 @@ XSetArcMode(display, gc, arc_mode) int arc_mode; { gc->arc_mode = arc_mode; - return 0; + return Success; } int @@ -371,7 +371,7 @@ XSetStipple(display, gc, stipple) Pixmap stipple; { gc->stipple = stipple; - return 0; + return Success; } int @@ -388,7 +388,7 @@ 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; + return Success; } int @@ -400,7 +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; + return Success; } /* @@ -457,7 +457,7 @@ XSetClipMask(display, gc, pixmap) clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = pixmap; } - return 0; + return Success; } /* 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) |