#include <atk/atk.h>
#include <droute/droute.h>
-#include "common/spi-dbus.h"
+#include "spi-dbus.h"
+
+#include "introspection.h"
static dbus_bool_t
impl_get_NActions (DBusMessageIter * iter, void *user_data)
}
static DBusMessage *
+impl_get_localized_name (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+ DBusMessage *reply;
+ DBusError error;
+ dbus_int32_t index;
+ const char *name;
+ AtkAction *action = (AtkAction *) user_data;
+
+ dbus_error_init (&error);
+ g_return_val_if_fail (ATK_IS_ACTION (user_data),
+ droute_not_yet_handled_error (message));
+ if (!dbus_message_get_args
+ (message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
+ {
+ return droute_invalid_arguments_error (message);
+ }
+ name = atk_action_get_localized_name (action, index);
+ if (!name)
+ name = "";
+ reply = dbus_message_new_method_return (message);
+ if (reply)
+ {
+ dbus_message_append_args (reply, DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID);
+ }
+ return reply;
+}
+
+static DBusMessage *
impl_get_keybinding (DBusConnection * bus, DBusMessage * message,
void *user_data)
{
for (i = 0; i < count; i++)
{
const char *name = atk_action_get_name (action, i);
+ const char *lname = atk_action_get_localized_name (action, i);
const char *desc = atk_action_get_description (action, i);
const char *kb = atk_action_get_keybinding (action, i);
if (!name)
name = "";
+ if (!lname)
+ lname = "";
if (!desc)
desc = "";
if (!kb)
(&iter_array, DBUS_TYPE_STRUCT, NULL, &iter_struct))
goto oom;
dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_STRING, &name);
+ dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_STRING, &lname);
dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_STRING, &desc);
dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_STRING, &kb);
if (!dbus_message_iter_close_container (&iter_array, &iter_struct))
AtkAction *action = (AtkAction *) user_data;
DBusError error;
dbus_int32_t index;
- dbus_bool_t rv;
+ dbus_bool_t rv = TRUE;
DBusMessage *reply;
g_return_val_if_fail (ATK_IS_ACTION (user_data),
{
return droute_invalid_arguments_error (message);
}
- rv = atk_action_do_action (action, index);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
DBUS_TYPE_INVALID);
}
- return reply;
+ dbus_connection_send (bus, reply, NULL);
+ dbus_message_unref (reply);
+ atk_action_do_action (action, index);
+ return NULL;
}
DRouteMethod methods[] = {
,
{impl_get_name, "GetName"}
,
+ {impl_get_localized_name, "GetLocalizedName"}
+ ,
{impl_get_keybinding, "GetKeyBinding"}
,
{impl_GetActions, "GetActions"}
spi_initialize_action (DRoutePath * path)
{
droute_path_add_interface (path,
- SPI_DBUS_INTERFACE_ACTION, methods, properties);
+ ATSPI_DBUS_INTERFACE_ACTION,
+ spi_org_a11y_atspi_Action, methods, properties);
};