Commit 01018da6 authored by Mike Gorse's avatar Mike Gorse
Browse files

Device events now use uint32 for hw_code and modifiers in the IPC

Changed device event IPC to use uint32 for hw_code and modifiers, to be
more consistent with the rest of the API.
Kept AT-SPI struct using gushorts to avoid ABI break, and the registry daemon
will continue to accept the old API as well as the new for now.
parent 099ec6f6
......@@ -312,8 +312,8 @@ read_device_event_from_iter (DBusMessageIter *iter, AtspiDeviceEvent *event)
{
dbus_uint32_t type;
dbus_int32_t id;
dbus_int16_t hw_code;
dbus_int16_t modifiers;
dbus_int32_t hw_code;
dbus_int32_t modifiers;
dbus_int32_t timestamp;
dbus_bool_t is_text;
DBusMessageIter iter_struct;
......@@ -328,12 +328,13 @@ read_device_event_from_iter (DBusMessageIter *iter, AtspiDeviceEvent *event)
event->id = id;
dbus_message_iter_next (&iter_struct);
/* TODO: Remove cast from next two on ABI break */
dbus_message_iter_get_basic (&iter_struct, &hw_code);
event->hw_code = hw_code;
event->hw_code = (gushort) hw_code;
dbus_message_iter_next (&iter_struct);
dbus_message_iter_get_basic (&iter_struct, &modifiers);
event->modifiers = modifiers;
event->modifiers = (gushort) modifiers;
dbus_message_iter_next (&iter_struct);
dbus_message_iter_get_basic (&iter_struct, &timestamp);
......@@ -363,7 +364,7 @@ atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void *
GList *l;
DBusMessage *reply;
if (strcmp (dbus_message_get_signature (message), "(uinnisb)") != 0)
if (strcmp (dbus_message_get_signature (message), "(uiuuisb)") != 0)
{
g_warning ("Atspi: Unknown signature for an event");
goto done;
......
......@@ -81,7 +81,7 @@ dbus_bool_t spi_dbus_marshal_deviceEvent(DBusMessage *message, const Accessibili
if (!message) return FALSE;
dbus_message_iter_init_append(message, &iter);
return spi_dbus_message_iter_append_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT16, &e->hw_code, DBUS_TYPE_INT16, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID);
return spi_dbus_message_iter_append_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_UINT32, &e->hw_code, DBUS_TYPE_UINT32, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID);
}
dbus_bool_t spi_dbus_demarshal_deviceEvent(DBusMessage *message, Accessibility_DeviceEvent *e)
......@@ -89,7 +89,9 @@ dbus_bool_t spi_dbus_demarshal_deviceEvent(DBusMessage *message, Accessibility_D
DBusMessageIter iter;
dbus_message_iter_init(message, &iter);
return spi_dbus_message_iter_get_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT16, &e->hw_code, DBUS_TYPE_INT16, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID);
/* TODO: Remove the || for 2.1 */
return spi_dbus_message_iter_get_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT32, &e->hw_code, DBUS_TYPE_INT32, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID) ||
spi_dbus_message_iter_get_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT16, &e->hw_code, DBUS_TYPE_INT16, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID);
}
/*
......
......@@ -54,8 +54,8 @@ struct _Accessibility_DeviceEvent
{
Accessibility_EventType type;
dbus_uint32_t id;
dbus_uint16_t hw_code;
dbus_uint16_t modifiers;
dbus_uint32_t hw_code;
dbus_uint32_t modifiers;
dbus_uint32_t timestamp;
char * event_string;
dbus_bool_t is_text;
......
......@@ -812,13 +812,13 @@ const char *spi_org_a11y_atspi_DeviceEventController =
" </method>"
""
" <method name=\"NotifyListenersSync\">"
" <arg direction=\"in\" name=\"event\" type=\"(uinnisb)\" />"
" <arg direction=\"in\" name=\"event\" type=\"(uiuuisb)\" />"
" <arg direction=\"out\" type=\"b\" />"
" "
" </method>"
""
" <method name=\"NotifyListenersAsync\">"
" <arg direction=\"in\" name=\"event\" type=\"(uinnisb)\" />"
" <arg direction=\"in\" name=\"event\" type=\"(uiuuisb)\" />"
" "
" </method>"
""
......@@ -829,7 +829,7 @@ const char *spi_org_a11y_atspi_DeviceEventListener =
"<interface name=\"org.a11y.atspi.DeviceEventListener\" version=\"0.1.7\">"
""
" <method name=\"NotifyEvent\">"
" <arg direction=\"in\" name=\"event\" type=\"(uinnisb)\" />"
" <arg direction=\"in\" name=\"event\" type=\"(uiuuisb)\" />"
" "
" <arg direction=\"out\" type=\"b\" />"
" </method>"
......
......@@ -50,13 +50,13 @@
</method>
<method name="NotifyListenersSync">
<arg direction="in" name="event" type="(uinnisb)"/>
<arg direction="in" name="event" type="(uiuuisb)"/>
<arg direction="out" type="b"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QSpiDeviceEvent"/>
</method>
<method name="NotifyListenersAsync">
<arg direction="in" name="event" type="(uinnisb)"/>
<arg direction="in" name="event" type="(uiuuisb)"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QSpiDeviceEvent"/>
</method>
......
......@@ -3,7 +3,7 @@
<interface name="org.a11y.atspi.DeviceEventListener">
<method name="NotifyEvent">
<arg direction="in" name="event" type="(uinnisb)"/>
<arg direction="in" name="event" type="(uiuuisb)"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QSpiDeviceEvent"/>
<arg direction="out" type="b"/>
</method>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment