Removed the extra boolean parameter added to know when to unref the
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / adaptors / application-adaptor.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2008 Novell, Inc.
6  * Copyright 2001, 2002 Sun Microsystems Inc.,
7  * Copyright 2001, 2002 Ximian, Inc.
8  *
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.
13  *
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.
18  *
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.
23  */
24
25 #include <atk/atk.h>
26 #include <droute/droute.h>
27
28 #include "common/spi-dbus.h"
29 #include "introspection.h"
30
31 static dbus_bool_t
32 impl_get_ToolkitName (DBusMessageIter * iter, void *user_data)
33 {
34   return droute_return_v_string (iter, atk_get_toolkit_name ());
35 }
36
37 static dbus_bool_t
38 impl_get_Version (DBusMessageIter * iter, void *user_data)
39 {
40   return droute_return_v_string (iter, atk_get_toolkit_version ());
41 }
42
43 static dbus_int32_t id;
44
45 static dbus_bool_t
46 impl_get_Id (DBusMessageIter * iter, void *user_data)
47 {
48   return droute_return_v_int32 (iter, id);
49 }
50
51 static dbus_bool_t
52 impl_set_Id (DBusMessageIter * iter, void *user_data)
53 {
54   id = droute_get_v_int32 (iter);
55   return TRUE;
56 }
57
58 static DBusMessage *
59 impl_registerToolkitEventListener (DBusConnection * bus,
60                                    DBusMessage * message, void *user_data)
61 {
62   return NULL;
63 }
64
65 static DBusMessage *
66 impl_registerObjectEventListener (DBusConnection * bus, DBusMessage * message,
67                                   void *user_data)
68 {
69   return NULL;
70 }
71
72 static DBusMessage *
73 impl_pause (DBusConnection * bus, DBusMessage * message, void *user_data)
74 {
75   return NULL;
76 }
77
78 static DBusMessage *
79 impl_resume (DBusConnection * bus, DBusMessage * message, void *user_data)
80 {
81   return NULL;
82 }
83
84 static DBusMessage *
85 impl_GetLocale (DBusConnection * bus, DBusMessage * message, void *user_data)
86 {
87   return NULL;
88 }
89
90 static DRouteMethod methods[] = {
91   {impl_registerToolkitEventListener, "registerToolkitEventListener"},
92   {impl_registerObjectEventListener, "registerObjectEventListener"},
93   {impl_pause, "pause"},
94   {impl_resume, "resume"},
95   {impl_GetLocale, "GetLocale"},
96   {NULL, NULL}
97 };
98
99 static DRouteProperty properties[] = {
100   {impl_get_ToolkitName, NULL, "ToolkitName"},
101   {impl_get_Version, NULL, "Version"},
102   {impl_get_Id, impl_set_Id, "Id"},
103   {NULL, NULL, NULL}
104 };
105
106 /*static long
107 obj_is_root (const char *path, void *user_data)
108 {
109   AtkObject *obj = atk_dbus_get_object (path);
110   return (obj == atk_get_root ());
111 }*/
112
113 void
114 spi_initialize_application (DRoutePath * path)
115 {
116   droute_path_add_interface (path,
117                              SPI_DBUS_INTERFACE_APPLICATION,
118                              spi_org_a11y_atspi_Application,
119                              methods, properties);
120 };