mirror of
https://github.com/danbulant/node-x11
synced 2026-05-19 04:18:35 +00:00
add ClearArea
This commit is contained in:
parent
28aa28eccb
commit
45ab095ef2
2 changed files with 24 additions and 0 deletions
18
examples/smoketest/cleararea.js
Normal file
18
examples/smoketest/cleararea.js
Normal 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
|
||||
});
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue