[at-spi2-core] Device events now use uint32 for hw_code and modifiers in the IPC
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Device events now use uint32 for hw_code and modifiers in the IPC
- Date: Thu, 24 Feb 2011 18:29:13 +0000 (UTC)
commit 01018da6e5069833793160bfddb537210a511df5
Author: Mike Gorse <mgorse novell com>
Date: Thu Feb 24 12:28:25 2011 -0600
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.
atspi/atspi-device-listener.c | 11 ++++++-----
registryd/de-marshaller.c | 6 ++++--
registryd/de-types.h | 4 ++--
registryd/introspection.c | 6 +++---
xml/DeviceEventController.xml | 4 ++--
xml/DeviceEventListener.xml | 2 +-
6 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c
index 0cc6c89..669f874 100644
--- a/atspi/atspi-device-listener.c
+++ b/atspi/atspi-device-listener.c
@@ -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, ×tamp);
@@ -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;
diff --git a/registryd/de-marshaller.c b/registryd/de-marshaller.c
index 3f62686..560020a 100644
--- a/registryd/de-marshaller.c
+++ b/registryd/de-marshaller.c
@@ -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);
}
/*
diff --git a/registryd/de-types.h b/registryd/de-types.h
index d7020b1..a338e38 100644
--- a/registryd/de-types.h
+++ b/registryd/de-types.h
@@ -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;
diff --git a/registryd/introspection.c b/registryd/introspection.c
index 837b655..b5daee5 100644
--- a/registryd/introspection.c
+++ b/registryd/introspection.c
@@ -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>"
diff --git a/xml/DeviceEventController.xml b/xml/DeviceEventController.xml
index 1f680ef..0af9aac 100644
--- a/xml/DeviceEventController.xml
+++ b/xml/DeviceEventController.xml
@@ -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>
diff --git a/xml/DeviceEventListener.xml b/xml/DeviceEventListener.xml
index 0a10c16..a6dd3b6 100644
--- a/xml/DeviceEventListener.xml
+++ b/xml/DeviceEventListener.xml
@@ -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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]