Merge pull request #84 from dizzib/dev_clear_area

Add ClearArea method
This commit is contained in:
Andrey Sidorov 2015-03-15 13:43:31 +11:00
commit 20886399ed
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,15 @@
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();
w.on('expose', function() {
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);
});
});

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