You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weston/doc/sphinx/toc/libweston/images/react-to-heads-changed.msc

25 lines
718 B

doc: output management sequence diagrams When we were designing the libweston output API, I wrote a design document as a Phabricator wiki page. Phabricator is no longer accessible so that information needs to be migrated to a new place. Here I am converting most of it into libweston Sphinx documentation, particularly pulling in the sequence diagrams I drew. This should help people understand how libweston output configuration works. The diagrams are committed as both MSC source files and rendered PNG files. I did not bother tinkering with the build to run mscgen automatically and then with the CI images to install the tool. The Sphinx configuration need numref explicitly enabled so that figures are automatically numbered and can be referenced by their number rather than their whole caption text(!). The document structure is changed a little better flowing with Output Management being the overview page and the Heads and Outputs being the API pages. First I wrote the struct weston_output and weston_head descriptions in Doxygen comments in libweston.h, but then in the API page that text would have been buried somewhere towards the end of the page. So I put that text in ReST instead where it comes as first on the pages as it should. The doc for the structs only contain a link to the top of the page. Yes, the comment style in libweston.h is a little broken. If I left the asterisk there it would show up as a bullet point in Sphinx. OTOH putting everything from \rst in a single line did not produce anything. Because Sphinx cannot look in two places, the images need to be copied into the build dir too. mscgen: http://www.mcternan.me.uk/mscgen/ Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/25 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years ago
#!/usr/bin/mscgen -Tpng
msc {
hscale="1.5";
c [label = "compositor"], w [label = "libweston core"],
b [label = "backend"];
|||;
--- [label = "Compositor reacts to heads_changed"];
c <<= w [label = "heads_changed callback"];
c box c [label = "Iterate with weston_compositor_iterate_heads(), for each head"];
c => w [label = "weston_head_is_connected()"];
c << w [label = "bool"];
c => w [label = "weston_head_is_enabled()"];
c << w [label = "bool"];
c => w [label = "weston_head_is_device_changed()"];
c << w [label = "bool"];
c abox c [label = "If the head needs enabling, create an output."];
c abox c [label = "If the head needs disabling, disable the output or destroy the output."];
c >> w;
}