[cairo] microraptor gui an immediate compromise

Øyvind Kolås pippin at gimp.org
Mon Apr 20 21:46:23 PDT 2015


Microraptor gui, is an experimental user interface framework built on
top of, one can even say integrated with cairos drawing model. While
drawing with cairo, you can register pointer/touch callbacks for the
current path. The information about these callbacks (the path,
transform, callback, eventmask) are kept in a list; stored in painting
order. During hit detection one has the ability to stop propagation.
The coordinates of pointer events get transformed to user coordinates;
thus you handle interaction and drawing in the same coordinate system.

The ideas experimented with in microraptor gui are variants on the
theme of immediate mode UI libraries. More extreme variations of this
theme[3]  which runs the render loop for every single event, and uses
inline procedural code instead of callbacks. Callbacks are a bit
painful in C – but if you write in a language with closures instead
the resulting structure of the code is similar to the imgui style; but
without the one frame lag of interaction, and full fps / at least rate
of event coordinates coming in re-rendering.

Other notable features of microraptor gui contains the start of a CSS
styling engine and a single-pass XHTML/SVG renderer using the above
infrastructure.

The framework seems powerful, and I keep discovering ways to improve
how various type interactions/interface can be implemented concisely
with this approach. For more, browse the code[1], peek at some
screenshots[2], watch a video[3] from FOSDEM of an earlier state,
attend a talk in Toronto the 1st of May at Libre Graphics Meeting[5]
or a lua slanted talk in Oslo during OSDC Nordic[6] the 10th of May.

Øyvind Kolås

Links:
1: https://github.com/hodefoting/mrg/
2: http://pippin.gimp.org/mrg/
3: http://iki.fi/sol/imgui/
4: http://video.fosdem.org/2015/devroom-desktops/microraptor_gui__CAM_ONLY.mp4
5: http://libregraphicsmeeting.org/
6: http://act.osdc.no/osdc2015no/


More information about the cairo mailing list