GNOME Bugzilla – Bug 795304
gdbus-codegen: Add a mode to generate GDBusInterfaceInfo structures
Last modified: 2018-05-24 20:26:49 UTC
Since the code generated by gdbus-codegen is typically only useful for trivial D-Bus services, I generally write my services by hand. This requires defining the GDBusInterfaceInfo structures in a header file, which is a pain. It’s a lot easier to write XML. It would be nice if gdbus-codegen had a mode to turn XML into GDBusInterfaceInfo structures (only). Something like: gdbus-codegen --interface-info --output my-interface.h --c-namespace Namespace my-interface.xml
Created attachment 371038 [details] Example C output Patches coming. Here are the output files generated by: gdbus-codegen --interface-info-body --output out.c gio/tests/test-codegen.xml gdbus-codegen --interface-info-header --output out.h gio/tests/test-codegen.xml
Created attachment 371039 [details] Example C header output
Created attachment 371043 [details] [review] codegen: Support Since and name changing annotations on annotations Recursive annotations do seem to be supported, so we should support them properly in the type system representation. This currently introduces no behavioural changes, but will be used in upcoming commits. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Created attachment 371044 [details] [review] codegen: Add --interface-info-[body|header] modes These generate basic .c and .h files containing the GDBusInterfaceInfo for a D-Bus introspection XML file, but no other code (no skeletons, proxies, GObjects, etc.). This is useful for projects who want to describe their D-Bus interfaces using introspection XML, but who wish to implement the interfaces manually (for various reasons, typically because the skeletons generated by gdbus-codegen are too simplistic and limiting). Previously, these projects would have had to write the GDBusInterfaceInfo manually, which is painstaking and error-prone. The new --interface-info-[body|header] options are very similar to --[body|header], but mutually exclusive with them. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Created attachment 371045 [details] [review] codegen: Suppress the old --xml-files option in the --help output Since it’s deprecated in favour of positional arguments, including it in the help output is confusing. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Created attachment 371046 [details] [review] codegen: Fix a minor Python linting warning This introduces no functional changes. Signed-off-by: Philip Withnall <withnall@endlessm.com>
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1368.