From 879b3e441b6dffaa2ddc53f8b7b1ff1e2e205d67 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 23 Aug 2019 13:59:06 +0000 Subject: Finally: Add XDrawArcs() and XDrawRectangles() to aqua --- generic/tkInt.decls | 6 ++++++ generic/tkIntXlibDecls.h | 18 ++++++++++++------ generic/tkStubInit.c | 4 ++-- macosx/tkMacOSXDraw.c | 30 +++++------------------------- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 6b27a5a..e314cc0 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1845,6 +1845,12 @@ declare 122 aqua { declare 130 aqua { int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } +declare 131 aqua { + int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) +} +declare 132 aqua { + int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) +} declare 136 aqua { int XReparentWindow(Display *d, Window w, Window p, int x, int y) } diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index ec04fb9..e71b611 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -745,8 +745,12 @@ EXTERN Window XCreateWindow(Display *display, Window parent, int x, /* 130 */ EXTERN int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n); -/* Slot 131 is reserved */ -/* Slot 132 is reserved */ +/* 131 */ +EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, + int n); +/* 132 */ +EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc, + XRectangle *r, int n); /* Slot 133 is reserved */ /* Slot 134 is reserved */ /* Slot 135 is reserved */ @@ -1041,8 +1045,8 @@ typedef struct TkIntXlibStubs { void (*reserved128)(void); void (*reserved129)(void); int (*xFillArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 130 */ - void (*reserved131)(void); - void (*reserved132)(void); + int (*xDrawArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 131 */ + int (*xDrawRectangles) (Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* 132 */ void (*reserved133)(void); void (*reserved134)(void); void (*reserved135)(void); @@ -1563,8 +1567,10 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; /* Slot 129 is reserved */ #define XFillArcs \ (tkIntXlibStubsPtr->xFillArcs) /* 130 */ -/* Slot 131 is reserved */ -/* Slot 132 is reserved */ +#define XDrawArcs \ + (tkIntXlibStubsPtr->xDrawArcs) /* 131 */ +#define XDrawRectangles \ + (tkIntXlibStubsPtr->xDrawRectangles) /* 132 */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ /* Slot 135 is reserved */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 9db26f5..96d7613 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -901,8 +901,8 @@ static const TkIntXlibStubs tkIntXlibStubs = { 0, /* 128 */ 0, /* 129 */ XFillArcs, /* 130 */ - 0, /* 131 */ - 0, /* 132 */ + XDrawArcs, /* 131 */ + XDrawRectangles, /* 132 */ 0, /* 133 */ 0, /* 134 */ 0, /* 135 */ diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 5acdc5b..7ca6e12 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -943,7 +943,6 @@ XDrawRectangle( return Success; } -#ifdef TK_MACOSXDRAW_UNUSED /* *---------------------------------------------------------------------- * @@ -968,7 +967,7 @@ XDrawRectangle( *---------------------------------------------------------------------- */ -void +int XDrawRectangles( Display *display, Drawable drawable, @@ -982,8 +981,8 @@ XDrawRectangles( int i, lw = gc->line_width; display->request++; - if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + if (!TkMacOSXSetupDrawingContext(drawable, gc, 1, &dc)) { + return BadDrawable; } if (dc.context) { CGRect rect; @@ -1001,8 +1000,8 @@ XDrawRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } -#endif /* *---------------------------------------------------------------------- @@ -1173,7 +1172,6 @@ XDrawArc( return Success; } -#ifdef TK_MACOSXDRAW_UNUSED /* *---------------------------------------------------------------------- * @@ -1254,7 +1252,6 @@ XDrawArcs( TkMacOSXRestoreDrawingContext(&dc); return Success; } -#endif /* *---------------------------------------------------------------------- @@ -1335,7 +1332,7 @@ XFillArc( return Success; } -#/* +/* *---------------------------------------------------------------------- * * XFillArcs -- @@ -1417,23 +1414,6 @@ XFillArcs( return Success; } -#ifdef TK_MACOSXDRAW_UNUSED -/* - *---------------------------------------------------------------------- - * - * XMaxRequestSize -- - * - *---------------------------------------------------------------------- - */ - -long -XMaxRequestSize( - Display *display) -{ - return (SHRT_MAX / 4); -} -#endif - /* *---------------------------------------------------------------------- * -- cgit v0.12