view README.rst @ 151:cb108c6fa079

Layers are now called Views.
author Mikhail Kryshen <mikhail@kryshen.net>
date Mon, 07 Apr 2014 15:23:58 +0400
parents b729e5ea9687
children 291afc2a8ca2
line source
1 =========
2 Indyvon
3 =========
5 Indyvon [INteractive DYnamic VisualizatiON] is an experimental GUI
6 library for Clojure. Indyvon allows you to build and draw interactive
7 objects in immediate mode without maintaining a scene graph or a
8 hierarchy of widgets.
10 It is based around the idea of basically stateless UI elements defined
11 by the following simple protocol::
13 (defprotocol Layer
14 (render! [layer]
15 "Draws the layer.")
16 (geometry [layer]
17 "Returns preferred size for the layer."))
19 Layer functions are called in the Layer context which is defined by
20 bindings to vars including:
22 - ``*graphics*`` — an instance of java.awt.Graphics2D used for drawing;
23 - ``*width*`` and ``*height*`` — size of the drawing bounds;
24 - ``*clip*`` — clipping area (instance of java.awt.geom.Shape).
26 In the ``render!`` function layer could draw using the provided
27 Graphics2D instance, display another layers at the specified locations
28 relative to it's own context, and register event handlers.
30 Event dispatching is done by remembering the clipping areas and affine
31 transforms of visible layer contexts after every repaint for the time
32 until the rendering of the next frame is complete.
34 It is possible to draw layers asynchronously in parallel threads by
35 wrapping them in ``async-layer``, which uses two off-screen buffers
36 (triple buffering) to avoid locking.