#include "accessible.h"
-#define get_object(message) spi_dbus_get_object(dbus_message_get_path(message))
+#define get_object(message) atk_dbus_get_object(dbus_message_get_path(message))
static AtkObject *
get_object_from_path (const char *path, void *user_data)
{
- return spi_dbus_get_object (path);
+ return atk_dbus_get_object (path);
}
static dbus_bool_t
impl_get_name (const char *path, DBusMessageIter * iter, void *user_data)
{
- AtkObject *object = spi_dbus_get_object (path);
+ AtkObject *object = atk_dbus_get_object (path);
if (!object)
return FALSE;
return droute_return_v_string (iter, atk_object_get_name (object));
static dbus_bool_t
impl_set_name (const char *path, DBusMessageIter * iter, void *user_data)
{
- AtkObject *object = spi_dbus_get_object (path);
+ AtkObject *object = atk_dbus_get_object (path);
const char *name = droute_get_v_string (iter);
atk_object_set_name (object, name);
return TRUE;
impl_get_description (const char *path, DBusMessageIter * iter,
void *user_data)
{
- AtkObject *object = spi_dbus_get_object (path);
+ AtkObject *object = atk_dbus_get_object (path);
if (!object)
return FALSE;
return droute_return_v_string (iter, atk_object_get_description (object));
impl_set_description (const char *path, DBusMessageIter * iter,
void *user_data)
{
- AtkObject *object = spi_dbus_get_object (path);
+ AtkObject *object = atk_dbus_get_object (path);
const char *description = droute_get_v_string (iter);
atk_object_set_description (object, description);
return TRUE;
static dbus_bool_t
impl_get_parent (const char *path, DBusMessageIter * iter, void *user_data)
{
- AtkObject *object = spi_dbus_get_object (path);
+ AtkObject *object = atk_dbus_get_object (path);
if (!object)
return FALSE;
impl_get_childCount (const char *path, DBusMessageIter * iter,
void *user_data)
{
- AtkObject *object = spi_dbus_get_object (path);
+ AtkObject *object = atk_dbus_get_object (path);
if (!object)
return FALSE;
}
static DBusMessage *
+impl_getChildAtIndex (DBusConnection * bus, DBusMessage * message,
+ void *user_data)
+{
+ AtkObject *object = get_object (message);
+ dbus_int32_t i;
+ AtkObject *child;
+
+ if (!object)
+ return spi_dbus_general_error (message);
+ if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID))
+ return spi_dbus_general_error (message);
+ child = atk_object_ref_accessible_child (object, i);
+ return spi_dbus_return_object (message, child, FALSE);
+}
+
+static DBusMessage *
impl_getChildren (DBusConnection * bus, DBusMessage * message,
void *user_data)
{
for (i = 0; i < count; i++)
{
AtkObject *child = atk_object_ref_accessible_child (object, i);
- char *path = spi_dbus_get_path (child);
+ char *path = atk_dbus_get_path (child);
if (path)
{
dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_OBJECT_PATH,
AtkObject *obj = target->pdata[j];
char *path;
if (!obj) continue;
- path = spi_dbus_get_path (obj);
- dbus_message_iter_append (&iter_targets, DBUS_TYPE_OBJECT_PATH, &path);
+ path = atk_dbus_get_path (obj);
+ dbus_message_iter_append_basic (&iter_targets, DBUS_TYPE_OBJECT_PATH, &path);
}
dbus_message_iter_close_container (&iter_struct, &iter_targets);
dbus_message_iter_close_container (&iter_array, &iter_struct);
}
static DRouteMethod methods[] = {
- //{impl_isEqual, "isEqual"},
+ {impl_getChildAtIndex, "getChildAtIndex"},
{impl_getChildren, "getChildren"},
{impl_getIndexInParent, "getIndexInParent"},
{impl_getRelationSet, "getRelationSet"},
{impl_get_name, impl_set_name, "name"},
{impl_get_description, impl_set_description, "description"},
{impl_get_parent, NULL, "parent"},
- //{impl_get_childCount, NULL, "childCount"},
- //{NULL, NULL, NULL, "role"},
+ {impl_get_childCount, NULL, "childCount"},
{NULL, NULL, NULL}
};