diff --git a/examples/smoketest/cleararea.js b/examples/smoketest/cleararea.js new file mode 100644 index 0000000..fbba51a --- /dev/null +++ b/examples/smoketest/cleararea.js @@ -0,0 +1,18 @@ +var x11 = require('../../lib'); +var Window = require('./wndwrap'); + +x11.createClient(function(err, display) { + var X = display.client; + var w = new Window(X, 0, 0, 700, 500); + w.map(); + + var render = function() { + //X.ChangeGC(w.gc.id, { foreground: w.black, background: w.white }); + var gc = X.AllocID(); + X.CreateGC(gc, w.id, { foreground: w.black, background: w.white }); + X.PolyFillRectangle(w.id, gc, [50, 50, 600, 400]); + X.ClearArea(w.id, 0, 0, 300, 300, 0); + } + + setTimeout(render, 100); // sometimes doesn't render without a delay +}); diff --git a/lib/corereqs.js b/lib/corereqs.js index 5c1bc9f..8fa1d76 100644 --- a/lib/corereqs.js +++ b/lib/corereqs.js @@ -782,6 +782,12 @@ var templates = { } ], + ClearArea: [ + function(wid, x, y, width, height, exposures) { + return [ 'CCSLssSS', [61, exposures, 4, wid, x, y, width, height] ]; + } + ], + // CopyArea: [ function(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height) {