GDBusActionGroup: add static platform registration

We provide a mechanism by which a 'platform' (eg: Gtk) can register some
hook functions to be called to collect platform-data at the point of
sending an outgoing action activation request and also to inform the
platform of this data on incoming requests (before and after dispatching
the actual request).

This can be used for forwarding timestamp and startup-notification
information (as is presently done in GApplication) but the before/after
hook could also be used for acquiring/releasing the Gdk lock or other
similar things.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
This commit is contained in:
Ryan Lortie
2011-12-14 13:31:27 -05:00
parent 1d4009e6f7
commit fcc9902e98
4 changed files with 52 additions and 5 deletions

View File

@@ -45,9 +45,17 @@ G_BEGIN_DECLS
GType g_dbus_action_group_get_type (void) G_GNUC_CONST;
GDBusActionGroup * g_dbus_action_group_get (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path);
GDBusActionGroup * g_dbus_action_group_get (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path);
typedef void (* GDBusActionGroupSendHookFunc) (GDBusActionGroup *group,
GVariantBuilder *builder);
typedef void (* GDBusActionGroupEmitHookFunc) (GActionGroup *group,
GVariant *platform_data);
void g_dbus_action_group_register_platform (GDBusActionGroupSendHookFunc send_hook,
GDBusActionGroupEmitHookFunc before_hook,
GDBusActionGroupEmitHookFunc after_hook);
G_END_DECLS