application: Add dbus register/unregister hooks

When the application is using its D-Bus backend, it is useful to be able
to export extra D-Bus objects at the right time, i.e. *before* the application
tries to own the bus name. This is accomplished here by adding a hook
in GApplicationClass for this; and a corresponding hook that will be called
on unregistration to undo whatever the register hook did.

Bug #675509.
This commit is contained in:
Christian Persch
2012-05-05 16:52:28 +02:00
parent f642209ef4
commit 4979c1d075
5 changed files with 162 additions and 2 deletions

View File

@@ -90,8 +90,16 @@ struct _GApplicationClass
void (* run_mainloop) (GApplication *application);
void (* shutdown) (GApplication *application);
gboolean (* dbus_register) (GApplication *application,
GDBusConnection *connection,
const gchar *object_path,
GError **error);
void (* dbus_unregister) (GApplication *application,
GDBusConnection *connection,
const gchar *object_path);
/*< private >*/
gpointer padding[11];
gpointer padding[9];
};
GType g_application_get_type (void) G_GNUC_CONST;