X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=atspi%2Fatspi-misc-private.h;h=27b3717b8149958ba15af129634c0cb98a96e0ab;hb=d73e6b21e10f2a3d1f6e313b40f66c009c09a79c;hp=c65ee5d768d4992c00b999e7e5fdcab9ecb89fed;hpb=1299779d8ded027a7e277d5e64b76f88c4ba4da7;p=platform%2Fupstream%2Fat-spi2-core.git diff --git a/atspi/atspi-misc-private.h b/atspi/atspi-misc-private.h index c65ee5d..27b3717 100644 --- a/atspi/atspi-misc-private.h +++ b/atspi/atspi-misc-private.h @@ -4,7 +4,8 @@ * * Copyright 2002 Ximian, Inc. * 2002 Sun Microsystems Inc. - * + * Copyright 2010, 2011 Novell, Inc. + * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -27,18 +28,15 @@ /* Private internal implementation details of at-spi. */ +#include + #include "atspi.h" #include "dbus/dbus.h" #include "dbind/dbind.h" -#define ATSPI_CACHE_PARENT 0x0001 -#define ATSPI_CACHE_CHILDREN 0x0002 -#define ATSPI_CACHE_NAME 0x0004 -#define ATSPI_CACHE_DESCRIPTION 0x0008 -#define ATSPI_CACHE_STATES 0x0010 -#define ATSPI_CACHE_ROLE 0x0010 +G_BEGIN_DECLS typedef struct _AtspiReference AtspiReference; struct _AtspiReference @@ -47,38 +45,6 @@ struct _AtspiReference char *path; }; -/* constants */ -#define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry" -#define ATSPI_DBUS_PATH_REGISTRY "/org/a11y/atspi/registry" -#define ATSPI_DBUS_INTERFACE_REGISTRY "org.a11y.atspi.Registry" - -#define ATSPI_DBUS_PATH_NULL "/org/a11y/atspi/null" -#define ATSPI_DBUS_PATH_ROOT "/org/a11y/atspi/accessible/root" - -#define ATSPI_DBUS_PATH_DEC "/org/a11y/atspi/registry/deviceeventcontroller" -#define ATSPI_DBUS_INTERFACE_DEC "org.a11y.atspi.DeviceEventController" -#define ATSPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER "org.a11y.atspi.DeviceEventListener" - -#define ATSPI_DBUS_INTERFACE_CACHE "org.a11y.atspi.Cache" -#define ATSPI_DBUS_INTERFACE_ACCESSIBLE "org.a11y.atspi.Accessible" -#define ATSPI_DBUS_INTERFACE_ACTION "org.a11y.atspi.Action" -#define ATSPI_DBUS_INTERFACE_APPLICATION "org.a11y.atspi.Application" -#define ATSPI_DBUS_INTERFACE_COLLECTION "org.a11y.atspi.Collection" -#define ATSPI_DBUS_INTERFACE_COMPONENT "org.a11y.atspi.Component" -#define ATSPI_DBUS_INTERFACE_DOCUMENT "org.a11y.atspi.Document" -#define ATSPI_DBUS_INTERFACE_EDITABLE_TEXT "org.a11y.atspi.EditableText" -#define ATSPI_DBUS_INTERFACE_EVENT_KEYBOARD "org.a11y.atspi.Event.Keyboard" -#define ATSPI_DBUS_INTERFACE_EVENT_MOUSE "org.a11y.atspi.Event.Mouse" -#define ATSPI_DBUS_INTERFACE_EVENT_OBJECT "org.a11y.atspi.Event.Object" -#define ATSPI_DBUS_INTERFACE_HYPERLINK "org.a11y.atspi.Hyperlink" -#define ATSPI_DBUS_INTERFACE_HYPERTEXT "org.a11y.atspi.Hypertext" -#define ATSPI_DBUS_INTERFACE_IMAGE "org.a11y.atspi.Image" -#define ATSPI_DBUS_INTERFACE_SELECTION "org.a11y.atspi.Selection" -#define ATSPI_DBUS_INTERFACE_TABLE "org.a11y.atspi.Table" -#define ATSPI_DBUS_INTERFACE_TEXT "org.a11y.atspi.Text" -#define ATSPI_DBUS_INTERFACE_VALUE "org.a11y.atspi.Value" -#define ATSPI_DBUS_INTERFACE_SOCKET "org.a11y.atspi.Socket" - /* externs */ extern const char *atspi_path_dec; extern const char *atspi_path_registry; @@ -87,6 +53,7 @@ extern const char *atspi_bus_registry; extern const char *atspi_interface_accessible; extern const char *atspi_interface_action; extern const char *atspi_interface_application; +extern const char *atspi_interface_collection; extern const char *atspi_interface_component; extern const char *atspi_interface_dec; extern const char *atspi_interface_device_event_listener; @@ -98,6 +65,7 @@ extern const char *atspi_interface_image; extern const char *atspi_interface_registry; extern const char *atspi_interface_selection; extern const char *atspi_interface_table; +extern const char *atspi_interface_table_cell; extern const char *atspi_interface_text; extern const char *atspi_interface_cache; extern const char *atspi_interface_value; @@ -115,17 +83,89 @@ _atspi_dbus_return_accessible_from_message (DBusMessage *message); AtspiAccessible * _atspi_dbus_return_accessible_from_iter (DBusMessageIter *iter); -AtspiAccessible * _atspi_ref_related_accessible (AtspiAccessible *obj, const AtspiReference *ref); +AtspiHyperlink * +_atspi_dbus_return_hyperlink_from_message (DBusMessage *message); + +AtspiHyperlink * +_atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter); + +dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...); + +DBusMessage *_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...); + +DBusMessage *_atspi_dbus_call_partial_va (gpointer obj, const char *interface, const char *method, GError **error, const char *type, va_list args); + +dbus_bool_t _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, GError **error, const char *type, void *data); + +DBusMessage * _atspi_dbus_send_with_reply_and_block (DBusMessage *message, GError **error); + +GHashTable *_atspi_dbus_return_hash_from_message (DBusMessage *message); + +GHashTable *_atspi_dbus_hash_from_iter (DBusMessageIter *iter); + +GArray *_atspi_dbus_return_attribute_array_from_message (DBusMessage *message); + +GArray *_atspi_dbus_attribute_array_from_iter (DBusMessageIter *iter); + +void _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *iter); + +void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter); + +#define _ATSPI_DBUS_CHECK_SIG(message, type, error, ret) \ + if (!message) \ + return (ret); \ + if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) \ + { \ + const char *err; \ + dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); \ + if (err) \ + g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_IPC, err); \ + dbus_message_unref (message); \ + return ret; \ + } \ + if (strcmp (dbus_message_get_signature (message), type) != 0) \ + { \ + g_warning ("at-spi: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \ + dbus_message_unref (message); \ + return (ret); \ + } + + +/** + * ATSPI_ERROR: + * + * Error domain for AT-SPI IPC failures. Errors in this domain will + * be from the #ATSPIAtspiError enumeration. See #GError for information on + * error domains. + */ +#define ATSPI_ERROR _atspi_error_quark() +GQuark _atspi_error_quark (void); + +/** + * AtspiError: + * @ATSPI_APPLICATION_NO_LONGER_EXISTS: The application has quit. + */ +typedef enum +{ + ATSPI_ERROR_APPLICATION_GONE, + ATSPI_ERROR_IPC, + ATSPI_ERROR_SYNC_NOT_ALLOWED, +} AtspiError; + +extern GMainLoop *atspi_main_loop; +extern gboolean atspi_no_cache; + +GHashTable *_atspi_get_live_refs (); -dbus_bool_t _atspi_dbus_call (AtspiAccessible *obj, const char *interface, const char *method, GError **error, const char *type, ...); +gchar *_atspi_name_compat (gchar *in); -DBusMessage *_atspi_dbus_call_partial (AtspiAccessible *obj, const char *interface, const char *method, GError **error, const char *type, ...); +GHashTable *_atspi_dbus_update_cache_from_dict (AtspiAccessible *accessible, DBusMessageIter *iter); -dbus_bool_t _atspi_dbus_get_property (AtspiAccessible *obj, const char *interface, const char *name, GError **error, const char *type, void *data); +gboolean _atspi_get_allow_sync (); -DBusMessage * _atspi_dbus_send_with_reply_and_block (DBusMessage *message); +gboolean _atspi_set_allow_sync (gboolean val); -GHashTable *_atspi_dbus_hash_from_message (DBusMessage *message); +void _atspi_set_error_no_sync (GError **error); +G_END_DECLS -GArray *_atspi_dbus_attribute_array_from_message (DBusMessage *message); #endif /* _ATSPI_MISC_PRIVATE_H_ */