diff options
Diffstat (limited to 'atspi')
-rw-r--r-- | atspi/atspi-accessible.c | 58 | ||||
-rw-r--r-- | atspi/atspi-collection.c | 1 | ||||
-rw-r--r-- | atspi/atspi-component.c | 2 | ||||
-rw-r--r-- | atspi/atspi-device-listener-private.h | 3 | ||||
-rw-r--r-- | atspi/atspi-device-listener.c | 13 | ||||
-rw-r--r-- | atspi/atspi-editabletext.c | 2 | ||||
-rw-r--r-- | atspi/atspi-event-listener-private.h | 2 | ||||
-rw-r--r-- | atspi/atspi-event-listener.c | 20 | ||||
-rw-r--r-- | atspi/atspi-misc.c | 31 | ||||
-rw-r--r-- | atspi/atspi-registry.c | 10 | ||||
-rw-r--r-- | atspi/atspi-table.c | 4 | ||||
-rw-r--r-- | atspi/atspi-text.c | 8 |
12 files changed, 61 insertions, 93 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index 684f5be4..584c70a6 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -44,6 +44,7 @@ atspi_document_interface_init (AtspiDocument *document) { } +static void atspi_editable_text_interface_init (AtspiEditableText *editable_text) { } @@ -108,7 +109,6 @@ static void atspi_accessible_dispose (GObject *object) { AtspiAccessible *accessible = ATSPI_ACCESSIBLE (object); - gboolean cached; AtspiEvent e; AtspiAccessible *parent; @@ -772,6 +772,34 @@ atspi_accessible_get_toolkit_version (AtspiAccessible *obj, GError **error) } /* Interface query methods */ +static gboolean +_atspi_accessible_is_a (AtspiAccessible *accessible, + const char *interface_name) +{ + int n; + + if (accessible == NULL) + { + return FALSE; + } + + if (!(accessible->cached_properties & ATSPI_CACHE_INTERFACES)) + { + DBusMessage *reply; + DBusMessageIter iter; + reply = _atspi_dbus_call_partial (accessible, atspi_interface_accessible, + "GetInterfaces", NULL, ""); + _ATSPI_DBUS_CHECK_SIG (reply, "as", NULL, FALSE); + dbus_message_iter_init (reply, &iter); + _atspi_dbus_set_interfaces (accessible, &iter); + dbus_message_unref (reply); + } + + n = _atspi_get_iface_num (interface_name); + if (n == -1) return FALSE; + return (gboolean) ((accessible->interfaces & (1 << n))? TRUE: FALSE); +} + /** * atspi_accessible_is_action: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1211,34 +1239,6 @@ atspi_accessible_get_value (AtspiAccessible *accessible) g_object_ref (ATSPI_VALUE (accessible)) : NULL); } -gboolean -_atspi_accessible_is_a (AtspiAccessible *accessible, - const char *interface_name) -{ - int n; - - if (accessible == NULL) - { - return FALSE; - } - - if (!(accessible->cached_properties & ATSPI_CACHE_INTERFACES)) - { - DBusMessage *reply; - DBusMessageIter iter; - reply = _atspi_dbus_call_partial (accessible, atspi_interface_accessible, - "GetInterfaces", NULL, ""); - _ATSPI_DBUS_CHECK_SIG (reply, "as", NULL, FALSE); - dbus_message_iter_init (reply, &iter); - _atspi_dbus_set_interfaces (accessible, &iter); - dbus_message_unref (reply); - } - - n = _atspi_get_iface_num (interface_name); - if (n == -1) return FALSE; - return (gboolean) ((accessible->interfaces & (1 << n))? TRUE: FALSE); -} - static void append_const_val (GArray *array, const gchar *val) { diff --git a/atspi/atspi-collection.c b/atspi/atspi-collection.c index e4b79f8b..fa035ef9 100644 --- a/atspi/atspi-collection.c +++ b/atspi/atspi-collection.c @@ -75,6 +75,7 @@ append_accessible (DBusMessage *message, AtspiAccessible *accessible) dbus_message_iter_init_append (message, &iter); dbus_message_iter_append_basic (&iter, DBUS_TYPE_OBJECT_PATH, &accessible->parent.path); + return TRUE; /* TODO: Check for out-of-memory */ } static GArray * diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index f653a28e..42f0771c 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -118,8 +118,6 @@ atspi_component_get_accessible_at_point (AtspiComponent *obj, dbus_int32_t d_x = x, d_y = y; dbus_uint16_t d_ctype = ctype; DBusMessage *reply; - char *path = NULL; - AtspiAccessible *retval = NULL; g_return_val_if_fail (obj != NULL, FALSE); diff --git a/atspi/atspi-device-listener-private.h b/atspi/atspi-device-listener-private.h index 471ca7a1..2c07f9e5 100644 --- a/atspi/atspi-device-listener-private.h +++ b/atspi/atspi-device-listener-private.h @@ -32,4 +32,7 @@ DBusHandlerResult _atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void *data); gchar *_atspi_device_listener_get_path (AtspiDeviceListener *listener); + +DBusHandlerResult +atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void *data); #endif /* _ATSPI_DEVICE_LISTENER_H_ */ diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c index 235d6b2d..218c26cb 100644 --- a/atspi/atspi-device-listener.c +++ b/atspi/atspi-device-listener.c @@ -22,6 +22,7 @@ */ #include "atspi-private.h" +#include <stdio.h> typedef struct { @@ -32,8 +33,6 @@ typedef struct GObjectClass *device_parent_class; -static guint32 _e_id = 0; - /* * Misc. helpers. */ @@ -114,12 +113,6 @@ id_is_free (guint id) return TRUE; } -static void -remove_listener (GObject *obj, gpointer data) -{ - device_listeners = g_list_remove (device_listeners, obj); -} - static AtspiDeviceEvent * atspi_device_event_copy (AtspiDeviceEvent *src) { @@ -313,8 +306,6 @@ atspi_device_listener_remove_callback (AtspiDeviceListener *listener, listener->callbacks = event_list_remove_by_cb (listener->callbacks, (void *) callback); } -static const char *device_event_type = "(uinnisb)"; - static void read_device_event_from_iter (DBusMessageIter *iter, AtspiDeviceEvent *event) { @@ -323,7 +314,6 @@ read_device_event_from_iter (DBusMessageIter *iter, AtspiDeviceEvent *event) dbus_int16_t hw_code; dbus_int16_t modifiers; dbus_int32_t timestamp; - char *event_string; dbus_bool_t is_text; DBusMessageIter iter_struct; @@ -371,7 +361,6 @@ atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void * dbus_bool_t retval = FALSE; GList *l; DBusMessage *reply; - void *p = &event; if (strcmp (dbus_message_get_signature (message), "(uinnisb)") != 0) { diff --git a/atspi/atspi-editabletext.c b/atspi/atspi-editabletext.c index 2bd70c34..bbfb2417 100644 --- a/atspi/atspi-editabletext.c +++ b/atspi/atspi-editabletext.c @@ -136,7 +136,7 @@ atspi_editable_text_copy_text (AtspiEditableText *obj, g_return_val_if_fail (obj != NULL, FALSE); - _atspi_dbus_call (obj, atspi_interface_editable_text, "CopyText", error, "ii", start_pos, end_pos); + _atspi_dbus_call (obj, atspi_interface_editable_text, "CopyText", error, "ii", d_start_pos, d_end_pos); return TRUE; } diff --git a/atspi/atspi-event-listener-private.h b/atspi/atspi-event-listener-private.h index 98fa8673..d3d529c9 100644 --- a/atspi/atspi-event-listener-private.h +++ b/atspi/atspi-event-listener-private.h @@ -32,4 +32,6 @@ DBusHandlerResult _atspi_dbus_handle_Event (DBusConnection *bus, DBusMessage *message, void *data); void _atspi_send_event (AtspiEvent *e); + +DBusHandlerResult atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data); #endif /* _ATSPI_EVENT_LISTENER_H_ */ diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c index e931ba1b..1d0d0101 100644 --- a/atspi/atspi-event-listener.c +++ b/atspi/atspi-event-listener.c @@ -23,6 +23,7 @@ #include "atspi-private.h" #include <string.h> +#include <ctype.h> typedef struct { @@ -186,7 +187,7 @@ cache_process_children_changed (AtspiEvent *event) { event->source->children = g_list_remove (event->source->children, child); if (child == child->parent.app->root) - g_object_run_dispose (child->parent.app); + g_object_run_dispose (G_OBJECT (child->parent.app)); g_object_unref (child); } } @@ -310,7 +311,6 @@ convert_event_type_to_dbus (const char *eventType, char **categoryp, char **name gchar *tmp = strdup_and_adjust_for_dbus (eventType); char *category = NULL, *name = NULL, *detail = NULL; char *saveptr = NULL; - char *p; if (tmp == NULL) return FALSE; category = strtok_r (tmp, ":", &saveptr); @@ -366,7 +366,7 @@ oom: static void listener_entry_free (EventListenerEntry *e) { - gpointer callback = (e->callback = remove_datum ? e->user_data : e->callback); + gpointer callback = (e->callback == remove_datum ? e->user_data : e->callback); g_free (e->category); g_free (e->name); if (e->detail) g_free (e->detail); @@ -537,13 +537,13 @@ atspi_event_listener_register_from_callback (AtspiEventListenerCB callback, /* TODO: Set error */ } - dbus_error_init (&error); + dbus_error_init (&d_error); message = dbus_message_new_method_call (atspi_bus_registry, atspi_path_registry, atspi_interface_registry, "RegisterEvent"); if (!message) - return; + return FALSE; dbus_message_append_args (message, DBUS_TYPE_STRING, &event_type, DBUS_TYPE_INVALID); reply = _atspi_dbus_send_with_reply_and_block (message, error); if (reply) @@ -602,9 +602,9 @@ atspi_event_listener_deregister (AtspiEventListener *listener, const gchar *event_type, GError **error) { - atspi_event_listener_deregister_from_callback (listener->callback, - listener->user_data, - event_type, error); + return atspi_event_listener_deregister_from_callback (listener->callback, + listener->user_data, + event_type, error); } /** @@ -662,7 +662,7 @@ atspi_event_listener_deregister_from_callback (AtspiEventListenerCB callback, atspi_interface_registry, "RegisterEvent"); if (!message) - return; + return FALSE; dbus_message_append_args (message, DBUS_TYPE_STRING, &event_type, DBUS_TYPE_INVALID); reply = _atspi_dbus_send_with_reply_and_block (message, error); dbus_message_unref (reply); @@ -774,7 +774,7 @@ atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) if (strcmp (signature, "siiv(so)") != 0) { g_warning (_("Got invalid signature %s for signal %s from interface %s\n"), signature, member, category); - return; + return DBUS_HANDLER_RESULT_HANDLED; } memset (&e, 0, sizeof (e)); diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 1befd8fc..1a3f4121 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -29,16 +29,14 @@ #include "atspi-private.h" #include "X11/Xlib.h" +#include "dbus/dbus-glib.h" #include <stdio.h> #include <string.h> static void handle_get_items (DBusPendingCall *pending, void *user_data); static DBusConnection *bus = NULL; -static GHashTable *apps = NULL; static GHashTable *live_refs = NULL; -static GQueue *exception_handlers = NULL; -static DBusError exception; const char *atspi_path_dec = ATSPI_DBUS_PATH_DEC; const char *atspi_path_registry = ATSPI_DBUS_PATH_REGISTRY; @@ -285,7 +283,6 @@ handle_remove_accessible (DBusConnection *bus, DBusMessage *message, void *user_ DBusMessageIter iter, iter_struct; const char *signature = dbus_message_get_signature (message); AtspiAccessible *a; - int id; if (strcmp (signature, "(so)") != 0) { @@ -312,7 +309,6 @@ static gboolean add_app_to_desktop (AtspiAccessible *a, const char *bus_name) { DBusError error; - char *root_path; dbus_error_init (&error); AtspiAccessible *obj = ref_accessible (bus_name, atspi_path_root); @@ -395,11 +391,9 @@ get_reference_from_iter (DBusMessageIter *iter, const char **app_name, const cha static void add_accessible_from_iter (DBusMessageIter *iter) { - gint i; GList *new_list; DBusMessageIter iter_struct, iter_array; const char *app_name, *path; - AtspiApplication *app; AtspiAccessible *accessible; const char *name, *description; dbus_uint32_t role; @@ -477,7 +471,6 @@ add_accessible_from_iter (DBusMessageIter *iter) static void handle_get_items (DBusPendingCall *pending, void *user_data) { - AtspiApplication *app = user_data; DBusMessage *reply = dbus_pending_call_steal_reply (pending); DBusMessageIter iter, iter_array; @@ -509,9 +502,6 @@ static AtspiAccessible * ref_accessible_desktop (AtspiApplication *app) { DBusError error; - GArray *apps = NULL; - GArray *additions; - gint i; DBusMessage *message, *reply; DBusMessageIter iter, iter_array; gchar *bus_name_dup; @@ -535,14 +525,14 @@ ref_accessible_desktop (AtspiApplication *app) atspi_interface_accessible, "GetChildren"); if (!message) - return; + return NULL; reply = _atspi_dbus_send_with_reply_and_block (message, NULL); if (!reply || strcmp (dbus_message_get_signature (reply), "a(so)") != 0) { g_error ("Couldn't get application list: %s", error.message); if (reply) dbus_message_unref (reply); - return; + return NULL; } dbus_message_iter_init (reply, &iter); dbus_message_iter_recurse (&iter, &iter_array); @@ -643,14 +633,12 @@ handle_add_accessible (DBusConnection *bus, DBusMessage *message, void *user_dat { DBusMessageIter iter; const char *sender = dbus_message_get_sender (message); - AtspiApplication *app = get_application (sender); - const char *type = cache_signal_type; if (strcmp (dbus_message_get_signature (message), cache_signal_type) != 0) { g_warning (_("AT-SPI: AddAccessible with unknown signature %s\n"), dbus_message_get_signature (message)); - return; + return DBUS_HANDLER_RESULT_HANDLED; } dbus_message_iter_init (message, &iter); @@ -671,9 +659,6 @@ process_deferred_message (BusDataClosure *closure) { int type = dbus_message_get_type (closure->message); const char *interface = dbus_message_get_interface (closure->message); - const char *member = dbus_message_get_member (closure->message); - dbus_uint32_t v; - char *bus_name; if (type == DBUS_MESSAGE_TYPE_SIGNAL && !strncmp (interface, "org.a11y.atspi.Event.", 21)) @@ -703,7 +688,7 @@ _atspi_process_deferred_messages (gpointer data) static int in_process_deferred_messages = 0; if (in_process_deferred_messages) - return; + return TRUE; in_process_deferred_messages = 1; while (deferred_messages != NULL) { @@ -747,9 +732,6 @@ atspi_dbus_filter (DBusConnection *bus, DBusMessage *message, void *data) { int type = dbus_message_get_type (message); const char *interface = dbus_message_get_interface (message); - const char *member = dbus_message_get_member (message); - dbus_uint32_t v; - char *bus_name; if (type == DBUS_MESSAGE_TYPE_SIGNAL && !strncmp (interface, "org.a11y.atspi.Event.", 21)) @@ -897,7 +879,6 @@ atspi_init (void) { DBusError error; char *match; - int i; if (atspi_inited) { @@ -1056,7 +1037,6 @@ _atspi_dbus_call_partial_va (gpointer obj, va_list args) { AtspiObject *aobj = ATSPI_OBJECT (obj); - dbus_bool_t retval; DBusError err; DBusMessage *msg = NULL, *reply = NULL; DBusMessageIter iter; @@ -1257,7 +1237,6 @@ _atspi_dbus_attribute_array_from_iter (DBusMessageIter *iter) { DBusMessageIter iter_array, iter_dict; GArray *array = g_array_new (TRUE, TRUE, sizeof (gchar *)); - gint count = 0; dbus_message_iter_recurse (iter, &iter_array); while (dbus_message_iter_get_arg_type (&iter_array) != DBUS_TYPE_INVALID) diff --git a/atspi/atspi-registry.c b/atspi/atspi-registry.c index b3a6eeb7..9e49562b 100644 --- a/atspi/atspi-registry.c +++ b/atspi/atspi-registry.c @@ -25,8 +25,6 @@ #include "atspi-private.h" -static GArray *desktops; - /** * atspi_get_desktop_count: * @@ -250,7 +248,6 @@ atspi_register_device_event_listener (AtspiDeviceListener *listener, { gboolean retval = FALSE; dbus_uint32_t d_event_types = event_types; - gint i; gchar *path = _atspi_device_listener_get_path (listener); DBusError d_error; @@ -353,11 +350,14 @@ atspi_generate_keyboard_event (glong keyval, gboolean atspi_generate_mouse_event (glong x, glong y, const gchar *name, GError **error) { - dbus_int32_t dbus_x = x, dbus__y = y; + dbus_int32_t d_x = x, d_y = y; DBusError d_error; dbus_error_init (&d_error); - dbind_method_call_reentrant (_atspi_bus(), atspi_bus_registry, atspi_path_dec, atspi_interface_dec, "GenerateMouseEvent", &d_error, "iis", x, y, name); + dbind_method_call_reentrant (_atspi_bus(), atspi_bus_registry, + atspi_path_dec, atspi_interface_dec, + "GenerateMouseEvent", &d_error, "iis", + d_x, d_y, name); return TRUE; } diff --git a/atspi/atspi-table.c b/atspi/atspi-table.c index 6174ca86..492778ed 100644 --- a/atspi/atspi-table.c +++ b/atspi/atspi-table.c @@ -36,7 +36,6 @@ AtspiAccessible * atspi_table_get_caption (AtspiTable *obj, GError **error) { - char *path; AtspiAccessible *retval = NULL; g_return_val_if_fail (obj != NULL, NULL); @@ -130,12 +129,11 @@ atspi_table_get_accessible_at (AtspiTable *obj, GError **error) { dbus_int32_t d_row = row, d_column = column; - AtspiAccessible *retval; DBusMessage *reply; g_return_val_if_fail (obj != NULL, NULL); - reply = _atspi_dbus_call_partial (obj, atspi_interface_table, "GetAccessibleAt", error, "ii", row, column); + reply = _atspi_dbus_call_partial (obj, atspi_interface_table, "GetAccessibleAt", error, "ii", d_row, d_column); return _atspi_dbus_return_accessible_from_message (reply); } diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c index 9ca2fd8a..81858036 100644 --- a/atspi/atspi-text.c +++ b/atspi/atspi-text.c @@ -107,7 +107,7 @@ atspi_text_get_text (AtspiText *obj, g_return_val_if_fail (obj != NULL, g_strdup ("")); - _atspi_dbus_call (obj, atspi_interface_text, "GetText", error, "ii=>s", start_offset, end_offset, &retval); + _atspi_dbus_call (obj, atspi_interface_text, "GetText", error, "ii=>s", d_start_offset, d_end_offset, &retval); if (!retval) retval = g_strdup (""); @@ -161,10 +161,9 @@ atspi_text_get_attributes (AtspiText *obj, { dbus_int32_t d_offset = offset; dbus_int32_t d_start_offset, d_end_offset; - GHashTable *hash; DBusMessage *reply; DBusMessageIter iter; - GHashTable *ret; + GHashTable *ret = NULL; if (obj == NULL) return NULL; @@ -215,10 +214,9 @@ atspi_text_get_attribute_run (AtspiText *obj, { dbus_int32_t d_offset = offset; dbus_int32_t d_start_offset, d_end_offset; - GHashTable *hash; DBusMessage *reply; DBusMessageIter iter; - GHashTable *ret; + GHashTable *ret = NULL; if (obj == NULL) return NULL; |