mirror of
https://github.com/danbulant/node-x11
synced 2026-07-07 12:10:47 +00:00
make borderWidth, class, visual and depth arguments optional defaults to 0
This commit is contained in:
parent
c26bc6b47d
commit
c5c5d973b5
1 changed files with 11 additions and 2 deletions
|
|
@ -117,8 +117,16 @@ module.exports = {
|
||||||
// create request packet - function OR format string
|
// create request packet - function OR format string
|
||||||
function(id, parentId, x, y, width, height, borderWidth, depth, _class, visual, values) {
|
function(id, parentId, x, y, width, height, borderWidth, depth, _class, visual, values) {
|
||||||
|
|
||||||
// TODO: ??? there is depth field in xproto, but xlib just sets it to zero
|
if (borderWidth === undefined)
|
||||||
// var depth = 0;
|
borderWidth = 0;
|
||||||
|
if (depth === undefined)
|
||||||
|
depth = 0;
|
||||||
|
if (_class === undefined)
|
||||||
|
_class = 0;
|
||||||
|
if (visual === undefined)
|
||||||
|
visual = 0;
|
||||||
|
if (values === undefined)
|
||||||
|
values = {}
|
||||||
|
|
||||||
var packetLength = 8 + (values ? Object.keys(values).length : 0);
|
var packetLength = 8 + (values ? Object.keys(values).length : 0);
|
||||||
// TODO: should be CCSLLssSSSSLL - x,y are signed
|
// TODO: should be CCSLLssSSSSLL - x,y are signed
|
||||||
|
|
@ -185,6 +193,7 @@ module.exports = {
|
||||||
['CxSL', [3, 2]],
|
['CxSL', [3, 2]],
|
||||||
function(buf)
|
function(buf)
|
||||||
{
|
{
|
||||||
|
// TODO: change from array to named object fields
|
||||||
var res = buf.unpack('LSCCLLCCCCCLLLS');
|
var res = buf.unpack('LSCCLLCCCCCLLLS');
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue