From d7cc4b5710811c097ba198acd6a47d0ad0c32fe1 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:01:47 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- .../examples/smoketest/shape-rectangles.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 js/x11/core/examples/smoketest/shape-rectangles.js diff --git a/js/x11/core/examples/smoketest/shape-rectangles.js b/js/x11/core/examples/smoketest/shape-rectangles.js new file mode 100644 index 0000000..38c02d4 --- /dev/null +++ b/js/x11/core/examples/smoketest/shape-rectangles.js @@ -0,0 +1,22 @@ +var x11 = require('../../lib'); + +var Expose = 12; + +x11.createClient(function(err, display) { + var X = display.client; + var root = display.screen[0].root; + X.require('shape', function(err, Shape) { + var win = X.AllocID(); + X.CreateWindow(win, root, 0, 0, 200, 200); + X.ChangeWindowAttributes(win, { backgroundPixel: display.screen[0].black_pixel }); + X.MapWindow(win); + Shape.Rectangles(Shape.Op.Set, Shape.Kind.Bounding, win, 0, 0, [ + [40, 40, 40, 40], [120, 40, 40, 40], + [0, 120, 20, 20], [180, 120, 20, 20], + [20, 140, 30, 20], [150, 140, 30, 20], + [50, 160, 100, 20] + ]); + }); + X.on('error', function(err) { console.log(err); }); + +});