summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--generic/tkInt.decls51
-rw-r--r--generic/tkIntXlibDecls.h128
-rw-r--r--generic/tkPointer.c6
-rw-r--r--generic/tkStubInit.c143
-rw-r--r--mac/tkMacClipboard.c8
-rw-r--r--mac/tkMacColor.c6
-rw-r--r--mac/tkMacDraw.c5
-rw-r--r--mac/tkMacKeyboard.c3
-rw-r--r--mac/tkMacXStubs.c6
-rw-r--r--macosx/tkMacOSXClipboard.c8
-rw-r--r--macosx/tkMacOSXColor.c6
-rw-r--r--macosx/tkMacOSXDraw.c19
-rw-r--r--macosx/tkMacOSXKeyboard.c3
-rw-r--r--macosx/tkMacOSXXStubs.c6
-rw-r--r--unix/Makefile.in212
-rw-r--r--unix/tkUnixPort.h36
-rw-r--r--win/Makefile.in51
-rw-r--r--win/stubs.c23
-rw-r--r--win/tkWinClipboard.c16
-rw-r--r--win/tkWinColor.c26
-rwxr-xr-xwin/tkWinDraw.c69
-rw-r--r--win/tkWinKey.c17
-rw-r--r--win/tkWinPointer.c13
-rw-r--r--win/tkWinX.c69
-rw-r--r--xlib/xdraw.c4
-rw-r--r--xlib/xgc.c21
-rw-r--r--xlib/ximage.c2
-rw-r--r--xlib/xutil.c6
29 files changed, 535 insertions, 437 deletions
diff --git a/ChangeLog b/ChangeLog
index 7577bdd..d90693a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
-2012-05-09 Jan Nijtmans <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 3084743..b20a46e 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -1065,7 +1065,7 @@ interface tkIntXlib
# X functions for Windows
declare 0 win {
- void XSetDashes(Display *display, GC gc, int dash_offset,
+ int XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n)
}
declare 1 win {
@@ -1095,7 +1095,8 @@ declare 7 win {
}
declare 8 win {
Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
- unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2)
+ unsigned int ui1, unsigned int ui2, XColor _Xconst *x1,
+ XColor _Xconst *x2)
}
declare 9 win {
GContext XGContextFromGC(GC g)
@@ -1129,7 +1130,7 @@ declare 18 win {
Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
declare 19 win {
- void XBell(Display *d, int i)
+ int XBell(Display *d, int i)
}
declare 20 win {
void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
@@ -1160,7 +1161,7 @@ declare 26 win {
_Xconst char *data, unsigned int width, unsigned int height)
}
declare 27 win {
- void XDefineCursor(Display *d, Window w, Cursor c)
+ int XDefineCursor(Display *d, Window w, Cursor c)
}
declare 28 win {
void XDeleteProperty(Display *d, Window w, Atom a)
@@ -1194,17 +1195,17 @@ declare 36 win {
void XForceScreenSaver(Display *d, int i)
}
declare 37 win {
- void XFreeColormap(Display *d, Colormap c)
+ int XFreeColormap(Display *d, Colormap c)
}
declare 38 win {
- void XFreeColors(Display *d, Colormap c,
+ int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul)
}
declare 39 win {
void XFreeCursor(Display *d, Cursor c)
}
declare 40 win {
- void XFreeModifiermap(XModifierKeymap *x)
+ int XFreeModifiermap(XModifierKeymap *x)
}
declare 41 win {
Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
@@ -1280,7 +1281,7 @@ declare 61 win {
Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x)
}
declare 62 win {
- void XSetCommand(Display *d, Window w, char **c, int i)
+ int XSetCommand(Display *d, Window w, char **c, int i)
}
declare 63 win {
void XSetIconName(Display *d, Window w, _Xconst char *c)
@@ -1289,7 +1290,7 @@ declare 64 win {
void XSetInputFocus(Display *d, Window w, int i, Time t)
}
declare 65 win {
- void XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
+ int XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
declare 66 win {
void XSetWindowBackground(Display *d, Window w, unsigned long ul)
@@ -1317,7 +1318,7 @@ declare 73 win {
void XUngrabKeyboard(Display *d, Time t)
}
declare 74 win {
- void XUngrabPointer(Display *d, Time t)
+ int XUngrabPointer(Display *d, Time t)
}
declare 75 win {
void XUnmapWindow(Display *d, Window w)
@@ -1336,7 +1337,7 @@ declare 79 win {
KeySym *k, Status *s)
}
declare 80 win {
- void TkPutImage(unsigned long *colors, int ncolors, Display *display,
+ int TkPutImage(unsigned long *colors, int ncolors, Display *display,
Drawable d, GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width, unsigned int height)
}
@@ -1425,20 +1426,20 @@ declare 104 win {
int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
int x2, int y2)
}
+declare 105 win {
+ int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
+ unsigned int sw, unsigned int sh, int dx, int dy)
+}
declare 106 win {
int XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width, unsigned int height)
}
-declare 105 win {
- void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
- unsigned int sw, unsigned int sh, int dx, int dy)
-}
################################
# X functions for Mac and Aqua
declare 0 {mac aqua} {
- void XSetDashes(Display *display, GC gc, int dash_offset,
+ int XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n)
}
declare 1 {mac aqua} {
@@ -1481,7 +1482,7 @@ declare 12 {mac aqua} {
Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
declare 13 {mac aqua} {
- void XBell(Display *d, int i)
+ int XBell(Display *d, int i)
}
declare 14 {mac aqua} {
void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
@@ -1509,7 +1510,7 @@ declare 19 {mac aqua} {
_Xconst char *data, unsigned int width, unsigned int height)
}
declare 20 {mac aqua} {
- void XDefineCursor(Display *d, Window w, Cursor c)
+ int XDefineCursor(Display *d, Window w, Cursor c)
}
declare 21 {mac aqua} {
void XDestroyWindow(Display *d, Window w)
@@ -1537,14 +1538,14 @@ declare 27 {mac aqua} {
int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
}
declare 28 {mac aqua} {
- void XFreeColormap(Display *d, Colormap c)
+ int XFreeColormap(Display *d, Colormap c)
}
declare 29 {mac aqua} {
- void XFreeColors(Display *d, Colormap c,
+ int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul)
}
declare 30 {mac aqua} {
- void XFreeModifiermap(XModifierKeymap *x)
+ int XFreeModifiermap(XModifierKeymap *x)
}
declare 31 {mac aqua} {
Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
@@ -1603,7 +1604,7 @@ declare 46 {mac aqua} {
void XSetInputFocus(Display *d, Window w, int i, Time t)
}
declare 47 {mac aqua} {
- void XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
+ int XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
declare 48 {mac aqua} {
void XSetWindowBackground(Display *d, Window w, unsigned long ul)
@@ -1627,13 +1628,13 @@ declare 54 {mac aqua} {
void XUngrabKeyboard(Display *d, Time t)
}
declare 55 {mac aqua} {
- void XUngrabPointer(Display *d, Time t)
+ int XUngrabPointer(Display *d, Time t)
}
declare 56 {mac aqua} {
void XUnmapWindow(Display *d, Window w)
}
declare 57 {mac aqua} {
- void TkPutImage(unsigned long *colors, int ncolors, Display *display,
+ int TkPutImage(unsigned long *colors, int ncolors, Display *display,
Drawable d, GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width, unsigned int height)
}
@@ -1739,7 +1740,7 @@ declare 86 {mac aqua} {
int npoints, int mode)
}
declare 87 {mac aqua} {
- void XWarpPointer(Display *display, Window src_w, Window dest_w,
+ int XWarpPointer(Display *display, Window src_w, Window dest_w,
int src_x, int src_y, unsigned int src_width,
unsigned int src_height, int dest_x, int dest_y)
}
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index c3e5d6a..cdb88f0 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -38,7 +38,7 @@
#if defined(__WIN32__) /* WIN */
/* 0 */
-EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc,
+EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc,
int dash_offset, _Xconst char *dash_list,
int n));
/* 1 */
@@ -66,7 +66,7 @@ EXTERN Cursor XCreatePixmapCursor _ANSI_ARGS_((Display *d,
/* 8 */
EXTERN Cursor XCreateGlyphCursor _ANSI_ARGS_((Display *d, Font f1,
Font f2, unsigned int ui1, unsigned int ui2,
- XColor *x1, XColor *x2));
+ XColor _Xconst *x1, XColor _Xconst *x2));
/* 9 */
EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g));
/* 10 */
@@ -93,7 +93,7 @@ EXTERN Status XGetWMColormapWindows _ANSI_ARGS_((Display *d,
EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c,
XColor *xp));
/* 19 */
-EXTERN void XBell _ANSI_ARGS_((Display *d, int i));
+EXTERN int XBell _ANSI_ARGS_((Display *d, int i));
/* 20 */
EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w,
Atom a1, Atom a2, int i1, int i2,
@@ -122,7 +122,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display,
Drawable d, _Xconst char *data,
unsigned int width, unsigned int height));
/* 27 */
-EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w,
+EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w,
Cursor c));
/* 28 */
EXTERN void XDeleteProperty _ANSI_ARGS_((Display *d, Window w,
@@ -153,14 +153,14 @@ EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr,
/* 36 */
EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *d, int i));
/* 37 */
-EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c));
+EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c));
/* 38 */
-EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c,
+EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul));
/* 39 */
EXTERN void XFreeCursor _ANSI_ARGS_((Display *d, Cursor c));
/* 40 */
-EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x));
+EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x));
/* 41 */
EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr,
Window *w, int *i1, int *i2,
@@ -228,7 +228,7 @@ EXTERN void XSelectInput _ANSI_ARGS_((Display *d, Window w,
EXTERN Status XSendEvent _ANSI_ARGS_((Display *d, Window w, Bool b,
long l, XEvent *x));
/* 62 */
-EXTERN void XSetCommand _ANSI_ARGS_((Display *d, Window w,
+EXTERN int XSetCommand _ANSI_ARGS_((Display *d, Window w,
char **c, int i));
/* 63 */
EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w,
@@ -237,7 +237,7 @@ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w,
EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w,
int i, Time t));
/* 65 */
-EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a,
+EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a,
Window w, Time t));
/* 66 */
EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d,
@@ -264,7 +264,7 @@ EXTERN Bool XTranslateCoordinates _ANSI_ARGS_((Display *d,
/* 73 */
EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t));
/* 74 */
-EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t));
+EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t));
/* 75 */
EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w));
/* 76 */
@@ -279,7 +279,7 @@ EXTERN int XmbLookupString _ANSI_ARGS_((XIC xi,
XKeyPressedEvent *xk, char *c, int i,
KeySym *k, Status *s));
/* 80 */
-EXTERN void TkPutImage _ANSI_ARGS_((unsigned long *colors,
+EXTERN int TkPutImage _ANSI_ARGS_((unsigned long *colors,
int ncolors, Display *display, Drawable d,
GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
@@ -356,7 +356,7 @@ EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list,
EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g,
int x1, int y1, int x2, int y2));
/* 105 */
-EXTERN void XWarpPointer _ANSI_ARGS_((Display *d, Window s,
+EXTERN int XWarpPointer _ANSI_ARGS_((Display *d, Window s,
Window dw, int sx, int sy, unsigned int sw,
unsigned int sh, int dx, int dy));
/* 106 */
@@ -366,7 +366,7 @@ EXTERN int XFillRectangle _ANSI_ARGS_((Display *display,
#endif /* WIN */
#ifdef MAC_TCL
/* 0 */
-EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc,
+EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc,
int dash_offset, _Xconst char *dash_list,
int n));
/* 1 */
@@ -402,7 +402,7 @@ EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x));
EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c,
XColor *xp));
/* 13 */
-EXTERN void XBell _ANSI_ARGS_((Display *d, int i));
+EXTERN int XBell _ANSI_ARGS_((Display *d, int i));
/* 14 */
EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w,
Atom a1, Atom a2, int i1, int i2,
@@ -429,7 +429,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display,
Drawable d, _Xconst char *data,
unsigned int width, unsigned int height));
/* 20 */
-EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w,
+EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w,
Cursor c));
/* 21 */
EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w));
@@ -455,12 +455,12 @@ EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr,
EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr,
GC g, XRectangle *x, int i));
/* 28 */
-EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c));
+EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c));
/* 29 */
-EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c,
+EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul));
/* 30 */
-EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x));
+EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x));
/* 31 */
EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr,
Window *w, int *i1, int *i2,
@@ -514,7 +514,7 @@ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w,
EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w,
int i, Time t));
/* 47 */
-EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a,
+EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a,
Window w, Time t));
/* 48 */
EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d,
@@ -537,11 +537,11 @@ EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w,
/* 54 */
EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t));
/* 55 */
-EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t));
+EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t));
/* 56 */
EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w));
/* 57 */
-EXTERN void TkPutImage _ANSI_ARGS_((unsigned long *colors,
+EXTERN int TkPutImage _ANSI_ARGS_((unsigned long *colors,
int ncolors, Display *display, Drawable d,
GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
@@ -637,7 +637,7 @@ EXTERN void XDrawPoints _ANSI_ARGS_((Display *display,
Drawable d, GC gc, XPoint *points,
int npoints, int mode));
/* 87 */
-EXTERN void XWarpPointer _ANSI_ARGS_((Display *display,
+EXTERN int XWarpPointer _ANSI_ARGS_((Display *display,
Window src_w, Window dest_w, int src_x,
int src_y, unsigned int src_width,
unsigned int src_height, int dest_x,
@@ -656,7 +656,7 @@ EXTERN Status XQueryTree _ANSI_ARGS_((Display *d, Window w1,
#endif /* MAC_TCL */
#ifdef MAC_OSX_TK /* AQUA */
/* 0 */
-EXTERN void XSetDashes _ANSI_ARGS_((Display *display, GC gc,
+EXTERN int XSetDashes _ANSI_ARGS_((Display *display, GC gc,
int dash_offset, _Xconst char *dash_list,
int n));
/* 1 */
@@ -692,7 +692,7 @@ EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x));
EXTERN Status XAllocColor _ANSI_ARGS_((Display *d, Colormap c,
XColor *xp));
/* 13 */
-EXTERN void XBell _ANSI_ARGS_((Display *d, int i));
+EXTERN int XBell _ANSI_ARGS_((Display *d, int i));
/* 14 */
EXTERN void XChangeProperty _ANSI_ARGS_((Display *d, Window w,
Atom a1, Atom a2, int i1, int i2,
@@ -719,7 +719,7 @@ EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display *display,
Drawable d, _Xconst char *data,
unsigned int width, unsigned int height));
/* 20 */
-EXTERN void XDefineCursor _ANSI_ARGS_((Display *d, Window w,
+EXTERN int XDefineCursor _ANSI_ARGS_((Display *d, Window w,
Cursor c));
/* 21 */
EXTERN void XDestroyWindow _ANSI_ARGS_((Display *d, Window w));
@@ -745,12 +745,12 @@ EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr,
EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr,
GC g, XRectangle *x, int i));
/* 28 */
-EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c));
+EXTERN int XFreeColormap _ANSI_ARGS_((Display *d, Colormap c));
/* 29 */
-EXTERN void XFreeColors _ANSI_ARGS_((Display *d, Colormap c,
+EXTERN int XFreeColors _ANSI_ARGS_((Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul));
/* 30 */
-EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x));
+EXTERN int XFreeModifiermap _ANSI_ARGS_((XModifierKeymap *x));
/* 31 */
EXTERN Status XGetGeometry _ANSI_ARGS_((Display *d, Drawable dr,
Window *w, int *i1, int *i2,
@@ -804,7 +804,7 @@ EXTERN void XSetIconName _ANSI_ARGS_((Display *d, Window w,
EXTERN void XSetInputFocus _ANSI_ARGS_((Display *d, Window w,
int i, Time t));
/* 47 */
-EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a,
+EXTERN int XSetSelectionOwner _ANSI_ARGS_((Display *d, Atom a,
Window w, Time t));
/* 48 */
EXTERN void XSetWindowBackground _ANSI_ARGS_((Display *d,
@@ -827,11 +827,11 @@ EXTERN void XSetWindowColormap _ANSI_ARGS_((Display *d, Window w,
/* 54 */
EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display *d, Time t));
/* 55 */
-EXTERN void XUngrabPointer _ANSI_ARGS_((Display *d, Time t));
+EXTERN int XUngrabPointer _ANSI_ARGS_((Display *d, Time t));
/* 56 */
EXTERN void XUnmapWindow _ANSI_ARGS_((Display *d, Window w));
/* 57 */
-EXTERN void TkPutImage _ANSI_ARGS_((unsigned long *colors,
+EXTERN int TkPutImage _ANSI_ARGS_((unsigned long *colors,
int ncolors, Display *display, Drawable d,
GC gc, XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
@@ -927,7 +927,7 @@ EXTERN void XDrawPoints _ANSI_ARGS_((Display *display,
Drawable d, GC gc, XPoint *points,
int npoints, int mode));
/* 87 */
-EXTERN void XWarpPointer _ANSI_ARGS_((Display *display,
+EXTERN int XWarpPointer _ANSI_ARGS_((Display *display,
Window src_w, Window dest_w, int src_x,
int src_y, unsigned int src_width,
unsigned int src_height, int dest_x,
@@ -952,7 +952,7 @@ typedef struct TkIntXlibStubs {
struct TkIntXlibStubHooks *hooks;
#if defined(__WIN32__) /* WIN */
- void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */
+ int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */
XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */
XImage * (*xCreateImage) _ANSI_ARGS_((Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
XImage * (*xGetImage) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
@@ -960,7 +960,7 @@ typedef struct TkIntXlibStubs {
char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */
Colormap (*xCreateColormap) _ANSI_ARGS_((Display *d, Window w, Visual *v, int i)); /* 6 */
Cursor (*xCreatePixmapCursor) _ANSI_ARGS_((Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)); /* 7 */
- Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2)); /* 8 */
+ Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2)); /* 8 */
GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 9 */
XHostAddress * (*xListHosts) _ANSI_ARGS_((Display *d, int *i, Bool *b)); /* 10 */
KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display *d, unsigned int k, int i)); /* 11 */
@@ -971,7 +971,7 @@ typedef struct TkIntXlibStubs {
Status (*xWithdrawWindow) _ANSI_ARGS_((Display *d, Window w, int i)); /* 16 */
Status (*xGetWMColormapWindows) _ANSI_ARGS_((Display *d, Window w, Window **wpp, int *ip)); /* 17 */
Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 18 */
- void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */
+ int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 19 */
void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 20 */
void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 21 */
void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 22 */
@@ -979,7 +979,7 @@ typedef struct TkIntXlibStubs {
void (*xCopyArea) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 24 */
void (*xCopyPlane) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 25 */
Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 26 */
- void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */
+ int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 27 */
void (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */
void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */
void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */
@@ -989,10 +989,10 @@ typedef struct TkIntXlibStubs {
void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */
int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */
void (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */
- void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */
- void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */
+ int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */
+ int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */
void (*xFreeCursor) _ANSI_ARGS_((Display *d, Cursor c)); /* 39 */
- void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */
+ int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 40 */
Status (*xGetGeometry) _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4)); /* 41 */
void (*xGetInputFocus) _ANSI_ARGS_((Display *d, Window *w, int *i)); /* 42 */
int (*xGetWindowProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp)); /* 43 */
@@ -1014,10 +1014,10 @@ typedef struct TkIntXlibStubs {
void (*xResizeWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */
void (*xSelectInput) _ANSI_ARGS_((Display *d, Window w, long l)); /* 60 */
Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 61 */
- void (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 62 */
+ int (*xSetCommand) _ANSI_ARGS_((Display *d, Window w, char **c, int i)); /* 62 */
void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 63 */
void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 64 */
- void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */
+ int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 65 */
void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 66 */
void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 67 */
void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 68 */
@@ -1026,13 +1026,13 @@ typedef struct TkIntXlibStubs {
void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 71 */
Bool (*xTranslateCoordinates) _ANSI_ARGS_((Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3)); /* 72 */
void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 73 */
- void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */
+ int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 74 */
void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 75 */
void (*xWindowEvent) _ANSI_ARGS_((Display *d, Window w, long l, XEvent *x)); /* 76 */
void (*xDestroyIC) _ANSI_ARGS_((XIC x)); /* 77 */
Bool (*xFilterEvent) _ANSI_ARGS_((XEvent *x, Window w)); /* 78 */
int (*xmbLookupString) _ANSI_ARGS_((XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s)); /* 79 */
- void (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 80 */
+ int (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 80 */
VOID *reserved81;
Status (*xParseColor) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 82 */
GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 83 */
@@ -1057,11 +1057,11 @@ typedef struct TkIntXlibStubs {
void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 102 */
Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 103 */
int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */
- void (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */
+ int (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */
int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */
#endif /* WIN */
#ifdef MAC_TCL
- void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */
+ int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */
XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */
XImage * (*xCreateImage) _ANSI_ARGS_((Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
XImage * (*xGetImage) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
@@ -1074,14 +1074,14 @@ typedef struct TkIntXlibStubs {
Window (*xRootWindow) _ANSI_ARGS_((Display *d, int i)); /* 10 */
XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */
Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 12 */
- void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */
+ int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */
void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 14 */
void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 15 */
void (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 16 */
void (*xCopyArea) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */
void (*xCopyPlane) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */
Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */
- void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */
+ int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */
void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */
void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */
int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */
@@ -1089,9 +1089,9 @@ typedef struct TkIntXlibStubs {
void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */
void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */
int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */
- void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */
- void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */
- void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */
+ int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */
+ int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */
+ int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */
Status (*xGetGeometry) _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4)); /* 31 */
int (*xGetWindowProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp)); /* 32 */
int (*xGrabKeyboard) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */
@@ -1108,7 +1108,7 @@ typedef struct TkIntXlibStubs {
Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 44 */
void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 45 */
void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 46 */
- void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */
+ int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */
void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 48 */
void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 49 */
void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 50 */
@@ -1116,9 +1116,9 @@ typedef struct TkIntXlibStubs {
void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */
void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */
void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */
- void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */
+ int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */
void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */
- void (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */
+ int (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */
Status (*xParseColor) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */
GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */
void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */
@@ -1148,13 +1148,13 @@ typedef struct TkIntXlibStubs {
void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */
void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */
void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */
- void (*xWarpPointer) _ANSI_ARGS_((Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
+ int (*xWarpPointer) _ANSI_ARGS_((Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
void (*xQueryColor) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *def_in_out)); /* 88 */
void (*xQueryColors) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *defs_in_out, int ncolors)); /* 89 */
Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 90 */
#endif /* MAC_TCL */
#ifdef MAC_OSX_TK /* AQUA */
- void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */
+ int (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */
XModifierKeymap * (*xGetModifierMapping) _ANSI_ARGS_((Display *d)); /* 1 */
XImage * (*xCreateImage) _ANSI_ARGS_((Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
XImage * (*xGetImage) _ANSI_ARGS_((Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
@@ -1167,14 +1167,14 @@ typedef struct TkIntXlibStubs {
Window (*xRootWindow) _ANSI_ARGS_((Display *d, int i)); /* 10 */
XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */
Status (*xAllocColor) _ANSI_ARGS_((Display *d, Colormap c, XColor *xp)); /* 12 */
- void (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */
+ int (*xBell) _ANSI_ARGS_((Display *d, int i)); /* 13 */
void (*xChangeProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3)); /* 14 */
void (*xChangeWindowAttributes) _ANSI_ARGS_((Display *d, Window w, unsigned long ul, XSetWindowAttributes *x)); /* 15 */
void (*xConfigureWindow) _ANSI_ARGS_((Display *d, Window w, unsigned int i, XWindowChanges *x)); /* 16 */
void (*xCopyArea) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */
void (*xCopyPlane) _ANSI_ARGS_((Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */
Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height)); /* 19 */
- void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */
+ int (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */
void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */
void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */
int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */
@@ -1182,9 +1182,9 @@ typedef struct TkIntXlibStubs {
void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */
void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */
int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */
- void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */
- void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */
- void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */
+ int (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */
+ int (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */
+ int (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */
Status (*xGetGeometry) _ANSI_ARGS_((Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4)); /* 31 */
int (*xGetWindowProperty) _ANSI_ARGS_((Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp)); /* 32 */
int (*xGrabKeyboard) _ANSI_ARGS_((Display *d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */
@@ -1201,7 +1201,7 @@ typedef struct TkIntXlibStubs {
Status (*xSendEvent) _ANSI_ARGS_((Display *d, Window w, Bool b, long l, XEvent *x)); /* 44 */
void (*xSetIconName) _ANSI_ARGS_((Display *d, Window w, _Xconst char *c)); /* 45 */
void (*xSetInputFocus) _ANSI_ARGS_((Display *d, Window w, int i, Time t)); /* 46 */
- void (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */
+ int (*xSetSelectionOwner) _ANSI_ARGS_((Display *d, Atom a, Window w, Time t)); /* 47 */
void (*xSetWindowBackground) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 48 */
void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display *d, Window w, Pixmap p)); /* 49 */
void (*xSetWindowBorder) _ANSI_ARGS_((Display *d, Window w, unsigned long ul)); /* 50 */
@@ -1209,9 +1209,9 @@ typedef struct TkIntXlibStubs {
void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display *d, Window w, unsigned int ui)); /* 52 */
void (*xSetWindowColormap) _ANSI_ARGS_((Display *d, Window w, Colormap c)); /* 53 */
void (*xUngrabKeyboard) _ANSI_ARGS_((Display *d, Time t)); /* 54 */
- void (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */
+ int (*xUngrabPointer) _ANSI_ARGS_((Display *d, Time t)); /* 55 */
void (*xUnmapWindow) _ANSI_ARGS_((Display *d, Window w)); /* 56 */
- void (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */
+ int (*tkPutImage) _ANSI_ARGS_((unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */
Status (*xParseColor) _ANSI_ARGS_((Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr)); /* 58 */
GC (*xCreateGC) _ANSI_ARGS_((Display *display, Drawable d, unsigned long valuemask, XGCValues *values)); /* 59 */
void (*xFreeGC) _ANSI_ARGS_((Display *display, GC gc)); /* 60 */
@@ -1241,7 +1241,7 @@ typedef struct TkIntXlibStubs {
void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */
void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */
void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */
- void (*xWarpPointer) _ANSI_ARGS_((Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
+ int (*xWarpPointer) _ANSI_ARGS_((Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
void (*xQueryColor) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *def_in_out)); /* 88 */
void (*xQueryColors) _ANSI_ARGS_((Display *display, Colormap colormap, XColor *defs_in_out, int ncolors)); /* 89 */
Status (*xQueryTree) _ANSI_ARGS_((Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui)); /* 90 */
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 17c7424..949dcee 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -475,7 +475,7 @@ XGrabPointer(display, grab_window, owner_events, event_mask, pointer_mode,
*----------------------------------------------------------------------
*/
-void
+int
XUngrabPointer(display, time)
Display* display;
Time time;
@@ -488,6 +488,7 @@ XUngrabPointer(display, time)
tsdPtr->restrictWinPtr = NULL;
TkpSetCapture(NULL);
UpdateCursor(tsdPtr->lastWinPtr);
+ return Success;
}
/*
@@ -590,7 +591,7 @@ UpdateCursor(winPtr)
*----------------------------------------------------------------------
*/
-void
+int
XDefineCursor(display, w, cursor)
Display* display;
Window w;
@@ -604,6 +605,7 @@ XDefineCursor(display, w, cursor)
UpdateCursor(winPtr);
}
display->request++;
+ return Success;
}
/*
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index adaf319..02ab98b 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -1,12 +1,12 @@
-/*
+/*
* tkStubInit.c --
*
* This file contains the initializers for the Tk stub vectors.
*
* Copyright (c) 1998-1999 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkInt.h"
@@ -46,13 +46,19 @@ doNothing(void)
return 0;
}
+#define TkCreateXEventSource TkPlatCreateXEventSource
+static void
+TkCreateXEventSource(void)
+{
+ TkWinXInit(Tk_GetHINSTANCE());
+}
+
/*
* Remove macros that will interfere with the definitions below.
*/
# undef TkpCmapStressed
# undef TkpSync
-# define TkCreateXEventSource (void (*) (void)) doNothing
# define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing
# define TkpSync (void (*) (Display *)) doNothing
# define TkUnixContainerId 0
@@ -63,24 +69,6 @@ doNothing(void)
#else /* !__WIN32__ */
-# undef TkClipBox
-# undef TkCreateRegion
-# undef TkDestroyRegion
-# undef TkIntersectRegion
-# undef TkRectInRegion
-# undef TkSetRegion
-# undef TkUnionRectWithRegion
-# undef TkSubtractRegion
-
-# define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox
-# define TkCreateRegion (TkRegion (*) ()) XCreateRegion
-# define TkDestroyRegion (void (*) _ANSI_ARGS_((TkRegion))) XDestroyRegion
-# define TkIntersectRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XIntersectRegion
-# define TkRectInRegion (int (*) _ANSI_ARGS_((TkRegion, int, int, unsigned int, unsigned int))) XRectInRegion
-# define TkSetRegion (void (*) _ANSI_ARGS_((Display *, GC, TkRegion))) XSetRegion
-# define TkUnionRectWithRegion (void (*) _ANSI_ARGS_((XRectangle *, TkRegion, TkRegion))) XUnionRectWithRegion
-# define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion
-
/*
* Make sure that extensions which call XParseColor through the stub
* table, call TkParseColor instead. [Bug 3486474]
@@ -89,25 +77,16 @@ doNothing(void)
# ifdef __CYGWIN__
- /*
- * Remove macros that will interfere with the definitions below.
- */
-# undef TkPutImage
-# undef TkSetPixmapColormap
-# undef TkpPrintWindowId
-# undef TkWinChildProc
-
+ TkIntStubs tkIntStubs;
- /*
- * Trick, so we don't have to include <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__ */
/*
diff --git a/mac/tkMacClipboard.c b/mac/tkMacClipboard.c
index 953ae23..c25dc69 100644
--- a/mac/tkMacClipboard.c
+++ b/mac/tkMacClipboard.c
@@ -107,7 +107,7 @@ TkSelGetSelection(
*----------------------------------------------------------------------
*/
-void
+int
XSetSelectionOwner(
Display* display, /* X Display. */
Atom selection, /* What selection to own. */
@@ -132,11 +132,11 @@ XSetSelectionOwner(
*/
dispPtr = TkGetMainInfoList()->winPtr->dispPtr;
- if (dispPtr->clipboardActive) {
- return;
+ if (!dispPtr->clipboardActive) {
+ ZeroScrap();
}
- ZeroScrap();
}
+ return Success;
}
/*
diff --git a/mac/tkMacColor.c b/mac/tkMacColor.c
index 6c3c230..dad7396 100644
--- a/mac/tkMacColor.c
+++ b/mac/tkMacColor.c
@@ -141,14 +141,15 @@ XCreateColormap(
return index++;
}
-void
+int
XFreeColormap(
Display* display, /* Display. */
Colormap colormap) /* Colormap. */
{
+ return Success;
}
-void
+int
XFreeColors(
Display* display, /* Display. */
Colormap colormap, /* Colormap. */
@@ -161,6 +162,7 @@ XFreeColors(
* needs to be done to release colors as there really is
* no colormap in the Tk sense.
*/
+ return Success;
}
/*
diff --git a/mac/tkMacDraw.c b/mac/tkMacDraw.c
index 720dd71..5fd718e 100644
--- a/mac/tkMacDraw.c
+++ b/mac/tkMacDraw.c
@@ -276,7 +276,7 @@ XCopyPlane(
*----------------------------------------------------------------------
*/
-void
+int
TkPutImage(
unsigned long *colors, /* Unused on Macintosh. */
int ncolors, /* Unused on Macintosh. */
@@ -381,6 +381,7 @@ TkPutImage(
ckfree(newData);
}
SetGWorld(saveWorld, saveDevice);
+ return Success;
}
/*
@@ -433,7 +434,7 @@ XFillRectangles(
}
SetGWorld(saveWorld, saveDevice);
- return 1;
+ return Success;
}
/*
diff --git a/mac/tkMacKeyboard.c b/mac/tkMacKeyboard.c
index 07b57c0..a79d813 100644
--- a/mac/tkMacKeyboard.c
+++ b/mac/tkMacKeyboard.c
@@ -293,7 +293,7 @@ XGetModifierMapping(
*----------------------------------------------------------------------
*/
-void
+int
XFreeModifiermap(
XModifierKeymap *modmap)
{
@@ -301,6 +301,7 @@ XFreeModifiermap(
ckfree((char *) modmap->modifiermap);
}
ckfree((char *) modmap);
+ return Success;
}
/*
diff --git a/mac/tkMacXStubs.c b/mac/tkMacXStubs.c
index 1e0ad51..aff29dc 100644
--- a/mac/tkMacXStubs.c
+++ b/mac/tkMacXStubs.c
@@ -395,12 +395,13 @@ XSelectInput(
Debugger();
}
-void
+int
XBell(
Display* display,
int percent)
{
SysBeep(percent);
+ return Success;
}
void
@@ -528,7 +529,7 @@ XDrawPoints(
}
*/
-void
+int
XWarpPointer(
Display* display,
Window src_w,
@@ -540,6 +541,7 @@ XWarpPointer(
int dest_x,
int dest_y)
{
+ return Success;
}
void
diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c
index b561244..ae56383 100644
--- a/macosx/tkMacOSXClipboard.c
+++ b/macosx/tkMacOSXClipboard.c
@@ -161,7 +161,7 @@ TkSelGetSelection(
*----------------------------------------------------------------------
*/
-void
+int
XSetSelectionOwner(
Display *display, /* X Display. */
Atom selection, /* What selection to own. */
@@ -185,11 +185,11 @@ XSetSelectionOwner(
*/
dispPtr = TkGetMainInfoList()->winPtr->dispPtr;
- if (dispPtr->clipboardActive) {
- return;
+ if (!dispPtr->clipboardActive) {
+ ClearCurrentScrap();
}
- ClearCurrentScrap();
}
+ return Success;
}
/*
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 9520a77..22686a3 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -713,14 +713,15 @@ XCreateColormap(
return index++;
}
-void
+int
XFreeColormap(
Display* display, /* Display. */
Colormap colormap) /* Colormap. */
{
+ return Success;
}
-void
+int
XFreeColors(
Display* display, /* Display. */
Colormap colormap, /* Colormap. */
@@ -733,4 +734,5 @@ XFreeColors(
* needs to be done to release colors as there really is
* no colormap in the Tk sense.
*/
+ return Success;
}
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 6805f28..5c36967 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -340,7 +340,7 @@ end:
*----------------------------------------------------------------------
*/
-void
+int
TkPutImage(
unsigned long *colors, /* Unused on Macintosh. */
int ncolors, /* Unused on Macintosh. */
@@ -360,7 +360,7 @@ TkPutImage(
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
TkMacOSXDbgMsg("Ignored CG drawing of XImage");
@@ -532,6 +532,7 @@ TkPutImage(
}
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
/*
@@ -564,16 +565,12 @@ XDrawLines(
int i, lw = gc->line_width;
if (npoints < 2) {
- /*
- * TODO: generate BadValue error.
- */
-
- return 0;
+ return BadValue;
}
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
- return 0;
+ return BadDrawable;
}
if (dc.context) {
double prevx, prevy;
@@ -614,7 +611,7 @@ XDrawLines(
}
}
TkMacOSXRestoreDrawingContext(&dc);
- return 1;
+ return Success;
}
/*
@@ -918,7 +915,7 @@ XFillRectangles(
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
- return 0;
+ return BadDrawable;
}
if (dc.context) {
CGRect rect;
@@ -945,7 +942,7 @@ XFillRectangles(
}
}
TkMacOSXRestoreDrawingContext(&dc);
- return 1;
+ return Success;
}
/*
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index b1e60bb..6bf3643 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -394,7 +394,7 @@ XGetModifierMapping(
*----------------------------------------------------------------------
*/
-void
+int
XFreeModifiermap(
XModifierKeymap *modmap)
{
@@ -402,6 +402,7 @@ XFreeModifiermap(
ckfree((char *) modmap->modifiermap);
}
ckfree((char *) modmap);
+ return Success;
}
/*
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 8bf57fa..4845454 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -464,12 +464,13 @@ XSelectInput(
Debugger();
}
-void
+int
XBell(
Display* display,
int percent)
{
SysBeep(percent);
+ return Success;
}
#if 0
@@ -549,7 +550,7 @@ XDrawPoints(
}
*/
-void
+int
XWarpPointer(
Display* display,
Window src_w,
@@ -561,6 +562,7 @@ XWarpPointer(
int dest_x,
int dest_y)
{
+ return Success;
}
void
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 80dd6a0..1e963d4 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -34,6 +34,7 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
+datarootdir = @datarootdir@
mandir = @mandir@
# The following definition can be set to non-null for special systems
@@ -90,11 +91,21 @@ HTML_DIR = @HTML_DIR@
# Directory in which to install html documentation:
HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR)
+# Directory in which to install the configuration file tkConfig.sh:
+CONFIG_INSTALL_DIR = $(INSTALL_ROOT)$(libdir)
+
+# Directory in which to install the demo files:
+DEMO_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY)/demos
+
# The directory containing the Tcl sources and headers appropriate
# for this version of Tk ("srcdir" will be replaced or has already
# been replaced by the configure script):
TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
+# The directory containing the platform specific Tcl sources and headers
+# appropriate for this version of Tk:
+TCL_PLATFORM_DIR = @TCL_SRC_DIR@/unix
+
# The directory containing the Tcl library archive file appropriate
# for this version of Tk:
TCL_BIN_DIR = @TCL_BIN_DIR@
@@ -200,6 +211,7 @@ BUILD_TCLSH = @BUILD_TCLSH@
# required just to do a normal build although it can be required to run
# make dist. This variable is set to "" if no tclsh is available.
TCL_EXE = @TCLSH_PROG@
+WISH_EXE = wish
# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
@@ -207,7 +219,7 @@ TCL_EXE = @TCLSH_PROG@
# with the distribution, which is slower but guaranteed to work.
INSTALL_STRIP_PROGRAM = -s
-INSTALL_STRIP_LIBRARY = -S -S
+INSTALL_STRIP_LIBRARY = -S -x
INSTALL = @srcdir@/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
@@ -293,9 +305,10 @@ RANLIB = @RANLIB@
SRC_DIR = @srcdir@
TOP_DIR = $(SRC_DIR)/..
GENERIC_DIR = $(TOP_DIR)/generic
-UNIX_DIR = $(SRC_DIR)
+UNIX_DIR = $(TOP_DIR)/unix
BMAP_DIR = $(TOP_DIR)/bitmaps
TOOL_DIR = @TCL_SRC_DIR@/tools
+TEST_DIR = $(TOP_DIR)/tests
MAC_OSX_DIR = $(TOP_DIR)/macosx
XLIB_DIR = $(TOP_DIR)/xlib
@@ -305,8 +318,8 @@ XLIB_DIR = $(TOP_DIR)/xlib
# either.
#----------------------------------------------------------------
-# Flags to be passed to installManPage to control whether the manpages
-# should be compressed and linked with softlinks
+# Flags to be passed to installManPage to control how the manpages
+# should be installed (symlinks, compression, package name suffix).
MAN_FLAGS = @MAN_FLAGS@
CC = @CC@
@@ -477,11 +490,25 @@ HDRS = bltList.h \
default.h ks_names.h tkPatch.h tk.h tkButton.h tkCanvas.h tkInt.h \
tkPort.h tkScrollbar.h tkText.h
+PUBLIC_HDRS = $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \
+ $(GENERIC_DIR)/tkPlatDecls.h $(@TK_WINDOWINGSYSTEM@_HDRS)
+
+# The private headers we want installed for install-private-headers
+PRIVATE_HDRS = $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \
+ $(GENERIC_DIR)/tkIntPlatDecls.h \
+ $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS)
+
DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
+SHELL_ENV = \
+ @LD_LIBRARY_PATH_VAR@="`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}"; \
+ export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
+ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY;
+
all: binaries libraries doc
-binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish
+binaries: ${LIB_FILE} ${STUB_LIB_FILE} ${WISH_EXE}
libraries:
@@ -522,9 +549,9 @@ tkLibObjs:
objs: ${OBJS}
-wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@
+${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@
${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish
+ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE}
# Resetting the LIB_RUNTIME_DIR below is required so that
# the generated tktest executable gets the build directory
@@ -533,7 +560,7 @@ wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@
# Tk shared libraries.
tktest: $(TKTEST_OBJS) $(TK_LIB_FILE)
- $(MAKE) tktest-real LIB_RUNTIME_DIR=`pwd`:$(TCL_BIN_DIR)
+ $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)"
tktest-real:
${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \
@@ -555,52 +582,50 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE)
# args to tcltest, ie:
# % make test TESTFLAGS="-verbose bps -file fileName.test"
-test: tktest
- @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \
- export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
- TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
- ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \
+test: test-classic
+
+test-classic: tktest
+ $(SHELL_ENV) ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 \
$(TESTFLAGS) $(TCLTESTARGS)
# Tests with different languages
testlang: tktest
- @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \
- export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
- TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
+ $(SHELL_ENV) \
for lang in $(LOCALES) ; \
do \
LANG=$(lang); export LANG; \
- ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \
+ ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 \
$(TESTFLAGS) $(TCLTESTARGS); \
done
# Useful target to launch a built tktest with the proper path,...
runtest: tktest
- @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \
- export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
- TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
- ./tktest
+ $(SHELL_ENV) ./tktest
# This target can be used to run wish from the build directory
# via `make shell` or `make shell SCRIPT=/tmp/foo.tcl`
-shell: wish
- @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \
- export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
- TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
- ./wish $(SCRIPT)
+shell: ${WISH_EXE}
+ $(SHELL_ENV) ./${WISH_EXE} $(SCRIPT)
+
+demo:
+ $(SHELL_ENV) ./${WISH_EXE} $(TOP_DIR)/library/demos/widget
# This target can be used to run wish inside either gdb or insight
-gdb: wish
- @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+gdb: ${WISH_EXE}
+ @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
@echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run
@echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run
- gdb ./wish --command=gdb.run
+ gdb ./${WISH_EXE} --command=gdb.run
rm gdb.run
+VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v
+
+valgrind: tktest
+ $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS)
+
+valgrindshell: tktest
+ $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest $(SCRIPT)
+
INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@
install: $(INSTALL_TARGETS)
@@ -614,13 +639,13 @@ install-strip:
# some ranlibs write to current directory, and this might not always be
# possible (e.g. if installing as root).
-install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
- @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) $(PKG_INSTALL_DIR); \
+install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH_EXE}
+ @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" "$(PKG_INSTALL_DIR)"; \
do \
- if [ ! -d $$i ] ; then \
+ if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p $$i; \
- chmod 755 $$i; \
+ mkdir -p "$$i"; \
+ chmod 755 "$$i"; \
else true; \
fi; \
done;
@@ -629,7 +654,7 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
fi
@if test "x$(TK_SHARED_BUILD)" = "x1"; then \
echo "Creating package index $(PKG_INDEX)"; \
- rm -f $(PKG_INDEX); \
+ rm -f "$(PKG_INDEX)"; \
(\
relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\
echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\
@@ -653,10 +678,10 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
$(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \
$(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \
fi
- @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)"
- @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION)
- @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/"
- @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh
+ @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)"
+ @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)"
+ @echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/"
+ @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)/tkConfig.sh"
@if test "$(STUB_LIB_FILE)" != "" ; then \
echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
@INSTALL_STUB_LIB@ ; \
@@ -665,15 +690,15 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
install-libraries: libraries
@if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \
- XLIB_INCLUDE_INSTALL_DIR=$(INCLUDE_INSTALL_DIR)/X11; fi; \
- for i in $(INCLUDE_INSTALL_DIR) $${XLIB_INCLUDE_INSTALL_DIR} \
- $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \
- $(SCRIPT_INSTALL_DIR)/msgs; \
+ XLIB_INCLUDE_INSTALL_DIR="$(INCLUDE_INSTALL_DIR)/X11"; fi; \
+ for i in "$(INCLUDE_INSTALL_DIR)" "$${XLIB_INCLUDE_INSTALL_DIR}" \
+ "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)/images" \
+ "$(SCRIPT_INSTALL_DIR)/msgs"; \
do \
- if [ ! -d $$i ] ; then \
+ if [ -n "$$i" -a ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p $$i; \
- chmod 755 $$i; \
+ mkdir -p "$$i"; \
+ chmod 755 "$$i"; \
else true; \
fi; \
done;
@@ -681,8 +706,7 @@ install-libraries: libraries
chmod +x $(SRC_DIR)/install-sh; \
fi
@echo "Installing header files";
- @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \
- $(GENERIC_DIR)/tkPlatDecls.h $(@TK_WINDOWINGSYSTEM@_HDRS) ; \
+ @for i in $(PUBLIC_HDRS); \
do \
$(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \
done;
@@ -779,25 +803,23 @@ install-doc:
install-private-headers: libraries
@for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \
do \
- if [ ! -d $$i ] ; then \
+ if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p $$i; \
- chmod 755 $$i; \
+ mkdir -p "$$i"; \
+ chmod 755 "$$i"; \
else true; \
fi; \
done;
@if test ! -x $(SRC_DIR)/install-sh; then \
chmod +x $(SRC_DIR)/install-sh; \
fi
- @echo "Installing private header files";
- @for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \
- $(GENERIC_DIR)/tkIntPlatDecls.h \
- $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS); \
+ @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/";
+ @for i in $(PRIVATE_HDRS); \
do \
- $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \
+ $(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
done;
@sed -e 's#\.\./unix/##' $(GENERIC_DIR)/tkPort.h > tkPort.h; \
- $(INSTALL_DATA) tkPort.h $(PRIVATE_INCLUDE_INSTALL_DIR); \
+ $(INSTALL_DATA) tkPort.h "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
rm -f tkPort.h
Makefile: $(UNIX_DIR)/Makefile.in
@@ -805,7 +827,7 @@ Makefile: $(UNIX_DIR)/Makefile.in
clean:
rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \
- errors wish tktest lib.exp Tk *.rsrc
+ errors ${WISH_EXE} tktest lib.exp Tk *.rsrc
distclean: clean
rm -rf Makefile config.status config.cache config.log tkConfig.sh \
@@ -822,7 +844,7 @@ depend:
# execute concurrently with the renaming and recompiling of that same object
# file in the target below.
-tkTestInit.o: $(UNIX_DIR)/tkAppInit.c wish
+tkTestInit.o: $(UNIX_DIR)/tkAppInit.c ${WISH_EXE}
@if test -f tkAppInit.o ; then \
rm -f tkAppInit.sav; \
mv tkAppInit.o tkAppInit.sav; \
@@ -1169,7 +1191,7 @@ tkMacOSXHLEvents.o: $(MAC_OSX_DIR)/tkMacOSXHLEvents.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXHLEvents.c
tkMacOSXInit.o: $(MAC_OSX_DIR)/tkMacOSXInit.c $(GENERIC_DIR)/tkInitScript.h tkConfig.sh
- $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \
+ $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \
$(MAC_OSX_DIR)/tkMacOSXInit.c
tkMacOSXKeyboard.o: $(MAC_OSX_DIR)/tkMacOSXKeyboard.c
@@ -1298,13 +1320,13 @@ checkexports: $(TK_LIB_FILE)
# system.
#
-rpm: all /bin/rpm
+rpm: all
rm -f THIS.TCL.SPEC
echo "%define _builddir `pwd`" > THIS.TK.SPEC
echo "%define _rpmdir `pwd`/RPMS" >> THIS.TK.SPEC
cat tk.spec >> THIS.TK.SPEC
mkdir -p RPMS/i386
- rpm -bb THIS.TK.SPEC
+ rpmbuild -bb THIS.TK.SPEC
mv RPMS/i386/*.rpm .
rm -rf RPMS THIS.TK.SPEC
@@ -1340,7 +1362,7 @@ dist:
fi; \
done;)
mkdir $(DISTDIR)/generic
- cp -p $(GENERIC_DIR)/*.c $(GENERIC_DIR)/*.h $(GENERIC_DIR)/prolog.ps \
+ cp -p $(GENERIC_DIR)/*.[ch] $(GENERIC_DIR)/prolog.ps \
$(DISTDIR)/generic
cp -p $(GENERIC_DIR)/*.decls $(DISTDIR)/generic
cp -p $(GENERIC_DIR)/README $(DISTDIR)/generic
@@ -1354,8 +1376,7 @@ dist:
$(TOP_DIR)/win/tkConfig.sh.in \
$(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \
$(DISTDIR)/win
- cp -p $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.h $(DISTDIR)/win
- cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.bat $(DISTDIR)/win
$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/*.bat
cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win
$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/makefile.*
@@ -1366,9 +1387,7 @@ dist:
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win
mkdir $(DISTDIR)/win/rc
cp -p $(TOP_DIR)/win/wish.exe.manifest.in $(DISTDIR)/win/
- cp -p $(TOP_DIR)/win/rc/*.rc $(TOP_DIR)/win/rc/*.cur \
- $(TOP_DIR)/win/rc/*.ico $(TOP_DIR)/win/rc/*.bmp \
- $(DISTDIR)/win/rc
+ cp -p $(TOP_DIR)/win/rc/*.{rc,cur,ico,bmp} $(DISTDIR)/win/rc
$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/*.rc
$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/wish.exe.manifest.in
mkdir $(DISTDIR)/mac
@@ -1393,7 +1412,7 @@ dist:
$(TCLDIR)/compat/stdlib.h $(TCLDIR)/compat/limits.h \
$(DISTDIR)/compat
mkdir $(DISTDIR)/xlib
- cp -p $(XLIB_DIR)/*.h $(XLIB_DIR)/*.c $(DISTDIR)/xlib
+ cp -p $(XLIB_DIR)/*.[ch] $(DISTDIR)/xlib
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/xlib
mkdir $(DISTDIR)/xlib/X11
cp -p $(XLIB_DIR)/X11/*.h $(DISTDIR)/xlib/X11
@@ -1436,14 +1455,9 @@ dist:
cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \
$(TCLDIR)/doc/man.macros $(DISTDIR)/doc
mkdir $(DISTDIR)/tests
- cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/tests/*.test \
- $(TOP_DIR)/tests/*.tcl $(TOP_DIR)/tests/README \
- $(TOP_DIR)/tests/option.file* $(DISTDIR)/tests
-
-#
-# The following target can only be used for non-patch releases. Use
-# the "allpatch" target below for patch releases.
-#
+ cp -p $(TOP_DIR)/license.terms $(TEST_DIR)/*.{test,tcl} \
+ $(TEST_DIR)/README \
+ $(TEST_DIR)/option.file* $(DISTDIR)/tests
alldist: dist
rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)
@@ -1451,23 +1465,6 @@ alldist: dist
gzip -9 $(DISTNAME)-src.tar; zip -qr8 $(ZIPNAME) $(DISTNAME)
#
-# The target below is similar to "alldist" except it works for patch
-# releases. It is needed because patch releases are peculiar: the
-# patch designation appears in the name of the compressed file
-# (e.g. tk8.0p1.tar.gz) but the extracted source directory doesn't
-# include the patch designation (e.g. tk8.0).
-#
-
-allpatch: dist
- rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)
- mv $(DISTROOT)/tk${VERSION} $(DISTROOT)/old
- mv $(DISTROOT)/$(DISTNAME) $(DISTROOT)/tk${VERSION}
- cd $(DISTROOT); tar cf $(DISTNAME)-src.tar tk${VERSION}; \
- gzip -9 $(DISTNAME)-src.tar; zip -r8 $(ZIPNAME) tk${VERSION}
- mv $(DISTROOT)/tk${VERSION} $(DISTROOT)/$(DISTNAME)
- mv $(DISTROOT)/old $(DISTROOT)/tk${VERSION}
-
-#
# This target creates the HTML folder for Tcl & Tk and places it
# in DISTDIR/html. It uses the tcltk-man2html.tcl tool from
# the Tcl group's tool workspace. It depends on the Tcl & Tk being
@@ -1487,11 +1484,9 @@ html-tk:
BUILD_HTML = \
@if test -f "$(BUILD_TCLSH)"; then \
- @LD_LIBRARY_PATH_VAR@=$(TCL_BIN_DIR):$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
- TCLSH="$(BUILD_TCLSH)"; else \
+ $(SHELL_ENV) TCLSH="$(BUILD_TCLSH)"; else \
TCLSH="$(TCL_EXE)"; fi ;\
- $${TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \
+ "$${TCLSH}" $(TOOL_DIR)/tcltk-man2html.tcl --htmldir="$(HTML_INSTALL_DIR)" \
--srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS)
#
@@ -1591,4 +1586,17 @@ package-generate:
pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE)
rm -rf $(PACKAGE)
+#
+# The list of all the targets that do not correspond to real files. This stops
+# 'make' from getting confused when someone makes an error in a rule.
+#
+
+.PHONY: all binaries libraries objs doc html html-tcl html-tk test runtest
+.PHONY: install install-strip install-binaries install-libraries
+.PHONY: install-headers install-private-headers install-doc
+.PHONY: clean distclean depend genstubs checkstubs checkexports checkuchar
+.PHONY: shell gdb valgrind valgrindshell dist alldist rpm
+.PHONY: tkLibObjs tktest-real test-classic test-ttk testlang
+.PHONY: demo install-demos
+
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 6e03287..c4053b9 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -138,7 +138,7 @@
# define WPARAM void *
# define LPARAM void *
# define LRESULT void *
-#endif /* This really should be an #else, as soon as the Xlib stubs are enabled for Cygwin. */
+#else /* !__CYGWIN__ */
/*
* The TkPutImage macro strips off the color table information, which isn't
* needed for X.
@@ -148,25 +148,23 @@
XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
desty, width, height);
-/* #endif */
-
-/*
- * These macros are just wrappers for the equivalent X Region calls.
- */
+ /*
+ * These macros are just wrappers for the equivalent X Region calls.
+ */
-#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
-#define TkCreateRegion() (TkRegion) XCreateRegion()
-#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
-#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
- (Region) b, (Region) r)
-#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
-#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
-#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \
- (Region) b, (Region) r)
-#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
- (Region) src, (Region) ret)
-
-/* #endif */
+# define TkClipBox(rgn, rect) XClipBox((Region) (rgn), (rect))
+# define TkCreateRegion() (TkRegion) XCreateRegion()
+# define TkDestroyRegion(rgn) XDestroyRegion((Region) (rgn))
+# define TkIntersectRegion(a, b, r) XIntersectRegion((Region) (a), \
+ (Region) (b), (Region) (r))
+# define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) (r), (x), (y), (w), (h))
+# define TkSetRegion(d, gc, rgn) XSetRegion((d), (gc), (Region) (rgn))
+# define TkSubtractRegion(a, b, r) XSubtractRegion((Region) (a), \
+ (Region) (b), (Region) (r))
+# define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion((rect), \
+ (Region) (src), (Region) (ret))
+
+#endif /* !__CYGWIN__ */
/*
* Supply macros for seek offsets, if they're not already provided by
diff --git a/win/Makefile.in b/win/Makefile.in
index 714b0e9..6e48f01 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -92,6 +92,11 @@ TCL_BIN_DIR = @TCL_BIN_DIR@
# for this version of Tk ("srcdir" will be replaced or has already
# been replaced by the configure script):
TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
+
+# The directory containing the platform specific Tcl sources and headers
+# appropriate for this version of Tk:
+TCL_PLATFORM_DIR = @TCL_SRC_DIR@/win
+
TCL_TOOL_DIR = @TCL_SRC_DIR@/tools
# Converts a POSIX path to a Windows native path.
@@ -117,6 +122,7 @@ BITMAP_DIR_NATIVE = $(ROOT_DIR_NATIVE)/bitmaps
XLIB_DIR_NATIVE = $(ROOT_DIR_NATIVE)/xlib
RC_DIR_NATIVE = $(WIN_DIR_NATIVE)/rc
TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)' | sed 's!\\!/!g')
+TCL_PLATFORM_NATIVE = $(shell $(CYGPATH) '$(TCL_PLATFORM_DIR)' | sed 's!\\!/!g')
TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)' | sed 's!\\!/!g')
DLLSUFFIX = @DLLSUFFIX@
@@ -203,7 +209,7 @@ TCL_EXE = @TCLSH_PROG@
CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
-I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \
-I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \
- -I"${TCL_GENERIC_NATIVE}" ${AC_FLAGS}
+-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS}
CC_OBJNAME = @CC_OBJNAME@
CC_EXENAME = @CC_EXENAME@
@@ -349,6 +355,11 @@ CORE_DOCS = $(TCL_DOCS) $(TK_DOCS)
DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
+SHELL_ENV = \
+ @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
+ TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
+ PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH;
+
# Main targets. The default target -- all -- builds the binaries,
# performs any post processing on libraries or documents.
@@ -376,26 +387,22 @@ $(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c
# args to tcltest, ie:
# % make test TESTFLAGS="-verbose bps -file fileName.test"
-test: binaries $(TKTEST)
- @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
- TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
- PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \
- ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \
- | ./$(CAT32)
+test: test-classic
+
+test-classic: binaries $(TKTEST)
+ $(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" \
+ $(TESTFLAGS) | ./$(CAT32)
runtest: binaries $(TKTEST)
- @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
- TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
- PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \
- ./$(TKTEST) $(TESTFLAGS) $(SCRIPT)
+ $(SHELL_ENV) ./$(TKTEST) $(TESTFLAGS) $(SCRIPT)
# This target can be used to run wish from the build directory
# via `make shell` or `make shell SCRIPT=foo.tcl`
shell: binaries
- @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
- TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
- PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \
- ./$(WISH) $(SCRIPT)
+ $(SHELL_ENV) ./$(WISH) $(SCRIPT)
+
+demo: $(WISH)
+ $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget
# This target can be used to run wish inside either gdb or insight
gdb: binaries
@@ -539,8 +546,7 @@ install-private-headers: libraries
@echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/";
@for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \
$(GENERIC_DIR)/tkIntPlatDecls.h $(GENERIC_DIR)/tkPort.h \
- $(WIN_DIR)/tkWinPort.h $(WIN_DIR)/tkWinInt.h \
- $(WIN_DIR)/tkWin.h; \
+ $(WIN_DIR)/tkWinPort.h $(WIN_DIR)/tkWinInt.h $(WIN_DIR)/tkWin.h; \
do \
$(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \
done;
@@ -562,7 +568,7 @@ $(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32)
$(TCL_SRC_DIR)/win/cat.c:
cat32.${OBJEXT}: $(TCL_SRC_DIR)/win/cat.c
- $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
+ $(CC) -c $(CC_SWITCHES) "$(TCL_SRC_DIR)/win/cat.c" $(CC_OBJNAME)
$(CAT32): cat32.${OBJEXT}
$(CC) $(CFLAGS) cat32.$(OBJEXT) $(CC_EXENAME) $(LIBS) $(LDFLAGS_CONSOLE)
@@ -602,6 +608,11 @@ tkWinTest.$(OBJEXT): tkWinTest.c
tkSquare.$(OBJEXT): tkSquare.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
+# Extra dependency info
+tkConsole.$(OBJEXT): configure Makefile
+tkMain.$(OBJEXT): configure Makefile
+tkWindow.$(OBJEXT): configure Makefile
+
# Add the object extension to the implicit rules. By default .obj is not
# automatically added.
@@ -609,9 +620,9 @@ tkSquare.$(OBJEXT): tkSquare.c
.SUFFIXES: .$(RES)
.SUFFIXES: .rc
-# Implicit rule for all object files that will end up in the Tcl library
+# Implicit rule for all object files that will end up in the Tk library
-.c.$(OBJEXT):
+%.$(OBJEXT): %.c
$(CC) -c $(STUB_CC_SWITCHES) -DBUILD_tk @DEPARG@ $(CC_OBJNAME)
.rc.$(RES):
diff --git a/win/stubs.c b/win/stubs.c
index 60d2dc8..5977a2b 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -6,7 +6,7 @@
int _XInitImageFuncPtrs(XImage *image)
{
- return 0;
+ return Success;
}
/*
@@ -55,8 +55,8 @@ XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char,
Font mask_font;
unsigned int source_char;
unsigned int mask_char;
- XColor* foreground_color;
- XColor* background_color;
+ XColor _Xconst* foreground_color;
+ XColor _Xconst* background_color;
{
return 1;
}
@@ -137,7 +137,7 @@ XGetWindowAttributes(display, w, window_attributes_return)
Window w;
XWindowAttributes* window_attributes_return;
{
- return 0;
+ return Success;
}
Status
@@ -156,7 +156,7 @@ XIconifyWindow(display, w, screen_number)
Window w;
int screen_number;
{
- return 0;
+ return Success;
}
XHostAddress *
@@ -177,7 +177,7 @@ XLookupColor(display, colormap, color_name, exact_def_return,
XColor* exact_def_return;
XColor* screen_def_return;
{
- return 0;
+ return Success;
}
void
@@ -213,7 +213,7 @@ XQueryTree(display, w, root_return, parent_return, children_return,
Window** children_return;
unsigned int* nchildren_return;
{
- return 0;
+ return Success;
}
void
@@ -246,16 +246,17 @@ XSendEvent(display, w, propagate, event_mask, event_send)
long event_mask;
XEvent* event_send;
{
- return 0;
+ return Success;
}
-void
+int
XSetCommand(display, w, argv, argc)
Display* display;
Window w;
char** argv;
int argc;
{
+ return Success;
}
XErrorHandler
@@ -351,7 +352,7 @@ XWithdrawWindow(display, w, screen_number)
Window w;
int screen_number;
{
- return 0;
+ return Success;
}
int
@@ -364,7 +365,7 @@ XmbLookupString(ic, event, buffer_return, bytes_buffer, keysym_return,
KeySym* keysym_return;
Status* status_return;
{
- return 0;
+ return Success;
}
int
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c
index 19dcc11..38037c2 100644
--- a/win/tkWinClipboard.c
+++ b/win/tkWinClipboard.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkWinClipboard.c --
*
* This file contains functions for managing the clipboard.
@@ -23,7 +23,7 @@ static void UpdateClipboard _ANSI_ARGS_((HWND hwnd));
* Retrieve the specified selection from another process. For
* now, only fetching XA_STRING from CLIPBOARD is supported.
* Eventually other types should be allowed.
- *
+ *
* Results:
* The return value is a standard Tcl return value.
* If an error occurs (such as no selection exists)
@@ -98,10 +98,9 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData)
Tcl_DStringInit(&ds);
Tcl_DStringAppend(&ds, "cp######", -1);
data = GlobalLock(handle);
-
/*
- * Even though the documentation claims that GetLocaleInfo
+ * Even though the documentation claims that GetLocaleInfo
* expects an LCID, on Windows 9x it really seems to expect
* a LanguageID.
*/
@@ -144,7 +143,7 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData)
/*
* Translate CR/LF to LF.
*/
-
+
data = destPtr = Tcl_DStringValue(&ds);
while (*data) {
if (data[0] == '\r' && data[1] == '\n') {
@@ -163,7 +162,7 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData)
Tcl_DStringFree(&ds);
CloseClipboard();
return result;
-
+
error:
Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
" selection doesn't exist or form \"",
@@ -190,7 +189,7 @@ error:
*----------------------------------------------------------------------
*/
-void
+int
XSetSelectionOwner(display, selection, owner, time)
Display* display;
Atom selection;
@@ -218,6 +217,7 @@ XSetSelectionOwner(display, selection, owner, time)
UpdateClipboard(hwnd);
}
}
+ return Success;
}
/*
@@ -403,7 +403,7 @@ UpdateClipboard(hwnd)
* TkSelEventProc --
*
* This procedure is invoked whenever a selection-related
- * event occurs.
+ * event occurs.
*
* Results:
* None.
diff --git a/win/tkWinColor.c b/win/tkWinColor.c
index 088c216..ffb4bd1 100644
--- a/win/tkWinColor.c
+++ b/win/tkWinColor.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkWinColor.c --
*
* Functions to map color names to system color values.
@@ -67,7 +67,7 @@ static SystemColorEntry sysColors[] = {
{NULL, 0}
};
-typedef struct ThreadSpecificData {
+typedef struct ThreadSpecificData {
int ncolors;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -104,7 +104,7 @@ FindSystemColor(name, colorPtr, indexPtr)
int *indexPtr; /* Out parameter to store color index. */
{
int l, u, r, i;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -209,7 +209,7 @@ TkpGetColor(tkwin, name)
XAllocColor(Tk_Display(tkwin), Tk_Colormap(tkwin),
&winColPtr->info.color);
- return (TkColor *) winColPtr;
+ return (TkColor *) winColPtr;
}
return (TkColor *) NULL;
}
@@ -308,7 +308,7 @@ TkWinIndexOfColor(colorPtr)
register WinColor *winColPtr = (WinColor *) colorPtr;
if (winColPtr->info.magic == COLOR_MAGIC) {
return winColPtr->index;
- }
+ }
return -1;
}
@@ -354,7 +354,7 @@ XAllocColor(display, colormap, color)
/*
* Find the nearest existing palette entry.
*/
-
+
newPixel = RGB(entry.peRed, entry.peGreen, entry.peBlue);
index = GetNearestPaletteIndex(cmap->palette, newPixel);
GetPaletteEntries(cmap->palette, index, 1, &closeEntry);
@@ -370,7 +370,7 @@ XAllocColor(display, colormap, color)
* those values and just put the new color in as if the colors
* had not matched.
*/
-
+
if ((index >= cmap->size) || (newPixel != closePixel)) {
if (cmap->size == sizePalette) {
color->red = closeEntry.peRed * 257;
@@ -397,11 +397,11 @@ XAllocColor(display, colormap, color)
}
Tcl_SetHashValue(entryPtr, (ClientData)refCount);
} else {
-
+
/*
* Determine what color will actually be used on non-colormap systems.
*/
-
+
color->pixel = GetNearestColor(dc,
RGB(entry.peRed, entry.peGreen, entry.peBlue));
color->red = GetRValue(color->pixel) * 257;
@@ -430,7 +430,7 @@ XAllocColor(display, colormap, color)
*----------------------------------------------------------------------
*/
-void
+int
XFreeColors(display, colormap, pixels, npixels, planes)
Display* display;
Colormap colormap;
@@ -449,7 +449,7 @@ XFreeColors(display, colormap, pixels, npixels, planes)
/*
* We don't have to do anything for non-palette devices.
*/
-
+
if (GetDeviceCaps(dc, RASTERCAPS) & RC_PALETTE) {
/*
@@ -485,6 +485,7 @@ XFreeColors(display, colormap, pixels, npixels, planes)
}
}
ReleaseDC(NULL, dc);
+ return Success;
}
/*
@@ -567,7 +568,7 @@ XCreateColormap(display, w, visual, alloc)
*----------------------------------------------------------------------
*/
-void
+int
XFreeColormap(display, colormap)
Display* display;
Colormap colormap;
@@ -578,6 +579,7 @@ XFreeColormap(display, colormap)
}
Tcl_DeleteHashTable(&cmap->refCounts);
ckfree((char *) cmap);
+ return Success;
}
/*
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index fea17d3..26d73e8 100755
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkWinDraw.c --
*
* This file contains the Xlib emulation functions pertaining to
@@ -156,7 +156,7 @@ TkWinGetDrawableDC(display, d, state)
if (twdPtr->type == TWD_WINDOW) {
TkWindow *winPtr = twdPtr->window.winPtr;
-
+
dc = GetDC(twdPtr->window.handle);
if (winPtr == NULL) {
cmap = DefaultColormap(display, DefaultScreen(display));
@@ -220,7 +220,7 @@ TkWinReleaseDrawableDC(d, dc, state)
* Returns the converted array of POINTs.
*
* Side effects:
- * Allocates a block of memory in thread local storage that
+ * Allocates a block of memory in thread local storage that
* should not be freed.
*
*----------------------------------------------------------------------
@@ -233,7 +233,7 @@ ConvertPoints(points, npoints, mode, bbox)
int mode; /* CoordModeOrigin or CoordModePrevious. */
RECT *bbox; /* Bounding box of points. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int i;
@@ -256,7 +256,7 @@ ConvertPoints(points, npoints, mode, bbox)
bbox->left = bbox->right = points[0].x;
bbox->top = bbox->bottom = points[0].y;
-
+
if (mode == CoordModeOrigin) {
for (i = 0; i < npoints; i++) {
tsdPtr->winPoints[i].x = points[i].x;
@@ -505,7 +505,7 @@ XCopyPlane(display, src, dest, gc, src_x, src_y, width, height, dest_x,
*----------------------------------------------------------------------
*/
-void
+int
TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x,
dest_y, width, height)
unsigned long *colors; /* Array of pixel values used by this
@@ -515,7 +515,7 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x,
Drawable d; /* Destination drawable. */
GC gc;
XImage* image; /* Source image. */
- int src_x, src_y; /* Offset of subimage. */
+ int src_x, src_y; /* Offset of subimage. */
int dest_x, dest_y; /* Position of subimage origin in
* drawable. */
unsigned int width, height; /* Dimensions of subimage. */
@@ -549,22 +549,22 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x,
}
SetTextColor(dc, gc->foreground);
SetBkColor(dc, gc->background);
- } else {
+ } else {
int i, usePalette;
/*
* Do not use a palette for TrueColor images.
*/
-
+
usePalette = (image->bits_per_pixel < 16);
-
+
if (usePalette) {
infoPtr = (BITMAPINFO*) ckalloc(sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD)*ncolors);
} else {
infoPtr = (BITMAPINFO*) ckalloc(sizeof(BITMAPINFOHEADER));
}
-
+
infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
infoPtr->bmiHeader.biWidth = image->width;
infoPtr->bmiHeader.biHeight = -image->height; /* Top-down order */
@@ -595,13 +595,14 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x,
panic("Fail to allocate bitmap\n");
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
- return;
+ return BadValue;
}
bitmap = SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY);
DeleteObject(SelectObject(dcMem, bitmap));
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -635,7 +636,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
HBRUSH brush, oldBrush;
if (d == None) {
- return 0;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -658,7 +659,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
/*
* Select stipple pattern into destination dc.
*/
-
+
stipple = CreatePatternBrush(twdPtr->bitmap.handle);
SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL);
oldBrush = SelectObject(dc, stipple);
@@ -690,7 +691,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
SelectObject(dcMem, oldBitmap);
DeleteObject(bitmap);
}
-
+
DeleteDC(dcMem);
SelectObject(dc, oldBrush);
DeleteObject(stipple);
@@ -708,7 +709,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
HPEN newPen = CreatePen(PS_NULL, 0, gc->foreground);
HPEN oldPen = SelectObject(dc, newPen);
oldBrush = SelectObject(dc, brush);
-
+
for (i = 0; i < nrectangles; i++) {
Rectangle(dc, rectangles[i].x, rectangles[i].y,
rectangles[i].x + rectangles[i].width + 1,
@@ -722,7 +723,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
}
DeleteObject(brush);
TkWinReleaseDrawableDC(d, dc, &state);
- return 1;
+ return Success;
}
/*
@@ -756,7 +757,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
HPEN oldPen;
HBRUSH oldBrush;
POINT *winPoints = ConvertPoints(points, npoints, mode, &rect);
-
+
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
&& gc->stipple != None) {
@@ -767,7 +768,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
HBITMAP oldBitmap;
int i;
HBRUSH oldMemBrush;
-
+
if (twdPtr->type != TWD_BITMAP) {
panic("unexpected drawable type in stipple");
}
@@ -787,7 +788,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
/*
* Select stipple pattern into destination dc.
*/
-
+
SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL);
oldBrush = SelectObject(dc, CreatePatternBrush(twdPtr->bitmap.handle));
@@ -795,7 +796,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
* Create temporary drawing surface containing a copy of the
* destination equal in size to the bounding box of the object.
*/
-
+
dcMem = CreateCompatibleDC(dc);
oldBitmap = SelectObject(dcMem, CreateCompatibleBitmap(dc, width,
height));
@@ -804,7 +805,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
/*
* Translate the object for rendering in the temporary drawing
- * surface.
+ * surface.
*/
for (i = 0; i < npoints; i++) {
@@ -884,9 +885,9 @@ XDrawLines(display, d, gc, points, npoints, mode)
HPEN pen;
TkWinDCState state;
HDC dc;
-
+
if (d == None) {
- return 0;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -895,9 +896,9 @@ XDrawLines(display, d, gc, points, npoints, mode)
SetBkMode(dc, TRANSPARENT);
RenderObject(dc, gc, points, npoints, mode, pen, Polyline);
DeleteObject(pen);
-
+
TkWinReleaseDrawableDC(d, dc, &state);
- return 1;
+ return Success;
}
/*
@@ -1229,24 +1230,24 @@ SetUpGraphicsPort(gc)
switch (gc->cap_style) {
case CapNotLast:
case CapButt:
- style |= PS_ENDCAP_FLAT;
+ style |= PS_ENDCAP_FLAT;
break;
case CapRound:
- style |= PS_ENDCAP_ROUND;
+ style |= PS_ENDCAP_ROUND;
break;
default:
- style |= PS_ENDCAP_SQUARE;
+ style |= PS_ENDCAP_SQUARE;
break;
}
switch (gc->join_style) {
- case JoinMiter:
- style |= PS_JOIN_MITER;
+ case JoinMiter:
+ style |= PS_JOIN_MITER;
break;
case JoinRound:
- style |= PS_JOIN_ROUND;
+ style |= PS_JOIN_ROUND;
break;
default:
- style |= PS_JOIN_BEVEL;
+ style |= PS_JOIN_BEVEL;
break;
}
return ExtCreatePen(style, gc->line_width, &lb, 0, NULL);
@@ -1350,7 +1351,7 @@ TkWinFillRect(dc, x, y, width, height, pixel)
*----------------------------------------------------------------------
*/
-void
+void
TkpDrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, drawable)
Tk_Window tkwin;
GC fgGC;
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index aa532bf..07bdaf6 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -94,7 +94,7 @@ TkpGetString(winPtr, eventPtr, dsPtr)
}
} else if (eventPtr->xkey.send_event == -2) {
/*
- * Special case for win2000 multi-lingal IME input.
+ * Special case for win2000 multi-lingal IME input.
* xkey.trans_chars[] already contains a UNICODE char.
*/
@@ -119,12 +119,12 @@ TkpGetString(winPtr, eventPtr, dsPtr)
} else {
/*
* This is an event generated from generic code. It has no
- * nchars or trans_chars members.
+ * nchars or trans_chars members.
*/
keysym = KeycodeToKeysym(eventPtr->xkey.keycode,
eventPtr->xkey.state, 0);
- if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256))
+ if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256))
|| (keysym == XK_Return)
|| (keysym == XK_Tab)) {
char buf[TCL_UTF_MAX];
@@ -226,7 +226,7 @@ KeycodeToKeysym(keycode, state, noascii)
if (state & Mod2Mask)
keys[VK_MENU] = 0x80;
- /*
+ /*
* Make sure all lock button info is correct so we don't mess up the
* lights
*/
@@ -260,7 +260,7 @@ KeycodeToKeysym(keycode, state, noascii)
* Call ToAscii() again with proper parameters to restore it.
*/
- /*
+ /*
* Get information about the old char
*/
@@ -557,7 +557,7 @@ TkpSetKeycodeAndState(tkwin, keySym, eventPtr)
int i;
SHORT result;
int shift;
-
+
eventPtr->xkey.keycode = 0;
if (keySym == NoSymbol) {
return;
@@ -690,12 +690,13 @@ XGetModifierMapping(display)
*----------------------------------------------------------------------
*/
-void
+int
XFreeModifiermap(modmap)
XModifierKeymap* modmap;
{
ckfree((char *) modmap->modifiermap);
ckfree((char *) modmap);
+ return Success;
}
/*
@@ -703,7 +704,7 @@ XFreeModifiermap(modmap)
*
* XStringToKeysym --
*
- * Translate a keysym name to the matching keysym.
+ * Translate a keysym name to the matching keysym.
*
* Results:
* Returns the keysym. Since this is already handled by
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index 0d9ed61..42e6e49 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkWinPointer.c --
*
* Windows specific mouse tracking code.
@@ -208,7 +208,7 @@ XUngrabKeyboard(display, time)
*
* MouseTimerProc --
*
- * Check the current mouse position and look for enter/leave
+ * Check the current mouse position and look for enter/leave
* events.
*
* Results:
@@ -347,7 +347,7 @@ XQueryPointer(display, w, root_return, child_return, root_x_return,
*----------------------------------------------------------------------
*/
-void
+int
XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width,
src_height, dest_x, dest_y)
Display* display;
@@ -363,7 +363,8 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width,
RECT r;
GetWindowRect(Tk_GetHWND(dest_w), &r);
- SetCursorPos(r.left+dest_x, r.top+dest_y);
+ SetCursorPos(r.left+dest_x, r.top+dest_y);
+ return Success;
}
/*
@@ -469,7 +470,7 @@ TkpChangeFocus(winPtr, force)
if (winPtr->window == None) {
panic("ChangeXFocus got null X window");
}
-
+
/*
* Change the foreground window so the focus window is raised to the top of
* the system stacking order and gets the keyboard focus.
@@ -501,7 +502,7 @@ TkpChangeFocus(winPtr, force)
* This function captures the mouse so that all future events
* will be reported to this window, even if the mouse is outside
* the window. If the specified window is NULL, then the mouse
- * is released.
+ * is released.
*
* Results:
* None.
diff --git a/win/tkWinX.c b/win/tkWinX.c
index cdbdc84..48fedea 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -1,7 +1,7 @@
-/*
+/*
* tkWinX.c --
*
- * This file contains Windows emulation procedures for X routines.
+ * This file contains Windows emulation procedures for X routines.
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
* Copyright (c) 1994 Software Research Associates, Inc.
@@ -317,7 +317,7 @@ TkWinXCleanup(clientData)
/*
* Clean up our own class.
*/
-
+
if (childClassInitialized) {
childClassInitialized = 0;
UnregisterClass(TK_WIN_CHILD_CLASS_NAME, hInstance);
@@ -331,7 +331,7 @@ TkWinXCleanup(clientData)
/*
* And let the window manager clean up its own class(es).
*/
-
+
TkWinWmCleanup(hInstance);
}
@@ -340,12 +340,12 @@ TkWinXCleanup(clientData)
*
* TkWinGetPlatformId --
*
- * Determines whether running under NT, 95, or Win32s, to allow
+ * Determines whether running under NT, 95, or Win32s, to allow
* runtime conditional code. Win32s is no longer supported.
*
* Results:
* The return value is one of:
- * VER_PLATFORM_WIN32s Win32s on Windows 3.1.
+ * VER_PLATFORM_WIN32s Win32s on Windows 3.1.
* VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95.
* VER_PLATFORM_WIN32_NT Win32 on Windows NT
*
@@ -364,10 +364,10 @@ TkWinGetPlatformId()
os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&os);
tkPlatformId = os.dwPlatformId;
-
- /* Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC.
- * The TK_THEME_WIN_CLASSIC could be set even when running
- * under XP if the windows classic theme was selected. */
+
+ /* Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC.
+ * The TK_THEME_WIN_CLASSIC could be set even when running
+ * under XP if the windows classic theme was selected. */
if ((os.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
(os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) {
HKEY hKey;
@@ -568,11 +568,11 @@ TkpOpenDisplay(display_name)
Screen *screen;
TkWinDrawable *twdPtr;
Display *display;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->winDisplay != NULL) {
- if (strcmp(tsdPtr->winDisplay->display->display_name, display_name)
+ if (strcmp(tsdPtr->winDisplay->display->display_name, display_name)
== 0) {
return tsdPtr->winDisplay;
} else {
@@ -653,7 +653,7 @@ TkpCloseDisplay(dispPtr)
{
Display *display = dispPtr->display;
HWND hwnd;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (dispPtr != tsdPtr->winDisplay) {
@@ -664,7 +664,7 @@ TkpCloseDisplay(dispPtr)
/*
* Force the clipboard to be rendered if we are the clipboard owner.
*/
-
+
if (dispPtr->clipWindow) {
hwnd = Tk_GetHWND(Tk_WindowId(dispPtr->clipWindow));
if (GetClipboardOwner() == hwnd) {
@@ -759,12 +759,13 @@ TkClipCleanup(dispPtr)
*----------------------------------------------------------------------
*/
-void
+int
XBell(display, percent)
Display* display;
int percent;
{
MessageBeep(MB_OK);
+ return Success;
}
/*
@@ -832,7 +833,7 @@ TkWinChildProc(hwnd, message, wParam, lParam)
result = TkWinEmbeddedEventProc(hwnd, message, wParam, lParam);
break;
- case WM_UNICHAR:
+ case WM_UNICHAR:
if (wParam == UNICODE_NOCHAR) {
/* If wParam is UNICODE_NOCHAR and the application processes
* this message, then return TRUE. */
@@ -981,7 +982,7 @@ GenerateXEvent(hwnd, message, wParam, lParam)
{
XEvent event;
TkWindow *winPtr = (TkWindow *)Tk_HWNDToWindow(hwnd);
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!winPtr || winPtr->window == None) {
@@ -1176,31 +1177,31 @@ GenerateXEvent(hwnd, message, wParam, lParam)
* Synthesize both a KeyPress and a KeyRelease.
* Strings generated by Input Method Editor are handled
* in the following manner:
- * 1. A series of WM_KEYDOWN & WM_KEYUP messages that
+ * 1. A series of WM_KEYDOWN & WM_KEYUP messages that
* cause GetTranslatedKey() to be called and return
- * immediately because the WM_KEYDOWNs have no
- * associated WM_CHAR messages -- the IME window is
- * accumulating the characters and translating them
+ * immediately because the WM_KEYDOWNs have no
+ * associated WM_CHAR messages -- the IME window is
+ * accumulating the characters and translating them
* itself. In the "bind" command, you get an event
- * with a mystery keysym and %A == "" for each
+ * with a mystery keysym and %A == "" for each
* WM_KEYDOWN that actually was meant for the IME.
* 2. A WM_KEYDOWN corresponding to the "confirm typing"
- * character. This causes GetTranslatedKey() to be
+ * character. This causes GetTranslatedKey() to be
* called.
- * 3. A WM_IME_NOTIFY message saying that the IME is
- * done. A side effect of this message is that
+ * 3. A WM_IME_NOTIFY message saying that the IME is
+ * done. A side effect of this message is that
* GetTranslatedKey() thinks this means that there
* are no WM_CHAR messages and returns immediately.
* In the "bind" command, you get an another event
* with a mystery keysym and %A == "".
- * 4. A sequence of WM_CHAR messages that correspond to
- * the characters in the IME window. A bunch of
- * simulated KeyPress/KeyRelease events will be
- * generated, one for each character. Adjacent
+ * 4. A sequence of WM_CHAR messages that correspond to
+ * the characters in the IME window. A bunch of
+ * simulated KeyPress/KeyRelease events will be
+ * generated, one for each character. Adjacent
* WM_CHAR messages may actually specify the high
* and low bytes of a multi-byte character -- in that
* case the two WM_CHAR messages will be combined into
- * one event. It is the event-consumer's
+ * one event. It is the event-consumer's
* responsibility to convert the string returned from
* XLookupString from system encoding to UTF-8.
* 5. And finally we get the WM_KEYUP for the "confirm
@@ -1256,7 +1257,7 @@ GenerateXEvent(hwnd, message, wParam, lParam)
*
* GetState --
*
- * This function constructs a state mask for the mouse buttons
+ * This function constructs a state mask for the mouse buttons
* and modifier keys as they were before the event occured.
*
* Results:
@@ -1350,7 +1351,7 @@ GetTranslatedKey(xkey)
XKeyEvent *xkey;
{
MSG msg;
-
+
xkey->nbytes = 0;
while ((xkey->nbytes < XMaxTransChars)
@@ -1514,7 +1515,7 @@ TkWinGetUnicodeEncoding()
*
* This function correctly processes the composition data and
* sends the UNICODE values of the composed characters to
- * TK's event queue.
+ * TK's event queue.
*
* Results:
* If this function has processed the composition data, returns 1.
@@ -1763,7 +1764,7 @@ TkpGetMS()
void
TkWinUpdatingClipboard(int mode)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->updatingClipboard = mode;
diff --git a/xlib/xdraw.c b/xlib/xdraw.c
index 8ec924a..8523df7 100644
--- a/xlib/xdraw.c
+++ b/xlib/xdraw.c
@@ -1,4 +1,4 @@
-/*
+/*
* xdraw.c --
*
* This file contains generic procedures related to X drawing
@@ -17,7 +17,7 @@
*
* XDrawLine --
*
- * Draw a single line between two points in a given drawable.
+ * Draw a single line between two points in a given drawable.
*
* Results:
* None.
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 76828b1..a741b76 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -1,8 +1,8 @@
-/*
+/*
* xgc.c --
*
* This file contains generic routines for manipulating X graphics
- * contexts.
+ * contexts.
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
* Copyright (c) 2002-2007 Daniel A. Steffen <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; }
@@ -256,7 +256,7 @@ void XFreeGC(d, gc)
*----------------------------------------------------------------------
*/
-void
+void
XSetForeground(display, gc, foreground)
Display *display;
GC gc;
@@ -265,7 +265,7 @@ XSetForeground(display, gc, foreground)
gc->foreground = foreground;
}
-void
+void
XSetBackground(display, gc, background)
Display *display;
GC gc;
@@ -274,7 +274,7 @@ XSetBackground(display, gc, background)
gc->background = background;
}
-void
+int
XSetDashes(display, gc, dash_offset, dash_list, n)
Display* display;
GC gc;
@@ -296,6 +296,7 @@ XSetDashes(display, gc, dash_offset, dash_list, n)
*p++ = *dash_list++;
}
*p = 0;
+ return Success;
}
void
diff --git a/xlib/ximage.c b/xlib/ximage.c
index de3bb1e..e7ac86c 100644
--- a/xlib/ximage.c
+++ b/xlib/ximage.c
@@ -1,4 +1,4 @@
-/*
+/*
* ximage.c --
*
* X bitmap and image routines.
diff --git a/xlib/xutil.c b/xlib/xutil.c
index db9d35e..23b589c 100644
--- a/xlib/xutil.c
+++ b/xlib/xutil.c
@@ -1,4 +1,4 @@
-/*
+/*
* xutil.c --
*
* This function contains generic X emulation routines.
@@ -46,7 +46,7 @@ XInternAtom(display, atom_name, only_if_exists)
Bool only_if_exists;
{
static Atom atom = XA_LAST_PREDEFINED;
-
+
display->request++;
return ++atom;
}
@@ -85,7 +85,7 @@ XGetVisualInfo(display, vinfo_mask, vinfo_template, nitems_return)
info->red_mask = info->visual->red_mask;
info->green_mask = info->visual->green_mask;
info->blue_mask = info->visual->blue_mask;
-
+
if (((vinfo_mask & VisualIDMask)
&& (vinfo_template->visualid != info->visualid))
|| ((vinfo_mask & VisualScreenMask)