[at-spi2-atk] Add SetExtents, SetPosition, and SetSize



commit e1c5709455edfdce17519d7a56366e49b4aa1ab4
Author: Mike Gorse <mgorse novell com>
Date:   Wed Jan 26 16:54:25 2011 -0600

    Add SetExtents, SetPosition, and SetSize

 atk-adaptor/adaptors/component-adaptor.c |  107 ++++++++++++++++++++++++++++++
 1 files changed, 107 insertions(+), 0 deletions(-)
---
diff --git a/atk-adaptor/adaptors/component-adaptor.c b/atk-adaptor/adaptors/component-adaptor.c
index 5be3b54..17082e3 100644
--- a/atk-adaptor/adaptors/component-adaptor.c
+++ b/atk-adaptor/adaptors/component-adaptor.c
@@ -291,6 +291,110 @@ impl_GetAlpha (DBusConnection * bus, DBusMessage * message, void *user_data)
   return reply;
 }
 
+static DBusMessage *
+impl_SetExtents (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+  AtkComponent *component = (AtkComponent *) user_data;
+  DBusMessageIter iter, iter_struct;
+  dbus_uint32_t coord_type;
+  dbus_int32_t x, y, width, height;
+  dbus_bool_t ret;
+  DBusMessage *reply;
+
+  g_return_val_if_fail (ATK_IS_COMPONENT (user_data),
+                        droute_not_yet_handled_error (message));
+
+  if (strcmp (dbus_message_get_signature (message), "(iiii)u") != 0)
+    {
+      return droute_invalid_arguments_error (message);
+    }
+
+  dbus_message_iter_init (message, &iter);
+  dbus_message_iter_recurse (&iter, &iter_struct);
+  dbus_message_iter_get_basic (&iter_struct, &x);
+  dbus_message_iter_next (&iter_struct);
+  dbus_message_iter_get_basic (&iter_struct, &y);
+  dbus_message_iter_next (&iter_struct);
+  dbus_message_iter_get_basic (&iter_struct, &width);
+  dbus_message_iter_next (&iter_struct);
+  dbus_message_iter_get_basic (&iter_struct, &height);
+  dbus_message_iter_next (&iter_struct);
+  dbus_message_iter_next (&iter);
+  dbus_message_iter_get_basic (&iter, &coord_type);
+
+  ret = atk_component_set_extents (component, x, y, width, height, coord_type);
+
+  reply = dbus_message_new_method_return (message);
+  if (reply)
+    {
+      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
+                                DBUS_TYPE_INVALID);
+    }
+
+  return reply;
+}
+
+static DBusMessage *
+impl_SetPosition (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+  AtkComponent *component = (AtkComponent *) user_data;
+  dbus_uint32_t coord_type;
+  dbus_int32_t x, y;
+  dbus_bool_t ret;
+  DBusMessage *reply;
+
+  g_return_val_if_fail (ATK_IS_COMPONENT (user_data),
+                        droute_not_yet_handled_error (message));
+
+  if (!dbus_message_get_args
+      (message, NULL, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y,
+       DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID))
+    {
+      return droute_invalid_arguments_error (message);
+    }
+
+  ret = atk_component_set_position (component, x, y, coord_type);
+
+  reply = dbus_message_new_method_return (message);
+  if (reply)
+    {
+      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
+                                DBUS_TYPE_INVALID);
+    }
+
+  return reply;
+}
+
+static DBusMessage *
+impl_SetSize (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+  AtkComponent *component = (AtkComponent *) user_data;
+  dbus_int32_t width, height;
+  dbus_bool_t ret;
+  DBusMessage *reply;
+
+  g_return_val_if_fail (ATK_IS_COMPONENT (user_data),
+                        droute_not_yet_handled_error (message));
+
+  if (!dbus_message_get_args
+      (message, NULL, DBUS_TYPE_INT32, &width, DBUS_TYPE_INT32, &height,
+       DBUS_TYPE_INVALID))
+    {
+      return droute_invalid_arguments_error (message);
+    }
+
+  ret = atk_component_set_size (component, width, height);
+
+  reply = dbus_message_new_method_return (message);
+  if (reply)
+    {
+      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
+                                DBUS_TYPE_INVALID);
+    }
+
+  return reply;
+}
+
 static DRouteMethod methods[] = {
   {impl_contains, "contains"},
   {impl_GetAccessibleAtPoint, "GetAccessibleAtPoint"},
@@ -303,6 +407,9 @@ static DRouteMethod methods[] = {
   //{impl_registerFocusHandler, "registerFocusHandler"},
   //{impl_deregisterFocusHandler, "deregisterFocusHandler"},
   {impl_GetAlpha, "GetAlpha"},
+  {impl_SetExtents, "SetExtents"},
+  {impl_SetPosition, "SetPosition"},
+  {impl_SetSize, "SetSize"},
   {NULL, NULL}
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]