mirror of
https://github.com/danbulant/node-x11
synced 2026-05-22 22:09:14 +00:00
ChangeWindowAttributes, ChangeSaveSet, ReparentWindow requests
This commit is contained in:
parent
a77498a547
commit
b7a6c8b190
1 changed files with 44 additions and 1 deletions
|
|
@ -164,10 +164,38 @@ module.exports = {
|
|||
|
||||
],
|
||||
|
||||
ChangeWindowAttributes:[
|
||||
function(wid, values) {
|
||||
var format = 'CxSLL';
|
||||
var packetLength = 3 + (values ? Object.keys(values).length : 0);
|
||||
var vals = packValueMask('CreateWindow', values);
|
||||
var args = [2, packetLength, wid, vals[0]];
|
||||
var valArr = vals[1];
|
||||
for (v in valArr)
|
||||
{
|
||||
format += 'L';
|
||||
args.push(valArr[v]);
|
||||
}
|
||||
return [format, args];
|
||||
}
|
||||
],
|
||||
|
||||
DestroyWindow: [
|
||||
[ 'CxSL', [4, 2] ]
|
||||
],
|
||||
|
||||
ChangeSaveSet: [
|
||||
function(isInsert, wid)
|
||||
{
|
||||
return [ 'CCSL', [6, (isInsert ? 0 : 1), 2, wid]]
|
||||
}
|
||||
],
|
||||
|
||||
// wid, newParentId, x, y
|
||||
ReparentWindow: [
|
||||
[ 'CxSLLss', [7, 4]]
|
||||
],
|
||||
|
||||
MapWindow: [
|
||||
// 8 - opcode, 2 - length, wid added as parameter
|
||||
[ 'CxSL', [8, 2] ]
|
||||
|
|
@ -178,7 +206,7 @@ module.exports = {
|
|||
],
|
||||
|
||||
|
||||
// TODO: remove? this is actually a ConfigureWindow request
|
||||
// TODO: remove or leave as a convinient helper? this is actually a ConfigureWindow request
|
||||
// with width and height argiments & arguments mask
|
||||
ResiseWindow: [
|
||||
function(win, width, height) {
|
||||
|
|
@ -186,6 +214,21 @@ module.exports = {
|
|||
}
|
||||
],
|
||||
|
||||
QueryTree: [
|
||||
['CxSL', [15, 2]],
|
||||
|
||||
function(buf) {
|
||||
var tree = {};
|
||||
var res = buf.unpack('LLS');
|
||||
tree.root = res[0];
|
||||
tree.parent = res[1];
|
||||
tree.children = [];
|
||||
for (var i=0; i < res[2]; ++i)
|
||||
tree.children.push(buf.unpack('L', 24 + i*4)[0]);
|
||||
return tree;
|
||||
}
|
||||
],
|
||||
|
||||
// opcode 16
|
||||
InternAtom: [
|
||||
function (returnOnlyIfExist, value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue