Mercurial > hg > indyvon
changeset 84:b04bdeec5700
English README.
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Wed, 08 Sep 2010 04:40:05 +0400 |
parents | b5bb0e16507d |
children | e718a69f7d99 |
files | README.rst |
diffstat | 1 files changed, 34 insertions(+), 0 deletions(-) [+] |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/README.rst Wed Sep 08 04:40:05 2010 +0400 1.3 @@ -0,0 +1,34 @@ 1.4 +========= 1.5 + Indyvon 1.6 +========= 1.7 + 1.8 +Indyvon [INteractive DYnamic VisualizatiON] is an experimental GUI 1.9 +library for Clojure. 1.10 + 1.11 +It is based around the idea of basically stateless UI elements defined 1.12 +by the following simple protocol:: 1.13 + 1.14 + (defprotocol Layer 1.15 + (render! [layer] 1.16 + "Draws the layer.") 1.17 + (layer-size [layer] 1.18 + "Returns preferred size for the layer.")) 1.19 + 1.20 +Layer functions are called in the Layer context which is defined by 1.21 +bindings to vars including: 1.22 + 1.23 +- ``*graphics*`` — an instance of java.awt.Graphics2D used for drawing; 1.24 +- ``*width*`` and ``*height*`` — size of the drawing bounds; 1.25 +- ``*clip*`` — clipping area (instance of java.awt.geom.Shape). 1.26 + 1.27 +In the ``render!`` function layer could draw using the provided 1.28 +Graphics2D instance, display another layers at the specified locations 1.29 +relative to it's own context, and register event handlers. 1.30 + 1.31 +Event dispatching is done by remembering the clipping areas and affine 1.32 +transforms of visible layer contexts after every repaint for the time 1.33 +until the rendering of the next frame is complete. 1.34 + 1.35 +It is possible to draw layers asynchronously in a separate thread by 1.36 +wrapping them in ``async-layer`` which uses two off-screen buffers 1.37 +(triple buffering) to avoid locking.