gdbus: Use symbolic constants for interfaces from dbus-specification

Most D-Bus interfaces are domain-specific, but these interfaces from the
D-Bus Specification are intended to be commonly used in any context for
which they are found to be appropriate.

Most of these use `gdbusprivate.h`. One exception is that
`gio/tests/gdbus-example-*` redefine the constants locally: due to these
files' dual role as part of the unit tests and as sample code, it seems
desirable to ensure that they can still be compiled outside GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2024-05-13 13:00:34 +01:00
committed by Philip Withnall
parent b4f8d4a5d5
commit 7c609f8142
18 changed files with 95 additions and 75 deletions

View File

@@ -36,6 +36,12 @@ G_BEGIN_DECLS
#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local"
#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
/* Other well-known D-Bus interfaces from the specification */
#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
#define DBUS_INTERFACE_OBJECT_MANAGER "org.freedesktop.DBus.ObjectManager"
#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
/* Owner flags */
#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */