GDBusMethodInvocation: add 'property_info'

Add a field on GDBusMethodInvocation for GDBusPropertyInfo.

For now, it is always %NULL.  It will be set in future patches.

https://bugzilla.gnome.org/show_bug.cgi?id=698375
This commit is contained in:
Ryan Lortie 2013-04-17 09:28:05 -04:00
parent 14dc028003
commit c691f7b6ca
4 changed files with 47 additions and 19 deletions

View File

@ -4841,6 +4841,7 @@ schedule_method_call (GDBusConnection *connection,
guint subtree_registration_id,
const GDBusInterfaceInfo *interface_info,
const GDBusMethodInfo *method_info,
const GDBusPropertyInfo *property_info,
GVariant *parameters,
const GDBusInterfaceVTable *vtable,
GMainContext *main_context,
@ -4854,6 +4855,7 @@ schedule_method_call (GDBusConnection *connection,
g_dbus_message_get_interface (message),
g_dbus_message_get_member (message),
method_info,
property_info,
connection,
message,
parameters,
@ -4950,7 +4952,7 @@ validate_and_maybe_schedule_method_call (GDBusConnection *connection,
/* schedule the call in idle */
schedule_method_call (connection, message, registration_id, subtree_registration_id,
interface_info, method_info, parameters,
interface_info, method_info, NULL, parameters,
vtable, main_context, user_data);
g_variant_unref (parameters);
handled = TRUE;

View File

@ -86,6 +86,7 @@ struct _GDBusMethodInvocation
gchar *interface_name;
gchar *method_name;
GDBusMethodInfo *method_info;
GDBusPropertyInfo *property_info;
GDBusConnection *connection;
GDBusMessage *message;
GVariant *parameters;
@ -193,6 +194,24 @@ g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation)
return invocation->method_info;
}
/**
* g_dbus_method_invocation_get_property_info:
* @invocation: A #GDBusMethodInvocation
*
* Gets information about the property that this method call is for, if
* any.
*
* Returns: (transfer none): a #GDBusPropertyInfo or %NULL
*
* Since: 2.38
*/
const GDBusPropertyInfo *
g_dbus_method_invocation_get_property_info (GDBusMethodInvocation *invocation)
{
g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL);
return invocation->property_info;
}
/**
* g_dbus_method_invocation_get_method_name:
* @invocation: A #GDBusMethodInvocation.
@ -293,6 +312,7 @@ g_dbus_method_invocation_get_user_data (GDBusMethodInvocation *invocation)
* @interface_name: The name of the D-Bus interface the method was invoked on.
* @method_name: The name of the method that was invoked.
* @method_info: (allow-none): Information about the method call or %NULL.
* @property_info: (allow-none): Information about the property or %NULL.
* @connection: The #GDBusConnection the method was invoked on.
* @message: The D-Bus message as a #GDBusMessage.
* @parameters: The parameters as a #GVariant tuple.
@ -305,15 +325,16 @@ g_dbus_method_invocation_get_user_data (GDBusMethodInvocation *invocation)
* Since: 2.26
*/
GDBusMethodInvocation *
_g_dbus_method_invocation_new (const gchar *sender,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
const GDBusMethodInfo *method_info,
GDBusConnection *connection,
GDBusMessage *message,
GVariant *parameters,
gpointer user_data)
_g_dbus_method_invocation_new (const gchar *sender,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
const GDBusMethodInfo *method_info,
const GDBusPropertyInfo *property_info,
GDBusConnection *connection,
GDBusMessage *message,
GVariant *parameters,
gpointer user_data)
{
GDBusMethodInvocation *invocation;
@ -332,6 +353,8 @@ _g_dbus_method_invocation_new (const gchar *sender,
invocation->method_name = g_strdup (method_name);
if (method_info)
invocation->method_info = g_dbus_method_info_ref ((GDBusMethodInfo *)method_info);
if (property_info)
invocation->property_info = g_dbus_property_info_ref ((GDBusPropertyInfo *)property_info);
invocation->connection = g_object_ref (connection);
invocation->message = g_object_ref (message);
invocation->parameters = g_variant_ref (parameters);

View File

@ -47,6 +47,8 @@ GLIB_AVAILABLE_IN_ALL
const gchar *g_dbus_method_invocation_get_method_name (GDBusMethodInvocation *invocation);
GLIB_AVAILABLE_IN_ALL
const GDBusMethodInfo *g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation);
GLIB_AVAILABLE_IN_2_38
const GDBusPropertyInfo *g_dbus_method_invocation_get_property_info (GDBusMethodInvocation *invocation);
GLIB_AVAILABLE_IN_ALL
GDBusConnection *g_dbus_method_invocation_get_connection (GDBusMethodInvocation *invocation);
GLIB_AVAILABLE_IN_ALL

View File

@ -119,15 +119,16 @@ gchar *_g_dbus_enum_to_string (GType enum_type, gint value);
/* ---------------------------------------------------------------------------------------------------- */
GDBusMethodInvocation *_g_dbus_method_invocation_new (const gchar *sender,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
const GDBusMethodInfo *method_info,
GDBusConnection *connection,
GDBusMessage *message,
GVariant *parameters,
gpointer user_data);
GDBusMethodInvocation *_g_dbus_method_invocation_new (const gchar *sender,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
const GDBusMethodInfo *method_info,
const GDBusPropertyInfo *property_info,
GDBusConnection *connection,
GDBusMessage *message,
GVariant *parameters,
gpointer user_data);
/* ---------------------------------------------------------------------------------------------------- */