Support sending data with events
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / bridge.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001, 2002, 2003 Sun Microsystems Inc.,
6  * Copyright 2001, 2002, 2003 Ximian, Inc.
7  * Copyright 2008, 2009, 2010 Codethink Ltd.
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 #ifndef BRIDGE_H
26 #define BRIDGE_H
27
28 #include <atk/atk.h>
29 #include <droute/droute.h>
30
31 typedef struct _SpiBridge SpiBridge;
32 typedef struct _SpiBridgeClass SpiBridgeClass;
33
34 G_BEGIN_DECLS
35
36 typedef struct _AtspiPropertyDefinition AtspiPropertyDefinition;
37 struct _AtspiPropertyDefinition
38 {
39   char *name;
40   GType type;
41   DRoutePropertyFunction func;
42 };
43
44 typedef struct _event_data event_data;
45 struct _event_data
46 {
47   gchar *bus_name;
48   gchar **data;
49   GSList *properties;
50 };
51
52 struct _SpiBridge
53 {
54   GObject parent;
55
56   AtkObject *root;
57
58   DBusConnection *bus;
59   DRouteContext  *droute;
60   GMainContext *main_context;
61   DBusServer *server;
62   GList *direct_connections;
63
64 /*
65   SpiRegister *reg;
66   SpiCache    *cache;
67   SpiLeasing  *leasing;
68 */
69   gchar *desktop_name;
70   gchar *desktop_path;
71 gchar *app_tmp_dir;
72 gchar *app_bus_addr;
73   GList *events;
74   gboolean events_initialized;
75   GHashTable *property_hash;
76 };
77
78 extern SpiBridge *spi_global_app_data;
79
80 void spi_atk_add_client (const char *bus_name);
81 void spi_atk_remove_client (const char *bus_name);
82
83 int spi_atk_create_socket (SpiBridge *app);
84
85 void spi_atk_add_interface (DRoutePath *path,
86                             const char *name,
87                             const char *introspect,
88                             const DRouteMethod   *methods,
89                             const DRouteProperty *properties);
90
91 DRoutePropertyFunction _atk_bridge_find_property_func (const char *property,
92                                                        GType *type);
93
94 GType _atk_bridge_type_from_iface (const char *iface);
95 G_END_DECLS
96
97 #endif /* BRIDGE_H */