/*---------------------------------------------------------------------------*/
+typedef struct _SpiReentrantCallClosure
+{
+ GMainLoop *loop;
+ DBusMessage *reply;
+} SpiReentrantCallClosure;
+
static void
set_reply (DBusPendingCall * pending, void *user_data)
{
- void **replyptr = (void **) user_data;
+ SpiReentrantCallClosure* closure = (SpiReentrantCallClosure *) user_data;
- *replyptr = dbus_pending_call_steal_reply (pending);
+ closure->reply = dbus_pending_call_steal_reply (pending);
+ g_main_loop_quit (closure->loop);
}
static DBusMessage *
send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
{
DBusPendingCall *pending;
- DBusMessage *reply = NULL;
+ SpiReentrantCallClosure closure;
if (!dbus_connection_send_with_reply (bus, message, &pending, -1))
- {
return NULL;
- }
- dbus_pending_call_set_notify (pending, set_reply, (void *) &reply, NULL);
- while (!reply)
- {
- if (!dbus_connection_read_write_dispatch (bus, -1))
- return NULL;
- }
- return reply;
+ dbus_pending_call_set_notify (pending, set_reply, (void *) &closure, NULL);
+ closure.loop = g_main_loop_new (NULL, FALSE);
+
+ g_main_loop_run (closure.loop);
+
+ g_main_loop_unref (closure.loop);
+ return closure.reply;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
-#define PCHANGE "property_change"
+#define PCHANGE "PropertyChange"
/*
* This handler handles the following ATK signals and
emit_event (accessible, ITF_EVENT_OBJECT, PCHANGE, pname, 0, 0,
DBUS_TYPE_STRING_AS_STRING, s1, append_basic);
}
- if (strcmp (pname, "accessible-description") == 0)
+ else if (strcmp (pname, "accessible-description") == 0)
{
s1 = atk_object_get_description (accessible);
if (s1 != NULL)
emit_event (accessible, ITF_EVENT_OBJECT, PCHANGE, pname, 0, 0,
DBUS_TYPE_STRING_AS_STRING, s1, append_basic);
}
- if (strcmp (pname, "accessible-parent") == 0)
+ else if (strcmp (pname, "accessible-parent") == 0)
{
otemp = atk_object_get_parent (accessible);
if (otemp != NULL)
emit_event (accessible, ITF_EVENT_OBJECT, PCHANGE, pname, 0, 0,
"(so)", otemp, append_object);
}
- if (strcmp (pname, "accessible-table-summary") == 0)
+ else if (strcmp (pname, "accessible-role") == 0)
+ {
+ dbus_uint32_t role = atk_object_get_role (accessible);
+ emit_event (accessible, ITF_EVENT_OBJECT, PCHANGE, pname, 0, 0,
+ DBUS_TYPE_UINT32_AS_STRING, role, append_basic);
+ }
+ else if (strcmp (pname, "accessible-table-summary") == 0)
{
otemp = atk_table_get_summary (ATK_TABLE (accessible));
if (otemp != NULL)
AtkObject *child;
GSignalQuery signal_query;
const gchar *name, *minor;
- gchar *s;
gint detail1;
g_signal_query (signal_hint->signal_id, &signal_query);
emit_event (accessible, ITF_EVENT_OBJECT, name, "", detail1, 0,
"(so)", child, append_object);
- g_free (s);
return TRUE;
}
const gchar *name, *minor;
gint detail1, detail2 = 0;
- AtkObject *accessible, *ao;
+ AtkObject *accessible, *ao=NULL;
gpointer child;
g_signal_query (signal_hint->signal_id, &signal_query);