GDBusMethodInvocation: add 'property_info'
authorRyan Lortie <desrt@desrt.ca>
Wed, 17 Apr 2013 13:28:05 +0000 (09:28 -0400)
committerRyan Lortie <desrt@desrt.ca>
Sat, 22 Jun 2013 17:38:31 +0000 (13:38 -0400)
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

gio/gdbusconnection.c
gio/gdbusmethodinvocation.c
gio/gdbusmethodinvocation.h
gio/gdbusprivate.h

index 7abc5eb..a745be4 100644 (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;
index 4a20aa6..6ff0556 100644 (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;
@@ -194,6 +195,24 @@ g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation)
 }
 
 /**
+ * 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);
index 5f139c7..7fd4aff 100644 (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
index 3a62867..1bc503c 100644 (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);
 
 /* ---------------------------------------------------------------------------------------------------- */