Code style enforcement.
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / 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
30 static dbus_bool_t
31 impl_get_ToolkitName (DBusMessageIter * iter, void *user_data)
32 {
33   return droute_return_v_string (iter, atk_get_toolkit_name ());
34 }
35
36 static dbus_bool_t
37 impl_get_Version (DBusMessageIter * iter, void *user_data)
38 {
39   return droute_return_v_string (iter, atk_get_toolkit_version ());
40 }
41
42 static dbus_int32_t id;
43
44 static dbus_bool_t
45 impl_get_Id (DBusMessageIter * iter, void *user_data)
46 {
47   return droute_return_v_int32 (iter, id);
48 }
49
50 static dbus_bool_t
51 impl_set_Id (DBusMessageIter * iter, void *user_data)
52 {
53   id = droute_get_v_int32 (iter);
54   return TRUE;
55 }
56
57 static DBusMessage *
58 impl_registerToolkitEventListener (DBusConnection * bus,
59                                    DBusMessage * message, void *user_data)
60 {
61   return NULL;
62 }
63
64 static DBusMessage *
65 impl_registerObjectEventListener (DBusConnection * bus, DBusMessage * message,
66                                   void *user_data)
67 {
68   return NULL;
69 }
70
71 static DBusMessage *
72 impl_pause (DBusConnection * bus, DBusMessage * message, void *user_data)
73 {
74   return NULL;
75 }
76
77 static DBusMessage *
78 impl_resume (DBusConnection * bus, DBusMessage * message, void *user_data)
79 {
80   return NULL;
81 }
82
83 static DBusMessage *
84 impl_GetLocale (DBusConnection * bus, DBusMessage * message, void *user_data)
85 {
86   return NULL;
87 }
88
89 static DRouteMethod methods[] = {
90   {impl_registerToolkitEventListener, "registerToolkitEventListener"},
91   {impl_registerObjectEventListener, "registerObjectEventListener"},
92   {impl_pause, "pause"},
93   {impl_resume, "resume"},
94   {impl_GetLocale, "GetLocale"},
95   {NULL, NULL}
96 };
97
98 static DRouteProperty properties[] = {
99   {impl_get_ToolkitName, NULL, "ToolkitName"},
100   {impl_get_Version, NULL, "Version"},
101   {impl_get_Id, impl_set_Id, "Id"},
102   {NULL, NULL, NULL}
103 };
104
105 /*static long
106 obj_is_root (const char *path, void *user_data)
107 {
108   AtkObject *obj = atk_dbus_get_object (path);
109   return (obj == atk_get_root ());
110 }*/
111
112 void
113 spi_initialize_application (DRoutePath * path)
114 {
115   droute_path_add_interface (path,
116                              SPI_DBUS_INTERFACE_APPLICATION,
117                              methods, properties);
118 };