diff options
Diffstat (limited to 'meson/test cases/frameworks/10 gtk-doc/include')
4 files changed, 142 insertions, 0 deletions
diff --git a/meson/test cases/frameworks/10 gtk-doc/include/foo-version.h.in b/meson/test cases/frameworks/10 gtk-doc/include/foo-version.h.in new file mode 100644 index 000000000..30751cd75 --- /dev/null +++ b/meson/test cases/frameworks/10 gtk-doc/include/foo-version.h.in @@ -0,0 +1,29 @@ +#pragma once + +/** + * SECTION:version + * @section_id: foo-version + * @short_description: <filename>foo-version.h</filename> + * @title: Foo Versioning + */ + +/** + * FOO_MAJOR_VERSION: + * + * The major version of foo. + */ +#define FOO_MAJOR_VERSION (@FOO_MAJOR_VERSION@) + +/** + * FOO_MINOR_VERSION: + * + * The minor version of foo. + */ +#define FOO_MINOR_VERSION (@FOO_MINOR_VERSION@) + +/** + * FOO_MICRO_VERSION: + * + * The micro version of foo. + */ +#define FOO_MICRO_VERSION (@FOO_MICRO_VERSION@) diff --git a/meson/test cases/frameworks/10 gtk-doc/include/foo.h b/meson/test cases/frameworks/10 gtk-doc/include/foo.h new file mode 100644 index 000000000..510f3d1ec --- /dev/null +++ b/meson/test cases/frameworks/10 gtk-doc/include/foo.h @@ -0,0 +1,33 @@ +#pragma once + +#include <glib-object.h> + +/** + * FooIndecision: + * @FOO_MAYBE: Something maybe + * @FOO_POSSIBLY: Something possible + * + * The indecision type. + **/ + +typedef enum { + FOO_MAYBE, + FOO_POSSIBLY, +} FooIndecision; + +/** + * FooObjClass: + * + * The class + */ + +/** + * FooObj: + * + * The instance + */ + +#define FOO_TYPE_OBJ foo_obj_get_type() +G_DECLARE_FINAL_TYPE(FooObj, foo_obj, FOO, OBJ, GObject) + +int foo_do_something(FooObj *self); diff --git a/meson/test cases/frameworks/10 gtk-doc/include/generate-enums-docbook.py b/meson/test cases/frameworks/10 gtk-doc/include/generate-enums-docbook.py new file mode 100644 index 000000000..41c6121b2 --- /dev/null +++ b/meson/test cases/frameworks/10 gtk-doc/include/generate-enums-docbook.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +import sys + +DOC_HEADER = '''<?xml version='1.0'?> +<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + +<refentry id="{0}"> + <refmeta> + <refentrytitle role="top_of_page" id="{0}.top_of_page">{0}</refentrytitle> + <refmiscinfo>{0}</refmiscinfo> + </refmeta> + <refnamediv> + <refname>{0}</refname> + <refpurpose></refpurpose> + </refnamediv> + + <refsect2 id="{1}" role="enum"> + <title>enum {1}</title> + <indexterm zone="{1}"> + <primary>{1}</primary> + </indexterm> + <para><link linkend="{1}">{1}</link></para> + <refsect3 role="enum_members"> + <title>Values</title> + <informaltable role="enum_members_table" pgwide="1" frame="none"> + <tgroup cols="4"> + <colspec colname="enum_members_name" colwidth="300px" /> + <colspec colname="enum_members_value" colwidth="100px"/> + <colspec colname="enum_members_description" /> + <tbody> +''' + +DOC_ENUM = ''' <row role="constant"> + <entry role="enum_member_name"><para>{0}</para><para></para></entry> + <entry role="enum_member_value"><para>= <literal>{1}</literal></para><para></para></entry> + <entry role="enum_member_description"></entry> + </row>''' + +DOC_FOOTER = ''' + </tbody> + </tgroup> + </informaltable> + </refsect3> + </refsect2> +</refentry> +''' + +if __name__ == '__main__': + if len(sys.argv) >= 4: + with open(sys.argv[1], 'w') as doc_out: + enum_name = sys.argv[2] + enum_type = sys.argv[3] + + doc_out.write(DOC_HEADER.format(enum_name, enum_type)) + for i, enum in enumerate(sys.argv[4:]): + doc_out.write(DOC_ENUM.format(enum, i)) + doc_out.write(DOC_FOOTER) + else: + print('Use: ' + sys.argv[0] + ' out name type [enums]') + + sys.exit(0) diff --git a/meson/test cases/frameworks/10 gtk-doc/include/meson.build b/meson/test cases/frameworks/10 gtk-doc/include/meson.build new file mode 100644 index 000000000..aa328850e --- /dev/null +++ b/meson/test cases/frameworks/10 gtk-doc/include/meson.build @@ -0,0 +1,17 @@ +cdata = configuration_data() +parts = meson.project_version().split('.') +cdata.set('FOO_MAJOR_VERSION', parts[0]) +cdata.set('FOO_MINOR_VERSION', parts[1]) +cdata.set('FOO_MICRO_VERSION', parts[2]) +configure_file(input : 'foo-version.h.in', + output : 'foo-version.h', + configuration : cdata, + install : true, + install_dir : get_option('includedir')) + +generate_enums_docbook = find_program('generate-enums-docbook.py') + +docbook = custom_target('enum-docbook', + output : 'bar.xml', + command : [generate_enums_docbook, '@OUTPUT@', 'BAR', 'BAR_TYPE', 'BAR_FOO'], + build_by_default : true) |