From bd5da131a2f38a281729729fc4849f309be31b2a Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 19 Apr 2011 14:39:47 -0400 Subject: [PATCH] gdbus-codegen: Generate gtk-doc section docs This is nice to have if using gtk-doc on the generated code. We could also generate -sections.txt and .types files but we don't do that right now... Signed-off-by: David Zeuthen --- gio/gdbus-codegen/codegen.py | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/gio/gdbus-codegen/codegen.py b/gio/gdbus-codegen/codegen.py index f64538baa..a64b6d350 100644 --- a/gio/gdbus-codegen/codegen.py +++ b/gio/gdbus-codegen/codegen.py @@ -2218,6 +2218,17 @@ class CodeGenerator: ' */\n' '\n') + self.c.write(self.docbook_gen.expand( + '/**\n' + ' * SECTION:%sObjectManagerClient\n' + ' * @title: %sObjectManagerClient\n' + ' * @short_description: Generated #GDBusObjectManagerClient subclass\n' + ' *\n' + ' * This section contains a #GDBusObjectManagerClient that uses %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.\n' + ' */\n' + %(self.namespace, self.namespace, self.ns_lower))) + self.c.write('\n') + self.c.write(self.docbook_gen.expand( '/**\n' ' * %sObjectManagerClient:\n' @@ -2514,15 +2525,29 @@ class CodeGenerator: # --------------------------------------------------------------------------------------------------- + def generate_interface_intro(self, i): + self.c.write('/* ------------------------------------------------------------------------\n' + ' * Code for interface %s\n' + ' * ------------------------------------------------------------------------\n' + ' */\n' + '\n'%(i.name)) + + self.c.write(self.docbook_gen.expand( + '/**\n' + ' * SECTION:%s\n' + ' * @title: %s\n' + ' * @short_description: Generated C code for the %s D-Bus interface\n' + ' *\n' + ' * This section contains code for working with the #%s D-Bus interface in C.\n' + ' */\n' + %(i.camel_name, i.camel_name, i.name, i.name))) + self.c.write('\n') + def generate(self): self.generate_intro() self.declare_types() for i in self.ifaces: - self.c.write('/* ------------------------------------------------------------------------\n' - ' * Code for interface %s\n' - ' * ------------------------------------------------------------------------\n' - ' */\n' - '\n'%(i.name)) + self.generate_interface_intro(i) self.generate_introspection_for_interface(i) self.generate_interface(i) self.generate_property_accessors(i)