After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795304 - gdbus-codegen: Add a mode to generate GDBusInterfaceInfo structures
gdbus-codegen: Add a mode to generate GDBusInterfaceInfo structures
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gdbus
2.56.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-04-16 15:41 UTC by Philip Withnall
Modified: 2018-05-24 20:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example C output (68.48 KB, text/plain)
2018-04-17 13:07 UTC, Philip Withnall
  Details
Example C header output (1.29 KB, text/x-chdr)
2018-04-17 13:07 UTC, Philip Withnall
  Details
codegen: Support Since and name changing annotations on annotations (3.49 KB, patch)
2018-04-17 13:13 UTC, Philip Withnall
none Details | Review
codegen: Add --interface-info-[body|header] modes (22.84 KB, patch)
2018-04-17 13:13 UTC, Philip Withnall
none Details | Review
codegen: Suppress the old --xml-files option in the --help output (1.46 KB, patch)
2018-04-17 13:13 UTC, Philip Withnall
none Details | Review
codegen: Fix a minor Python linting warning (973 bytes, patch)
2018-04-17 13:14 UTC, Philip Withnall
none Details | Review

Description Philip Withnall 2018-04-16 15:41:32 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
Comment 1 Philip Withnall 2018-04-17 13:07:13 UTC
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
Comment 2 Philip Withnall 2018-04-17 13:07:33 UTC
Created attachment 371039 [details]
Example C header output
Comment 3 Philip Withnall 2018-04-17 13:13:39 UTC
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>
Comment 4 Philip Withnall 2018-04-17 13:13:45 UTC
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>
Comment 5 Philip Withnall 2018-04-17 13:13:55 UTC
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>
Comment 6 Philip Withnall 2018-04-17 13:14:02 UTC
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>
Comment 7 GNOME Infrastructure Team 2018-05-24 20:26:49 UTC
-- 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.