summaryrefslogtreecommitdiff
path: root/atspi/atspi-misc.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2020-05-27 10:47:13 -0500
committerMike Gorse <mgorse@suse.com>2020-05-27 10:51:25 -0500
commit053af44c2a270c29ef286abdb3d0b083f05e39a6 (patch)
tree333d270c2b207bdf3edc16252872f56685947f1c /atspi/atspi-misc.c
parenta8e3e2ef2c3030c563183f4308aa8e63621eac64 (diff)
downloadat-spi2-core-053af44c2a270c29ef286abdb3d0b083f05e39a6.tar.gz
Use the event name when sending screen reader events over dbus
For screen reader events, look at the name of the signal and convert it, rather than hard-coding "RegionChanged." This is necessary to allow screen_reader_signal_watcher to process signals that will be added in the future. https://gitlab.gnome.org/GNOME/orca/issues/36
Diffstat (limited to 'atspi/atspi-misc.c')
-rw-r--r--atspi/atspi-misc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 9e8595ad..f49041ec 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -1899,3 +1899,33 @@ _atspi_prepare_screen_reader_interface ()
dbus_connection_add_filter (a11y_bus, screen_reader_filter, NULL, NULL);
return TRUE;
}
+
+gchar *
+_atspi_strdup_and_adjust_for_dbus (const char *s)
+{
+ gchar *d = g_strdup (s);
+ gchar *p;
+ int parts = 0;
+
+ if (!d)
+ return NULL;
+
+ for (p = d; *p; p++)
+ {
+ if (*p == '-')
+ {
+ memmove (p, p + 1, g_utf8_strlen (p, -1));
+ *p = toupper (*p);
+ }
+ else if (*p == ':')
+ {
+ parts++;
+ if (parts == 2)
+ break;
+ p [1] = toupper (p [1]);
+ }
+ }
+
+ d [0] = toupper (d [0]);
+ return d;
+}