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"
41 typedef struct _AtspiReference AtspiReference;
42 struct _AtspiReference
49 extern const char *atspi_path_dec;
50 extern const char *atspi_path_registry;
51 extern const char *atspi_path_root;
52 extern const char *atspi_bus_registry;
53 extern const char *atspi_interface_accessible;
54 extern const char *atspi_interface_action;
55 extern const char *atspi_interface_application;
56 extern const char *atspi_interface_collection;
57 extern const char *atspi_interface_component;
58 extern const char *atspi_interface_dec;
59 extern const char *atspi_interface_device_event_listener;
60 extern const char *atspi_interface_document;
61 extern const char *atspi_interface_editable_text;
62 extern const char *atspi_interface_hyperlink;
63 extern const char *atspi_interface_hypertext;
64 extern const char *atspi_interface_image;
65 extern const char *atspi_interface_registry;
66 extern const char *atspi_interface_selection;
67 extern const char *atspi_interface_table;
68 extern const char *atspi_interface_text;
69 extern const char *atspi_interface_cache;
70 extern const char *atspi_interface_value;
72 /* function prototypes */
73 gint _atspi_get_iface_num (const char *iface);
75 DBusConnection * _atspi_bus ();
77 AtspiAccessible * _atspi_ref_accessible (const char *app, const char *path);
80 _atspi_dbus_return_accessible_from_message (DBusMessage *message);
83 _atspi_dbus_return_accessible_from_iter (DBusMessageIter *iter);
86 _atspi_dbus_return_hyperlink_from_message (DBusMessage *message);
89 _atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter);
91 dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
93 DBusMessage *_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
95 DBusMessage *_atspi_dbus_call_partial_va (gpointer obj, const char *interface, const char *method, GError **error, const char *type, va_list args);
97 dbus_bool_t _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, GError **error, const char *type, void *data);
99 DBusMessage * _atspi_dbus_send_with_reply_and_block (DBusMessage *message, GError **error);
101 GHashTable *_atspi_dbus_return_hash_from_message (DBusMessage *message);
103 GHashTable *_atspi_dbus_hash_from_iter (DBusMessageIter *iter);
105 GArray *_atspi_dbus_return_attribute_array_from_message (DBusMessage *message);
107 GArray *_atspi_dbus_attribute_array_from_iter (DBusMessageIter *iter);
109 gboolean _atspi_process_deferred_messages (gpointer data);
111 void _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *iter);
113 void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter);
115 #define _ATSPI_DBUS_CHECK_SIG(message, type, error, ret) \
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;
160 #endif /* _ATSPI_MISC_PRIVATE_H_ */