Implement GrabHighlight and ClearHighligh methods. 88/50188/1
authorZbigniew Kosinski <z.kosinski@samsung.com>
Tue, 4 Nov 2014 14:57:36 +0000 (15:57 +0100)
committerTomasz Olszak <t.olszak@samsung.com>
Mon, 26 Oct 2015 15:30:21 +0000 (16:30 +0100)
This commit adds support for new AtkComponent method interfaces.

Change-Id: I66de60a86a308dc40107cf65d33c99dcbb1eaab2
Signed-off-by: Lukasz Stanislawski <l.stanislaws@samsung.com>
atspi/atspi-component.c
atspi/atspi-component.h
registryd/introspection.c
registryd/registry.c

index 0ab552b..41adeef 100644 (file)
@@ -271,6 +271,46 @@ atspi_component_grab_focus (AtspiComponent *obj, GError **error)
 }
 
 /**
+ * atspi_component_grab_highlight:
+ * @obj: a pointer to the #AtspiComponent on which to operate.
+ *
+ * Attempts to set highlight to the specified
+ *         #AtspiComponent.
+ *
+ * Returns: #TRUE if successful, #FALSE otherwise.
+ *
+ **/
+gboolean
+atspi_component_grab_highlight (AtspiComponent *obj, GError **error)
+{
+  dbus_bool_t retval = FALSE;
+
+  _atspi_dbus_call (obj, atspi_interface_component, "GrabHighlight", error, "=>b", &retval);
+
+  return retval;
+}
+
+/**
+ * atspi_component_clear_highlight:
+ * @obj: a pointer to the #AtspiComponent on which to operate.
+ *
+ * Attempts to clear highlight on the specified
+ *         #AtspiComponent.
+ *
+ * Returns: #TRUE if successful, #FALSE otherwise.
+ *
+ **/
+gboolean
+atspi_component_clear_highlight (AtspiComponent *obj, GError **error)
+{
+  dbus_bool_t retval = FALSE;
+
+  _atspi_dbus_call (obj, atspi_interface_component, "ClearHighlight", error, "=>b", &retval);
+
+  return retval;
+}
+
+/**
  * atspi_component_get_alpha:
  * @obj: The #AtspiComponent to be queried.
  *
index dd3455a..f5ddc62 100644 (file)
@@ -107,6 +107,10 @@ gboolean atspi_component_set_position (AtspiComponent *obj, gint x, gint y, Atsp
 
 gboolean atspi_component_set_size (AtspiComponent *obj, gint width, gint height, GError **error);
 
+gboolean atspi_component_grab_highlight (AtspiComponent *obj, GError **error);
+
+gboolean atspi_component_clear_highlight (AtspiComponent *obj, GError **error);
+
 G_END_DECLS
 
 #endif /* _ATSPI_COMPONENT_H_ */
index edcf60d..84ce759 100644 (file)
@@ -226,6 +226,14 @@ const char *spi_org_a11y_atspi_Component =
 "    <arg direction=\"out\" type=\"b\" />"
 "  </method>"
 ""
+"  <method name=\"ClearHighlight\">"
+"    <arg direction=\"out\" type=\"b\" />"
+"  </method>"
+""
+"  <method name=\"GrabHighlight\">"
+"    <arg direction=\"out\" type=\"b\" />"
+"  </method>"
+""
 "  <method name=\"GetAlpha\">"
 "    <arg direction=\"out\" type=\"d\" />"
 "  </method>"
index 15bc7a9..0a4e378 100644 (file)
@@ -541,6 +541,30 @@ impl_GrabFocus (DBusConnection * bus, DBusMessage * message, void *user_data)
 }
 
 static DBusMessage *
+impl_ClearHighlight (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+  DBusMessage *reply;
+  dbus_bool_t retval = FALSE;
+
+  reply = dbus_message_new_method_return (message);
+  dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval,
+                            DBUS_TYPE_INVALID);
+  return reply;
+}
+
+static DBusMessage *
+impl_GrabHighlight (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+  DBusMessage *reply;
+  dbus_bool_t retval = FALSE;
+
+  reply = dbus_message_new_method_return (message);
+  dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval,
+                            DBUS_TYPE_INVALID);
+  return reply;
+}
+
+static DBusMessage *
 impl_GetAlpha (DBusConnection * bus, DBusMessage * message, void *user_data)
 {
   double rv = 1.0;
@@ -1247,6 +1271,10 @@ handle_method_root (DBusConnection *bus, DBusMessage *message, void *user_data)
           reply = impl_GetMDIZOrder (bus, message, user_data);
       else if (!strcmp (member, "GrabFocus"))
           reply = impl_GrabFocus (bus, message, user_data);
+      else if (!strcmp (member, "GrabHighlight"))
+          reply = impl_GrabHighlight (bus, message, user_data);
+      else if (!strcmp (member, "ClearHighlight"))
+          reply = impl_ClearHighlight (bus, message, user_data);
       else if (!strcmp (member, "GetAlpha"))
           reply = impl_GetAlpha (bus, message, user_data);
       else