mirror of
https://github.com/danbulant/node-x11
synced 2026-06-20 07:01:23 +00:00
ChangeGC and ListFonts requests
This commit is contained in:
parent
2678daa7b8
commit
0c2cdeb884
1 changed files with 47 additions and 0 deletions
|
|
@ -341,6 +341,36 @@ module.exports = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
ListFonts: [
|
||||||
|
function(pattern, max)
|
||||||
|
{
|
||||||
|
var req_len = 2+xutil.padded_length(pattern.length)/4;
|
||||||
|
return [ 'CxSSSp', [49, req_len, max, pattern.length, pattern] ];
|
||||||
|
},
|
||||||
|
|
||||||
|
function(buf) {
|
||||||
|
console.log(buf);
|
||||||
|
// TODO: move to buffer.unpackStringList
|
||||||
|
var res = [];
|
||||||
|
var off = 24;
|
||||||
|
while (off < buf.length)
|
||||||
|
{
|
||||||
|
var len = buf[off++];
|
||||||
|
if (len == 0)
|
||||||
|
break;
|
||||||
|
if (off + len > buf.length)
|
||||||
|
{
|
||||||
|
len = buf.length - off;
|
||||||
|
if (len <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
res.push(buf.unpackString(len, off));
|
||||||
|
off += len;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
CreatePixmap: [
|
CreatePixmap: [
|
||||||
function(pid, drawable, depth, width, height) {
|
function(pid, drawable, depth, width, height) {
|
||||||
return [ 'CCSLLSS', [53, depth, 4, pid, drawable, width, height] ];
|
return [ 'CCSLLSS', [53, depth, 4, pid, drawable, width, height] ];
|
||||||
|
|
@ -365,6 +395,23 @@ module.exports = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
ChangeGC: [
|
||||||
|
function(cid, values) {
|
||||||
|
var format = 'CxSLL';
|
||||||
|
var packetLength = 3 + (values ? Object.keys(values).length : 0);
|
||||||
|
var args = [56, packetLength, cid];
|
||||||
|
var vals = packValueMask('CreateGC', values);
|
||||||
|
args.push(vals[0]); // values bitmask
|
||||||
|
var valArr = vals[1];
|
||||||
|
for (v in valArr)
|
||||||
|
{
|
||||||
|
format += 'L'; // TODO: we know format string length in advance and += inefficient for string
|
||||||
|
args.push(valArr[v]);
|
||||||
|
}
|
||||||
|
return [format, args];
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
//
|
//
|
||||||
CopyArea: [
|
CopyArea: [
|
||||||
function(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height) {
|
function(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue