From 5b0ea83ab0be1c0f0415fc57ce2c4bc04d525932 Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Tue, 19 Jul 2011 00:52:13 -0700 Subject: [PATCH 1/4] Edited README.md via GitHub --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4ae59ee..e518203 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,61 @@ # status -stage 2) ( see [roadmap.txt](node-x11/blob/master/roadmap.txt) ) -next todo: dispatch replies and errors, decode all evnt types +( see [List of implemented requests](https://github.com/sidorares/node-x11/wiki/CoreRequests) ) # example - var X = require('x11').createClient(); - X.on('connect', function(display) { +Core requsests usage: + + var x11 = require('../lib/x11'); + + var xclient = x11.createClient(); + var Exposure = x11.eventMask.Exposure; + var PointerMotion = x11.eventMask.PointerMotion; + + xclient.on('connect', function(display) { + var X = this; var root = display.screen[0].root; + var white = display.screen[0].white_pixel; + var black = display.screen[0].black_pixel; + var wid = X.AllocID(); - X.CreateWindow(wid, root, 10, 10, 400, 300, 1, 1, 0, { backgroundPixel: 0, eventMask: 0x00000040 }); + X.CreateWindow( + wid, root, + 0, 0, 100, 100, + 1, 1, 0, + { + backgroundPixel: white, eventMask: Exposure|PointerMotion + } + ); X.MapWindow(wid); + + var gc = X.AllocID(); + X.CreateGC(gc, wid, { foreground: black, background: white } ); + + X.on('event', function(ev) { + if (ev.type == 12) + { + X.PolyText8(wid, gc, 50, 50, ['Hello, Node.JS!']); + } + }); + X.on('error', function(e) { + console.log(e); + }); + }); + + +Simple core requests Window wrapper: + + var x11 = require('x11'); + var Window = require('./wndwrap'); + var xclient = x11.createClient(); + xclient.on('connect', function(display) { + var mainwnd = new Window(xclient, 0, 0, 100, 100); + mainwnd.on('expose', function(ev) { + ev.gc.drawText(50, 50, 'Hello, NodeJS!'); + }); + mainwnd.map(); }); From 61fb5ff9fdbf97a4139004bf815fe1523ef6e242 Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Tue, 19 Jul 2011 00:53:11 -0700 Subject: [PATCH 2/4] Edited README.md via GitHub --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e518203..cc6a79a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # status -( see [List of implemented requests](https://github.com/sidorares/node-x11/wiki/CoreRequests) ) +[implemented requests documentation](https://github.com/sidorares/node-x11/wiki/CoreRequests) # example From e7ae00235a716901520db744ed81bee014027e20 Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Tue, 19 Jul 2011 01:05:34 -0700 Subject: [PATCH 3/4] Edited README.md via GitHub --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc6a79a..77442b9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # status -[implemented requests documentation](https://github.com/sidorares/node-x11/wiki/CoreRequests) +[implemented requests documentation](https://github.com/sidorares/node-x11/wiki/Core-requests) # example From 2be335ce5fb1a537f1b76ee8bded2ea02df2a112 Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Tue, 19 Jul 2011 01:07:23 -0700 Subject: [PATCH 4/4] Edited roadmap.txt via GitHub --- roadmap.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roadmap.txt b/roadmap.txt index d67d7c6..d77d53d 100644 --- a/roadmap.txt +++ b/roadmap.txt @@ -8,7 +8,7 @@ 7) vnc client using https://github.com/substack/node-rfb 8) rdesktop client using https://github.com/substack/node-rdesktop 9) widget implementing basic subset of html5 canvas api using https://github.com/learnboost/node-canvas or https://github.com/ajaxorg/node-o3-canvas -10) pdf viewer using https://github.com/andreasgal/pdf.js/ +10) pdf viewer using https://github.com/andreasgal/pdf.js/, (ODF viewer? - http://webodf.org/demo/) 12) ICCCM library http://www.x.org/docs/ICCCM/icccm.pdf http://tronche.com/gui/x/icccm/ 11) pure js window manager 12) general purpose widgets set, layout managers, box model