2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2008 Novell, Inc.
6 * Copyright 2001, 2002 Sun Microsystems Inc.,
7 * Copyright 2001, 2002 Ximian, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
24 #include "accessible.h"
28 impl_get_toolkitName (const char *path, DBusMessageIter * iter,
31 return droute_return_v_string (iter, atk_get_toolkit_name ());
35 impl_get_toolkitName_str (void *datum)
37 return g_strdup (atk_get_toolkit_name ());
41 impl_get_version (const char *path, DBusMessageIter * iter, void *user_data)
43 return droute_return_v_string (iter, atk_get_toolkit_version ());
47 impl_get_version_str (void *datum)
49 return g_strdup (atk_get_toolkit_version ());
52 static dbus_int32_t id;
55 impl_get_id (const char *path, DBusMessageIter * iter, void *user_data)
57 return droute_return_v_int32 (iter, id);
61 impl_get_id_str (void *datum)
63 return g_strdup_printf ("%d", id);
67 impl_set_id (const char *path, DBusMessageIter * iter, void *user_data)
69 id = droute_get_v_int32 (iter);
74 impl_registerToolkitEventListener (DBusConnection * bus,
75 DBusMessage * message, void *user_data)
80 impl_registerObjectEventListener (DBusConnection * bus, DBusMessage * message,
86 impl_pause (DBusConnection * bus, DBusMessage * message, void *user_data)
91 impl_resume (DBusConnection * bus, DBusMessage * message, void *user_data)
96 impl_getLocale (DBusConnection * bus, DBusMessage * message, void *user_data)
100 static DRouteMethod methods[] = {
101 {DROUTE_METHOD, impl_registerToolkitEventListener,
102 "registerToolkitEventListener", "o,listener,i:s,eventName,i"},
103 {DROUTE_METHOD, impl_registerObjectEventListener,
104 "registerObjectEventListener", "o,listener,i:s,eventName,i"},
105 {DROUTE_METHOD, impl_pause, "pause", "b,,o"},
106 {DROUTE_METHOD, impl_resume, "resume", "b,,o"},
107 {DROUTE_METHOD, impl_getLocale, "getLocale", "u,lctype,i:s,,o"},
108 {0, NULL, NULL, NULL}
111 static DRouteProperty properties[] = {
112 {impl_get_toolkitName, impl_get_toolkitName_str, NULL, NULL, "toolkitName",
114 {impl_get_version, impl_get_version_str, NULL, NULL, "version", "s"},
115 {impl_get_id, impl_get_id_str, impl_set_id, NULL, "id", "i"},
116 {NULL, NULL, NULL, NULL, NULL, NULL}
120 obj_is_root (const char *path, void *user_data)
122 AtkObject *obj = spi_dbus_get_object (path);
123 return (obj == atk_get_root ());
127 spi_initialize_application (DRouteData * data)
129 droute_add_interface (data, "org.freedesktop.atspi.Application",
131 (DRouteGetDatumFunction) obj_is_root, NULL);