add ClearArea

This commit is contained in:
dizzib 2015-03-04 13:26:20 +00:00
parent 28aa28eccb
commit 45ab095ef2
2 changed files with 24 additions and 0 deletions

View file

@ -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
});

View file

@ -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) {