node-x11/test/genstdatoms.js
2011-07-21 15:28:14 +10:00

28 lines
701 B
JavaScript

var x11 = require('../lib/x11');
var xclient = x11.createClient();
var atomId = 1;
xclient.on('connect', function(display) {
var X = this;
function listAtoms()
{
function getAtom(a)
{
X.GetAtomName(a, function(str) {
if (a == 1)
console.log('module.exports = {')
if (a != 68)
console.log(' %s: %d,', str, a);
else
console.log(' %s: %d\n}', str, a);
listAtoms();
});
}
if (atomId <= 68)
getAtom(atomId);
else
X.terminate();
atomId++;
}
listAtoms();
});