Reduce action related IPC 32/136232/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Fri, 19 May 2017 10:44:31 +0000 (19:44 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Wed, 28 Jun 2017 23:58:56 +0000 (08:58 +0900)
If there are more than 10 actions on an object, then more than 10 IPC occurs for
doing more than 10th action.

Change-Id: Id3767be2978357d147e7f2ecf96aee8e48641c16

atspi/atspi-action.c
atspi/atspi-action.h

index 731773a..d4e963e 100644 (file)
@@ -214,6 +214,28 @@ atspi_action_do_action (AtspiAction *obj, gint i, GError **error)
   return retval;
 }
 
+/**
+ * atspi_action_do_action_name:
+ * @obj: a pointer to the #AtspiAction to query.
+ * @name: a action name specifying which action to invoke.
+ *
+ * Invoke the action indicated by name.
+ *
+ * Returns: #TRUE if the action is successfully invoked, otherwise #FALSE.
+ **/
+gboolean
+atspi_action_do_action_name (AtspiAction *obj, gchar *name, GError **error)
+{
+  const char *action_name = name;
+  dbus_bool_t retval = FALSE;
+
+  g_return_val_if_fail (obj != NULL, FALSE);
+
+  _atspi_dbus_call (obj, atspi_interface_action, "DoActionName", error, "s=>b", action_name, &retval);
+
+  return retval;
+}
+
 static void
 atspi_action_base_init (AtspiAction *klass)
 {
index 99de8af..00f3a2e 100644 (file)
@@ -57,6 +57,7 @@ gchar * atspi_action_get_key_binding (AtspiAction *obj, gint i, GError **error);
 gchar * atspi_action_get_localized_name (AtspiAction *obj, gint i, GError **error);
 
 gboolean atspi_action_do_action (AtspiAction *obj, gint i, GError **error);
+gboolean atspi_action_do_action_name (AtspiAction *obj, gchar *name, GError **error);
 
 #ifndef ATSPI_DISABLE_DEPRECATED
 gchar * atspi_action_get_description (AtspiAction *obj, gint i, GError **error);