+
+GHashTable *
+_atspi_dbus_update_cache_from_dict (AtspiAccessible *accessible, DBusMessageIter *iter)
+{
+ GHashTable *cache = _atspi_accessible_ref_cache (accessible);
+ DBusMessageIter iter_dict, iter_dict_entry, iter_struct, iter_variant;
+
+ dbus_message_iter_recurse (iter, &iter_dict);
+ while (dbus_message_iter_get_arg_type (&iter_dict) != DBUS_TYPE_INVALID)
+ {
+ const char *key;
+ GValue *val = NULL;
+ dbus_message_iter_recurse (&iter_dict, &iter_dict_entry);
+ dbus_message_iter_get_basic (&iter_dict_entry, &key);
+ dbus_message_iter_next (&iter_dict_entry);
+ dbus_message_iter_recurse (&iter_dict_entry, &iter_variant);
+ if (!strcmp (key, "interfaces"))
+ {
+ _atspi_dbus_set_interfaces (accessible, &iter_variant);
+ }
+ else if (!strcmp (key, "Attributes"))
+ {
+ char *iter_sig = dbus_message_iter_get_signature (&iter_variant);
+ val = g_new0 (GValue, 1);;
+ g_value_init (val, G_TYPE_HASH_TABLE);
+ if (strcmp (iter_sig, "a{ss}") != 0)
+ {
+ dbus_free (iter_sig);
+ break;
+ }
+ dbus_free (iter_sig);
+ g_value_take_boxed (val, _atspi_dbus_hash_from_iter (&iter_variant));
+ }
+ else if (!strcmp (key, "Component.ScreenExtents"))
+ {
+ dbus_int32_t d_int;
+ AtspiRect extents;
+ char *iter_sig = dbus_message_iter_get_signature (&iter_variant);
+ val = g_new0 (GValue, 1);;
+ g_value_init (val, ATSPI_TYPE_RECT);
+ if (strcmp (iter_sig, "(iiii)") != 0)
+ {
+ dbus_free (iter_sig);
+ break;
+ }
+ dbus_free (iter_sig);
+ dbus_message_iter_recurse (&iter_variant, &iter_struct);
+ dbus_message_iter_get_basic (&iter_struct, &d_int);
+ extents.x = d_int;
+ dbus_message_iter_next (&iter_struct);
+ dbus_message_iter_get_basic (&iter_struct, &d_int);
+ extents.y = d_int;
+ dbus_message_iter_next (&iter_struct);
+ dbus_message_iter_get_basic (&iter_struct, &d_int);
+ extents.width = d_int;
+ dbus_message_iter_next (&iter_struct);
+ dbus_message_iter_get_basic (&iter_struct, &d_int);
+ extents.height = d_int;
+ g_value_set_boxed (val, &extents);
+ }
+ if (val)
+ g_hash_table_insert (cache, g_strdup (key), val);
+ dbus_message_iter_next (&iter_dict);
+ }
+
+ return cache;
+}
+
+gboolean
+_atspi_get_allow_sync ()
+{
+ return allow_sync;
+}
+
+gboolean
+_atspi_set_allow_sync (gboolean val)
+{
+ gboolean ret = allow_sync;
+
+ allow_sync = val;
+ return ret;
+}
+
+void
+_atspi_set_error_no_sync (GError **error)
+{
+ g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_SYNC_NOT_ALLOWED,
+ _("Attempted synchronous call where prohibited"));
+}