mirror of
https://github.com/danbulant/node-x11
synced 2026-05-27 14:01:52 +00:00
Add function Rectangles. Fix function Mask
This commit is contained in:
parent
e7d9ba7cb4
commit
520be559e8
1 changed files with 32 additions and 7 deletions
|
|
@ -31,12 +31,19 @@ exports.requireExt = function(display, callback)
|
||||||
Intersect: 2,
|
Intersect: 2,
|
||||||
Subtract: 3,
|
Subtract: 3,
|
||||||
Invert: 4
|
Invert: 4
|
||||||
}
|
};
|
||||||
|
|
||||||
|
ext.Ordering = {
|
||||||
|
Unsorted: 0,
|
||||||
|
YSorted: 1,
|
||||||
|
YXSorted: 2,
|
||||||
|
YXBanded: 3
|
||||||
|
};
|
||||||
|
|
||||||
ext.QueryVersion = function(cb)
|
ext.QueryVersion = function(cb)
|
||||||
{
|
{
|
||||||
X.seq_num++;
|
X.seq_num++;
|
||||||
captureStack();
|
// captureStack();
|
||||||
X.pack_stream.pack('CCSLL', [ext.majorOpcode, 0, 1]);
|
X.pack_stream.pack('CCSLL', [ext.majorOpcode, 0, 1]);
|
||||||
X.replies[X.seq_num] = [
|
X.replies[X.seq_num] = [
|
||||||
function(buf, opt) {
|
function(buf, opt) {
|
||||||
|
|
@ -48,18 +55,36 @@ exports.requireExt = function(display, callback)
|
||||||
X.pack_stream.flush();
|
X.pack_stream.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Accepts rectangles as [[x, y, width, height]]
|
||||||
|
ext.Rectangles = function( op, kind, window, x, y, rectangles, ordering /* = Ordering.Unsorted */ )
|
||||||
|
{
|
||||||
|
if (ordering === undefined)
|
||||||
|
ordering = ext.Ordering.Unsorted;
|
||||||
|
|
||||||
|
var length = 4 + rectangles.length * 2;
|
||||||
|
|
||||||
|
X.seq_num++;
|
||||||
|
// captureStack();
|
||||||
|
X.pack_stream.pack('CCSCCCxLss', [ext.majorOpcode, 1, length, op, kind, ordering, window, x, y]);
|
||||||
|
for (var i = 0; i < rectangles.length; ++i) {
|
||||||
|
var r = rectangles[i];
|
||||||
|
X.pack_stream.pack('ssSS', r);
|
||||||
|
}
|
||||||
|
X.pack_stream.flush();
|
||||||
|
}
|
||||||
|
|
||||||
ext.Mask = function( op, kind, window, x, y, bitmap )
|
ext.Mask = function( op, kind, window, x, y, bitmap )
|
||||||
{
|
{
|
||||||
X.seq_num++;
|
X.seq_num++;
|
||||||
captureStack();
|
// captureStack();
|
||||||
X.pack_stream.pack('CCSCCxxLssL', [ext.majorOpcode, 2, 5, op, kind, x, y, bitmap]);
|
X.pack_stream.pack('CCSCCxxLssL', [ext.majorOpcode, 2, 5, op, kind, window, x, y, bitmap]);
|
||||||
X.pack_stream.flush();
|
X.pack_stream.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.SelectInput = function( window, enable )
|
ext.SelectInput = function( window, enable )
|
||||||
{
|
{
|
||||||
X.seq_num++;
|
X.seq_num++;
|
||||||
captureStack();
|
// captureStack();
|
||||||
X.pack_stream.pack('CCSLCxxx', [ext.majorOpcode, 6, 3, window, enable ]);
|
X.pack_stream.pack('CCSLCxxx', [ext.majorOpcode, 6, 3, window, enable ]);
|
||||||
X.pack_stream.flush();
|
X.pack_stream.flush();
|
||||||
}
|
}
|
||||||
|
|
@ -67,7 +92,7 @@ exports.requireExt = function(display, callback)
|
||||||
ext.InputSelected = function( window, cb )
|
ext.InputSelected = function( window, cb )
|
||||||
{
|
{
|
||||||
X.seq_num++;
|
X.seq_num++;
|
||||||
captureStack();
|
// captureStack();
|
||||||
X.pack_stream.pack('CCSL', [ext.majorOpcode, 7, 2, window ]);
|
X.pack_stream.pack('CCSL', [ext.majorOpcode, 7, 2, window ]);
|
||||||
X.replies[X.seq_num] = [
|
X.replies[X.seq_num] = [
|
||||||
function(buf, opt) {
|
function(buf, opt) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue