doc: Switch from static image files to generated diagrams.

Switches diagrams from using static PNG images to instead generate them via
simple graphviz DOT markup files.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
This commit is contained in:
Jon Cruz 2015-01-28 17:24:04 -08:00 committed by Bryce Harrington
parent f858550cf4
commit b5fca036cc
7 changed files with 137 additions and 13 deletions

View file

@ -1,4 +1,6 @@
.SUFFIXES = .gv .png
noinst_DATA = xml/Client/index.xml xml/Server/index.xml
dist_noinst_DATA = wayland.doxygen.in
@ -22,15 +24,21 @@ scanned_src_files_man = \
$(top_srcdir)/src/wayland-client.c \
$(top_srcdir)/src/wayland-client.h
diagramsdir := dot
diagramssrc := $(wildcard $(diagramsdir)/*.gv)
diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
# find all man/man3/wl_foo.3 pages
# for this to work, we need to create them before the man target (hence
# all-local below)
dist_man3_MANS = $(shell test -d man && find man/man3 -name "wl_*.3" -printf "man/man3/%P\n")
# Listing various directories that might need to be created.
alldirs := xml/Client xml/Server man/man3
alldirs := xml xml/Client xml/Server man/man3
xml/%/index.xml: $(scanned_src_files_%) wayland.doxygen | xml/%
$(diagrams): $(diagramssrc)
xml/%/index.xml: $(scanned_src_files_%) wayland.doxygen $(diagrams) | xml/%
$(AM_V_GEN)(cat wayland.doxygen; \
echo "GENERATE_XML=YES"; \
echo "XML_OUTPUT=xml/$*"; \
@ -45,6 +53,9 @@ man/man3/wl_display.3: $(scanned_src_files_man) wayland.doxygen | man/man3
echo "INPUT= $(scanned_src_files_man)"; \
) | $(DOXYGEN) -
xml/%.png: $(diagramsdir)/%.gv | xml
$(AM_V_GEN)$(DOT) -Tpng -o$@ $<
# general rule to create one of the listed directories.
$(alldirs):
$(AM_V_GEN)$(MKDIR_P) $@

View file

@ -0,0 +1,39 @@
digraph arch_wayland {
edge[
fontname="DejaVu Sans";
dir="both";
arrowtail="dot";
arrowsize=.5;
fontname="DejaVu Sans"
fontsize="18";
]
node[
shape="Mrecord";
color=none;
fillcolor="#ffbc00";
style="filled";
fontname="DejaVu Sans"
fontsize="18";
]
c1 [label="Wayland Client"; URL="#c1"]
c2 [label="Wayland Client"; URL="#c2"]
comp [tooltip="Wayland Compositor" label="|{|Wayland\nCompositor|}|"; URL="#comp"]
impl [tooltip="KMS evdev Kernel" label="|{{KMS|evdev}|Kernel}|"; URL="#impl"]
c1 -> comp [taillabel="③"; labeldistance=2.5; URL="#step_3"];
c2 -> comp;
comp -> c1 [label="②"; URL="#step_2"];
comp -> c2;
comp -> impl [xlabel = "④"; URL="#step_4"];
comp -> impl [style = invis; label=" "];
impl -> comp [xlabel = "①"; URL="#step_1"];
c1 -> c2 [style=invis];
}

View file

@ -0,0 +1,54 @@
digraph arch_x {
edge[
fontname="DejaVu Sans";
dir="both";
arrowtail="dot";
arrowsize=.5;
fontname="DejaVu Sans"
fontsize="18";
]
node[
shape="Mrecord";
color=none;
fillcolor="#ffbc00";
style="filled";
fontname="DejaVu Sans"
fontsize="18";
]
{
rank=same;
c1 [label="X Client"; URL="#c1"]
c3 [label="X Client"; URL="#c3"]
}
c2 [label="X Client"; URL="#c2"]
{
rank=same;
xserver [tooltip="X Server" label="|{|X Server|}|"; URL="#xserver"]
comp [tooltip="Compositor" label="|{|Compositor|}|"; URL="#comp"]
}
impl [tooltip="KMS evdev Kernel" label="|{{KMS|evdev}|Kernel}|"; URL="#impl"]
c1 -> xserver [taillabel="③"; labeldistance=2; URL="#step_3"];
c2 -> xserver;
c3 -> xserver;
xserver -> c1 [taillabel="②"; labeldistance=2; URL="#step_2"];
xserver -> c2;
xserver -> c3;
xserver -> impl [taillabel = "⑥"; labeldistance=1.75; URL="#step_6"];
xserver -> impl [style = invis; label=" "];
impl -> xserver [taillabel = "①"; labeldistance=1.75; URL="#step_1"];
xserver -> comp [style=invis];
xserver -> comp [taillabel="④"; labeldistance=1.75; labelangle=-45; URL="#step_4"];
comp -> xserver [taillabel="⑤"; URL="#step_5"];
comp -> xserver [style=invis]
c1 -> c2 [style=invis];
c3 -> c2 [style=invis];
}