2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2002 Ximian, Inc.
6 * 2002 Sun Microsystems Inc.
7 * Copyright 2010, 2011 Novell, Inc.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the
22 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 * Boston, MA 02111-1307, USA.
26 #ifndef _ATSPI_MISC_PRIVATE_H_
27 #define _ATSPI_MISC_PRIVATE_H_
29 /* Private internal implementation details of at-spi. */
35 #include "dbus/dbus.h"
37 #include "dbind/dbind.h"
39 typedef struct _AtspiReference AtspiReference;
40 struct _AtspiReference
47 #define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry"
48 #define ATSPI_DBUS_PATH_REGISTRY "/org/a11y/atspi/registry"
49 #define ATSPI_DBUS_INTERFACE_REGISTRY "org.a11y.atspi.Registry"
51 #define ATSPI_DBUS_PATH_NULL "/org/a11y/atspi/null"
52 #define ATSPI_DBUS_PATH_ROOT "/org/a11y/atspi/accessible/root"
54 #define ATSPI_DBUS_PATH_DEC "/org/a11y/atspi/registry/deviceeventcontroller"
55 #define ATSPI_DBUS_INTERFACE_DEC "org.a11y.atspi.DeviceEventController"
56 #define ATSPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER "org.a11y.atspi.DeviceEventListener"
58 #define ATSPI_DBUS_INTERFACE_CACHE "org.a11y.atspi.Cache"
59 #define ATSPI_DBUS_INTERFACE_ACCESSIBLE "org.a11y.atspi.Accessible"
60 #define ATSPI_DBUS_INTERFACE_ACTION "org.a11y.atspi.Action"
61 #define ATSPI_DBUS_INTERFACE_APPLICATION "org.a11y.atspi.Application"
62 #define ATSPI_DBUS_INTERFACE_COLLECTION "org.a11y.atspi.Collection"
63 #define ATSPI_DBUS_INTERFACE_COMPONENT "org.a11y.atspi.Component"
64 #define ATSPI_DBUS_INTERFACE_DOCUMENT "org.a11y.atspi.Document"
65 #define ATSPI_DBUS_INTERFACE_EDITABLE_TEXT "org.a11y.atspi.EditableText"
66 #define ATSPI_DBUS_INTERFACE_EVENT_KEYBOARD "org.a11y.atspi.Event.Keyboard"
67 #define ATSPI_DBUS_INTERFACE_EVENT_MOUSE "org.a11y.atspi.Event.Mouse"
68 #define ATSPI_DBUS_INTERFACE_EVENT_OBJECT "org.a11y.atspi.Event.Object"
69 #define ATSPI_DBUS_INTERFACE_HYPERLINK "org.a11y.atspi.Hyperlink"
70 #define ATSPI_DBUS_INTERFACE_HYPERTEXT "org.a11y.atspi.Hypertext"
71 #define ATSPI_DBUS_INTERFACE_IMAGE "org.a11y.atspi.Image"
72 #define ATSPI_DBUS_INTERFACE_SELECTION "org.a11y.atspi.Selection"
73 #define ATSPI_DBUS_INTERFACE_TABLE "org.a11y.atspi.Table"
74 #define ATSPI_DBUS_INTERFACE_TEXT "org.a11y.atspi.Text"
75 #define ATSPI_DBUS_INTERFACE_VALUE "org.a11y.atspi.Value"
76 #define ATSPI_DBUS_INTERFACE_SOCKET "org.a11y.atspi.Socket"
79 extern const char *atspi_path_dec;
80 extern const char *atspi_path_registry;
81 extern const char *atspi_path_root;
82 extern const char *atspi_bus_registry;
83 extern const char *atspi_interface_accessible;
84 extern const char *atspi_interface_action;
85 extern const char *atspi_interface_application;
86 extern const char *atspi_interface_collection;
87 extern const char *atspi_interface_component;
88 extern const char *atspi_interface_dec;
89 extern const char *atspi_interface_device_event_listener;
90 extern const char *atspi_interface_document;
91 extern const char *atspi_interface_editable_text;
92 extern const char *atspi_interface_hyperlink;
93 extern const char *atspi_interface_hypertext;
94 extern const char *atspi_interface_image;
95 extern const char *atspi_interface_registry;
96 extern const char *atspi_interface_selection;
97 extern const char *atspi_interface_table;
98 extern const char *atspi_interface_text;
99 extern const char *atspi_interface_cache;
100 extern const char *atspi_interface_value;
102 /* function prototypes */
103 gint _atspi_get_iface_num (const char *iface);
105 DBusConnection * _atspi_bus ();
107 AtspiAccessible * _atspi_ref_accessible (const char *app, const char *path);
110 _atspi_dbus_return_accessible_from_message (DBusMessage *message);
113 _atspi_dbus_return_accessible_from_iter (DBusMessageIter *iter);
116 _atspi_dbus_return_hyperlink_from_message (DBusMessage *message);
119 _atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter);
121 dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
123 DBusMessage *_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
125 DBusMessage *_atspi_dbus_call_partial_va (gpointer obj, const char *interface, const char *method, GError **error, const char *type, va_list args);
127 dbus_bool_t _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, GError **error, const char *type, void *data);
129 DBusMessage * _atspi_dbus_send_with_reply_and_block (DBusMessage *message, GError **error);
131 GHashTable *_atspi_dbus_return_hash_from_message (DBusMessage *message);
133 GHashTable *_atspi_dbus_hash_from_iter (DBusMessageIter *iter);
135 GArray *_atspi_dbus_return_attribute_array_from_message (DBusMessage *message);
137 GArray *_atspi_dbus_attribute_array_from_iter (DBusMessageIter *iter);
139 gboolean _atspi_process_deferred_messages (gpointer data);
141 void _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *iter);
143 void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter);
145 #define _ATSPI_DBUS_CHECK_SIG(message, type, error, ret) \
147 g_warning ("at-spi: Got no message at %s line %d\n", __FILE__, __LINE__); \
150 if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) \
153 dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); \
155 g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_IPC, err); \
156 dbus_message_unref (message); \
159 if (strcmp (dbus_message_get_signature (message), type) != 0) \
161 g_warning ("at-spi: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \
162 dbus_message_unref (message); \
170 * Error domain for AT-SPI IPC failures. Errors in this domain will
171 * be from the #ATSPIAtspiError enumeration. See #GError for information on
174 #define ATSPI_ERROR atspi_error_quark()
175 GQuark atspi_error_quark (void);
179 * @ATSPI_APPLICATION_NO_LONGER_EXISTS: The application has quit.
183 ATSPI_ERROR_APPLICATION_GONE,
186 #endif /* _ATSPI_MISC_PRIVATE_H_ */