mirror of
https://github.com/danbulant/node-x11
synced 2026-06-18 14:11:29 +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
|
||||
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
|
||||
// var depth = 0;
|
||||
if (borderWidth === undefined)
|
||||
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);
|
||||
// TODO: should be CCSLLssSSSSLL - x,y are signed
|
||||
|
|
@ -185,6 +193,7 @@ module.exports = {
|
|||
['CxSL', [3, 2]],
|
||||
function(buf)
|
||||
{
|
||||
// TODO: change from array to named object fields
|
||||
var res = buf.unpack('LSCCLLCCCCCLLLS');
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue