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 extern const char *atspi_path_dec;
48 extern const char *atspi_path_registry;
49 extern const char *atspi_path_root;
50 extern const char *atspi_bus_registry;
51 extern const char *atspi_interface_accessible;
52 extern const char *atspi_interface_action;
53 extern const char *atspi_interface_application;
54 extern const char *atspi_interface_collection;
55 extern const char *atspi_interface_component;
56 extern const char *atspi_interface_dec;
57 extern const char *atspi_interface_device_event_listener;
58 extern const char *atspi_interface_document;
59 extern const char *atspi_interface_editable_text;
60 extern const char *atspi_interface_hyperlink;
61 extern const char *atspi_interface_hypertext;
62 extern const char *atspi_interface_image;
63 extern const char *atspi_interface_registry;
64 extern const char *atspi_interface_selection;
65 extern const char *atspi_interface_table;
66 extern const char *atspi_interface_text;
67 extern const char *atspi_interface_cache;
68 extern const char *atspi_interface_value;
70 /* function prototypes */
71 gint _atspi_get_iface_num (const char *iface);
73 DBusConnection * _atspi_bus ();
75 AtspiAccessible * _atspi_ref_accessible (const char *app, const char *path);
78 _atspi_dbus_return_accessible_from_message (DBusMessage *message);
81 _atspi_dbus_return_accessible_from_iter (DBusMessageIter *iter);
84 _atspi_dbus_return_hyperlink_from_message (DBusMessage *message);
87 _atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter);
89 dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
91 DBusMessage *_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
93 DBusMessage *_atspi_dbus_call_partial_va (gpointer obj, const char *interface, const char *method, GError **error, const char *type, va_list args);
95 dbus_bool_t _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, GError **error, const char *type, void *data);
97 DBusMessage * _atspi_dbus_send_with_reply_and_block (DBusMessage *message, GError **error);
99 GHashTable *_atspi_dbus_return_hash_from_message (DBusMessage *message);
101 GHashTable *_atspi_dbus_hash_from_iter (DBusMessageIter *iter);
103 GArray *_atspi_dbus_return_attribute_array_from_message (DBusMessage *message);
105 GArray *_atspi_dbus_attribute_array_from_iter (DBusMessageIter *iter);
107 gboolean _atspi_process_deferred_messages (gpointer data);
109 void _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *iter);
111 void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter);
113 #define _ATSPI_DBUS_CHECK_SIG(message, type, error, ret) \
115 g_warning ("at-spi: Got no message at %s line %d\n", __FILE__, __LINE__); \
118 if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) \
121 dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); \
123 g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_IPC, err); \
124 dbus_message_unref (message); \
127 if (strcmp (dbus_message_get_signature (message), type) != 0) \
129 g_warning ("at-spi: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \
130 dbus_message_unref (message); \
138 * Error domain for AT-SPI IPC failures. Errors in this domain will
139 * be from the #ATSPIAtspiError enumeration. See #GError for information on
142 #define ATSPI_ERROR _atspi_error_quark()
143 GQuark _atspi_error_quark (void);
147 * @ATSPI_APPLICATION_NO_LONGER_EXISTS: The application has quit.
151 ATSPI_ERROR_APPLICATION_GONE,
155 extern GMainLoop *atspi_main_loop;
156 extern gboolean atspi_no_cache;
157 #endif /* _ATSPI_MISC_PRIVATE_H_ */