view README.rst @ 99:ad09a826ebaf

Repaint viewport miniature when the viewport updates.
author Mikhail Kryshen <mikhail@kryshen.net>
date Tue, 15 Mar 2011 05:03:42 +0300
parents
children f42e2b9e1ad9
line source
1 =========
2 Indyvon
3 =========
5 Indyvon [INteractive DYnamic VisualizatiON] is an experimental GUI
6 library for Clojure.
8 It is based around the idea of basically stateless UI elements defined
9 by the following simple protocol::
11 (defprotocol Layer
12 (render! [layer]
13 "Draws the layer.")
14 (layer-size [layer]
15 "Returns preferred size for the layer."))
17 Layer functions are called in the Layer context which is defined by
18 bindings to vars including:
20 - ``*graphics*`` — an instance of java.awt.Graphics2D used for drawing;
21 - ``*width*`` and ``*height*`` — size of the drawing bounds;
22 - ``*clip*`` — clipping area (instance of java.awt.geom.Shape).
24 In the ``render!`` function layer could draw using the provided
25 Graphics2D instance, display another layers at the specified locations
26 relative to it's own context, and register event handlers.
28 Event dispatching is done by remembering the clipping areas and affine
29 transforms of visible layer contexts after every repaint for the time
30 until the rendering of the next frame is complete.
32 It is possible to draw layers asynchronously in a separate thread by
33 wrapping them in ``async-layer`` which uses two off-screen buffers
34 (triple buffering) to avoid locking.