Codebase list wayland / b5fca03
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
7 changed file(s) with 137 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
2626 # Check for programs
2727 AC_PROG_CC
2828 AC_PROG_CXX
29 AC_PROG_GREP
2930
3031 # check if we have C++ compiler. This is hacky workaround,
3132 # for a reason why it is this way see
134135 AC_MSG_ERROR([Documentation build requested but xmlto not found. Install xmlto or disable the documentation using --disable-documentation])
135136 fi
136137
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
137150 AC_CONFIG_FILES([
138151 doc/doxygen/wayland.doxygen
139152 ])
0
1 .SUFFIXES = .gv .png
02
13 noinst_DATA = xml/Client/index.xml xml/Server/index.xml
24 dist_noinst_DATA = wayland.doxygen.in
2123 $(top_srcdir)/src/wayland-client.c \
2224 $(top_srcdir)/src/wayland-client.h
2325
26 diagramsdir := dot
27 diagramssrc := $(wildcard $(diagramsdir)/*.gv)
28 diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
29
2430 # find all man/man3/wl_foo.3 pages
2531 # for this to work, we need to create them before the man target (hence
2632 # all-local below)
2733 dist_man3_MANS = $(shell test -d man && find man/man3 -name "wl_*.3" -printf "man/man3/%P\n")
2834
2935 # 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
3137
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/%
3341 $(AM_V_GEN)(cat wayland.doxygen; \
3442 echo "GENERATE_XML=YES"; \
3543 echo "XML_OUTPUT=xml/$*"; \
4452 echo "INPUT= $(scanned_src_files_man)"; \
4553 ) | $(DOXYGEN) -
4654
55 xml/%.png: $(diagramsdir)/%.gv | xml
56 $(AM_V_GEN)$(DOT) -Tpng -o$@ $<
57
4758 # general rule to create one of the listed directories.
4859 $(alldirs):
4960 $(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 }
1111 # $(builddir)/en-US
1212 # * run xmlto on $(builddir)/en-US, output to $(builddir)/Wayland/en-US
1313
14 doxydir := $(top_builddir)/doc/doxygen
15 html_destdir := $(builddir)/Wayland/en-US/html
16
1417 publican_sources = \
1518 $(srcdir)/sources/Wayland.ent \
1619 $(srcdir)/sources/Wayland.xml \
2427 $(srcdir)/sources/Protocol.xml \
2528 $(srcdir)/sources/Compositors.xml \
2629 $(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
3031
3132 css_sources = \
3233 $(srcdir)/sources/css/brand.css \
3738
3839 img_sources = \
3940 $(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
4346
4447 if HAVE_XMLTO
4548 if HAVE_XSLTPROC
5053 --stringparam toc.section.depth=1 \
5154 --stringparam html.stylesheet=css/default.css
5255
53 doxydir := $(top_builddir)/doc/doxygen
54
55 html_destdir = $(builddir)/Wayland/en-US/html
56
5756 # Listing various directories that might need to be created.
5857 alldirs := $(builddir)/en-US $(builddir)/en-US/images $(html_destdir) $(html_destdir)/css $(html_destdir)/images
5958
6059
6160 html_css_targets = $(addprefix $(html_destdir)/css/,$(notdir $(css_sources)))
6261 html_img_targets = $(addprefix $(html_destdir)/images/,$(notdir $(img_sources)))
62 doxygen_img_targets := $(doxygen_img_sources:$(doxydir)/xml/%=$(html_destdir)/images/%)
6363
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
6565 $(AM_V_GEN)$(XMLTO) $(XMLTO_PARAM) html $(builddir)/en-US/Wayland.xml -o $(html_destdir)
6666 @touch $@
6767
6969 $(AM_V_GEN)cp -f $< $@
7070
7171 $(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
7275 $(AM_V_GEN)cp -f $< $@
7376
7477 pubdir = $(docdir)/Wayland/en-US
103106 $(AM_V_GEN)cp -f $< $@
104107 $(AM_V_at)chmod a+w $@
105108
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
106113 # general rule to create one of the listed directories.
107114 $(alldirs):
108115 $(AM_V_GEN)$(MKDIR_P) $@
doc/publican/sources/images/wayland-architecture.png less more
Binary diff not shown
doc/publican/sources/images/x-architecture.png less more
Binary diff not shown