usage: gdbus-codegen [-h] [--interface-prefix PREFIX] [--c-namespace NAMESPACE]
[--c-generate-object-manager] [--c-generate-autocleanup {none,objects,all}]
[--generate-docbook OUTFILES] [--generate-md OUTFILES]
[--generate-rst OUTFILES] [--pragma-once]
[--annotate WHAT KEY VALUE WHAT KEY VALUE WHAT KEY VALUE]
[--glib-min-required VERSION] [--glib-max-allowed VERSION]
[--symbol-decorator SYMBOL_DECORATOR]
[--symbol-decorator-header SYMBOL_DECORATOR_HEADER]
[--symbol-decorator-define SYMBOL_DECORATOR_DEFINE]
[--extension-path EXTENSION_PATH] [--generate-c-code OUTFILES | --header |
--body | --interface-info-header | --interface-info-body] [--output FILE |
--output-directory OUTDIR]
FILE [FILE ...]
D-Bus code and documentation generator
positional arguments:
FILE D-Bus introspection XML file
options:
-h, --help show this help message and exit
--interface-prefix PREFIX
String to strip from D-Bus interface names for code and docs
--c-namespace NAMESPACE
The namespace to use for generated C code
--c-generate-object-manager
Generate a GDBusObjectManagerClient subclass when generating C code
--c-generate-autocleanup {none,objects,all}
Generate autocleanup support
--generate-docbook OUTFILES
Generate Docbook in OUTFILES-org.Project.IFace.xml
--generate-md OUTFILES
Generate Markdown in OUTFILES-org.Project.IFace.md
--generate-rst OUTFILES
Generate reStructuredText in OUTFILES-org.Project.IFace.rst
--pragma-once Use "pragma once" as the inclusion guard
--annotate WHAT KEY VALUE WHAT KEY VALUE WHAT KEY VALUE
Add annotation (may be used several times)
--glib-min-required VERSION
Minimum version of GLib to be supported by the outputted code (default:
2.30)
--glib-max-allowed VERSION
Maximum version of GLib to be used by the outputted code (default: current
GLib version)
--symbol-decorator SYMBOL_DECORATOR
Macro used to decorate a symbol in the outputted header, possibly to
export symbols
--symbol-decorator-header SYMBOL_DECORATOR_HEADER
Additional header required for decorator specified by --symbol-decorator
--symbol-decorator-define SYMBOL_DECORATOR_DEFINE
Additional define required for decorator specified by --symbol-decorator
--extension-path EXTENSION_PATH
Path to a gdbus-codegen Python extension file (unstable API)
--generate-c-code OUTFILES
Generate C code in OUTFILES.[ch]
--header Generate C headers
--body Generate C code
--interface-info-header
Generate GDBusInterfaceInfo C header
--interface-info-body
Generate GDBusInterfaceInfo C code
--output FILE Write output into the specified file
--output-directory OUTDIR
Location to output generated files
Options (24)
| Option | Description | Source |
|---|---|---|
-h, --help | show this help message and exit | help + man |
--interface-prefix PREFIX | A prefix to strip from all D-Bus interface names when calculating the type name for the C binding and the DocBook sortas attribute <https://tdg.docbook.org/tdg/4.5/primary.html>. | help + man |
--c-namespace NAMESPACE | The namespace to use for generated C code. | help + man |
--c-generate-object-manager | If this option is passed, suitable GDBusObject, GDBusObjectProxy, GDBusObjectSkeleton and GDBusObjectManagerClient subclasses are generated. | help + man |
--c-generate-autocleanup none | This option influences what types autocleanup functions are generated for. | help + man |
--generate-docbook OUTFILES | Generate DocBook Documentation for each D-Bus interface and put it in OUTFILES-NAME.xml where NAME is a placeholder for the interface name, e.g. net.Corp.FooBar and so on. | help + man |
--generate-md OUTFILES | Generate Markdown Documentation for each D-Bus interface and put it in OUTFILES-NAME.md where NAME is a placeholder for the interface name, e.g. net.Corp.FooBar and so on. | help + man |
--generate-rst OUTFILES | Generate reStructuredText Documentation for each D-Bus interface and put it in OUTFILES-NAME.rst where NAME is a placeholder for the interface name, e.g. net.Corp.FooBar and so on. | help + man |
--pragma-once | If this option is passed, the #pragma once <https://en.wikipedia.org/wiki/Pragma_once> preprocessor directive is used instead of include guards. | help + man |
--glib-min-required VERSION | Specifies the minimum version of GLib which the code generated by gdbus-codegen can depend on. | help + man |
--glib-max-allowed VERSION | Specifies the maximum version of GLib which the code generated by gdbus-codegen can depend on. | help + man |
--symbol-decorator SYMBOL_DECORATOR | If a DECORATOR is passed in with this option, all the generated function prototypes in the generated header will be marked with DECORATOR. | help + man |
--symbol-decorator-header SYMBOL_DECORATOR_HEADER | If a HEADER is passed in with this option, the generated header will put a #include HEADER before the rest of the items, except for the inclusion guards or #pragma once (if --pragma-once is used). | help + man |
--symbol-decorator-define SYMBOL_DECORATOR_DEFINE | If a DEFINE is passed in with this option, the generated source will add a #define DEFINE before the rest of the items. | help + man |
--extension-path EXTENSION_PATH | Path to a gdbus-codegen Python extension file (unstable API) | help + man |
--generate-c-code OUTFILES | Generate C code for all D-Bus interfaces and put it in OUTFILES.c and OUTFILES.h including any sub-directories. | help + man |
--header | If this option is passed, it will generate the header code and write it to the disk by using the path and file name provided by --output. | help + man |
--body | If this option is passed, it will generate the source code and write it to the disk by using the path and file name provided by --output. | help + man |
--interface-info-header | If this option is passed, it will generate the header code for the GDBusInterfaceInfo structures only and will write it to the disk by using the path and file name provided by --output. | help + man |
--interface-info-body | If this option is passed, it will generate the source code for the GDBusInterfaceInfo structures only and will write it to the disk by using the path and file name provided by --output. | help + man |
--output FILE | The full path where the header (--header, --interface-info-header) or the source code (--body, --interface-info-body) will be written, using the path and filename provided by --output. | help + man |
--output-directory OUTDIR | Directory to output generated source to. | help + man |
--xml-files FILE | This option is deprecated; (in the manual page but not in --help) | man |
--annotate ELEMENT | Used to inject D-Bus annotations into the given XML files. (in the manual page but not in --help) | man |
Examples (5) from the manual page, untested
<node>
Consider the following D-Bus Introspection XML:gdbus-codegen --generate-c-code myapp-generated \
If gdbus-codegen is used on this file like this:/* GType macros for the three generated types */
two files called myapp-generated.[ch] are generated.MyAppFrobber *proxy;
You can use the generated proxy type with the generated constructors:static gboolean
For example: