* Boston, MA 02111-1307, USA.
*/
+#include <string.h>
#include <atk/atk.h>
#include <droute/droute.h>
#include "bridge.h"
return NULL;
}
+static DBusMessage *
+impl_DoActionName (DBusConnection * bus, DBusMessage * message, void *user_data)
+{
+ AtkAction *action = (AtkAction *) user_data;
+ const char *action_name = NULL;
+ gint count;
+ gint i, index = -1;
+ dbus_bool_t rv = TRUE;
+ DBusMessage *reply;
+
+ g_return_val_if_fail (ATK_IS_ACTION (user_data),
+ droute_not_yet_handled_error (message));
+ if (!dbus_message_get_args
+ (message, NULL, DBUS_TYPE_STRING, &action_name, DBUS_TYPE_INVALID))
+ {
+ return droute_invalid_arguments_error (message);
+ }
+ reply = dbus_message_new_method_return (message);
+ if (reply)
+ {
+ dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
+ DBUS_TYPE_INVALID);
+ }
+ dbus_connection_send (bus, reply, NULL);
+ dbus_message_unref (reply);
+
+ count = atk_action_get_n_actions (action);
+ for (i = 0; i < count; i++)
+ {
+ const char *name = atk_action_get_name (action, i);
+ if (name && !strcmp(name, action_name))
+ {
+ index = i;
+ break;
+ }
+ }
+ atk_action_do_action (action, index);
+ return NULL;
+}
+
DRouteMethod methods[] = {
{impl_get_description, "GetDescription"}
,
,
{impl_DoAction, "DoAction"}
,
+ {impl_DoActionName, "DoActionName"}
+ ,
{NULL, NULL}
};