diff options
author | culler <culler> | 2020-08-18 16:36:05 (GMT) |
---|---|---|
committer | culler <culler> | 2020-08-18 16:36:05 (GMT) |
commit | ac29dc484022e95b598290946ebecaff9dc401d3 (patch) | |
tree | 917f7d3ff3eb6f8d9ad5388627394d2578677bda /macosx/tkMacOSXXStubs.c | |
parent | c40f7dce9a850527652b4026480a50c415d248f2 (diff) | |
download | tk-ac29dc484022e95b598290946ebecaff9dc401d3.zip tk-ac29dc484022e95b598290946ebecaff9dc401d3.tar.gz tk-ac29dc484022e95b598290946ebecaff9dc401d3.tar.bz2 |
Test using XSetClipRectangles on macOS.
Diffstat (limited to 'macosx/tkMacOSXXStubs.c')
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index e183ca7..00dc028 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -718,6 +718,31 @@ XSync( return 0; } +int +XSetClipRectangles( + Display *d, + GC gc, + int clip_x_origin, + int clip_y_origin, + XRectangle* rectangles, + int n, + int ordering) +{ + TkRegion clipRgn = TkCreateRegion(); + XSetClipMask(d, gc, None); + + while (n--) { + XRectangle rect = *rectangles; + + rect.x += clip_x_origin; + rect.y += clip_y_origin; + TkUnionRectWithRegion(&rect, clipRgn, clipRgn); + rectangles++; + } + TkSetRegion(d, gc, clipRgn); + TkDestroyRegion(clipRgn); + return 1; +} /* *---------------------------------------------------------------------- * |