summaryrefslogtreecommitdiffstats
path: root/xlib/xgc.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-07-16 13:28:34 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-07-16 13:28:34 (GMT)
commit81da7830cb098eaccd1d444a8bd5defa37a25b84 (patch)
treea9a0bb126561028526eaab747d6a8e623c83eb92 /xlib/xgc.c
parentef6562fba1ee7d08f5cfec0030c94b5364ba90d6 (diff)
downloadtk-81da7830cb098eaccd1d444a8bd5defa37a25b84.zip
tk-81da7830cb098eaccd1d444a8bd5defa37a25b84.tar.gz
tk-81da7830cb098eaccd1d444a8bd5defa37a25b84.tar.bz2
Bug [f9eddb541a] (TkSetRegion(), XSetClipRectangles): Patch 5 from Christopher Chavez - Implement XSetClipRectangles() on Windows by relocating the existing Aqua implementation
Diffstat (limited to 'xlib/xgc.c')
-rw-r--r--xlib/xgc.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/xlib/xgc.c b/xlib/xgc.c
index ba186b4..1a5dd81 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -432,7 +432,7 @@ XSetClipOrigin(
/*
*----------------------------------------------------------------------
*
- * TkSetRegion, XSetClipMask --
+ * TkSetRegion, XSetClipMask, XSetClipRectangles --
*
* Sets the clipping region/pixmap for a GC.
*
@@ -488,6 +488,31 @@ XSetClipMask(
return Success;
}
+int
+XSetClipRectangles(
+ Display* d,
+ GC gc,
+ int clip_x_origin,
+ int clip_y_origin,
+ XRectangle* rectangles,
+ int n,
+ TCL_UNUSED(int))
+{
+ TkRegion clipRgn = TkCreateRegion();
+
+ 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;
+}
+
/*
* Some additional dummy functions (hopefully implemented soon).
*/