Commit 9490d67f authored by Alexander Larsson's avatar Alexander Larsson

Add GDBusDAaemon, an implementation of a message bus

This is mostly complete, sans support for activation. However, its
not as picky as the libdbus implementation in terms like validation
and limits checking, nor is it as tested.

Its can be useful to test gdbus if dbus-daemon is not availible, but
its main reason for existance is to implement a default session bus
on win32 so that e.g. GApplication is guaranteed to work.
(cherry picked from commit 25581738)
parent 27352d96
......@@ -3,6 +3,7 @@ gdbus
gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Animal.xml
gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml
gdbus-example-objectmanager-generated.[ch]
gdbus-daemon-generated.[ch]
gio-marshal.[ch]
gio-public-headers.txt
gio-querymodules
......
......@@ -95,6 +95,19 @@ gdbus_sources = \
gdbusobjectmanagerserver.h gdbusobjectmanagerserver.c \
$(NULL)
# These are not built into the library yet
EXTRA_DIST += gdbusdaemon.c gdbusdaemon.h
gdbus-daemon-generated.h gdbus-daemon-generated.c : dbus-daemon.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
--interface-prefix org. \
--generate-c-code gdbus-daemon-generated \
--c-namespace _G \
$(srcdir)/dbus-daemon.xml \
$(NULL)
settings_headers = \
gsettingsbackend.h \
gsettingsschema.h \
......@@ -604,6 +617,8 @@ BUILT_SOURCES = \
gconstructor_as_data.h \
gioenumtypes.h \
gioenumtypes.c \
gdbus-daemon-generated.c \
gdbus-daemon-generated.h \
$(NULL)
EXTRA_DIST += \
......@@ -625,7 +640,7 @@ BUILT_EXTRA_DIST = \
gio-public-headers.txt: Makefile
echo $(gioinclude_HEADERS) $(giowin32include_HEADERS) $(giounixinclude_HEADERS) > $@.tmp && mv $@.tmp $@
CLEANFILES = gio-public-headers.txt gconstructor_as_data.h
CLEANFILES = gdbus-daemon-generated.c gdbus-daemon-generated.h gio-public-headers.txt gconstructor_as_data.h
all-local: gio-public-headers.txt
......
<node>
<interface name="org.freedesktop.DBus">
<method name="Hello">
<arg direction="out" type="s" name="assigned_name"/>
</method>
<method name="RequestName">
<arg direction="in" type="s" name="name"/>
<arg direction="in" type="u" name="flags"/>
<arg direction="out" type="u" name="value"/>
</method>
<method name="ReleaseName">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="u" name="value"/>
</method>
<method name="StartServiceByName">
<arg direction="in" type="s" name="name"/>
<arg direction="in" type="u" name="flags"/>
<arg direction="out" type="u" name="value"/>
</method>
<method name="NameHasOwner">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="b" name="has_owner"/>
</method>
<method name="ListNames">
<arg direction="out" type="as" name="names"/>
</method>
<method name="ListActivatableNames">
<arg direction="out" type="as" name="activatable_names"/>
</method>
<method name="AddMatch">
<arg direction="in" type="s" name="rule"/>
</method>
<method name="RemoveMatch">
<arg direction="in" type="s" name="rule"/>
</method>
<method name="GetNameOwner">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="s" name="unique_name"/>
</method>
<method name="ListQueuedOwners">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="as" name="queued_owners"/>
</method>
<method name="GetConnectionUnixUser">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="u" name="uid"/>
</method>
<method name="GetConnectionUnixProcessID">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="u" name="pid"/>
</method>
<method name="GetConnectionSELinuxSecurityContext">
<arg direction="in" type="s" name="name"/>
<arg direction="out" type="ay" name="security_context"/>
</method>
<method name="UpdateActivationEnvironment">
<arg direction="in" type="a{ss}" name="environment"/>
</method>
<method name="ReloadConfig">
</method>
<method name="GetId">
<arg direction="out" type="s" name="unique_id"/>
</method>
<signal name="NameOwnerChanged">
<arg type="s" name="name"/>
<arg type="s" name="old_owner"/>
<arg type="s" name="new_owner"/>
</signal>
<signal name="NameLost">
<arg type="s" name="name"/>
</signal>
<signal name="NameAcquired">
<arg type="s" name="name"/>
</signal>
</interface>
</node>
This diff is collapsed.
#include <gio/gio.h>
#define G_TYPE_DBUS_DAEMON (_g_dbus_daemon_get_type ())
#define G_DBUS_DAEMON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_DAEMON, GDBusDaemon))
#define G_DBUS_DAEMON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), G_TYPE_DBUS_DAEMON, GDBusDaemonClass))
#define G_DBUS_DAEMON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_DAEMON, GDBusDaemonClass))
#define G_IS_DBUS_DAEMON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_DAEMON))
#define G_IS_DBUS_DAEMON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_DAEMON))
typedef struct _GDBusDaemon GDBusDaemon;
typedef struct _GDBusDaemonClass GDBusDaemonClass;
GType _g_dbus_daemon_get_type (void) G_GNUC_CONST;
GDBusDaemon *_g_dbus_daemon_new (const char *address,
GCancellable *cancellable,
GError **error);
const char *_g_dbus_daemon_get_address (GDBusDaemon *daemon);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment