From c985425b2f03e2e14bf3f7ee9884cd74c184373e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 29 May 2012 15:08:30 +0000 Subject: Change XFillRectangle(s)/XDrawLines(s) signature to match Xorg, needed for Cygwin. Generate same pkgIndex.tcl file for win32 and cygwin, one that is equally useable for both. --- ChangeLog | 11 +++++++++++ generic/tk.decls | 2 +- generic/tkInt.decls | 18 +++++++++--------- generic/tkIntXlibDecls.h | 48 ++++++++++++++++++++++++------------------------ generic/tkMain.c | 2 -- mac/tkMacDraw.c | 8 +++++--- macosx/tkMacOSXDraw.c | 12 +++++++----- unix/Makefile.in | 15 ++++++++------- win/Makefile.in | 12 +++++------- win/tkWinDraw.c | 10 ++++++---- xlib/xdraw.c | 8 ++++---- 11 files changed, 80 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b7dcec..7577bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-05-09 Jan Nijtmans + + * generic/tkInt.decls: Change XFillRectangle(s)/XDrawLines(s) signature + * generic/tkIntXlibDeclsDecls.h: to match Xorg, needed for Cygwin. + * xlib/xdraw.c: + * mac/tkMacDraw.c: + * macosx/tkMacOSXDraw.c: + * win/tkWinDraw.c: + * win/Makefile.in: Generate same pkgIndex.tcl file for win32 and + * unix/Makefile.in: cygwin, one that is equally useable for both. + 2012-05-25 Jan Nijtmans * generic/tkWindow.c: Simpify determination whether we are running on cygwin. diff --git a/generic/tk.decls b/generic/tk.decls index 400c415..f752151 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1057,7 +1057,7 @@ declare 0 mac { Tk_MacEmbedGetClipProc *getClipProc, Tk_MacEmbedGetOffsetInParentProc *getOffsetProc) } - + declare 1 mac { void Tk_MacTurnOffMenus(void) } diff --git a/generic/tkInt.decls b/generic/tkInt.decls index df2ad29..3084743 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -427,7 +427,7 @@ declare 119 { TkRegion src, TkRegion dr_return) } declare 121 {mac aqua} { - Pixmap TkpCreateNativeBitmap(Display *display, const char *source) + Pixmap TkpCreateNativeBitmap(Display *display, const char *source) } declare 122 {mac aqua} { void TkpDefineNativeBitmaps(void) @@ -1173,7 +1173,7 @@ declare 30 win { unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 31 win { - void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 32 win { void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, @@ -1188,7 +1188,7 @@ declare 34 win { int i1, int i2, int i3) } declare 35 win { - void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 36 win { void XForceScreenSaver(Display *d, int i) @@ -1422,11 +1422,11 @@ declare 103 win { XTextProperty *text_prop_return) } declare 104 win { - void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 106 win { - void XFillRectangle(Display *display, Drawable d, GC gc, + int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 105 win { @@ -1519,7 +1519,7 @@ declare 22 {mac aqua} { unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 23 {mac aqua} { - void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 24 {mac aqua} { void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, @@ -1534,7 +1534,7 @@ declare 26 {mac aqua} { int i1, int i2, int i3) } declare 27 {mac aqua} { - void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 28 {mac aqua} { void XFreeColormap(Display *d, Colormap c) @@ -1721,11 +1721,11 @@ declare 81 {mac aqua} { void XForceScreenSaver(Display *display, int mode) } declare 82 {mac aqua} { - void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 83 {mac aqua} { - void XFillRectangle(Display *display, Drawable d, GC gc, + int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 84 {mac aqua} { diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 0ca0da4..c3e5d6a 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -134,7 +134,7 @@ EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 31 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 32 */ EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, @@ -148,7 +148,7 @@ EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 35 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 36 */ EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *d, int i)); @@ -353,14 +353,14 @@ EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display *display, EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 104 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 105 */ EXTERN void XWarpPointer _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 106 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); #endif /* WIN */ @@ -438,7 +438,7 @@ EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 23 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 24 */ EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, @@ -452,7 +452,7 @@ EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 27 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 28 */ EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); @@ -621,10 +621,10 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ @@ -728,7 +728,7 @@ EXTERN void XDrawArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 23 */ -EXTERN void XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XDrawLines _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 24 */ EXTERN void XDrawRectangle _ANSI_ARGS_((Display *d, Drawable dr, @@ -742,7 +742,7 @@ EXTERN void XFillArc _ANSI_ARGS_((Display *d, Drawable dr, GC g, EXTERN void XFillPolygon _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 27 */ -EXTERN void XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, +EXTERN int XFillRectangles _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 28 */ EXTERN void XFreeColormap _ANSI_ARGS_((Display *d, Colormap c)); @@ -911,10 +911,10 @@ EXTERN void XDrawSegments _ANSI_ARGS_((Display *display, EXTERN void XForceScreenSaver _ANSI_ARGS_((Display *display, int mode)); /* 82 */ -EXTERN void XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, +EXTERN int XDrawLine _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 83 */ -EXTERN void XFillRectangle _ANSI_ARGS_((Display *display, +EXTERN int XFillRectangle _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 84 */ @@ -983,11 +983,11 @@ typedef struct TkIntXlibStubs { void (*xDeleteProperty) _ANSI_ARGS_((Display *d, Window w, Atom a)); /* 28 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 29 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 31 */ void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */ void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 34 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 35 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *d, int i)); /* 36 */ void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 37 */ void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 38 */ @@ -1056,9 +1056,9 @@ typedef struct TkIntXlibStubs { XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return)); /* 101 */ void (*xSetWMClientMachine) _ANSI_ARGS_((Display *display, Window w, XTextProperty *text_prop)); /* 102 */ Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 103 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */ void (*xWarpPointer) _ANSI_ARGS_((Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */ #endif /* WIN */ #ifdef MAC_TCL void (*xSetDashes) _ANSI_ARGS_((Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n)); /* 0 */ @@ -1084,11 +1084,11 @@ typedef struct TkIntXlibStubs { void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ @@ -1143,8 +1143,8 @@ typedef struct TkIntXlibStubs { Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ @@ -1177,11 +1177,11 @@ typedef struct TkIntXlibStubs { void (*xDefineCursor) _ANSI_ARGS_((Display *d, Window w, Cursor c)); /* 20 */ void (*xDestroyWindow) _ANSI_ARGS_((Display *d, Window w)); /* 21 */ void (*xDrawArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */ - void (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ + int (*xDrawLines) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)); /* 23 */ void (*xDrawRectangle) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */ void (*xFillArc) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */ void (*xFillPolygon) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3)); /* 26 */ - void (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ + int (*xFillRectangles) _ANSI_ARGS_((Display *d, Drawable dr, GC g, XRectangle *x, int i)); /* 27 */ void (*xFreeColormap) _ANSI_ARGS_((Display *d, Colormap c)); /* 28 */ void (*xFreeColors) _ANSI_ARGS_((Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul)); /* 29 */ void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap *x)); /* 30 */ @@ -1236,8 +1236,8 @@ typedef struct TkIntXlibStubs { Status (*xStringListToTextProperty) _ANSI_ARGS_((char **list, int count, XTextProperty *text_prop_return)); /* 79 */ void (*xDrawSegments) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)); /* 80 */ void (*xForceScreenSaver) _ANSI_ARGS_((Display *display, int mode)); /* 81 */ - void (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ - void (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ + int (*xDrawLine) _ANSI_ARGS_((Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */ + int (*xFillRectangle) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */ void (*xClearWindow) _ANSI_ARGS_((Display *d, Window w)); /* 84 */ void (*xDrawPoint) _ANSI_ARGS_((Display *display, Drawable d, GC gc, int x, int y)); /* 85 */ void (*xDrawPoints) _ANSI_ARGS_((Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)); /* 86 */ diff --git a/generic/tkMain.c b/generic/tkMain.c index af2448e..f400c05 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -129,8 +129,6 @@ static void StdinProc _ANSI_ARGS_((ClientData clientData, * *---------------------------------------------------------------------- */ -int LoadCygwinTk(Tcl_Interp *interp); - void Tk_MainEx(argc, argv, appInitProc, interp) int argc; /* Number of arguments. */ diff --git a/mac/tkMacDraw.c b/mac/tkMacDraw.c index ddf23d2..720dd71 100644 --- a/mac/tkMacDraw.c +++ b/mac/tkMacDraw.c @@ -399,7 +399,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -433,6 +433,7 @@ XFillRectangles( } SetGWorld(saveWorld, saveDevice); + return 1; } /* @@ -451,7 +452,7 @@ XFillRectangles( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -470,7 +471,7 @@ XDrawLines( display->request++; if (npoints < 2) { - return; /* TODO: generate BadValue error. */ + return 0; /* TODO: generate BadValue error. */ } GetGWorld(&saveWorld, &saveDevice); SetGWorld(destPort, NULL); @@ -495,6 +496,7 @@ XDrawLines( } SetGWorld(saveWorld, saveDevice); + return 1; } /* diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 63e26a1..6805f28 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -550,7 +550,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -568,12 +568,12 @@ XDrawLines( * TODO: generate BadValue error. */ - return; + return 0; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return 0; } if (dc.context) { double prevx, prevy; @@ -614,6 +614,7 @@ XDrawLines( } } TkMacOSXRestoreDrawingContext(&dc); + return 1; } /* @@ -902,7 +903,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -917,7 +918,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return 0; } if (dc.context) { CGRect rect; @@ -944,6 +945,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return 1; } /* diff --git a/unix/Makefile.in b/unix/Makefile.in index 8a3856b..80dd6a0 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -633,15 +633,16 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish (\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ - echo "if {[string match CYGWIN* \$$::tcl_platform(os)]} {";\ - echo " if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ - echo " } else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ - echo " }";\ + if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + else \ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ echo "}";\ + fi \ ) > $(PKG_INDEX); \ fi @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" diff --git a/win/Makefile.in b/win/Makefile.in index 6612230..714b0e9 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -427,14 +427,12 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[package vcompare [package provide Tcl]\ - $(TCLVERSION)] != 0} { return }";\ - echo "if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ - echo " package ifneeded Tk $(VERSION)\ - [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(VERSION)\ - [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 805dde3..fea17d3 100755 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -620,7 +620,7 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, *---------------------------------------------------------------------- */ -void +int XFillRectangles(display, d, gc, rectangles, nrectangles) Display* display; Drawable d; @@ -635,7 +635,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HBRUSH brush, oldBrush; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -722,6 +722,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); + return 1; } /* @@ -871,7 +872,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) *---------------------------------------------------------------------- */ -void +int XDrawLines(display, d, gc, points, npoints, mode) Display* display; Drawable d; @@ -885,7 +886,7 @@ XDrawLines(display, d, gc, points, npoints, mode) HDC dc; if (d == None) { - return; + return 0; } dc = TkWinGetDrawableDC(display, d, &state); @@ -896,6 +897,7 @@ XDrawLines(display, d, gc, points, npoints, mode) DeleteObject(pen); TkWinReleaseDrawableDC(d, dc, &state); + return 1; } /* diff --git a/xlib/xdraw.c b/xlib/xdraw.c index 281a7e8..8ec924a 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- */ -void +int XDrawLine(display, d, gc, x1, y1, x2, y2) Display* display; Drawable d; @@ -41,7 +41,7 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) points[0].y = y1; points[1].x = x2; points[1].y = y2; - XDrawLines(display, d, gc, points, 2, CoordModeOrigin); + return XDrawLines(display, d, gc, points, 2, CoordModeOrigin); } /* @@ -61,7 +61,7 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) *---------------------------------------------------------------------- */ -void +int XFillRectangle(display, d, gc, x, y, width, height) Display* display; Drawable d; @@ -76,5 +76,5 @@ XFillRectangle(display, d, gc, x, y, width, height) rectangle.y = y; rectangle.width = width; rectangle.height = height; - XFillRectangles(display, d, gc, &rectangle, 1); + return XFillRectangles(display, d, gc, &rectangle, 1); } -- cgit v0.12