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>
Jon Cruz authored 9 years ago
Bryce Harrington committed 9 years ago
26 | 26 | # Check for programs |
27 | 27 | AC_PROG_CC |
28 | 28 | AC_PROG_CXX |
29 | AC_PROG_GREP | |
29 | 30 | |
30 | 31 | # check if we have C++ compiler. This is hacky workaround, |
31 | 32 | # for a reason why it is this way see |
134 | 135 | AC_MSG_ERROR([Documentation build requested but xmlto not found. Install xmlto or disable the documentation using --disable-documentation]) |
135 | 136 | fi |
136 | 137 | |
138 | AC_PATH_PROG(DOT, dot) | |
139 | if test "x$DOT" = "x"; then | |
140 | AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation]) | |
141 | fi | |
142 | AC_MSG_CHECKING([for compatible dot version]) | |
143 | dot_version=`$DOT -V 2>&1|$GREP -oP '(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'` | |
144 | AS_VERSION_COMPARE([$dot_version], [2.26.0], | |
145 | [AC_MSG_RESULT([no]) | |
146 | AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])], | |
147 | [AC_MSG_RESULT([yes])], | |
148 | [AC_MSG_RESULT([yes])]) | |
149 | ||
137 | 150 | AC_CONFIG_FILES([ |
138 | 151 | doc/doxygen/wayland.doxygen |
139 | 152 | ]) |
0 | ||
1 | .SUFFIXES = .gv .png | |
0 | 2 | |
1 | 3 | noinst_DATA = xml/Client/index.xml xml/Server/index.xml |
2 | 4 | dist_noinst_DATA = wayland.doxygen.in |
21 | 23 | $(top_srcdir)/src/wayland-client.c \ |
22 | 24 | $(top_srcdir)/src/wayland-client.h |
23 | 25 | |
26 | diagramsdir := dot | |
27 | diagramssrc := $(wildcard $(diagramsdir)/*.gv) | |
28 | diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png)) | |
29 | ||
24 | 30 | # find all man/man3/wl_foo.3 pages |
25 | 31 | # for this to work, we need to create them before the man target (hence |
26 | 32 | # all-local below) |
27 | 33 | dist_man3_MANS = $(shell test -d man && find man/man3 -name "wl_*.3" -printf "man/man3/%P\n") |
28 | 34 | |
29 | 35 | # Listing various directories that might need to be created. |
30 | alldirs := xml/Client xml/Server man/man3 | |
36 | alldirs := xml xml/Client xml/Server man/man3 | |
31 | 37 | |
32 | xml/%/index.xml: $(scanned_src_files_%) wayland.doxygen | xml/% | |
38 | $(diagrams): $(diagramssrc) | |
39 | ||
40 | xml/%/index.xml: $(scanned_src_files_%) wayland.doxygen $(diagrams) | xml/% | |
33 | 41 | $(AM_V_GEN)(cat wayland.doxygen; \ |
34 | 42 | echo "GENERATE_XML=YES"; \ |
35 | 43 | echo "XML_OUTPUT=xml/$*"; \ |
44 | 52 | echo "INPUT= $(scanned_src_files_man)"; \ |
45 | 53 | ) | $(DOXYGEN) - |
46 | 54 | |
55 | xml/%.png: $(diagramsdir)/%.gv | xml | |
56 | $(AM_V_GEN)$(DOT) -Tpng -o$@ $< | |
57 | ||
47 | 58 | # general rule to create one of the listed directories. |
48 | 59 | $(alldirs): |
49 | 60 | $(AM_V_GEN)$(MKDIR_P) $@ |
0 | digraph arch_wayland { | |
1 | edge[ | |
2 | fontname="DejaVu Sans"; | |
3 | dir="both"; | |
4 | arrowtail="dot"; | |
5 | arrowsize=.5; | |
6 | fontname="DejaVu Sans" | |
7 | fontsize="18"; | |
8 | ] | |
9 | ||
10 | node[ | |
11 | shape="Mrecord"; | |
12 | color=none; | |
13 | fillcolor="#ffbc00"; | |
14 | style="filled"; | |
15 | fontname="DejaVu Sans" | |
16 | fontsize="18"; | |
17 | ] | |
18 | ||
19 | c1 [label="Wayland Client"; URL="#c1"] | |
20 | c2 [label="Wayland Client"; URL="#c2"] | |
21 | ||
22 | comp [tooltip="Wayland Compositor" label="|{|Wayland\nCompositor|}|"; URL="#comp"] | |
23 | ||
24 | impl [tooltip="KMS evdev Kernel" label="|{{KMS|evdev}|Kernel}|"; URL="#impl"] | |
25 | ||
26 | ||
27 | c1 -> comp [taillabel="③"; labeldistance=2.5; URL="#step_3"]; | |
28 | c2 -> comp; | |
29 | ||
30 | comp -> c1 [label="②"; URL="#step_2"]; | |
31 | comp -> c2; | |
32 | ||
33 | comp -> impl [xlabel = "④"; URL="#step_4"]; | |
34 | comp -> impl [style = invis; label=" "]; | |
35 | impl -> comp [xlabel = "①"; URL="#step_1"]; | |
36 | ||
37 | c1 -> c2 [style=invis]; | |
38 | } |
0 | digraph arch_x { | |
1 | edge[ | |
2 | fontname="DejaVu Sans"; | |
3 | dir="both"; | |
4 | arrowtail="dot"; | |
5 | arrowsize=.5; | |
6 | fontname="DejaVu Sans" | |
7 | fontsize="18"; | |
8 | ] | |
9 | ||
10 | node[ | |
11 | shape="Mrecord"; | |
12 | color=none; | |
13 | fillcolor="#ffbc00"; | |
14 | style="filled"; | |
15 | fontname="DejaVu Sans" | |
16 | fontsize="18"; | |
17 | ] | |
18 | ||
19 | { | |
20 | rank=same; | |
21 | c1 [label="X Client"; URL="#c1"] | |
22 | c3 [label="X Client"; URL="#c3"] | |
23 | } | |
24 | c2 [label="X Client"; URL="#c2"] | |
25 | ||
26 | { | |
27 | rank=same; | |
28 | xserver [tooltip="X Server" label="|{|X Server|}|"; URL="#xserver"] | |
29 | comp [tooltip="Compositor" label="|{|Compositor|}|"; URL="#comp"] | |
30 | } | |
31 | ||
32 | impl [tooltip="KMS evdev Kernel" label="|{{KMS|evdev}|Kernel}|"; URL="#impl"] | |
33 | ||
34 | c1 -> xserver [taillabel="③"; labeldistance=2; URL="#step_3"]; | |
35 | c2 -> xserver; | |
36 | c3 -> xserver; | |
37 | ||
38 | xserver -> c1 [taillabel="②"; labeldistance=2; URL="#step_2"]; | |
39 | xserver -> c2; | |
40 | xserver -> c3; | |
41 | ||
42 | xserver -> impl [taillabel = "⑥"; labeldistance=1.75; URL="#step_6"]; | |
43 | xserver -> impl [style = invis; label=" "]; | |
44 | impl -> xserver [taillabel = "①"; labeldistance=1.75; URL="#step_1"]; | |
45 | ||
46 | xserver -> comp [style=invis]; | |
47 | xserver -> comp [taillabel="④"; labeldistance=1.75; labelangle=-45; URL="#step_4"]; | |
48 | comp -> xserver [taillabel="⑤"; URL="#step_5"]; | |
49 | comp -> xserver [style=invis] | |
50 | ||
51 | c1 -> c2 [style=invis]; | |
52 | c3 -> c2 [style=invis]; | |
53 | } |
11 | 11 | # $(builddir)/en-US |
12 | 12 | # * run xmlto on $(builddir)/en-US, output to $(builddir)/Wayland/en-US |
13 | 13 | |
14 | doxydir := $(top_builddir)/doc/doxygen | |
15 | html_destdir := $(builddir)/Wayland/en-US/html | |
16 | ||
14 | 17 | publican_sources = \ |
15 | 18 | $(srcdir)/sources/Wayland.ent \ |
16 | 19 | $(srcdir)/sources/Wayland.xml \ |
24 | 27 | $(srcdir)/sources/Protocol.xml \ |
25 | 28 | $(srcdir)/sources/Compositors.xml \ |
26 | 29 | $(srcdir)/sources/images/icon.svg \ |
27 | $(srcdir)/sources/images/wayland-architecture.png \ | |
28 | $(srcdir)/sources/images/wayland.png \ | |
29 | $(srcdir)/sources/images/x-architecture.png | |
30 | $(srcdir)/sources/images/wayland.png | |
30 | 31 | |
31 | 32 | css_sources = \ |
32 | 33 | $(srcdir)/sources/css/brand.css \ |
37 | 38 | |
38 | 39 | img_sources = \ |
39 | 40 | $(srcdir)/sources/images/icon.svg \ |
40 | $(srcdir)/sources/images/wayland-architecture.png \ | |
41 | $(srcdir)/sources/images/wayland.png \ | |
42 | $(srcdir)/sources/images/x-architecture.png | |
41 | $(srcdir)/sources/images/wayland.png | |
42 | ||
43 | doxygen_img_sources := \ | |
44 | $(doxydir)/xml/wayland-architecture.png \ | |
45 | $(doxydir)/xml/x-architecture.png | |
43 | 46 | |
44 | 47 | if HAVE_XMLTO |
45 | 48 | if HAVE_XSLTPROC |
50 | 53 | --stringparam toc.section.depth=1 \ |
51 | 54 | --stringparam html.stylesheet=css/default.css |
52 | 55 | |
53 | doxydir := $(top_builddir)/doc/doxygen | |
54 | ||
55 | html_destdir = $(builddir)/Wayland/en-US/html | |
56 | ||
57 | 56 | # Listing various directories that might need to be created. |
58 | 57 | alldirs := $(builddir)/en-US $(builddir)/en-US/images $(html_destdir) $(html_destdir)/css $(html_destdir)/images |
59 | 58 | |
60 | 59 | |
61 | 60 | html_css_targets = $(addprefix $(html_destdir)/css/,$(notdir $(css_sources))) |
62 | 61 | html_img_targets = $(addprefix $(html_destdir)/images/,$(notdir $(img_sources))) |
62 | doxygen_img_targets := $(doxygen_img_sources:$(doxydir)/xml/%=$(html_destdir)/images/%) | |
63 | 63 | |
64 | $(builddir)/Wayland: $(publican_targets) $(html_css_targets) $(html_img_targets) | $(builddir)/en-US | |
64 | $(builddir)/Wayland: $(publican_targets) $(html_css_targets) $(html_img_targets) $(doxygen_img_targets) | $(builddir)/en-US | |
65 | 65 | $(AM_V_GEN)$(XMLTO) $(XMLTO_PARAM) html $(builddir)/en-US/Wayland.xml -o $(html_destdir) |
66 | 66 | @touch $@ |
67 | 67 | |
69 | 69 | $(AM_V_GEN)cp -f $< $@ |
70 | 70 | |
71 | 71 | $(html_destdir)/images/%: $(srcdir)/sources/images/% | $(html_destdir)/images |
72 | $(AM_V_GEN)cp -f $< $@ | |
73 | ||
74 | $(html_destdir)/images/%: $(doxydir)/xml/% | $(html_destdir)/images | |
72 | 75 | $(AM_V_GEN)cp -f $< $@ |
73 | 76 | |
74 | 77 | pubdir = $(docdir)/Wayland/en-US |
103 | 106 | $(AM_V_GEN)cp -f $< $@ |
104 | 107 | $(AM_V_at)chmod a+w $@ |
105 | 108 | |
109 | $(builddir)/en-US/images/%: $(doxydir)/xml/% | $(builddir)/en-US/images | |
110 | $(AM_V_GEN)cp -f $< $@ | |
111 | $(AM_V_at)chmod a+w $@ | |
112 | ||
106 | 113 | # general rule to create one of the listed directories. |
107 | 114 | $(alldirs): |
108 | 115 | $(AM_V_GEN)$(MKDIR_P) $@ |