From e8d4a02ec931a8d45a80357d8c04ef4cdfca013e Mon Sep 17 00:00:00 2001 From: Ask Hjorth Larsen Date: Sat, 26 Aug 2017 16:23:07 +0200 Subject: [PATCH 01/16] Updated Danish translation --- po/da.po | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/po/da.po b/po/da.po index 74789dc..1724397 100644 --- a/po/da.po +++ b/po/da.po @@ -7,8 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: at-spi2-core master\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-19 22:27+0100\n" +"Report-Msgid-Bugs-To: " +"https://bugzilla.gnome.org/enter_bug.cgi?product=at-spi&keywords=I18N+L10N&component=at-spi2-core\n" +"POT-Creation-Date: 2017-06-27 21:34+0000\n" "PO-Revision-Date: 2014-03-15 14:12+0100\n" "Last-Translator: Kris Thomsen \n" "Language-Team: Danish \n" @@ -18,12 +19,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../atspi/atspi-component.c:325 ../atspi/atspi-misc.c:1036 -#: ../atspi/atspi-value.c:111 +#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 msgid "The application no longer exists" msgstr "Programmet findes ikke længere" -#: ../atspi/atspi-misc.c:1779 +#: atspi/atspi-misc.c:1843 msgid "Attempted synchronous call where prohibited" msgstr "Et forsøgt synkront kald blev forbudt" @@ -56,8 +56,8 @@ msgstr "Et forsøgt synkront kald blev forbudt" #~ msgid "" #~ "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" #~ msgstr "" -#~ "AT-SPI: forventede en variant under hentning af %s fra grænseflade %s; " -#~ "fik %s\n" +#~ "AT-SPI: forventede en variant under hentning af %s fra grænseflade %s; fik " +#~ "%s\n" #~ msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" #~ msgstr "atspi_dbus_get_property: Forkert type: forventede %s, fik %c\n" @@ -74,8 +74,10 @@ msgstr "Et forsøgt synkront kald blev forbudt" #~ msgid "" #~ "called atspi_event_listener_register_from_callback with a NULL event_type" #~ msgstr "" -#~ "kaldte atspi_event_listener_register_from_callback event_type med en NULL-" -#~ "værdi" +#~ "kaldte atspi_event_listener_register_from_callback event_type med en " +#~ "NULL-værdi" #~ msgid "Got invalid signature %s for signal %s from interface %s\n" #~ msgstr "Modtog ugyldig signatur %s for signalet %s fra grænseflade %s\n" + + -- 2.7.4 From aa3a11a1dece49328e119f8465f0a46cd548b680 Mon Sep 17 00:00:00 2001 From: Patrick Welche Date: Thu, 24 Aug 2017 14:49:04 +0100 Subject: [PATCH 02/16] configure.ac: make xkb optional, as intended [] is not sufficient to avoid PKG_CHECK_MODULES' default action of bailing if xkbcommon-x11 is not found. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c1de48c..bf3450a 100644 --- a/configure.ac +++ b/configure.ac @@ -111,7 +111,7 @@ AS_IF([test "x$enable_x11" = xno], [ AC_DEFINE(HAVE_XKB, 1, [Define to use XKB]) X11_CFLAGS="$X11_CFLAGS $XKB_CFLAGS" X11_LIBS="$X11_LIBS $XKB_LIBS" - ], []) + ], [:]) ]) AC_SUBST(X11_CFLAGS) -- 2.7.4 From 15140f5a10127ef50c73230b395991efb9ab3219 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Sun, 27 Aug 2017 14:23:38 -0500 Subject: [PATCH 03/16] Update MAINTAINERS Email address for me was old, and Li and Mark haven't been involved for several years now. --- MAINTAINERS | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 96801fc..34024c3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,4 +1 @@ - -Mike Gorse -Li Yuan -Mark Doffman +Mike Gorse -- 2.7.4 From 0cce560e437e39daf04e0dd60b38f6c313c7112a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 31 Aug 2017 17:06:13 +0200 Subject: [PATCH 04/16] Optionally read the dbus address from env var AT_SPI_BUS_ADDRESS This will be used for flatpak to set a custom bus (which is really the bus proxy). It can be used for testing purposes too. For more details, see https://github.com/flatpak/flatpak/issues/79 https://bugzilla.gnome.org/show_bug.cgi?id=787126 --- atspi/atspi-misc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 46d1c11..eebbed4 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -1577,6 +1577,7 @@ atspi_get_a11y_bus (void) { DBusError error; char *address = NULL; + const char *address_env = NULL; if (a11y_bus && dbus_connection_get_is_connected (a11y_bus)) return a11y_bus; @@ -1585,8 +1586,12 @@ atspi_get_a11y_bus (void) if (!dbus_connection_allocate_data_slot (&a11y_dbus_slot)) g_warning ("at-spi: Unable to allocate D-Bus slot"); + address_env = g_getenv ("AT_SPI_BUS_ADDRESS"); + if (address_env != NULL && *address_env != 0) + address = g_strdup (address_env); #ifdef HAVE_X11 - address = get_accessibility_bus_address_x11 (); + if (!address) + address = get_accessibility_bus_address_x11 (); #endif if (!address) address = get_accessibility_bus_address_dbus (); -- 2.7.4 From 774a363203dfaa6212295c9da29feba64dc29823 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Mon, 4 Sep 2017 17:29:05 -0500 Subject: [PATCH 05/16] 2.25.92 --- NEWS | 7 +++++++ configure.ac | 2 +- meson.build | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 96750d3..959ade0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +What's new in at-spi2-core 2.25.92: + +* configure.ac: make xkb optional, as intended. + +* Optionally read the bus address from the ATSPI_BUS_ADDRESS environment + variable (bgo#787126). + What's new in at-spi2-core 2.25.91: * Meson builds should now be usable. diff --git a/configure.ac b/configure.ac index bf3450a..2434972 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([at-spi2-core], [2.25.91], [accessibility-atspi@lists.linux-foundation.org]) +AC_INIT([at-spi2-core], [2.25.92], [accessibility-atspi@lists.linux-foundation.org]) AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) diff --git a/meson.build b/meson.build index c8f6951..72f9b87 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('at-spi2-core', 'c', - version: '2.25.91', + version: '2.25.92', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', -- 2.7.4 From ff911c5dcb5553605b7fa83cae5494de1407ce33 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Mon, 11 Sep 2017 14:24:08 -0500 Subject: [PATCH 06/16] 2.26.0 --- configure.ac | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 2434972..8c4fca2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([at-spi2-core], [2.25.92], [accessibility-atspi@lists.linux-foundation.org]) +AC_INIT([at-spi2-core], [2.26.0], [accessibility-atspi@lists.linux-foundation.org]) AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) diff --git a/meson.build b/meson.build index 72f9b87..abd4c7c 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('at-spi2-core', 'c', - version: '2.25.92', + version: '2.26.0', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', -- 2.7.4 From 23eef2559fe0e0e625cba7a47c07516fae05e23c Mon Sep 17 00:00:00 2001 From: hanniedu Date: Tue, 12 Sep 2017 11:18:40 +0200 Subject: [PATCH 07/16] Updated Dutch translation Master 3.26 --- po/nl.po | 125 +++++++++++++++++++++++++++------------------------------------ 1 file changed, 54 insertions(+), 71 deletions(-) diff --git a/po/nl.po b/po/nl.po index 3742114..0fe1fa6 100644 --- a/po/nl.po +++ b/po/nl.po @@ -10,94 +10,77 @@ msgid "" msgstr "" "Project-Id-Version: at-spi2-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-19 16:41+0100\n" -"PO-Revision-Date: 2011-03-19 16:33+0100\n" -"Last-Translator: Wouter Bolsterlee \n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=at-" +"spi&keywords=I18N+L10N&component=at-spi2-core\n" +"POT-Creation-Date: 2017-09-04 22:34+0000\n" +"PO-Revision-Date: 2015-05-26 17:44+0100\n" +"Last-Translator: Nathan Follens \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.5.4\n" -#: ../atspi/atspi-misc.c:291 -#, c-format -msgid "AT-SPI: Unknown signature %s for RemoveAccessible" -msgstr "AT-SPI: onbekende signature ‘%s’ voor RemoveAccessible" +#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 +msgid "The application no longer exists" +msgstr "De toepassing bestaat niet meer" -#: ../atspi/atspi-misc.c:328 -#, c-format -msgid "AT-SPI: Error calling getRoot for %s: %s" -msgstr "AT-SPI: Fout bij aanroep van getRoot voor %s: %s" +#: atspi/atspi-misc.c:1850 +msgid "Attempted synchronous call where prohibited" +msgstr "Synchrone oproep geprobeerd waar verboden" -#: ../atspi/atspi-misc.c:486 -#, c-format -msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" -msgstr "AT-SPI: Fout in GetItems, sender=%s, error=%s" +#~ msgid "AT-SPI: Unknown signature %s for RemoveAccessible" +#~ msgstr "AT-SPI: onbekende signature ‘%s’ voor RemoveAccessible" -#: ../atspi/atspi-misc.c:588 -#, c-format -msgid "" -"AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " -"signature %s" -msgstr "" -"AT-SPI: _atspi_dbus_return_accessible_from_message aangeroepen met vreemde " -"signature %s" +#~ msgid "AT-SPI: Error calling getRoot for %s: %s" +#~ msgstr "AT-SPI: Fout bij aanroep van getRoot voor %s: %s" -#: ../atspi/atspi-misc.c:617 -#, c-format -msgid "" -"AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " -"signature %s" -msgstr "" -"AT-SPI: _atspi_dbus_return_hyperlink_from_message aangeroepen met vreemde " -"signature %s" +#~ msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" +#~ msgstr "AT-SPI: Fout in GetItems, sender=%s, error=%s" -#: ../atspi/atspi-misc.c:642 -#, c-format -msgid "AT-SPI: AddAccessible with unknown signature %s\n" -msgstr "AT-SPI: AddAccessible met onbekende signature %s\n" +#~ msgid "" +#~ "AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " +#~ "signature %s" +#~ msgstr "" +#~ "AT-SPI: _atspi_dbus_return_accessible_from_message aangeroepen met " +#~ "vreemde signature %s" -#: ../atspi/atspi-misc.c:935 ../atspi/atspi-misc.c:986 -#: ../atspi/atspi-misc.c:1027 -msgid "The application no longer exists" -msgstr "De toepassing bestaat niet meer" +#~ msgid "" +#~ "AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " +#~ "signature %s" +#~ msgstr "" +#~ "AT-SPI: _atspi_dbus_return_hyperlink_from_message aangeroepen met vreemde " +#~ "signature %s" -#: ../atspi/atspi-misc.c:1063 -#, c-format -msgid "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" -msgstr "" -"AT-SPI: een variant verwacht bij opvragen van %s van interface %s; %s " -"verkregen\n" +#~ msgid "AT-SPI: AddAccessible with unknown signature %s\n" +#~ msgstr "AT-SPI: AddAccessible met onbekende signature %s\n" -#: ../atspi/atspi-misc.c:1069 -#, c-format -msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" -msgstr "atspi_dbus_get_property: Verkeerde type: %s verwacht, %c verkregen\n" +#~ msgid "" +#~ "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" +#~ msgstr "" +#~ "AT-SPI: een variant verwacht bij opvragen van %s van interface %s; %s " +#~ "verkregen\n" -#: ../atspi/atspi-misc.c:1212 -#, c-format -msgid "AT-SPI: Unknown interface %s" -msgstr "AT-SPI: Onbekende interface %s" +#~ msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" +#~ msgstr "" +#~ "atspi_dbus_get_property: Verkeerde type: %s verwacht, %c verkregen\n" -#: ../atspi/atspi-misc.c:1232 -#, c-format -msgid "AT-SPI: expected 2 values in states array; got %d\n" -msgstr "AT-SPI: 2 waardes verwacht in ‘states array’, %d verkregen\n" +#~ msgid "AT-SPI: Unknown interface %s" +#~ msgstr "AT-SPI: Onbekende interface %s" -#: ../atspi/atspi-accessible.c:997 -msgid "Streamable content not implemented" -msgstr "‘Streamable content’ niet geïmplementeerd" +#~ msgid "AT-SPI: expected 2 values in states array; got %d\n" +#~ msgstr "AT-SPI: 2 waardes verwacht in ‘states array’, %d verkregen\n" -#: ../atspi/atspi-event-listener.c:510 -msgid "" -"called atspi_event_listener_register_from_callback with a NULL event_type" -msgstr "" -"atspi_event_listener_register_from_callback aangeroepn met een NULL " -"event_type" +#~ msgid "Streamable content not implemented" +#~ msgstr "‘Streamable content’ niet geïmplementeerd" + +#~ msgid "" +#~ "called atspi_event_listener_register_from_callback with a NULL event_type" +#~ msgstr "" +#~ "atspi_event_listener_register_from_callback aangeroepn met een NULL " +#~ "event_type" -#: ../atspi/atspi-event-listener.c:777 -#, c-format -msgid "Got invalid signature %s for signal %s from interface %s\n" -msgstr "Ongeldige signature %s ontvangen voor signaal %s van interface %s\n" +#~ msgid "Got invalid signature %s for signal %s from interface %s\n" +#~ msgstr "Ongeldige signature %s ontvangen voor signaal %s van interface %s\n" -- 2.7.4 From 57ae8d6e0e518151e5e4b87cc8703ce60f46f1e5 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Thu, 28 Sep 2017 14:32:00 -0500 Subject: [PATCH 08/16] Remove dependency on libxkbcommon Currently, no functions in libxkbcommon are used, so the dependency is spurious. Instead, check for XkbGetMap in -lX11. https://bugzilla.gnome.org/show_bug.cgi?id=787756 --- configure.ac | 4 +--- meson.build | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 8c4fca2..850f808 100644 --- a/configure.ac +++ b/configure.ac @@ -107,10 +107,8 @@ AS_IF([test "x$enable_x11" = xno], [ X11_LIBS="$X11_LIBS $XINPUT_LIBS" # XKB (optional) - PKG_CHECK_MODULES(XKB, [xkbcommon-x11], [ + AC_CHECK_LIB(X11, XkbGetMap, [ AC_DEFINE(HAVE_XKB, 1, [Define to use XKB]) - X11_CFLAGS="$X11_CFLAGS $XKB_CFLAGS" - X11_LIBS="$X11_LIBS $XKB_LIBS" ], [:]) ]) diff --git a/meson.build b/meson.build index abd4c7c..e746e14 100644 --- a/meson.build +++ b/meson.build @@ -62,9 +62,7 @@ if x11_dep.found() xtest_dep = dependency('xtst') x11_deps += xtest_dep - xkb_dep = dependency('xkbcommon-x11', required: false) - if xkb_dep.found() - x11_deps += xkb_dep + if cc.has_function('XkbGetMap', dependencies: x11_deps) at_spi_conf.set('HAVE_XKB', 1) endif -- 2.7.4 From 5811e35fedbdf7124872b6ffb76ae0bfa851bef2 Mon Sep 17 00:00:00 2001 From: Xavi Ivars Date: Thu, 5 Oct 2017 13:29:22 +0200 Subject: [PATCH 09/16] [l10n] Updated Catalan (Valencian) translation --- po/ca@valencia.po | 115 +++++------------------------------------------------- 1 file changed, 10 insertions(+), 105 deletions(-) diff --git a/po/ca@valencia.po b/po/ca@valencia.po index fc877bc..ca0b97f 100644 --- a/po/ca@valencia.po +++ b/po/ca@valencia.po @@ -6,116 +6,21 @@ msgid "" msgstr "" "Project-Id-Version: at-spi2-core master\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-29 13:57+0200\n" -"PO-Revision-Date: 2011-04-02 20:16+0200\n" -"Last-Translator: David Planella \n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=at-" +"spi&keywords=I18N+L10N&component=at-spi2-core\n" +"POT-Creation-Date: 2017-06-27 21:34+0000\n" +"PO-Revision-Date: 2014-03-15 21:31+0100\n" +"Last-Translator: Xavi Ivars \n" "Language-Team: Catalan \n" -"Language: ca@valencia\n" +"Language: ca-valencia\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../atspi/atspi-misc.c:290 -#, c-format -msgid "AT-SPI: Unknown signature %s for RemoveAccessible" -msgstr "AT-SPI: es desconeix la signatura %s per RemoveAccessible" - -#: ../atspi/atspi-misc.c:327 -#, c-format -msgid "AT-SPI: Error calling getRoot for %s: %s" -msgstr "AT-SPI: s'ha produït un error en cridar getRoot per %s: %s" - -#: ../atspi/atspi-misc.c:485 -#, c-format -msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" -msgstr "AT-SPI: s'ha produït un error a GetItems, remitent=%s, error=%s" - -#: ../atspi/atspi-misc.c:587 -#, c-format -msgid "" -"AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " -"signature %s" -msgstr "" -"AT-SPI: s'ha cridat _atspi_dbus_return_accessible_from_message amb una " -"signatura estranya: %s" - -#: ../atspi/atspi-misc.c:616 -#, c-format -msgid "" -"AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " -"signature %s" -msgstr "" -"AT-SPI: s'ha cridat _atspi_dbus_return_hyperlink_from_message amb una " -"signatura estranya: %s" - -#: ../atspi/atspi-misc.c:641 -#, c-format -msgid "AT-SPI: AddAccessible with unknown signature %s\n" -msgstr "AT-SPI: AddAccessible té una signatura desconeguda: %s\n" - -#: ../atspi/atspi-misc.c:934 ../atspi/atspi-misc.c:985 -#: ../atspi/atspi-misc.c:1026 +#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 msgid "The application no longer exists" msgstr "L'aplicació ja no existeix" -#: ../atspi/atspi-misc.c:1062 -#, c-format -msgid "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" -msgstr "" -"AT-SPI: s'esperava una variant en recollir %s a la interfície %s, però s'ha " -"obtingut %s\n" - -#: ../atspi/atspi-misc.c:1068 -#, c-format -msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" -msgstr "" -"atspi_dbus_get_property: tipus incorrecte: s'esperava un %s, però s'ha " -"obtingut un %c\n" - -#: ../atspi/atspi-misc.c:1211 -#, c-format -msgid "AT-SPI: Unknown interface %s" -msgstr "AT-SPI: interfície desconeguda %s" - -#: ../atspi/atspi-misc.c:1231 -#, c-format -msgid "AT-SPI: expected 2 values in states array; got %d\n" -msgstr "" -"AT-SPI: s'esperaven 2 valors a la matriu d'estats, però se n'han obtingut " -"%d\n" - -#: ../atspi/atspi-accessible.c:1035 -msgid "Streamable content not implemented" -msgstr "No s'ha implementat el contingut en flux" - -#: ../atspi/atspi-event-listener.c:510 -msgid "" -"called atspi_event_listener_register_from_callback with a NULL event_type" -msgstr "" -"s'ha cridat la funció «atspi_event_listener_register_from_callback» amb un " -"«event_type» nul" - -#: ../atspi/atspi-event-listener.c:777 -#, c-format -msgid "Got invalid signature %s for signal %s from interface %s\n" -msgstr "" -"S'ha obtingut una signatura no vàlida (%s) per al senyal %s de la interfície " -"%s\n" - -#~ msgid "AT-SPI: Could not get the display\n" -#~ msgstr "AT-SPI: no s'ha pogut obtenir la pantalla\n" - -#~ msgid "AT-SPI: Accessibility bus not found - Using session bus.\n" -#~ msgstr "" -#~ "AT-SPI: no s'ha trobat el bus d'accessibilitat - s'utilitzarà el bus de " -#~ "la sessió.\n" - -#~ msgid "AT-SPI: Couldn't connect to bus: %s\n" -#~ msgstr "AT-SPI: no s'ha pogut connectar al bus: %s\n" - -#~ msgid "AT-SPI: Couldn't register with bus: %s\n" -#~ msgstr "AT-SPI: no s'ha pogut registrar al bus: %s\n" - -#~ msgid "AT-SPI: Got error: %s\n" -#~ msgstr "AT-SPI: s'ha obtingut l'error: %s\n" +#: atspi/atspi-misc.c:1843 +msgid "Attempted synchronous call where prohibited" +msgstr "S'ha intentat una crida síncrona on és prohibit" -- 2.7.4 From 70705839990f8eb5112b0262bb0960e806c62fbc Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Mon, 23 Oct 2017 20:21:57 -0500 Subject: [PATCH 10/16] meson: x11 fixes Meson wasn't defining HAVE_X11, so x11 support wasn't being compiled even if X was determined to be present. Also, add an enable-x11 option (default is to auto-detect). --- atspi/meson.build | 2 +- bus/meson.build | 2 +- meson.build | 28 ++++++++++++++++------------ meson_options.txt | 2 ++ registryd/meson.build | 19 +++++++++++-------- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/atspi/meson.build b/atspi/meson.build index 1ec3ecd..327134a 100644 --- a/atspi/meson.build +++ b/atspi/meson.build @@ -69,7 +69,7 @@ atspi_enum_h = atspi_enums[1] atspi = shared_library('atspi', atspi_sources + atspi_enums, include_directories: [ root_inc, registryd_inc ], - dependencies: [ libdbus_dep, gobject_dep, dbind_dep ], + dependencies: [ libdbus_dep, gobject_dep, dbind_dep, x11_deps ], install: true) atspi_dep = declare_dependency(link_with: atspi, diff --git a/bus/meson.build b/bus/meson.build index 8e4673f..909103c 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -45,7 +45,7 @@ endif executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c', include_directories: [ root_inc, include_directories('.') ], - dependencies: [ gio_dep ], + dependencies: [ gio_dep, x11_deps ], c_args: [ '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir), '-DDATADIR="@0@"'.format(atspi_datadir), diff --git a/meson.build b/meson.build index e746e14..4eac857 100644 --- a/meson.build +++ b/meson.build @@ -53,21 +53,25 @@ glib_dep = dependency('glib-2.0', version: glib_req_version) gobject_dep = dependency('gobject-2.0', version: gobject_req_version) gio_dep = dependency('gio-2.0', version: gio_req_version) dl_dep = cc.find_library('dl', required: false) -x11_dep = dependency('x11', required: false) x11_deps = [] -if x11_dep.found() - x11_deps += x11_dep - - xtest_dep = dependency('xtst') - x11_deps += xtest_dep - - if cc.has_function('XkbGetMap', dependencies: x11_deps) - at_spi_conf.set('HAVE_XKB', 1) +x11_option = get_option('enable-x11') +if x11_option != 'no' + x11_dep = dependency('x11', required: false) + + if x11_dep.found() + x11_deps += x11_dep + at_spi_conf.set('HAVE_X11', 1) + xtest_dep = dependency('xtst') + x11_deps += xtest_dep + + if cc.has_function('XkbGetMap', dependencies: x11_deps) + at_spi_conf.set('HAVE_XKB', 1) + endif + + xinput_dep = dependency('xi') + x11_deps += xinput_dep endif - - xinput_dep = dependency('xi') - x11_deps += xinput_dep endif # Alignments diff --git a/meson_options.txt b/meson_options.txt index 305fc8c..c9afe2f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,3 +16,5 @@ option('enable_docs', value: false) option('enable-introspection', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable GObject Introspection (depends on GObject)') + +option('enable-x11', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable X11 support') diff --git a/registryd/meson.build b/registryd/meson.build index 5de6902..eb8236e 100644 --- a/registryd/meson.build +++ b/registryd/meson.build @@ -16,15 +16,18 @@ registryd_deps = [ dl_dep, ] -if x11_dep.found() - registryd_sources += [ - 'deviceeventcontroller-x11.c', - 'display.c', - 'event-source.c', - 'ucs2keysym.c', - ] +x11_option = get_option('enable-x11') +if x11_option != 'no' + if x11_dep.found() + registryd_sources += [ + 'deviceeventcontroller-x11.c', + 'display.c', + 'event-source.c', + 'ucs2keysym.c', + ] - registryd_deps += x11_deps + registryd_deps += x11_deps + endif endif executable('at-spi2-registryd', registryd_sources, -- 2.7.4 From e1d5412b33463fd2f45dea400c45b107d0c78f42 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Sun, 10 Sep 2017 09:23:13 +0200 Subject: [PATCH 11/16] meson: Actually use the soversion --- atspi/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/atspi/meson.build b/atspi/meson.build index 327134a..ea48ddb 100644 --- a/atspi/meson.build +++ b/atspi/meson.build @@ -68,6 +68,8 @@ atspi_enums = gnome.mkenums('atspi-enum-types', atspi_enum_h = atspi_enums[1] atspi = shared_library('atspi', atspi_sources + atspi_enums, + version: soversion.split('.')[0], + soversion: soversion, include_directories: [ root_inc, registryd_inc ], dependencies: [ libdbus_dep, gobject_dep, dbind_dep, x11_deps ], install: true) -- 2.7.4 From 832febae6759636ce7abf98a93738d60a9726a3b Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Mon, 30 Oct 2017 11:37:56 -0500 Subject: [PATCH 12/16] 2.26.1 --- NEWS | 8 ++++++++ configure.ac | 2 +- meson.build | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 959ade0..0abf5f2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +What's new in at-spi2-core 2.26.1: + +* Remove unused dependency on libxkbcommon. + +* Various meson build fixes. + +* Updated Dutch and Catalan translations. + What's new in at-spi2-core 2.25.92: * configure.ac: make xkb optional, as intended. diff --git a/configure.ac b/configure.ac index 850f808..a84dcbd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([at-spi2-core], [2.26.0], [accessibility-atspi@lists.linux-foundation.org]) +AC_INIT([at-spi2-core], [2.26.1], [accessibility-atspi@lists.linux-foundation.org]) AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) diff --git a/meson.build b/meson.build index 4eac857..0cfdbef 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('at-spi2-core', 'c', - version: '2.26.0', + version: '2.26.1', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', -- 2.7.4 From 70280c8010a04900fc0f9f67d08fc9464b639615 Mon Sep 17 00:00:00 2001 From: Radoslaw Cybulski Date: Wed, 23 Jan 2019 15:38:41 +0100 Subject: [PATCH 13/16] 2.31.1 Change-Id: I5608051794e244fbcec00fbfafb9a6d71f485254 --- Makefile.am | 31 ----- NEWS | 37 +++++ atspi-2.pc.in | 11 -- atspi/Makefile.am | 160 ---------------------- atspi/atspi-collection.c | 4 +- atspi/atspi-component.c | 57 ++++++++ atspi/atspi-component.h | 4 + atspi/atspi-constants.h | 240 +++++++++++++++++++-------------- atspi/atspi-device-listener.c | 6 +- atspi/atspi-enum-types.c.template | 2 +- atspi/atspi-enum-types.h.template | 2 +- atspi/atspi-event-listener.c | 6 +- atspi/atspi-gmain.c | 18 +-- atspi/atspi-matchrule.c | 2 +- atspi/atspi-misc-private.h | 2 +- atspi/atspi-misc.c | 8 +- atspi/atspi-registry.c | 7 +- atspi/meson.build | 19 ++- autogen.sh | 18 --- bus/Makefile.am | 48 ------- bus/at-spi-bus-launcher.c | 237 ++++++++++++++++++++++++-------- bus/meson.build | 32 ++++- configure.ac | 188 -------------------------- dbind/Makefile.am | 27 ---- dbind/dbtest.c | 8 +- dbind/meson.build | 10 +- doc/Makefile.am | 4 - doc/libatspi/libatspi-docs.sgml | 2 - doc/libatspi/libatspi-sections.txt | 209 +++++++++++++++++++--------- doc/libatspi/tmpl/atspi-constants.sgml | 23 ++++ idl/component.didl | 41 +++++- idl/controller.didl | 4 +- meson.build | 18 +-- meson_options.txt | 9 ++ po/Makevars | 78 ----------- po/fr.po | 22 +-- registryd/Makefile.am | 68 ---------- registryd/de-types.h | 2 + registryd/deviceeventcontroller-x11.c | 16 ++- registryd/deviceeventcontroller.c | 6 + registryd/reentrant-list.c | 2 +- test/Makefile.am | 10 -- xml/Component.xml | 10 ++ xml/Makefile.am | 41 ------ 44 files changed, 761 insertions(+), 988 deletions(-) delete mode 100644 Makefile.am delete mode 100644 atspi-2.pc.in delete mode 100644 atspi/Makefile.am delete mode 100755 autogen.sh delete mode 100644 bus/Makefile.am delete mode 100644 configure.ac delete mode 100644 dbind/Makefile.am delete mode 100644 doc/Makefile.am delete mode 100644 po/Makevars delete mode 100644 registryd/Makefile.am delete mode 100644 test/Makefile.am delete mode 100644 xml/Makefile.am diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index dff484a..0000000 --- a/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -DISTCHECK_CONFIGURE_FLAGS = --enable-introspection --enable-gtk-doc - --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) -INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) - -SUBDIRS = po dbind xml atspi bus registryd doc test - -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - -EXTRA_DIST = \ - atspi-2.pc.in \ - meson.build \ - meson_options.txt - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = atspi-2.pc - -DISTCLEANFILES = \ - atspi-2.pc - -MAINTAINERCLEANFILES = \ - $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ - $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ - $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \ - gtk-doc.make \ - m4/gtk-doc.m4 \ - m4/intltool.m4 - --include $(top_srcdir)/git.mk diff --git a/NEWS b/NEWS index 0abf5f2..0dd86dc 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,40 @@ +What's new in at-spi2-core 2.31.1: + +* Bus launcher: fix an issue where the error wasn't cleared on failure. + +* Add support for locking/unlocking modifiers. + +* Update error log text for consistency. + +* Documentation clean-ups. + +What's new in at-spi2-core 2.29.1: + +* Add dbus-broker support to bus launcher. + +* Add ScrollTo and ScrollToPoint component interfaces. + +* Do not use deprecated GSettings API + +* Fix various compiler warnings and documentation annotations. + +What's new in at-spi2-core 2.27.92: + +* Support building a static library (bgo#793652). +\ +* Fix build on FreeBSD (bgo#791608). + +What's new in at-spi2-core 2.27.1: + +* Dropped autotools support. + +* documentation: Remove list association from + ATSPI_ROLE_DESCRIPTION_{TERM,VALUE} (bgo#791021). + +* Fix a potential buffer overflow in at-spi-bus-launcher (bgo#791124). + +* Make the build reproducible (bgo#791167). + What's new in at-spi2-core 2.26.1: * Remove unused dependency on libxkbcommon. diff --git a/atspi-2.pc.in b/atspi-2.pc.in deleted file mode 100644 index 71d028a..0000000 --- a/atspi-2.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: atspi -Description: Accessibility Technology software library -Requires: dbus-1 glib-2.0 -Version: @VERSION@ -Libs: -L${libdir} -latspi -Cflags: -I${includedir}/at-spi-2.0 diff --git a/atspi/Makefile.am b/atspi/Makefile.am deleted file mode 100644 index 636cc76..0000000 --- a/atspi/Makefile.am +++ /dev/null @@ -1,160 +0,0 @@ -lib_LTLIBRARIES = - -BUILT_SOURCES = - -CLEANFILES = -DISTCLEANFILES = -EXTRA_DIST = \ - meson.build - -lib_LTLIBRARIES += libatspi.la - -libatspi_la_LDFLAGS = \ - @LDFLAGS@ @LT_VERSION_INFO@ @LIBTOOL_EXPORT_OPTIONS@ \ - -no-undefined - -libatspi_la_CFLAGS = \ - $(DBUS_CFLAGS) \ - $(DBIND_CFLAGS) \ - $(GLIB_CFLAGS) \ - -I$(top_srcdir)/registryd \ - -I$(top_builddir)/registryd \ - -I$(top_builddir) \ - -I$(top_srcdir) - -libatspi_la_LIBADD = \ - $(DBUS_LIBS) \ - $(GOBJ_LIBS) \ - $(X11_LIBS) \ - $(top_builddir)/dbind/libdbind.la - -libatspi_la_DEPENDENCIES = $(top_builddir)/dbind/libdbind.la - -atspi_headers = \ - atspi.h \ - atspi-accessible.h \ - atspi-action.h \ - atspi-application.h \ - atspi-collection.h \ - atspi-component.h \ - atspi-constants.h \ - atspi-device-listener.h \ - atspi-device-listener-private.h \ - atspi-document.h \ - atspi-editabletext.h \ - atspi-event-listener.h \ - atspi-event-listener-private.h \ - atspi-gmain.h \ - atspi-hyperlink.h \ - atspi-hypertext.h \ - atspi-image.h \ - atspi-matchrule.h \ - atspi-misc.h \ - atspi-object.h \ - atspi-private.h \ - atspi-registry.h \ - atspi-relation.h \ - atspi-selection.h \ - atspi-stateset.h \ - atspi-table.h \ - atspi-table-cell.h \ - atspi-text.h \ - atspi-types.h \ - atspi-value.h - -libatspi_la_SOURCES = \ - $(BUILT_SOURCES) \ - atspi-accessible.c \ - atspi-accessible-private.h \ - atspi-action.c \ - atspi-application.c \ - atspi-collection.c \ - atspi-component.c \ - atspi-device-listener.c \ - atspi-device-listener-private.h \ - atspi-document.c \ - atspi-editabletext.c \ - atspi-event-listener.c \ - atspi-event-listener-private.h \ - atspi-gmain.c \ - atspi-hyperlink.c \ - atspi-hypertext.c \ - atspi-image.c \ - atspi-matchrule.c \ - atspi-matchrule-private.h \ - atspi-misc.c \ - atspi-misc-private.h \ - atspi-object.c \ - atspi-private.h \ - atspi-registry.c \ - atspi-relation.c \ - atspi-selection.c \ - atspi-stateset.c \ - atspi-table.c \ - atspi-table-cell.c \ - atspi-text.c \ - atspi-value.c \ - $() - -BUILT_SOURCES += \ - atspi-enum-types.c \ - atspi-enum-types.h - -libatspiincludedir = $(includedir)/at-spi-2.0/atspi -libatspiinclude_HEADERS = $(atspi_headers) atspi-enum-types.h - -#CLEANFILES = atspi-constants.h - -#atspi-constants.h: $(top_srcdir)/xml/spec.xml $(top_srcdir)/tools/c-constants-gen.py -# python $(top_srcdir)/tools/c-constants-gen.py Atspi $(top_srcdir)/xml/spec.xml atspi-constants - -ENUM_TYPES = \ - atspi-constants.h \ - atspi-types.h - -atspi-enum-types.h: atspi-enum-types.h.template $(ENUM_TYPES) - $(AM_V_GEN) $(GLIB_MKENUMS) --template $(srcdir)/atspi-enum-types.h.template $(addprefix $(srcdir)/, $(ENUM_TYPES)) > $@.tmp \ - && (cmp -s $@.tmp $@ || cp -f $@.tmp $@) \ - && rm -f $@.tmp - -atspi-enum-types.c: atspi-enum-types.c.template $(ENUM_TYPES) - $(AM_V_GEN) $(GLIB_MKENUMS) --template $(srcdir)/atspi-enum-types.c.template $(addprefix $(srcdir)/, $(ENUM_TYPES)) > $@.tmp \ - && (cmp -s $@.tmp $@ || cp -f $@.tmp $@) \ - && rm -f $@.tmp - -CLEANFILES += \ - atspi-enum-types.c \ - atspi-enum-types.h - -EXTRA_DIST += \ - atspi-enum-types.c.template \ - atspi-enum-types.h.template - --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all -INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) - -if HAVE_INTROSPECTION -Atspi-2.0.gir: libatspi.la -Atspi_2_0_gir_INCLUDES = DBus-1.0 GLib-2.0 GObject-2.0 -Atspi_2_0_gir_EXPORT_PACKAGES = atspi-2 -Atspi_2_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) -Atspi_2_0_gir_LIBS = libatspi.la $(top_builddir)/dbind/libdbind.la -Atspi_2_0_gir_FILES = $(libatspi_la_SOURCES) $(atspi_headers) atspi-enum-types.c atspi-enum-types.h -Atspi_2_0_gir_SCANNERFLAGS = --namespace Atspi --nsversion=2.0 -INTROSPECTION_SCANNER_ARGS += --c-include='atspi/atspi.h' -INTROSPECTION_GIRS += Atspi-2.0.gir - -girdir = $(datadir)/gir-1.0 -gir_DATA = $(INTROSPECTION_GIRS) - -typelibdir = $(libdir)/girepository-1.0 -typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) - -CLEANFILES += \ - $(gir_DATA) \ - $(typelib_DATA) -endif - --include $(top_srcdir)/git.mk diff --git a/atspi/atspi-collection.c b/atspi/atspi-collection.c index f4e33ef..d3f27da 100644 --- a/atspi/atspi-collection.c +++ b/atspi/atspi-collection.c @@ -36,7 +36,7 @@ atspi_collection_is_ancestor_of (AtspiCollection *collection, AtspiAccessible *test, GError **error) { - g_warning ("Atspi: TODO: Implement is_ancestor_of"); + g_warning ("AT-SPI: TODO: Implement is_ancestor_of"); return FALSE; } @@ -267,7 +267,7 @@ atspi_collection_get_matches_from (AtspiCollection *collection, AtspiAccessible * atspi_collection_get_active_descendant (AtspiCollection *collection, GError **error) { - g_warning ("atspi: TODO: Implement get_active_descendants"); + g_warning ("AT-SPI: TODO: Implement get_active_descendants"); return NULL; } diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index 0ab552b..ed22582 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -412,6 +412,63 @@ atspi_component_set_size (AtspiComponent *obj, return ret; } +/** + * atspi_component_scroll_to: + * @obj: a pointer to the #AtspiComponent object on which to operate. + * @type: a #AtspiScrollType indicating where the object should be placed on the + * screen. + * + * Scrolls whatever container of the #AtspiComponent object so it becomes + * visible on the screen. + * + * Returns: #TRUE if successful, #FALSE otherwise. + **/ +gboolean +atspi_component_scroll_to (AtspiComponent *obj, + AtspiScrollType type, + GError **error) +{ + dbus_bool_t retval = FALSE; + + g_return_val_if_fail (obj != NULL, FALSE); + + _atspi_dbus_call (obj, atspi_interface_component, + "ScrollTo", error, "u=>b", type, &retval); + + return retval; +} + +/** + * atspi_component_scroll_to_point: + * @obj: a pointer to the #AtspiComponent object on which to operate. + * @coords: a #AtspiCoordType indicating whether the coordinates are relative to + * the screen, to the window, or to the parent object. + * @x: the x coordinate of the point to reach + * @y: the y coordinate of the point to reach + * @error: return location for a #GError + * + * Scrolls whatever container of the #AtspiComponent object so it becomes + * visible on the screen at a given position. + * + * Returns: #TRUE if successful, #FALSE otherwise. + **/ +gboolean +atspi_component_scroll_to_point (AtspiComponent *obj, + AtspiCoordType coords, + gint x, + gint y, + GError **error) +{ + dbus_bool_t retval = FALSE; + + g_return_val_if_fail (obj != NULL, FALSE); + + _atspi_dbus_call (obj, atspi_interface_component, + "ScrollToPoint", error, "uii=>b", coords, x, y, &retval); + + return retval; +} + static void atspi_component_base_init (AtspiComponent *klass) { diff --git a/atspi/atspi-component.h b/atspi/atspi-component.h index dd3455a..c84232d 100644 --- a/atspi/atspi-component.h +++ b/atspi/atspi-component.h @@ -107,6 +107,10 @@ gboolean atspi_component_set_position (AtspiComponent *obj, gint x, gint y, Atsp gboolean atspi_component_set_size (AtspiComponent *obj, gint width, gint height, GError **error); +gboolean atspi_component_scroll_to (AtspiComponent *obj, AtspiScrollType type, GError **error); + +gboolean atspi_component_scroll_to_point (AtspiComponent *obj, AtspiCoordType coords, gint x, gint y, GError **error); + G_END_DECLS #endif /* _ATSPI_COMPONENT_H_ */ diff --git a/atspi/atspi-constants.h b/atspi/atspi-constants.h index 1af391d..b9f41ef 100644 --- a/atspi/atspi-constants.h +++ b/atspi/atspi-constants.h @@ -53,6 +53,8 @@ Accessibility::StateType\n Accessibility::Event\n Accessibility::EventDetails \n + Accessibility::ScrollType \n + Accessibility::CoordType \n \section Registry Accessibility also includes Accessibility::Registry, @@ -124,8 +126,10 @@ typedef enum { /** * AtspiCoordType: * @ATSPI_COORD_TYPE_SCREEN: Specifies xy coordinates relative to the screen. - * @ATSPI_COORD_TYPE_WINDOW: Specifies xy coordinates relative to the widget's + * @ATSPI_COORD_TYPE_WINDOW: Specifies xy coordinates relative to the widget's * top-level window. + * @ATSPI_COORD_TYPE_PARENT: Specifies xy coordinates relative to the widget's + * immediate parent. * * Enumeration used by #AtspiComponent, #AtspiImage, and #AtspiText interfaces * to specify whether coordinates are relative to the window or the screen. @@ -134,6 +138,7 @@ typedef enum { typedef enum { ATSPI_COORD_TYPE_SCREEN, ATSPI_COORD_TYPE_WINDOW, + ATSPI_COORD_TYPE_PARENT, } AtspiCoordType; /** @@ -141,18 +146,20 @@ typedef enum { * * One higher than the highest valid value of #AtspiCoordType. **/ -#define ATSPI_COORD_TYPE_COUNT (1+1) +#define ATSPI_COORD_TYPE_COUNT (2+1) /** * AtspiCollectionSortOrder: - * @ATSPI_Collection_SORT_ORDER_INVALID: - * @ATSPI_Collection_SORT_ORDER_CANONICAL: - * @ATSPI_Collection_SORT_ORDER_FLOW: - * @ATSPI_Collection_SORT_ORDER_TAB: - * @ATSPI_Collection_SORT_ORDER_REVERSE_CANONICAL: - * @ATSPI_Collection_SORT_ORDER_REVERSE_FLOW: - * @ATSPI_Collection_SORT_ORDER_REVERSE_TAB: - * @ATSPI_Collection_SORT_ORDER_LAST_DEFINED: + * @ATSPI_Collection_SORT_ORDER_INVALID: Invalid sort order + * @ATSPI_Collection_SORT_ORDER_CANONICAL: Canonical sort order + * @ATSPI_Collection_SORT_ORDER_FLOW: Flow sort order + * @ATSPI_Collection_SORT_ORDER_TAB: Tab sort order + * @ATSPI_Collection_SORT_ORDER_REVERSE_CANONICAL: Reverse canonical sort order + * @ATSPI_Collection_SORT_ORDER_REVERSE_FLOW: Reverse flow sort order + * @ATSPI_Collection_SORT_ORDER_REVERSE_TAB: Reverse tab sort order + * @ATSPI_Collection_SORT_ORDER_LAST_DEFINED: Used only to determine the end of the + * enumeration. + * * Enumeration used by interface #AtspiCollection to specify * the way #AtspiAccesible objects should be sorted. @@ -178,14 +185,14 @@ typedef enum { /** * AtspiCollectionMatchType: - * @ATSPI_Collection_MATCH_INVALID: Indicates an error condition or + * @ATSPI_Collection_MATCH_INVALID: Indicates an error condition or * uninitialized value. * @ATSPI_Collection_MATCH_ALL: #TRUE if all of the criteria are met. * @ATSPI_Collection_MATCH_ANY: #TRUE if any of the criteria are met. * @ATSPI_Collection_MATCH_NONE: #TRUE if none of the criteria are met. * @ATSPI_Collection_MATCH_EMPTY: Same as @ATSPI_Collection_MATCH_ALL if - * the criteria is non-empty; for empty criteria this rule requires returned - * value to also have empty set. + * the criteria is non-empty; for empty criteria this rule requires returned + * value to also have empty set. * @ATSPI_Collection_MATCH_LAST_DEFINED: Used only to determine the end of the * enumeration. * @@ -211,10 +218,11 @@ typedef enum { /** * AtspiCollectionTreeTraversalType: - * @ATSPI_Collection_TREE_RESTRICT_CHILDREN: - * @ATSPI_Collection_TREE_RESTRICT_SIBLING: - * @ATSPI_Collection_TREE_INORDER: - * @ATSPI_Collection_TREE_LAST_DEFINED: + * @ATSPI_Collection_TREE_RESTRICT_CHILDREN: Restrict children tree traveral + * @ATSPI_Collection_TREE_RESTRICT_SIBLING: Restrict sibling tree traversal + * @ATSPI_Collection_TREE_INORDER: In-order tree traversal. + * @ATSPI_Collection_TREE_LAST_DEFINED: Used only to determine the end of the + * enumeration. * * Enumeration used by interface #AtspiCollection to specify * restrictions on #AtspiAccesible objects to be traversed. @@ -414,7 +422,7 @@ typedef enum { * @ATSPI_STATE_ACTIVE: Indicates a window is currently the active window, or * an object is the active subelement within a container or table. * @ATSPI_STATE_ACTIVE should not be used for objects which have - * @ATSPI_STATE_FOCUSABLE or @ATSPI_STATE_SELECTABLE: Those objects should use + * #ATSPI_STATE_FOCUSABLE or #ATSPI_STATE_SELECTABLE: Those objects should use * @ATSPI_STATE_FOCUSED and @ATSPI_STATE_SELECTED respectively. * @ATSPI_STATE_ACTIVE is a means to indicate that an object which is not * focusable and not selectable is the currently-active item within its @@ -438,8 +446,8 @@ typedef enum { * disclosure of its children. * @ATSPI_STATE_EXPANDED: Indicates this object is expanded. * @ATSPI_STATE_FOCUSABLE: Indicates this object can accept keyboard focus, - * which means all events resulting from typing on the keyboard will - * normally be passed to it when it has focus. + * which means all events resulting from typing on the keyboard will + * normally be passed to it when it has focus. * @ATSPI_STATE_FOCUSED: Indicates this object currently has the keyboard * focus. * @ATSPI_STATE_HAS_TOOLTIP: Indicates that the object has an associated @@ -636,8 +644,8 @@ typedef enum { /** * AtspiKeyEventType: - * @ATSPI_KEY_PRESSED: - * @ATSPI_KEY_RELEASED: + * @ATSPI_KEY_PRESSED: Key press event + * @ATSPI_KEY_RELEASED: Key release event * * Deprecated. Should not be used. * @@ -707,6 +715,8 @@ typedef enum { * subject to the out-of-keymap limitations described for * @ATSPI_KEY_SYM. In practice this limitation primarily effects * Chinese and Japanese locales. + * @ATSPI_KEY_LOCKMODIFIERS: Emulates locking a set of modifiers. + * @ATSPI_KEY_UNLOCKMODIFIERS: Emulates unlocking a set of modifiers. * * Enumeration used when synthesizing keyboard input via * #atspi_generate_keyboard_event. @@ -718,6 +728,8 @@ typedef enum { ATSPI_KEY_PRESSRELEASE, ATSPI_KEY_SYM, ATSPI_KEY_STRING, + ATSPI_KEY_LOCKMODIFIERS, + ATSPI_KEY_UNLOCKMODIFIERS, } AtspiKeySynthType; /** @@ -864,7 +876,7 @@ typedef enum { * the valuator. Common examples include association of scrollbars with the * viewport or panel which they control. * - * + * * Enumeration used to specify * the type of relation encapsulated in an #AtspiRelation object. * @@ -1154,81 +1166,76 @@ typedef enum { * @ATSPI_ROLE_INFO_BAR: An object designed to present a message to the user * within an existing window. * @ATSPI_ROLE_LEVEL_BAR: A bar that serves as a level indicator to, for - * instance, show the strength of a password or the state of a battery. - * Since: 2.8 - *@ATSPI_ROLE_TITLE_BAR: A bar that serves as the title of a window or a - * dialog. @Since: 2.12 - *@ATSPI_ROLE_BLOCK_QUOTE: An object which contains a text section - * that is quoted from another source. @Since: 2.12 - *@ATSPI_ROLE_AUDIO: An object which represents an audio - * element. @Since: 2.12 - *@ATSPI_ROLE_VIDEO: An object which represents a video - * element. @Since: 2.12 - *@ATSPI_ROLE_DEFINITION: A definition of a term or concept. @Since: 2.12 - *@ATSPI_ROLE_ARTICLE: A section of a page that consists of a - * composition that forms an independent part of a document, page, or - * site. Examples: A blog entry, a news story, a forum post. @Since: - * 2.12 - *@ATSPI_ROLE_LANDMARK: A region of a web page intended as a - * navigational landmark. This is designed to allow Assistive - * Technologies to provide quick navigation among key regions within a - * document. @Since: 2.12 - *@ATSPI_ROLE_LOG: A text widget or container holding log content, such - * as chat history and error logs. In this role there is a - * relationship between the arrival of new items in the log and the - * reading order. The log contains a meaningful sequence and new - * information is added only to the end of the log, not at arbitrary - * points. @Since: 2.12 - *@ATSPI_ROLE_MARQUEE: A container where non-essential information - * changes frequently. Common usages of marquee include stock tickers - * and ad banners. The primary difference between a marquee and a log - * is that logs usually have a meaningful order or sequence of - * important content changes. @Since: 2.12 - *@ATSPI_ROLE_MATH: A text widget or container that holds a mathematical - * expression. @Since: 2.12 - *@ATSPI_ROLE_RATING: A widget whose purpose is to display a rating, - * such as the number of stars associated with a song in a media - * player. Objects of this role should also implement - * AtspiValue. @Since: 2.12 - *@ATSPI_ROLE_TIMER: An object containing a numerical counter which - * indicates an amount of elapsed time from a start point, or the time - * remaining until an end point. @Since: 2.12 - *@ATSPI_ROLE_STATIC: A generic non-container object whose purpose is to display - * a brief amount of information to the user and whose role is known by the - * implementor but lacks semantic value for the user. Examples in which - * @ATSPI_ROLE_STATIC is appropriate include the message displayed in a message - * box and an image used as an alternative means to display text. - * @ATSPI_ROLE_STATIC should not be applied to widgets which are traditionally - * interactive, objects which display a significant amount of content, or any - * object which has an accessible relation pointing to another object. The - * displayed information, as a general rule, should be exposed through the - * accessible name of the object. For labels which describe another widget, see - * @ATSPI_ROLE_LABEL. For text views, see @ATSPI_ROLE_TEXT. For generic - * containers, see @ATSPI_ROLE_PANEL. For objects whose role is not known by the - * implementor, see @ATSPI_ROLE_UNKNOWN. @Since: 2.16. - *@ATSPI_ROLE_MATH_FRACTION: An object that represents a mathematical fraction. - * @Since: 2.16. - *@ATSPI_ROLE_MATH_ROOT: An object that represents a mathematical expression - * displayed with a radical. @Since: 2.16. - *@ATSPI_ROLE_SUBSCRIPT: An object that contains text that is displayed as a - * subscript. @Since: 2.16. - *@ATSPI_ROLE_SUPERSCRIPT: An object that contains text that is displayed as a - * superscript. @Since: 2.16. - *@ATSPI_ROLE_DESCRIPTION_LIST: An object that represents a list of term-value - * groups. A term-value group represents an individual description and consist - * of one or more names (@ATSPI_ROLE_DESCRIPTION_TERM) followed by one or more - * values (@ATSPI_ROLE_DESCRIPTION_VALUE). For each list, there should not be - * more than one group with the same term name. @Since: 2.26. - *@ATSPI_ROLE_DESCRIPTION_TERM: An object that represents the term, or name, - * part of a term-description group in a description list. @Since: 2.26. - *@ATSPI_ROLE_DESCRIPTION_VALUE: An object that represents the description, - * definition, or value of a term-description group in a description list. - * The values within a group are alternatives, meaning that you can have - * several @ATSPI_ROLE_DESCRIPTION_VALUE objects for a given - * @ATSPI_ROLE_DESCRIPTION_TERM. @Since: 2.26. - *@ATSPI_ROLE_FOOTNOTE: An object that contains the text of a footnote. @Since: 2.26. - * @ATSPI_ROLE_LAST_DEFINED: Not a valid role, used for finding end of - * enumeration. + * instance, show the strength of a password or the state of a battery. @Since: 2.8 + * @ATSPI_ROLE_TITLE_BAR: A bar that serves as the title of a window or a + * dialog. @Since: 2.12 + * @ATSPI_ROLE_BLOCK_QUOTE: An object which contains a text section + * that is quoted from another source. @Since: 2.12 + * @ATSPI_ROLE_AUDIO: An object which represents an audio + * element. @Since: 2.12 + * @ATSPI_ROLE_VIDEO: An object which represents a video + * element. @Since: 2.12 + * @ATSPI_ROLE_DEFINITION: A definition of a term or concept. @Since: 2.12 + * @ATSPI_ROLE_ARTICLE: A section of a page that consists of a + * composition that forms an independent part of a document, page, or + * site. Examples: A blog entry, a news story, a forum post. @Since: + * 2.12 + * @ATSPI_ROLE_LANDMARK: A region of a web page intended as a + * navigational landmark. This is designed to allow Assistive + * Technologies to provide quick navigation among key regions within a + * document. @Since: 2.12 + * @ATSPI_ROLE_LOG: A text widget or container holding log content, such + * as chat history and error logs. In this role there is a + * relationship between the arrival of new items in the log and the + * reading order. The log contains a meaningful sequence and new + * information is added only to the end of the log, not at arbitrary + * points. @Since: 2.12 + * @ATSPI_ROLE_MARQUEE: A container where non-essential information + * changes frequently. Common usages of marquee include stock tickers + * and ad banners. The primary difference between a marquee and a log + * is that logs usually have a meaningful order or sequence of + * important content changes. @Since: 2.12 + * @ATSPI_ROLE_MATH: A text widget or container that holds a mathematical + * expression. @Since: 2.12 + * @ATSPI_ROLE_RATING: A widget whose purpose is to display a rating, + * such as the number of stars associated with a song in a media + * player. Objects of this role should also implement + * AtspiValue. @Since: 2.12 + * @ATSPI_ROLE_TIMER: An object containing a numerical counter which + * indicates an amount of elapsed time from a start point, or the time + * remaining until an end point. @Since: 2.12 + * @ATSPI_ROLE_STATIC: A generic non-container object whose purpose is to display + * a brief amount of information to the user and whose role is known by the + * implementor but lacks semantic value for the user. Examples in which + * @ATSPI_ROLE_STATIC is appropriate include the message displayed in a message + * box and an image used as an alternative means to display text. + * @ATSPI_ROLE_STATIC should not be applied to widgets which are traditionally + * interactive, objects which display a significant amount of content, or any + * object which has an accessible relation pointing to another object. The + * displayed information, as a general rule, should be exposed through the + * accessible name of the object. For labels which describe another widget, see + * @ATSPI_ROLE_LABEL. For text views, see @ATSPI_ROLE_TEXT. For generic + * containers, see @ATSPI_ROLE_PANEL. For objects whose role is not known by the + * implementor, see @ATSPI_ROLE_UNKNOWN. @Since: 2.16. + * @ATSPI_ROLE_MATH_FRACTION: An object that represents a mathematical fraction. @Since: 2.16. + * @ATSPI_ROLE_MATH_ROOT: An object that represents a mathematical expression + * displayed with a radical. @Since: 2.16. + * @ATSPI_ROLE_SUBSCRIPT: An object that contains text that is displayed as a + * subscript. @Since: 2.16. + * @ATSPI_ROLE_SUPERSCRIPT: An object that contains text that is displayed as a + * superscript. @Since: 2.16. + * @ATSPI_ROLE_DESCRIPTION_LIST: An object that represents a list of term-value + * groups. A term-value group represents an individual description and consist + * of one or more names (@ATSPI_ROLE_DESCRIPTION_TERM) followed by one or more + * values (@ATSPI_ROLE_DESCRIPTION_VALUE). For each list, there should not be + * more than one group with the same term name. @Since: 2.26. + * @ATSPI_ROLE_DESCRIPTION_TERM: An object that represents a term or phrase + * with a corresponding definition. @Since: 2.26. + * @ATSPI_ROLE_DESCRIPTION_VALUE: An object that represents the description, + * definition, or value of a term. @Since: 2.26. + * @ATSPI_ROLE_FOOTNOTE: An object that contains the text of a footnote. @Since: 2.26. + * @ATSPI_ROLE_LAST_DEFINED: Not a valid role, used for finding end of + * enumeration. * * Enumeration used by interface #AtspiAccessible to specify the role * of an #AtspiAccessible object. @@ -1386,6 +1393,43 @@ typedef enum ATSPI_CACHE_UNDEFINED = 0x40000000, } AtspiCache; +/** + * AtspiScrollType: + * @ATSPI_SCROLL_TOP_LEFT: Scroll the object to the top left corner of the + * window. + * @ATSPI_SCROLL_BOTTOM_RIGHT: Scroll the object to the bottom right corner of + * the window. + * @ATSPI_SCROLL_TOP_EDGE: Scroll the object to the top edge of the window. + * @ATSPI_SCROLL_BOTTOM_EDGE: Scroll the object to the bottom edge of the + * window. + * @ATSPI_SCROLL_LEFT_EDGE: Scroll the object to the left edge of the + * window. + * @ATSPI_SCROLL_RIGHT_EDGE: Scroll the object to the right edge of the + * window. + * @ATSPI_SCROLL_ANYWHERE: Scroll the object to application-dependent position + * on the window. + * + * Enumeration used by interface #AtspiAccessible to specify where an + * #AtspiAccessible object should be placed on the screen when using scroll_to. + * + */ +typedef enum { + ATSPI_SCROLL_TOP_LEFT, + ATSPI_SCROLL_BOTTOM_RIGHT, + ATSPI_SCROLL_TOP_EDGE, + ATSPI_SCROLL_BOTTOM_EDGE, + ATSPI_SCROLL_LEFT_EDGE, + ATSPI_SCROLL_RIGHT_EDGE, + ATSPI_SCROLL_ANYWHERE +} AtspiScrollType; + +/** + * ATSPI_SCROLLTYPE_COUNT: + * + * One higher than the highest valid value of #AtspiScrollType. + */ +#define ATSPI_SCROLLTYPE_COUNT (6+1) + #define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry" #define ATSPI_DBUS_PATH_REGISTRY "/org/a11y/atspi/registry" #define ATSPI_DBUS_INTERFACE_REGISTRY "org.a11y.atspi.Registry" diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c index 5aac60a..56597f7 100644 --- a/atspi/atspi-device-listener.c +++ b/atspi/atspi-device-listener.c @@ -351,13 +351,13 @@ _atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void if (strcmp (dbus_message_get_signature (message), "(uiuuisb)") != 0) { - g_warning ("Atspi: Unknown signature for an event"); + g_warning ("AT-SPI: Unknown signature for an event"); goto done; } if (sscanf (path, "/org/a11y/atspi/listeners/%d", &id) != 1) { - g_warning ("Atspi: Bad listener path: %s\n", path); + g_warning ("AT-SPI: Bad listener path: %s\n", path); goto done; } @@ -379,7 +379,7 @@ _atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void retval = (*klass->device_event) (listener, &event); if (retval != 0 && retval != 1) { - g_warning ("at-spi: device event handler returned %d; should be 0 or 1", retval); + g_warning ("AT-SPI: device event handler returned %d; should be 0 or 1", retval); retval = 0; } } diff --git a/atspi/atspi-enum-types.c.template b/atspi/atspi-enum-types.c.template index cd92f99..385d0ee 100644 --- a/atspi/atspi-enum-types.c.template +++ b/atspi/atspi-enum-types.c.template @@ -4,7 +4,7 @@ /*** END file-header ***/ /*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ +/* enumerations from "@basename@" */ #include "@filename@" /*** END file-production ***/ diff --git a/atspi/atspi-enum-types.h.template b/atspi/atspi-enum-types.h.template index bd297b5..789ad2e 100644 --- a/atspi/atspi-enum-types.h.template +++ b/atspi/atspi-enum-types.h.template @@ -9,7 +9,7 @@ G_BEGIN_DECLS /*** END file-header ***/ /*** BEGIN file-production ***/ -/* Enumerations from "@filename@" */ +/* Enumerations from "@basename@" */ /*** END file-production ***/ diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c index 752547d..6a3fe6b 100644 --- a/atspi/atspi-event-listener.c +++ b/atspi/atspi-event-listener.c @@ -101,7 +101,7 @@ callback_unref (gpointer callback) info = g_hash_table_lookup (callbacks, callback); if (!info) { - g_warning ("Atspi: Dereferencing invalid callback %p\n", callback); + g_warning ("AT-SPI: Dereferencing invalid callback %p\n", callback); return; } info->ref_count--; @@ -679,7 +679,7 @@ atspi_event_listener_register_from_callback_full (AtspiEventListenerCB callback, dbus_bus_add_match (_atspi_bus(), matchrule, &d_error); if (dbus_error_is_set (&d_error)) { - g_warning ("Atspi: Adding match: %s", d_error.message); + g_warning ("AT-SPI: Adding match: %s", d_error.message); dbus_error_free (&d_error); /* TODO: Set error */ } @@ -916,7 +916,7 @@ _atspi_send_event (AtspiEvent *e) if (!convert_event_type_to_dbus (e->type, &category, &name, &detail, NULL)) { - g_warning ("Atspi: Couldn't parse event: %s\n", e->type); + g_warning ("AT-SPI: Couldn't parse event: %s\n", e->type); return; } for (l = event_listeners; l; l = g_list_next (l)) diff --git a/atspi/atspi-gmain.c b/atspi/atspi-gmain.c index 3ab985b..588a60d 100644 --- a/atspi/atspi-gmain.c +++ b/atspi/atspi-gmain.c @@ -33,7 +33,7 @@ #define _(x) dgettext (GETTEXT_PACKAGE, x) #define N_(x) x -/** +/* * DBusGMessageQueue: * A GSource subclass for dispatching DBusConnection messages. * We need this on top of the IO handlers, because sometimes @@ -41,8 +41,8 @@ */ typedef struct { - GSource source; /**< the parent GSource */ - DBusConnection *connection; /**< the connection to dispatch */ + GSource source; /* the parent GSource */ + DBusConnection *connection; /* the connection to dispatch */ } DBusGMessageQueue; static gboolean message_queue_prepare (GSource *source, @@ -95,11 +95,11 @@ message_queue_dispatch (GSource *source, typedef struct { - GMainContext *context; /**< the main context */ - GSList *ios; /**< all IOHandler */ - GSList *timeouts; /**< all TimeoutHandler */ - DBusConnection *connection; /**< NULL if this is really for a server not a connection */ - GSource *message_queue_source; /**< DBusGMessageQueue */ + GMainContext *context; /* the main context */ + GSList *ios; /* all IOHandler */ + GSList *timeouts; /* all TimeoutHandler */ + DBusConnection *connection; /* NULL if this is really for a server not a connection */ + GSource *message_queue_source; /* DBusGMessageQueue */ } ConnectionSetup; @@ -510,7 +510,7 @@ connection_setup_new_from_old (GMainContext *context, return cs; } -/** @} */ /* End of GLib bindings internals */ +/* @} */ /* End of GLib bindings internals */ /** * atspi_dbus_connection_setup_with_g_main: (skip) diff --git a/atspi/atspi-matchrule.c b/atspi/atspi-matchrule.c index e995459..cf6a306 100644 --- a/atspi/atspi-matchrule.c +++ b/atspi/atspi-matchrule.c @@ -164,7 +164,7 @@ atspi_match_rule_new (AtspiStateSet *states, if (role < 128) rule->roles [role / 32] |= (1 << (role % 32)); else - g_warning ("Atspi: unexpected role %d\n", role); + g_warning ("AT-SPI: unexpected role %d\n", role); } } else diff --git a/atspi/atspi-misc-private.h b/atspi/atspi-misc-private.h index fe5ca56..314746e 100644 --- a/atspi/atspi-misc-private.h +++ b/atspi/atspi-misc-private.h @@ -125,7 +125,7 @@ void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter); } \ if (strcmp (dbus_message_get_signature (message), type) != 0) \ { \ - g_warning ("at-spi: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \ + g_warning ("AT-SPI: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \ dbus_message_unref (message); \ return (ret); \ } diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index eebbed4..9b97b18 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -203,7 +203,7 @@ handle_get_bus_address (DBusPendingCall *pending, void *user_data) else { if (!strcmp (error.name, DBUS_ERROR_FILE_NOT_FOUND)) - g_warning ("Unable to open bus connection: %s", error.message); + g_warning ("AT-SPI: Unable to open bus connection: %s", error.message); dbus_error_free (&error); } } @@ -1258,7 +1258,7 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, dbus_message_iter_init (reply, &iter); if (dbus_message_iter_get_arg_type (&iter) != 'v') { - g_warning ("AT-SPI: expected a variant when fetching %s from interface %s; got %s\n", name, interface, dbus_message_get_signature (reply)); + g_warning ("atspi_dbus_get_property: expected a variant when fetching %s from interface %s; got %s\n", name, interface, dbus_message_get_signature (reply)); goto done; } dbus_message_iter_recurse (&iter, &iter_variant); @@ -1530,7 +1530,7 @@ get_accessibility_bus_address_dbus (void) if (!reply) { - g_warning ("Error retrieving accessibility bus address: %s: %s", + g_warning ("AT-SPI: Error retrieving accessibility bus address: %s: %s", error.name, error.message); dbus_error_free (&error); goto out; @@ -1584,7 +1584,7 @@ atspi_get_a11y_bus (void) if (a11y_dbus_slot == -1) if (!dbus_connection_allocate_data_slot (&a11y_dbus_slot)) - g_warning ("at-spi: Unable to allocate D-Bus slot"); + g_warning ("AT-SPI: Unable to allocate D-Bus slot"); address_env = g_getenv ("AT_SPI_BUS_ADDRESS"); if (address_env != NULL && *address_env != 0) diff --git a/atspi/atspi-registry.c b/atspi/atspi-registry.c index c9b11f0..76b1926 100644 --- a/atspi/atspi-registry.c +++ b/atspi/atspi-registry.c @@ -426,8 +426,8 @@ atspi_deregister_device_event_listener (AtspiDeviceListener *listener, /** * atspi_generate_keyboard_event: - * @keyval: a #gint indicating the keycode or keysym of the key event - * being synthesized. + * @keyval: a #gint indicating the keycode or keysym or modifier mask of the + * key event being synthesized. * @keystring: (allow-none): an (optional) UTF-8 string which, if * @synth_type is %ATSPI_KEY_STRING, indicates a 'composed' * keyboard input string being synthesized; this type of @@ -436,7 +436,8 @@ atspi_deregister_device_event_listener (AtspiDeviceListener *listener, * input method (such as XIM) were used. * @synth_type: an #AtspiKeySynthType flag indicating whether @keyval * is to be interpreted as a keysym rather than a keycode - * (%ATSPI_KEY_SYM) or a string (%ATSPI_KEY_STRING), or + * (%ATSPI_KEY_SYM) or a string (%ATSPI_KEY_STRING) or a modifier + * mask (%ATSPI_KEY_LOCKMODIFIERS and %ATSPI_KEY_UNLOCKMODIFIERS), or * whether to synthesize %ATSPI_KEY_PRESS, * %ATSPI_KEY_RELEASE, or both (%ATSPI_KEY_PRESSRELEASE). * @error: (allow-none): a pointer to a %NULL #GError pointer, or %NULL diff --git a/atspi/meson.build b/atspi/meson.build index ea48ddb..b7a9357 100644 --- a/atspi/meson.build +++ b/atspi/meson.build @@ -67,9 +67,9 @@ atspi_enums = gnome.mkenums('atspi-enum-types', install_header: true) atspi_enum_h = atspi_enums[1] -atspi = shared_library('atspi', atspi_sources + atspi_enums, - version: soversion.split('.')[0], - soversion: soversion, +atspi = library('atspi', atspi_sources + atspi_enums, + version: soversion, + soversion: soversion.split('.')[0], include_directories: [ root_inc, registryd_inc ], dependencies: [ libdbus_dep, gobject_dep, dbind_dep, x11_deps ], install: true) @@ -90,7 +90,8 @@ if have_gir gir_extra_args = [ '--c-include=atspi/atspi.h', - '--pkg-export=atspi-2' + '--pkg-export=atspi-2', + '--quiet', ] gir_dir = join_paths(atspi_datadir, 'gir-1.0') @@ -112,3 +113,13 @@ if have_gir ) endif +pkgconfig = import('pkgconfig') +pkgconfig.generate( + name: 'atspi', + description: 'Accessibility Technology software library', + version: meson.project_version(), + libraries: atspi, + requires: 'dbus-1 glib-2.0', + subdirs: 'at-spi-2.0', + filebase: 'atspi-2', +) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 4576400..0000000 --- a/autogen.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. - -olddir=`pwd` -cd "$srcdir" - -# run gtkdocize -gtkdocize || exit 1 - -# gnome-autogen.sh runs configure, so do likewise. -autoreconf -vif - -cd "$olddir" - -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" - diff --git a/bus/Makefile.am b/bus/Makefile.am deleted file mode 100644 index 688f82a..0000000 --- a/bus/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -CLEANFILES = -DISTCLEANFILES = -EXTRA_DIST = \ - meson.build - -libexec_PROGRAMS = at-spi-bus-launcher -at_spi_bus_launcher_SOURCES = at-spi-bus-launcher.c -at_spi_bus_launcher_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \ - -DDATADIR=\"$(datadir)\" \ - -DDBUS_DAEMON=\"$(DBUS_DAEMON)\" -at_spi_bus_launcher_CFLAGS = $(GIO_CFLAGS) -at_spi_bus_launcher_LDADD = $(GIO_LIBS) $(X11_LIBS) - -substitutions = "s,@libexecdir[@],$(libexecdir)," - -default_sessiondir = $(sysconfdir)/xdg/autostart -default_session_DATA = at-spi-dbus-bus.desktop -at-spi-dbus-bus.desktop: at-spi-dbus-bus.desktop.in - $(AM_V_GEN) $(SED) -e$ $(substitutions) $< > $@.tmp && mv $@.tmp $@ - -EXTRA_DIST += at-spi-dbus-bus.desktop.in -CLEANFILES += at-spi-dbus-bus.desktop - -dbusservicedir = $(DBUS_SERVICES_DIR) -dbusservice_DATA = org.a11y.Bus.service -org.a11y.Bus.service: org.a11y.Bus.service.in - $(AM_V_GEN) $(SED) -e $(substitutions) $< > $@.tmp && mv $@.tmp $@ - -EXTRA_DIST += org.a11y.Bus.service.in -CLEANFILES += org.a11y.Bus.service - -systemd_userdir = $(prefix)/lib/systemd/user -systemd_user_DATA = at-spi-dbus-bus.service -at-spi-dbus-bus.service: at-spi-dbus-bus.service.in Makefile - $(AM_V_GEN) $(SED) -e $(substitutions) $< > $@.tmp && mv $@.tmp $@ - -EXTRA_DIST += at-spi-dbus-bus.service.in -CLEANFILES += at-spi-dbus-bus.service - -busconfigdir = $(datadir)/defaults/at-spi2 -busconfig_DATA = accessibility.conf -accessibility.conf: accessibility.conf.in - $(AM_V_GEN) $(SED) -e "s|[@]DATADIR[@]|$(datadir)|" $(srcdir)/$@.in > $@ - -EXTRA_DIST += accessibility.conf.in -CLEANFILES += accessibility.conf - --include $(top_srcdir)/git.mk diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 261353f..17f01c0 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -2,7 +2,7 @@ * * at-spi-bus-launcher: Manage the a11y bus as a child process * - * Copyright 2011 Red Hat, Inc. + * Copyright 2011-2018 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -25,6 +25,11 @@ #include #include #include +#ifdef __linux__ +#include +#include +#include +#endif #include #include #include @@ -50,6 +55,7 @@ typedef struct { GDBusConnection *session_bus; GSettings *a11y_schema; GSettings *interface_schema; + int name_owner_id; GDBusProxy *client_proxy; @@ -58,6 +64,7 @@ typedef struct { int a11y_bus_pid; char *a11y_bus_address; int pipefd[2]; + int listenfd; char *a11y_launch_error_message; } A11yBusLauncher; @@ -215,23 +222,6 @@ name_appeared_handler (GDBusConnection *connection, register_client (app); } -static void -setup_bus_child (gpointer data) -{ - A11yBusLauncher *app = data; - (void) app; - - close (app->pipefd[0]); - dup2 (app->pipefd[1], 3); - close (app->pipefd[1]); - - /* On Linux, tell the bus process to exit if this process goes away */ -#ifdef __linux -#include - prctl (PR_SET_PDEATHSIG, 15); -#endif -} - /** * unix_read_all_fd_to_string: * @@ -244,7 +234,7 @@ unix_read_all_fd_to_string (int fd, { ssize_t bytes_read; - while (max_bytes > 1 && (bytes_read = read (fd, buf, MAX (4096, max_bytes - 1)))) + while (max_bytes > 1 && (bytes_read = read (fd, buf, MIN (4096, max_bytes - 1)))) { if (bytes_read < 0) return FALSE; @@ -276,33 +266,41 @@ on_bus_exited (GPid pid, g_main_loop_quit (app->loop); } +#ifdef DBUS_DAEMON +static void +setup_bus_child_daemon (gpointer data) +{ + A11yBusLauncher *app = data; + (void) app; + + close (app->pipefd[0]); + dup2 (app->pipefd[1], 3); + close (app->pipefd[1]); + + /* On Linux, tell the bus process to exit if this process goes away */ +#ifdef __linux__ + prctl (PR_SET_PDEATHSIG, 15); +#endif +} + static gboolean -ensure_a11y_bus (A11yBusLauncher *app) +ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path) { + char *argv[] = { DBUS_DAEMON, config_path, "--nofork", "--print-address", "3", NULL }; GPid pid; - char *argv[] = { DBUS_DAEMON, NULL, "--nofork", "--print-address", "3", NULL }; char addr_buf[2048]; GError *error = NULL; - const char *config_path = NULL; - - if (app->a11y_bus_pid != 0) - return FALSE; - - if (g_file_test (SYSCONFDIR"/at-spi2/accessibility.conf", G_FILE_TEST_EXISTS)) - config_path = "--config-file="SYSCONFDIR"/at-spi2/accessibility.conf"; - else - config_path = "--config-file="DATADIR"/defaults/at-spi2/accessibility.conf"; - - argv[1] = config_path; if (pipe (app->pipefd) < 0) g_error ("Failed to create pipe: %s", strerror (errno)); - + + g_clear_pointer (&app->a11y_launch_error_message, g_free); + if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, - setup_bus_child, + setup_bus_child_daemon, app, &pid, &error)) @@ -335,6 +333,138 @@ ensure_a11y_bus (A11yBusLauncher *app) app->a11y_bus_address = g_strchomp (g_strdup (addr_buf)); g_debug ("a11y bus address: %s", app->a11y_bus_address); + return TRUE; + +error: + close (app->pipefd[0]); + close (app->pipefd[1]); + app->state = A11Y_BUS_STATE_ERROR; + + return FALSE; +} +#else +static gboolean +ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path) +{ + return FALSE; +} +#endif + +#ifdef DBUS_BROKER +static void +setup_bus_child_broker (gpointer data) +{ + A11yBusLauncher *app = data; + gchar *pid_str; + (void) app; + + dup2 (app->listenfd, 3); + close (app->listenfd); + g_setenv("LISTEN_FDS", "1", TRUE); + + pid_str = g_strdup_printf("%u", getpid()); + g_setenv("LISTEN_PID", pid_str, TRUE); + g_free(pid_str); + + /* Tell the bus process to exit if this process goes away */ + prctl (PR_SET_PDEATHSIG, SIGTERM); +} + +static gboolean +ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path) +{ + char *argv[] = { DBUS_BROKER, config_path, "--scope", "user", NULL }; + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + socklen_t addr_len = sizeof(addr); + GPid pid; + GError *error = NULL; + + if ((app->listenfd = socket (PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) < 0) + g_error ("Failed to create listening socket: %s", strerror (errno)); + + if (bind (app->listenfd, (struct sockaddr *)&addr, sizeof(sa_family_t)) < 0) + g_error ("Failed to bind listening socket: %s", strerror (errno)); + + if (getsockname (app->listenfd, (struct sockaddr *)&addr, &addr_len) < 0) + g_error ("Failed to get socket name for listening socket: %s", strerror(errno)); + + if (listen (app->listenfd, 1024) < 0) + g_error ("Failed to listen on socket: %s", strerror(errno)); + + g_clear_pointer (&app->a11y_launch_error_message, g_free); + + if (!g_spawn_async (NULL, + argv, + NULL, + G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, + setup_bus_child_broker, + app, + &pid, + &error)) + { + app->a11y_bus_pid = -1; + app->a11y_launch_error_message = g_strdup (error->message); + g_clear_error (&error); + goto error; + } + + close (app->listenfd); + app->listenfd = -1; + + g_child_watch_add (pid, on_bus_exited, app); + app->a11y_bus_pid = pid; + g_debug ("Launched a11y bus, child is %ld", (long) pid); + app->state = A11Y_BUS_STATE_RUNNING; + + app->a11y_bus_address = g_strconcat("unix:abstract=", addr.sun_path + 1, NULL); + g_debug ("a11y bus address: %s", app->a11y_bus_address); + + return TRUE; + +error: + close (app->listenfd); + app->state = A11Y_BUS_STATE_ERROR; + + return FALSE; +} +#else +static gboolean +ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path) +{ + return FALSE; +} +#endif + +static gboolean +ensure_a11y_bus (A11yBusLauncher *app) +{ + char *config_path = NULL; + gboolean success = FALSE; + + if (app->a11y_bus_pid != 0) + return FALSE; + + if (g_file_test (SYSCONFDIR"/at-spi2/accessibility.conf", G_FILE_TEST_EXISTS)) + config_path = "--config-file="SYSCONFDIR"/at-spi2/accessibility.conf"; + else + config_path = "--config-file="DATADIR"/defaults/at-spi2/accessibility.conf"; + +#ifdef WANT_DBUS_BROKER + success = ensure_a11y_bus_broker (app, config_path); + if (!success) + { + if (!ensure_a11y_bus_daemon (app, config_path)) + return FALSE; + } +#else + success = ensure_a11y_bus_daemon (app, config_path); + if (!success) + { + if (!ensure_a11y_bus_broker (app, config_path)) + return FALSE; + } +#endif + #ifdef HAVE_X11 { Display *display = XOpenDisplay (NULL); @@ -353,13 +483,6 @@ ensure_a11y_bus (A11yBusLauncher *app) #endif return TRUE; - - error: - close (app->pipefd[0]); - close (app->pipefd[1]); - app->state = A11Y_BUS_STATE_ERROR; - - return FALSE; } static void @@ -695,6 +818,15 @@ already_running () static GSettings * get_schema (const gchar *name) { +#if GLIB_CHECK_VERSION (2, 32, 0) + GSettingsSchemaSource *source = g_settings_schema_source_get_default (); + GSettingsSchema *schema = g_settings_schema_source_lookup (source, name, FALSE); + + if (schema == NULL) + return NULL; + + return g_settings_new_full (schema, NULL, NULL); +#else const char * const *schemas = NULL; gint i; @@ -706,13 +838,13 @@ get_schema (const gchar *name) } return NULL; +#endif } static void gsettings_key_changed (GSettings *gsettings, const gchar *key, void *user_data) { gboolean new_val = g_settings_get_boolean (gsettings, key); - A11yBusLauncher *app = user_data; if (!strcmp (key, "toolkit-accessibility")) handle_a11y_enabled_change (_global_app, new_val, FALSE); @@ -724,10 +856,6 @@ int main (int argc, char **argv) { - GError *error = NULL; - GMainLoop *loop; - GDBusConnection *session_bus; - int name_owner_id; gboolean a11y_set = FALSE; gboolean screen_reader_set = FALSE; gint i; @@ -783,14 +911,15 @@ main (int argc, introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); g_assert (introspection_data != NULL); - name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, - "org.a11y.Bus", - G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, - on_bus_acquired, - on_name_acquired, - on_name_lost, - _global_app, - NULL); + _global_app->name_owner_id = + g_bus_own_name (G_BUS_TYPE_SESSION, + "org.a11y.Bus", + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, + on_bus_acquired, + on_name_acquired, + on_name_lost, + _global_app, + NULL); g_main_loop_run (_global_app->loop); diff --git a/bus/meson.build b/bus/meson.build index 909103c..5c7e03d 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -31,8 +31,13 @@ configure_file(input: 'at-spi-dbus-bus.service.in', install: true, install_dir: systemd_user_dir) +launcher_args = [ + '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir), + '-DDATADIR="@0@"'.format(atspi_datadir), + ] + if get_option('dbus_daemon') != 'default' - dbus_daemon = get_option('dbus_daemon') + launcher_args += '-DDBUS_DAEMON="@0@"'.format(get_option('dbus_daemon')) else dbus_daemon = find_program('dbus-daemon', '/sbin/dbus-daemon', @@ -40,16 +45,29 @@ else '/libexec/dbus-daemon', '/usr/libexec/dbus-daemon', '/usr/pkg/bin/dbus-daemon', - required: true).path() + required: false) + if dbus_daemon.found() + launcher_args += '-DDBUS_DAEMON="@0@"'.format(dbus_daemon.path()) + endif +endif + +if get_option('dbus_broker') != 'default' + launcher_args += '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker')) +else + dbus_broker = find_program('dbus-broker-launch', + required: false) + if dbus_broker.found() + launcher_args += '-DDBUS_BROKER="@0@"'.format(dbus_broker.path()) + endif +endif + +if get_option('default_bus') == 'dbus-broker' + launcher_args += '-DWANT_DBUS_BROKER' endif executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c', include_directories: [ root_inc, include_directories('.') ], dependencies: [ gio_dep, x11_deps ], - c_args: [ - '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir), - '-DDATADIR="@0@"'.format(atspi_datadir), - '-DDBUS_DAEMON="@0@"'.format(dbus_daemon), - ], + c_args: launcher_args, install: true, install_dir: atspi_libexecdir) diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a84dcbd..0000000 --- a/configure.ac +++ /dev/null @@ -1,188 +0,0 @@ -AC_INIT([at-spi2-core], [2.26.1], [accessibility-atspi@lists.linux-foundation.org]) -AC_PREREQ([2.59]) -AC_CONFIG_AUX_DIR(config) -AC_CONFIG_MACRO_DIR([m4]) - -AT_SPI_CORE_MAJOR_VERSION=0 -AT_SPI_CORE_MINOR_VERSION=1 -AT_SPI_CORE_MICRO_VERSION=3 -AT_SPI_CORE_VERSION="$AT_SPI_CORE_MAJOR_VERSION.$AT_SPI_CORE_MINOR_VERSION" -AC_SUBST(AT_SPI_CORE_VERSION) - -LT_RELEASE=$AT_SPI_CORE_VERSION -LT_CURRENT=0 -LT_REVISION=1 -LT_AGE=0 -LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}' -AC_SUBST(LT_VERSION_INFO) -AC_SUBST(LT_RELEASE) -AC_SUBST(LT_CURRENT) -AC_SUBST(LT_REVISION) -AC_SUBST(LT_AGE) - -AM_INIT_AUTOMAKE([1.13 -Wall -Wno-portability foreign subdir-objects no-dist-gzip dist-xz]) - -# Support silent build rules. Disable -# by either passing --disable-silent-rules to configure or passing V=1 -# to make -AM_SILENT_RULES([yes]) - -AM_PROG_CC_C_O -LT_INIT([disable-static]) -PKG_PROG_PKG_CONFIG - -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_SED - -AM_GNU_GETTEXT_VERSION([0.19.8]) -AM_GNU_GETTEXT([external]) - -GETTEXT_PACKAGE="${PACKAGE}" -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], - ["$GETTEXT_PACKAGE"], - [The prefix for our gettext translation domains.]) - -PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0]) -AC_SUBST(DBUS_LIBS) -AC_SUBST(DBUS_CFLAGS) - -PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36.0]) -AC_SUBST(GLIB_LIBS) -AC_SUBST(GLIB_CFLAGS) - -# Use pkg-config to find the glib-mkenums script -GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` -AC_SUBST(GLIB_MKENUMS) - -PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0]) -AC_SUBST(GOBJ_LIBS) -AC_SUBST(GOBJ_CFLAGS) - -PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.28]) -AC_SUBST(GIO_LIBS) -AC_SUBST(GIO_CFLAGS) - -# -------------------------------------------------------------------- -# Find DL functionality - -AC_CHECK_LIB(c, dlopen, DL_LIBS="", - AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl", - AC_MSG_ERROR([Could not find a library with the dlopen function]) - ) -) - -AC_SUBST(DL_LIBS) - -AC_ARG_ENABLE(x11, - [AS_HELP_STRING([--disable-x11], - [disable the X11 backend])],, - [enable_x11=auto]) - -AS_IF([test "x$enable_x11" = xno], [ - AM_CONDITIONAL(USE_X11, false) -], [ - PKG_CHECK_MODULES(X11, [x11], [ - AC_DEFINE(HAVE_X11, 1, [Define to use X11]) - AC_SUBST(HAVE_X11) - have_x11=yes - ], [ - AS_IF([test "x$enable_x11" = xyes], [ - AC_MSG_ERROR([Unable to find X11 development files]) - ]) - have_x11=no - ]) - - # Check for additional X11 extensions - AS_IF([test "x$have_x11" = xyes], [ - # XTest (mandatory) - PKG_CHECK_MODULES(XTST, [xtst]) - X11_CFLAGS="$X11_CFLAGS $XTST_CFLAGS" - X11_LIBS="$X11_LIBS $XTST_LIBS" - - # XInput (mandatory) - PKG_CHECK_MODULES(XINPUT, [xi]) - X11_CFLAGS="$X11_CFLAGS $XINPUT_CFLAGS" - X11_LIBS="$X11_LIBS $XINPUT_LIBS" - - # XKB (optional) - AC_CHECK_LIB(X11, XkbGetMap, [ - AC_DEFINE(HAVE_XKB, 1, [Define to use XKB]) - ], [:]) - ]) - - AC_SUBST(X11_CFLAGS) - AC_SUBST(X11_LIBS) - - AM_CONDITIONAL(USE_X11, test "x$have_x11" = xyes) -]) - -AC_ARG_WITH([dbus_daemondir], - [AS_HELP_STRING([--with-dbus-daemondir=], - [Directory where the DBUS daemon is installed])], - [DBUS_DAEMON="$with_dbus_daemondir/dbus-daemon"], - [AC_PATH_PROG([DBUS_DAEMON], [dbus-daemon], [XXXDBUSDAEMONNOTFOUND], - [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR]dnl -[/libexec$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR/usr/local/bin]dnl -[$PATH_SEPARATOR/usr/pkg/bin])] - ) -if test "$DBUS_DAEMON" = "XXXDBUSDAEMONNOTFOUND"; then - DBUS_DAEMON = "$bindir/dbus-daemon" - AC_MSG_WARN([at-spi2 relies on dbus, and the dbus-daemon was not found]) - AC_MSG_WARN([we assume that it will be installed in "$bindir"]) -fi -AC_SUBST(DBUS_DAEMON) - -AC_ARG_WITH(dbus-services, - [AS_HELP_STRING([--with-dbus-services=], - [where D-BUS services directory is])]) -if ! test -z "$with_dbus_services" ; then - DBUS_SERVICES_DIR="$with_dbus_services" -else - DBUS_SERVICES_DIR="$datadir/dbus-1/services" -fi -AC_SUBST(DBUS_SERVICES_DIR) - -GOBJECT_INTROSPECTION_CHECK([1.32.0]) - -AC_SUBST(LIBTOOL_EXPORT_OPTIONS) - -dnl find sizes & alignments -orig_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" -AC_CHECK_ALIGNOF(char) -AC_CHECK_ALIGNOF(dbus_bool_t, [#include ]) -AC_CHECK_ALIGNOF(dbus_int16_t, [#include ]) -AC_CHECK_ALIGNOF(dbus_int32_t, [#include ]) -AC_CHECK_ALIGNOF(dbus_int64_t, [#include ]) -AC_CHECK_ALIGNOF(double, [#include ]) -AC_CHECK_ALIGNOF(dbind_pointer, [AC_INCLUDES_DEFAULT -typedef void *dbind_pointer;]) -AC_CHECK_ALIGNOF(dbind_struct, [AC_INCLUDES_DEFAULT -typedef struct {char s1;} dbind_struct;]) - -GTK_DOC_CHECK([1.25]) - -if test "x$GCC" = xyes; then - CFLAGS="$CFLAGS -Werror-implicit-function-declaration" -fi - -CPPFLAGS=$orig_CPPFLAGS - -AC_CONFIG_FILES([ - Makefile - po/Makefile.in - xml/Makefile - dbind/Makefile - atspi/Makefile - registryd/Makefile - bus/Makefile - doc/Makefile - doc/libatspi/Makefile - doc/libatspi/version.xml - test/Makefile - atspi-2.pc -]) - -AC_OUTPUT diff --git a/dbind/Makefile.am b/dbind/Makefile.am deleted file mode 100644 index 6594e3e..0000000 --- a/dbind/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -noinst_LTLIBRARIES = libdbind.la - -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"dbind\" \ - -I$(top_srcdir) \ - $(WARN_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(GLIB_CFLAGS) - -libdbind_la_SOURCES = \ - dbind.h \ - dbind.c \ - dbind-any.h \ - dbind-any.c -libdbind_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) - -TESTS = dbtest - -check_PROGRAMS = dbtest -dbtest_SOURCES = dbtest.c ../atspi/atspi-gmain.c -dbtest_LDFLAGS = libdbind.la -dbtest_LDADD = $(DBUS_LIBS) - -EXTRA_DIST = \ - meson.build - --include $(top_srcdir)/git.mk diff --git a/dbind/dbtest.c b/dbind/dbtest.c index abd241a..42c1919 100644 --- a/dbind/dbtest.c +++ b/dbind/dbtest.c @@ -27,7 +27,7 @@ #define DESKICE_PATH "/Novell/ICEDesktop/Daemon" #define DESKICE_NAMESPACE "Novell.ICEDesktop.Daemon" -void marshal (DBusMessage *msg, char *type, void *ptr) +void marshal (DBusMessage *msg, const char *type, void *ptr) { DBusMessageIter iter; @@ -35,7 +35,7 @@ void marshal (DBusMessage *msg, char *type, void *ptr) dbind_any_marshal (&iter, &type, &ptr); } -void demarshal (DBusMessage *msg, char *type, void *ptr) +void demarshal (DBusMessage *msg, const char *type, void *ptr) { DBusMessageIter iter; @@ -317,8 +317,8 @@ void test_twovals () DBusMessage *msg; DBusMessageIter iter; TwoVal i, o; - char *type_twoval = TYPEOF_TWOVAL; - char *type; + const char *type_twoval = TYPEOF_TWOVAL; + const char *type; void *ptr; msg = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); diff --git a/dbind/meson.build b/dbind/meson.build index e122645..5a9f02d 100644 --- a/dbind/meson.build +++ b/dbind/meson.build @@ -3,12 +3,10 @@ dbind_sources = [ 'dbind-any.c', ] -dbind = static_library('dbind', dbind_sources, - include_directories: root_inc, - dependencies: [ libdbus_dep, glib_dep ], - c_args: [ '-DG_LOG_DOMAIN="dbind"' ]) - -dbind_dep = declare_dependency(link_with: dbind) +dbind_dep = declare_dependency(sources: dbind_sources, + include_directories: root_inc, + compile_args: [ '-DG_LOG_DOMAIN="dbind"' ], + dependencies: [ libdbus_dep, glib_dep ]) test('dbind-test', executable('dbind-test', [ 'dbtest.c', '../atspi/atspi-gmain.c' ], diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index b478520..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ - -SUBDIRS=libatspi - --include $(top_srcdir)/git.mk diff --git a/doc/libatspi/libatspi-docs.sgml b/doc/libatspi/libatspi-docs.sgml index 8b9ff0d..935767c 100644 --- a/doc/libatspi/libatspi-docs.sgml +++ b/doc/libatspi/libatspi-docs.sgml @@ -42,8 +42,6 @@ - - diff --git a/doc/libatspi/libatspi-sections.txt b/doc/libatspi/libatspi-sections.txt index 78abe76..14304ff 100644 --- a/doc/libatspi/libatspi-sections.txt +++ b/doc/libatspi/libatspi-sections.txt @@ -1,10 +1,8 @@
atspi-text AtspiRange -ATSPI_TYPE_RANGE atspi_range_copy AtspiTextRange -ATSPI_TYPE_TEXT_RANGE atspi_text_get_type AtspiText atspi_text_range_get_type @@ -29,12 +27,17 @@ atspi_text_get_selection atspi_text_add_selection atspi_text_remove_selection atspi_text_set_selection +atspi_text_get_string_at_offset +atspi_text_get_text_attribute_value +atspi_text_get_text_attributes ATSPI_TEXT ATSPI_IS_TEXT ATSPI_TYPE_TEXT atspi_range_get_type ATSPI_TEXT_GET_IFACE +ATSPI_TYPE_RANGE +ATSPI_TYPE_TEXT_RANGE
@@ -97,6 +100,9 @@ AtspiAction atspi_action_get_n_actions atspi_action_get_description atspi_action_get_key_binding +atspi_action_get_action_description +atspi_action_get_action_name +atspi_action_get_localized_name atspi_action_get_name atspi_action_do_action @@ -161,6 +167,10 @@ AtspiDocument atspi_document_get_locale atspi_document_get_attribute_value atspi_document_get_attributes +atspi_document_get_current_page_number +atspi_document_get_document_attribute_value +atspi_document_get_document_attributes +atspi_document_get_page_count ATSPI_DOCUMENT ATSPI_IS_DOCUMENT @@ -207,6 +217,8 @@ atspi_accessible_get_attributes_as_array atspi_accessible_get_locale atspi_accessible_get_toolkit_name atspi_accessible_get_toolkit_version +atspi_accessible_get_atspi_version +atspi_accessible_get_id atspi_accessible_get_application atspi_accessible_get_action atspi_accessible_get_collection @@ -218,8 +230,24 @@ atspi_accessible_get_hypertext atspi_accessible_get_image atspi_accessible_get_selection atspi_accessible_get_table +atspi_accessible_get_table_cell atspi_accessible_get_text atspi_accessible_get_value +atspi_accessible_get_object_locale +atspi_accessible_set_cache_mask +atspi_accessible_clear_cache +atspi_accessible_get_process_id +atspi_accessible_get_action_iface +atspi_accessible_get_collection_iface +atspi_accessible_get_component_iface +atspi_accessible_get_document_iface +atspi_accessible_get_editable_text_iface +atspi_accessible_get_hypertext_iface +atspi_accessible_get_image_iface +atspi_accessible_get_selection_iface +atspi_accessible_get_table_iface +atspi_accessible_get_text_iface +atspi_accessible_get_value_iface atspi_accessible_get_interfaces ATSPI_ACCESSIBLE @@ -229,6 +257,9 @@ atspi_accessible_get_type ATSPI_ACCESSIBLE_CLASS ATSPI_IS_ACCESSIBLE_CLASS ATSPI_ACCESSIBLE_GET_CLASS + + +AtspiAccessiblePrivate
@@ -253,6 +284,20 @@ ATSPI_DEVICE_LISTENER_GET_CLASS
+atspi-hypertext +AtspiHypertext +atspi_hypertext_get_n_links +atspi_hypertext_get_link +atspi_hypertext_get_link_index + +ATSPI_HYPERTEXT +ATSPI_IS_HYPERTEXT +ATSPI_TYPE_HYPERTEXT +atspi_hypertext_get_type +ATSPI_HYPERTEXT_GET_IFACE +
+ +
atspi-hyperlink AtspiHyperlink AtspiHyperlink @@ -278,7 +323,6 @@ ATSPI_HYPERLINK_GET_CLASS
atspi-editabletext AtspiEditableText -atspi_editable_text_set_attributes atspi_editable_text_insert_text atspi_editable_text_copy_text atspi_editable_text_cut_text @@ -290,6 +334,8 @@ ATSPI_IS_EDITABLE_TEXT ATSPI_TYPE_EDITABLE_TEXT atspi_editable_text_get_type ATSPI_EDITABLE_TEXT_GET_IFACE + +atspi_editable_text_set_attributes
@@ -356,12 +402,13 @@ atspi_table_cell_get_position atspi_table_cell_get_row_column_span atspi_table_cell_get_table -ATSPI_TABLE -ATSPI_IS_TABLE -ATSPI_TYPE_TABLE -atspi_table_get_type -ATSPI_TABLE_GET_IFACE +ATSPI_TABLE_CELL +ATSPI_IS_TABLE_CELL +ATSPI_TYPE_TABLE_CELL +atspi_table_cell_get_type +ATSPI_TABLE_CELL_GET_IFACE
+
atspi-selection AtspiSelection @@ -393,7 +440,9 @@ atspi_event_listener_new atspi_event_listener_new_simple atspi_event_listener_register atspi_event_listener_register_from_callback +atspi_event_listener_register_from_callback_full atspi_event_listener_register_no_data +atspi_event_listener_register_full atspi_event_listener_deregister atspi_event_listener_deregister_from_callback atspi_event_listener_deregister_no_data @@ -408,20 +457,6 @@ ATSPI_EVENT_LISTENER_GET_CLASS
-atspi-hypertext -AtspiHypertext -atspi_hypertext_get_n_links -atspi_hypertext_get_link -atspi_hypertext_get_link_index - -ATSPI_HYPERTEXT -ATSPI_IS_HYPERTEXT -ATSPI_TYPE_HYPERTEXT -atspi_hypertext_get_type -ATSPI_HYPERTEXT_GET_IFACE -
- -
atspi-component AtspiRect ATSPI_TYPE_RECT @@ -441,6 +476,11 @@ atspi_component_get_layer atspi_component_get_mdi_z_order atspi_component_grab_focus atspi_component_get_alpha +atspi_component_scroll_to +atspi_component_scroll_to_point +atspi_component_set_extents +atspi_component_set_position +atspi_component_set_size ATSPI_COMPONENT ATSPI_IS_COMPONENT @@ -465,20 +505,6 @@ atspi_generate_mouse_event
atspi-types -AtspiAccessible -AtspiAction -AtspiCollection -AtspiComponent -AtspiDocument -AtspiEditableText -AtspiHyperlink -AtspiHypertext -AtspiImage -AtspiSelection -AtspiTable -AtspiTableCell -AtspiText -AtspiValue AtspiControllerEventMask AtspiKeyMaskType AtspiKeyEventMask @@ -487,9 +513,13 @@ AtspiDeviceEvent AtspiEventListenerMode AtspiKeyDefinition AtspiEvent -ATSPI_TYPE_EVENT AtspiKeystrokeListener AtspiKeyListenerSyncType + + +ATSPI_TYPE_EVENT +atspi_device_event_get_type +atspi_key_listener_sync_type_get_type
@@ -506,6 +536,7 @@ AtspiCollectionTreeTraversalType ATSPI_TREETRAVERSALTYPE AtspiComponentLayer ATSPI_COMPONENTLAYER_COUNT +AtspiTextGranularity AtspiTextBoundaryType ATSPI_TEXT_BOUNDARY_TYPE_COUNT AtspiTextClipType @@ -524,40 +555,83 @@ AtspiRelationType ATSPI_RELATIONTYPE_COUNT AtspiRole ATSPI_ROLE_COUNT +AtspiCache +AtspiScrollType +ATSPI_SCROLLTYPE_COUNT + + +atspi_cache_get_type +atspi_collection_match_type_get_type +atspi_collection_sort_order_get_type +atspi_collection_tree_traversal_type_get_type +atspi_component_layer_get_type +atspi_coord_type_get_type +atspi_event_type_get_type +atspi_key_event_type_get_type +atspi_key_synth_type_get_type +atspi_locale_type_get_type +atspi_modifier_type_get_type +atspi_modifier_type_get_type +atspi_relation_type_get_type +atspi_role_get_type +atspi_scroll_type_get_type +atspi_state_type_get_type +atspi_text_boundary_type_get_type +atspi_text_clip_type_get_type +atspi_text_granularity_get_type +ATSPI_TYPE_CACHE +ATSPI_TYPE_COLLECTION_MATCH_TYPE +ATSPI_TYPE_COLLECTION_SORT_ORDER +ATSPI_TYPE_COLLECTION_TREE_TRAVERSAL_TYPE +ATSPI_TYPE_COMPONENT_LAYER +ATSPI_TYPE_COORD_TYPE +ATSPI_TYPE_DEVICE_EVENT +ATSPI_TYPE_EVENT_TYPE +ATSPI_TYPE_KEY_EVENT_TYPE +ATSPI_TYPE_KEY_LISTENER_SYNC_TYPE +ATSPI_TYPE_KEY_SYNTH_TYPE +ATSPI_TYPE_LOCALE_TYPE +ATSPI_TYPE_MODIFIER_TYPE +ATSPI_TYPE_RELATION_TYPE +ATSPI_TYPE_ROLE +ATSPI_TYPE_SCROLL_TYPE +ATSPI_TYPE_STATE_TYPE +ATSPI_TYPE_TEXT_BOUNDARY_TYPE +ATSPI_TYPE_TEXT_CLIP_TYPE +ATSPI_TYPE_TEXT_GRANULARITY
atspi-misc atspi_init +atspi_is_initialized +atspi_set_timeout +atspi_set_main_context atspi_event_main atspi_event_quit atspi_exit -
-
-atspi-misc-private -ATSPI_CACHE_PARENT + +atspi_main_loop +atspi_get_a11y_bus +atspi_dbus_connection_setup_with_g_main +atspi_dbus_server_setup_with_g_main +atspi_bus_registry ATSPI_CACHE_CHILDREN -ATSPI_CACHE_NAME ATSPI_CACHE_DESCRIPTION -ATSPI_CACHE_STATES -ATSPI_CACHE_ROLE ATSPI_CACHE_INTERFACES -AtspiReference -ATSPI_DBUS_NAME_REGISTRY -ATSPI_DBUS_PATH_REGISTRY -ATSPI_DBUS_INTERFACE_REGISTRY -ATSPI_DBUS_PATH_NULL -ATSPI_DBUS_PATH_ROOT -ATSPI_DBUS_PATH_DEC -ATSPI_DBUS_INTERFACE_DEC -ATSPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER -ATSPI_DBUS_INTERFACE_CACHE +ATSPI_CACHE_NAME +ATSPI_CACHE_PARENT +ATSPI_CACHE_ROLE +ATSPI_CACHE_STATES ATSPI_DBUS_INTERFACE_ACCESSIBLE ATSPI_DBUS_INTERFACE_ACTION ATSPI_DBUS_INTERFACE_APPLICATION +ATSPI_DBUS_INTERFACE_CACHE ATSPI_DBUS_INTERFACE_COLLECTION ATSPI_DBUS_INTERFACE_COMPONENT +ATSPI_DBUS_INTERFACE_DEC +ATSPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER ATSPI_DBUS_INTERFACE_DOCUMENT ATSPI_DBUS_INTERFACE_EDITABLE_TEXT ATSPI_DBUS_INTERFACE_EVENT_KEYBOARD @@ -566,18 +640,22 @@ ATSPI_DBUS_INTERFACE_EVENT_OBJECT ATSPI_DBUS_INTERFACE_HYPERLINK ATSPI_DBUS_INTERFACE_HYPERTEXT ATSPI_DBUS_INTERFACE_IMAGE +ATSPI_DBUS_INTERFACE_REGISTRY ATSPI_DBUS_INTERFACE_SELECTION +ATSPI_DBUS_INTERFACE_SOCKET ATSPI_DBUS_INTERFACE_TABLE +ATSPI_DBUS_INTERFACE_TABLE_CELL ATSPI_DBUS_INTERFACE_TEXT ATSPI_DBUS_INTERFACE_VALUE -ATSPI_DBUS_INTERFACE_SOCKET -atspi_path_dec -atspi_path_registry -atspi_path_root -atspi_bus_registry +ATSPI_DBUS_NAME_REGISTRY +ATSPI_DBUS_PATH_DEC +ATSPI_DBUS_PATH_NULL +ATSPI_DBUS_PATH_REGISTRY +ATSPI_DBUS_PATH_ROOT atspi_interface_accessible atspi_interface_action atspi_interface_application +atspi_interface_cache atspi_interface_collection atspi_interface_component atspi_interface_dec @@ -592,12 +670,13 @@ atspi_interface_selection atspi_interface_table atspi_interface_table_cell atspi_interface_text -atspi_interface_cache atspi_interface_value -
+atspi_no_cache +atspi_path_dec +atspi_path_registry +atspi_path_root +AtspiReference +AtspiError +ATSPI_ERROR -
-atspi-listener-private -atspi_dbus_handle_deviceEvent
- diff --git a/doc/libatspi/tmpl/atspi-constants.sgml b/doc/libatspi/tmpl/atspi-constants.sgml index 8763873..af2ec33 100644 --- a/doc/libatspi/tmpl/atspi-constants.sgml +++ b/doc/libatspi/tmpl/atspi-constants.sgml @@ -39,6 +39,26 @@ Constant definitions needed by multiple interfaces. + + + + + +@ATSPI_SCROLL_TOP_LEFT: +@ATSPI_SCROLL_BOTTOM_RIGHT: +@ATSPI_SCROLL_TOP_EDGE: +@ATSPI_SCROLL_BOTTOM_EDGE: +@ATSPI_SCROLL_LEFT_EDGE: +@ATSPI_SCROLL_RIGHT_EDGE: +@ATSPI_SCROLL_ANYWHERE: + + + + + + + + @@ -46,6 +66,7 @@ Constant definitions needed by multiple interfaces. @ATSPI_COORD_TYPE_SCREEN: @ATSPI_COORD_TYPE_WINDOW: +@ATSPI_COORD_TYPE_PARENT: @@ -270,6 +291,8 @@ Constant definitions needed by multiple interfaces. @ATSPI_KEY_PRESSRELEASE: @ATSPI_KEY_SYM: @ATSPI_KEY_STRING: +@ATSPI_KEY_LOCKMODIFIERS: +@ATSPI_KEY_UNLOCKMODIFIERS: diff --git a/idl/component.didl b/idl/component.didl index aa40e78..31cfbf0 100644 --- a/idl/component.didl +++ b/idl/component.didl @@ -54,7 +54,30 @@ interface org.freestandards.atspi.Component { LAYER_WINDOW, LAYER_LAST_DEFINED } - + + /* + Describes where the object should be placed on the window. + */ + enum uint32 ScrollType { + SCROLL_TOP_LEFT = 0, + SCROLL_BOTTOM_RIGHT, + SCROLL_TOP_EDGE, + SCROLL_BOTTOM_EDGE, + SCROLL_LEFT_EDGE, + SCROLL_RIGHT_EDGE, + SCROLL_ANYWHERE + } + + /* + Specifies whether the coordinates are relative to the screen, to the + window, or to the parent object. + */ + enum uint32 CoordType { + COORD_TYPE_SCREEN = 0, + COORD_TYPE_WINDOW, + COORD_TYPE_PARENT + } + /* True if the specified point lies within the components bounding box. */ @@ -136,4 +159,20 @@ interface org.freestandards.atspi.Component { method GetAlpha reply { double alpha; } + + /* + Scroll this object so it becomes visible on the screen. + */ + method ScrollTo { + ScrollType type; + } + + /* + Scroll this object so it becomes visible on the screen at a given position. + */ + method ScrollToPoint { + CoordType type; + int32 x; + int32 y; + } } diff --git a/idl/controller.didl b/idl/controller.didl index 53b5f71..4519a0a 100644 --- a/idl/controller.didl +++ b/idl/controller.didl @@ -6,7 +6,9 @@ interface org.freestandards.atspi.DeviceEventController { KEY_RELEASE, KEY_PRESSRELEASE, KEY_SYM, - KEY_STRING + KEY_STRING, + KEY_LOCKMODIFIERS, + KEY_UNLOCKMODIFIERS } /* diff --git a/meson.build b/meson.build index 0cfdbef..351b207 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('at-spi2-core', 'c', - version: '2.26.1', + version: '2.31.1', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', @@ -8,7 +8,7 @@ project('at-spi2-core', 'c', ], meson_version: '>= 0.40.1') -add_project_arguments([ '-D_POSIX_C_SOURCE', '-D_DEFAULT_SOURCE' ], language: 'c') +add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE' ], language: 'c') atspi_gir_ns = 'Atspi' @@ -109,20 +109,6 @@ xgettext = find_program('xgettext', required : false) configure_file(output: 'config.h', configuration: at_spi_conf) -# Compat variables for pkgconfig -pkgconf = configuration_data() -pkgconf.set('prefix', get_option('prefix')) -pkgconf.set('exec_prefix', get_option('prefix')) -pkgconf.set('libdir', atspi_libdir) -pkgconf.set('includedir', atspi_includedir) -pkgconf.set('VERSION', meson.project_version()) - -configure_file(input: 'atspi-2.pc.in', - output: 'atspi-2.pc', - configuration: pkgconf, - install: true, - install_dir: join_paths(get_option('libdir'), 'pkgconfig')) - gnome = import('gnome') subdir('dbind') diff --git a/meson_options.txt b/meson_options.txt index c9afe2f..f8ec862 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,15 @@ option('dbus_daemon', description: 'The path of the DBus daemon', type: 'string', value: 'default') +option('dbus_broker', + description: 'The path of the DBus broker', + type: 'string', + value: 'default') +option('default_bus', + description: 'The default DBus implementation to use', + type: 'combo', + choices: ['dbus-daemon', 'dbus-broker'], + value: 'dbus-daemon') option('systemd_user_dir', description: 'Location of the systemd user services', type: 'string', diff --git a/po/Makevars b/po/Makevars deleted file mode 100644 index b40107f..0000000 --- a/po/Makevars +++ /dev/null @@ -1,78 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = at-spi2-core authors - -# This tells whether or not to prepend "GNU " prefix to the package -# name that gets inserted into the header of the $(DOMAIN).pot file. -# Possible values are "yes", "no", or empty. If it is empty, try to -# detect it automatically by scanning the files in $(top_srcdir) for -# "GNU packagename" string. -PACKAGE_GNU = no - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = https://bugzilla.gnome.org/enter_bug.cgi?product=at-spi&keywords=I18N+L10N&component=at-spi2-core - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = - -# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' -# context. Possible values are "yes" and "no". Set this to yes if the -# package uses functions taking also a message context, like pgettext(), or -# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. -USE_MSGCTXT = no - -# These options get passed to msgmerge. -# Useful options are in particular: -# --previous to keep previous msgids of translated messages, -# --quiet to reduce the verbosity. -MSGMERGE_OPTIONS = - -# These options get passed to msginit. -# If you want to disable line wrapping when writing PO files, add -# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and -# MSGINIT_OPTIONS. -MSGINIT_OPTIONS = - -# This tells whether or not to regenerate a PO file when $(DOMAIN).pot -# has changed. Possible values are "yes" and "no". Set this to no if -# the POT file is checked in the repository and the version control -# program ignores timestamps. -PO_DEPENDS_ON_POT = no - -# This tells whether or not to forcibly update $(DOMAIN).pot and -# regenerate PO files on "make dist". Possible values are "yes" and -# "no". Set this to no if the POT file and PO files are maintained -# externally. -DIST_DEPENDS_ON_UPDATE_PO = no diff --git a/po/fr.po b/po/fr.po index 6e1ba90..f0eb565 100644 --- a/po/fr.po +++ b/po/fr.po @@ -2,27 +2,27 @@ # Copyright (C) 2011 Listed translators # This file is distributed under the same license as the at-spi2-core package. # Claude Paroz , 2011. +# Charles Monzat , 2018. # msgid "" msgstr "" "Project-Id-Version: at-spi2-core master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=at-" -"spi&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2014-02-03 23:50+0000\n" -"PO-Revision-Date: 2014-03-11 22:53+0100\n" -"Last-Translator: Claude Paroz \n" -"Language-Team: GNOME French Team \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/at-spi2-core/issues\n" +"POT-Creation-Date: 2018-10-05 04:46+0000\n" +"PO-Revision-Date: 2018-11-14 18:35+0100\n" +"Last-Translator: Charles Monzat \n" +"Language-Team: français \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 3.30.0\n" -#: ../atspi/atspi-component.c:325 ../atspi/atspi-misc.c:1034 -#: ../atspi/atspi-value.c:111 +#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 msgid "The application no longer exists" -msgstr "L'application n'existe plus" +msgstr "L’application n’existe plus" -#: ../atspi/atspi-misc.c:1777 +#: atspi/atspi-misc.c:1850 msgid "Attempted synchronous call where prohibited" -msgstr "La tentative d'appel synchrone est interdite" +msgstr "La tentative d’appel synchrone est interdite" diff --git a/registryd/Makefile.am b/registryd/Makefile.am deleted file mode 100644 index 6a4b1d8..0000000 --- a/registryd/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -EXTRA_DIST = \ - meson.build - -libexec_PROGRAMS = at-spi2-registryd - -at_spi2_registryd_CFLAGS = \ - $(GLIB_CFLAGS) \ - $(GIO_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(GOBJ_CFLAGS) \ - $(ATK_CFLAGS) \ - $(X11_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -I$(top_builddir)/atspi \ - -DATSPI_INTROSPECTION_PATH=\"$(pkgdatadir)/$(DEFAULT_ATSPI_INTROSPECTION_PATH)\" - -at_spi2_registryd_LDADD = \ - ../atspi/libatspi.la \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(DBUS_LIBS) \ - $(GOBJ_CFLAGS) \ - $(ATK_LIBS) \ - $(X11_LIBS) \ - $(DL_LIBS) - -at_spi2_registryd_SOURCES = \ - de-marshaller.h \ - de-marshaller.c \ - de-types.h \ - keymasks.h \ - paths.h \ - registry-main.c \ - registry.c \ - registry.h \ - introspection.h \ - introspection.c \ - deviceeventcontroller.c \ - deviceeventcontroller.h \ - reentrant-list.c \ - reentrant-list.h - -X11_SOURCES = \ - deviceeventcontroller-x11.c \ - display.h \ - display.c \ - event-source.c \ - event-source.h \ - ucs2keysym.c - -if USE_X11 -at_spi2_registryd_SOURCES += $(X11_SOURCES) -else -EXTRA_DIST += $(X11_SOURCES) -endif - -servicedir=$(datadir)/dbus-1/accessibility-services -service_in_files = org.a11y.atspi.Registry.service.in -service_DATA = $(service_in_files:.service.in=.service) - -$(service_DATA): $(service_in_files) Makefile - $(AM_V_GEN)$(SED) -e "s|[@]libexecdir[@]|$(libexecdir)|" $(srcdir)/$@.in > $@ - -DISTCLEANFILES = org.a11y.atspi.Registry.service -EXTRA_DIST += org.a11y.atspi.Registry.service.in - --include $(top_srcdir)/git.mk diff --git a/registryd/de-types.h b/registryd/de-types.h index a338e38..f08823c 100644 --- a/registryd/de-types.h +++ b/registryd/de-types.h @@ -47,6 +47,8 @@ typedef enum { Accessibility_KEY_PRESSRELEASE, Accessibility_KEY_SYM, Accessibility_KEY_STRING, + Accessibility_KEY_LOCKMODIFIERS, + Accessibility_KEY_UNLOCKMODIFIERS, } Accessibility_KeySynthType; typedef struct _Accessibility_DeviceEvent Accessibility_DeviceEvent; diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c index d9d9a6c..e5b8dfc 100644 --- a/registryd/deviceeventcontroller-x11.c +++ b/registryd/deviceeventcontroller-x11.c @@ -1018,8 +1018,10 @@ spi_dec_x11_synth_keycode_press (SpiDEController *controller, { unsigned int time = CurrentTime; unsigned int bounce_delay; +#ifdef THIS_IS_BROKEN unsigned int elapsed_msec; struct timeval tv; +#endif DEControllerPrivateData *priv = controller->priv; spi_x_error_trap (); @@ -1028,15 +1030,15 @@ spi_dec_x11_synth_keycode_press (SpiDEController *controller, bounce_delay = xkb_get_bouncekeys_delay (controller); if (bounce_delay) { +#ifdef THIS_IS_BROKEN gettimeofday (&tv, NULL); elapsed_msec = (tv.tv_sec - priv->last_release_time.tv_sec) * 1000 + (tv.tv_usec - priv->last_release_time.tv_usec) / 1000; -#ifdef SPI_XKB_DEBUG +# ifdef SPI_XKB_DEBUG fprintf (stderr, "%d ms elapsed (%ld usec)\n", elapsed_msec, (long) (tv.tv_usec - priv->last_release_time.tv_usec)); -#endif -#ifdef THIS_IS_BROKEN +# endif if (elapsed_msec < bounce_delay) time = bounce_delay - elapsed_msec + 1; #else @@ -1062,8 +1064,10 @@ spi_dec_x11_synth_keycode_release (SpiDEController *controller, { unsigned int time = CurrentTime; unsigned int slow_delay; +#ifdef THIS_IS_BROKEN_DUNNO_WHY unsigned int elapsed_msec; struct timeval tv; +#endif DEControllerPrivateData *priv = controller->priv; spi_x_error_trap (); @@ -1072,15 +1076,15 @@ spi_dec_x11_synth_keycode_release (SpiDEController *controller, slow_delay = xkb_get_slowkeys_delay (controller); if (slow_delay) { +#ifdef THIS_IS_BROKEN_DUNNO_WHY gettimeofday (&tv, NULL); elapsed_msec = (tv.tv_sec - priv->last_press_time.tv_sec) * 1000 + (tv.tv_usec - priv->last_press_time.tv_usec) / 1000; -#ifdef SPI_XKB_DEBUG +# ifdef SPI_XKB_DEBUG fprintf (stderr, "%d ms elapsed (%ld usec)\n", elapsed_msec, (long) (tv.tv_usec - priv->last_press_time.tv_usec)); -#endif -#ifdef THIS_IS_BROKEN_DUNNO_WHY +# endif if (elapsed_msec < slow_delay) time = slow_delay - elapsed_msec + 1; #else diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 0c965ef..4e25ad6 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -1762,6 +1762,12 @@ impl_generate_keyboard_event (DBusConnection *bus, DBusMessage *message, void *u fprintf (stderr, "Keystring synthesis failure, string=%s\n", keystring); break; + case Accessibility_KEY_LOCKMODIFIERS: + spi_dec_plat_lock_modifiers (controller, keycode); + break; + case Accessibility_KEY_UNLOCKMODIFIERS: + spi_dec_plat_unlock_modifiers (controller, keycode); + break; } reply = dbus_message_new_method_return (message); return reply; diff --git a/registryd/reentrant-list.c b/registryd/reentrant-list.c index 29bdfca..7f9a716 100644 --- a/registryd/reentrant-list.c +++ b/registryd/reentrant-list.c @@ -45,7 +45,7 @@ spi_re_entrant_list_delete_link (GList * const *element_ptr) GList *next; GList *element; gboolean first_item; - GList *dummy; /* suppress warning */ + GList *dummy G_GNUC_UNUSED; g_return_if_fail (element_ptr != NULL); diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index b76db0a..0000000 --- a/test/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -LDADD = $(top_builddir)/atspi/libatspi.la -noinst_PROGRAMS = memory -memory_SOURCES = memory.c -memory_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_builddir)/atspi -memory_CFLAGS = $(GLIB_CFLAGS) $(GOBJ_LIBS) $(DBUS_CFLAGS) -memory_LDFLAGS = - --include $(top_srcdir)/git.mk - -EXTRA_DIST = meson.build diff --git a/xml/Component.xml b/xml/Component.xml index c67dde9..c1258d2 100644 --- a/xml/Component.xml +++ b/xml/Component.xml @@ -72,5 +72,15 @@ + + + + + + + + + + diff --git a/xml/Makefile.am b/xml/Makefile.am deleted file mode 100644 index edb71d3..0000000 --- a/xml/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -EXTRA_DIST = \ - Accessibility.xml \ - Accessible.xml \ - Action.xml \ - Application.xml \ - Cache.xml \ - Collection.xml \ - Component.xml \ - create-introspection.sh \ - DeviceEventController.xml \ - DeviceEventListener.xml \ - Document.xml \ - EditableText.xml \ - Event.xml \ - Hyperlink.xml \ - Hypertext.xml \ - Image.xml \ - Registry.xml \ - remove-annotations.xsl \ - Selection.xml \ - Socket.xml \ - Table.xml \ - Text.xml \ - Value.xml \ - versioned-introspection.py - -CLEANFILES = \ - introspection.c \ - introspection.h \ - Processed.xml - -#BUILT_SOURCES = spec.xml -#CLEANFILES += spec.xml - -XML_SPEC = $(filter %.xml,$(EXTRA_DIST)) - -spec.xml: $(XML_SPEC) - xsltproc --xinclude $(top_srcdir)/tools/identity.xsl Accessibility.xml >spec.xml - - --include $(top_srcdir)/git.mk -- 2.7.4 From 3785cfb93aa4a29b70ffdd39686f14d2c8e26b0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Fri, 7 Feb 2020 07:35:42 +0100 Subject: [PATCH 14/16] 2.34.0 Change-Id: I514111ff14f955ae7cc405bf8ff6298d7e982175 --- AUTHORS | 2 +- COPYING | 224 ++++++++++-------- INSTALL | 28 +-- NEWS | 65 +++++ at-spi2-core.doap | 27 +-- atspi/atspi-accessible-private.h | 13 +- atspi/atspi-accessible.c | 131 +++++++++- atspi/atspi-accessible.h | 16 +- atspi/atspi-action.c | 12 +- atspi/atspi-action.h | 12 +- atspi/atspi-application.c | 12 +- atspi/atspi-application.h | 14 +- atspi/atspi-collection.c | 12 +- atspi/atspi-collection.h | 12 +- atspi/atspi-component.c | 18 +- atspi/atspi-component.h | 12 +- atspi/atspi-constants.h | 25 +- atspi/atspi-device-listener-private.h | 12 +- atspi/atspi-device-listener.c | 12 +- atspi/atspi-device-listener.h | 12 +- atspi/atspi-document.c | 12 +- atspi/atspi-document.h | 12 +- atspi/atspi-editabletext.c | 16 +- atspi/atspi-editabletext.h | 12 +- atspi/atspi-event-listener-private.h | 12 +- atspi/atspi-event-listener.c | 83 ++++--- atspi/atspi-event-listener.h | 12 +- atspi/atspi-gmain.c | 2 +- atspi/atspi-gmain.h | 2 +- atspi/atspi-hyperlink.c | 12 +- atspi/atspi-hyperlink.h | 12 +- atspi/atspi-hypertext.c | 12 +- atspi/atspi-hypertext.h | 12 +- atspi/atspi-image.c | 18 +- atspi/atspi-image.h | 12 +- atspi/atspi-matchrule-private.h | 12 +- atspi/atspi-matchrule.c | 12 +- atspi/atspi-matchrule.h | 12 +- atspi/atspi-misc-private.h | 14 +- atspi/atspi-misc.c | 70 +++++- atspi/atspi-misc.h | 12 +- atspi/atspi-mutter-private.h | 36 +++ atspi/atspi-mutter.c | 407 ++++++++++++++++++++++++++++++++ atspi/atspi-object.c | 12 +- atspi/atspi-object.h | 12 +- atspi/atspi-private.h | 13 +- atspi/atspi-registry.c | 53 ++++- atspi/atspi-registry.h | 14 +- atspi/atspi-relation.c | 12 +- atspi/atspi-relation.h | 12 +- atspi/atspi-selection.c | 12 +- atspi/atspi-selection.h | 12 +- atspi/atspi-stateset.c | 12 +- atspi/atspi-stateset.h | 12 +- atspi/atspi-table-cell.c | 20 +- atspi/atspi-table-cell.h | 12 +- atspi/atspi-table.c | 18 +- atspi/atspi-table.h | 12 +- atspi/atspi-text.c | 82 ++++++- atspi/atspi-text.h | 15 +- atspi/atspi-types.h | 13 +- atspi/atspi-value.c | 12 +- atspi/atspi-value.h | 12 +- atspi/atspi.h | 12 +- atspi/atspimarshal.list | 25 ++ atspi/meson.build | 12 +- bus/at-spi-bus-launcher.c | 140 ++++------- bus/meson.build | 1 + dbind/dbind-any.c | 12 +- dbind/dbind-any.h | 12 +- dbind/dbind.c | 12 +- dbind/dbind.h | 12 +- dbind/dbtest.c | 12 +- doc/libatspi/libatspi-sections.txt | 4 + doc/libatspi/tmpl/atspi-accessible.sgml | 10 + idl/accessible.didl | 234 ------------------ idl/action.didl | 60 ----- idl/application.didl | 24 -- idl/cache.didl | 27 --- idl/collection.didl | 69 ------ idl/component.didl | 178 -------------- idl/controller.didl | 97 -------- idl/device.didl | 33 --- idl/document.didl | 25 -- idl/event.didl | 79 ------- idl/hypertext.didl | 82 ------- idl/image.didl | 33 --- idl/listener.didl | 9 - idl/selection.didl | 54 ----- idl/socket.didl | 31 --- idl/table.didl | 186 --------------- idl/text.didl | 311 ------------------------ idl/types.didl | 25 -- idl/value.didl | 15 -- meson.build | 18 +- meson_options.txt | 16 +- registryd/de-marshaller.c | 12 +- registryd/de-marshaller.h | 12 +- registryd/de-types.h | 12 +- registryd/deviceeventcontroller-x11.c | 25 +- registryd/deviceeventcontroller.c | 14 +- registryd/deviceeventcontroller.h | 12 +- registryd/display.c | 12 +- registryd/display.h | 12 +- registryd/event-source.c | 12 +- registryd/event-source.h | 12 +- registryd/keymasks.h | 12 +- registryd/meson.build | 2 +- registryd/paths.h | 12 +- registryd/reentrant-list.c | 12 +- registryd/reentrant-list.h | 12 +- registryd/registry-main.c | 12 +- registryd/registry.c | 12 +- registryd/registry.h | 12 +- xml/Accessible.xml | 2 + xml/Text.xml | 14 ++ 116 files changed, 1662 insertions(+), 2304 deletions(-) create mode 100644 atspi/atspi-mutter-private.h create mode 100644 atspi/atspi-mutter.c create mode 100644 atspi/atspimarshal.list delete mode 100644 idl/accessible.didl delete mode 100644 idl/action.didl delete mode 100644 idl/application.didl delete mode 100644 idl/cache.didl delete mode 100644 idl/collection.didl delete mode 100644 idl/component.didl delete mode 100644 idl/controller.didl delete mode 100644 idl/device.didl delete mode 100644 idl/document.didl delete mode 100644 idl/event.didl delete mode 100644 idl/hypertext.didl delete mode 100644 idl/image.didl delete mode 100644 idl/listener.didl delete mode 100644 idl/selection.didl delete mode 100644 idl/socket.didl delete mode 100644 idl/table.didl delete mode 100644 idl/text.didl delete mode 100644 idl/types.didl delete mode 100644 idl/value.didl diff --git a/AUTHORS b/AUTHORS index 6f89ab4..9f0f539 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,7 +2,7 @@ Authors of AT-SPI D-Bus implementation -------------------------------------- -Mike Gorse +Mike Gorse Mark Doffman diff --git a/COPYING b/COPYING index b8f9ad6..4362b49 100644 --- a/COPYING +++ b/COPYING @@ -1,13 +1,14 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] Preamble @@ -16,97 +17,109 @@ freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs @@ -145,7 +158,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -254,8 +267,8 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or + + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit @@ -282,23 +295,31 @@ of these things: Library will not necessarily be able to recompile the application to use the modified definitions.) - b) Accompany the work with a written offer, valid for at + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - c) If distribution of the work is made by offering access to copy + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - d) Verify that the user has already received a copy of these + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. @@ -308,7 +329,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -347,9 +368,9 @@ Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to +You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -390,7 +411,7 @@ excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. +versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. @@ -401,7 +422,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -435,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest @@ -453,19 +474,18 @@ convey the exclusion of warranty; and each file should have at least the Copyright (C) This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public + modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307 USA. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. diff --git a/INSTALL b/INSTALL index 54c3246..c9d569f 100644 --- a/INSTALL +++ b/INSTALL @@ -1,26 +1,26 @@ Install procedure ----------------- - % gzip -cd at-spi-core-2.0.0.tar.gz | tar xvf - # unpack the sources - % cd at-spi-core-2.0.0 # change to the toplevel directory - % ./configure # run the `configure' script - % make # build at-spi-core +tar -xJf at-spi2-core-2.34.0.tar.xz # unpack the sources + % cd at-spi2-core-2.34.0 # change to the toplevel directory +mkdir build # create a build directory +meson .. # configure +ninja # build at-spi2-core [ Become root if necessary ] - % make install # install at-spi-core +ninja install # install at-spi2-core Requirements ------------ - GNU make - GNU autotools - - pkg-config +Packages with local machine architecture: +meson +ninja +pkg-config +gobject-introspection +gtk-doc (for generation of documentation) +Packages with target architecture: glib - dbus - dbus-glib - - X - XEVIE (Reccomended) +libX11, libXtst, libXi (for X11 support) diff --git a/NEWS b/NEWS index 0dd86dc..f18af9a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,68 @@ +What's new in at-spi2-core 2.34.0: + +* Fix a use after free when freeing an event. +* Clean up handling of the X11 property specifying the bus address (#18). +* Update doap. + +What's new in at-spi2-core 2.33.92: + +* Now requires meson 0.50.0. +* License is now LGPL-2.1+. +* Meson: only link to libdl when it is necessary. +* Update installation instructions. +* Clarify atspi_editable_text_insert_text documentation. +* Do not warn on no reply from pending get_items call. +* Eliminate some superfluous runtime warnings. + +What's new in at-spi2-core 2.33.90: + +* Refactor the API for the screen reader to notify listeners of its status. + +* Add a sender to the AtspiEvent struct. + +* Add missing atspi_application_get_type prototype. + +* Support mutter remote desktop interface for synthesizing keyboard/mouse + events (likely still needs work). + +What's new in at-spi2-core 2.33.2: + +* Check WAYLAND_DISPLAY, rather than XDG_SESSION_TYPE, to avoid X + connections. Fixes breakage if X is started with startx and + XDG_SESSION_TYPE is unset. + +* X11: also try mod4 and mod5 to generate keysyms. + +* Add ATSPI_ROLE_CONTENT_DELETION and ATSPI_ROLE_CONTENT_INSERTION. + +* Check for dbus-daemon in /usr/lib (for Solaris). + +What's new in at-spi2-core 2.33.1: + +* Fix meson build for meson 0.50.0. + +* Add atspi_accessible_get_accessible_id. + +* Add atspi_text_notify_reading_position. + +* Check for an actual X11 session before calling X. This will be needed + for Mutter in the future because checking $DISPLAY is not sufficient, + and xwyland could be automatically started when it isn't wanted. + +What's new in at-spi2-core 2.31.92: + +* Fix atspi_table_cell_get_(row_column)_header_cells. + +* Update documentation to indicate that extents are only meaningful + when an object has both STATE_VISIBLE and STATE_SHOWING. + +* Use a consistent style for the meson options. + +* Fix a compiler warning on BSD. + + +* Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces. + What's new in at-spi2-core 2.31.1: * Bus launcher: fix an issue where the error wasn't cleared on failure. diff --git a/at-spi2-core.doap b/at-spi2-core.doap index 1ac8f84..85d64df 100644 --- a/at-spi2-core.doap +++ b/at-spi2-core.doap @@ -5,31 +5,28 @@ xmlns="http://usefulinc.com/ns/doap#"> at-spi2-core - D-Bus accessibility specifications and registration daemon + D-Bus accessibility specifications, library, and registration daemon + The Access Technology Service Provider Interface +(AT-SPI) is a set of interfaces that allow access technologies such as screen +readers to programmatically determine what is being displayed on the screen and +simulate keyboard and mouse events. It can also be used for automated testing. + +The at-spi2-core module contains the D-Bus specification, the registry daemon, +and a C library for use by access technologies that provides a convenient +wrapper around the DBus interfaces. + + + C - Mark Doffman - - markdoffman - - - - Mike Gorse mgorse - - - Li Yuan - - liyuan - - diff --git a/atspi/atspi-accessible-private.h b/atspi/atspi-accessible-private.h index 496f7d7..e7e748b 100644 --- a/atspi/atspi-accessible-private.h +++ b/atspi/atspi-accessible-private.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_ACCESSIBLE_PRIVATE_H_ @@ -29,6 +29,7 @@ G_BEGIN_DECLS #include "atspi-accessible.h" +#include "atspimarshal.h" struct _AtspiAccessiblePrivate { diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index e7f1446..fd6737d 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -7,28 +7,82 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" #include "atspi-accessible-private.h" #include +enum { + REGION_CHANGED, + LAST_SIGNAL +}; + static gboolean enable_caching = FALSE; static guint quark_locale; +static guint atspi_accessible_signals[LAST_SIGNAL] = { 0, }; + +static gboolean +screen_reader_signal_watcher (GSignalInvocationHint *signal_hint, + guint n_param_values, + const GValue *param_values, + gpointer data) +{ + GObject *object; + AtspiAccessible *accessible; + GSignalQuery signal_query; + const char *name; + DBusMessage *signal; + DBusMessageIter iter, iter_struct, iter_variant, iter_array; + dbus_int32_t detail1, detail2; + const char *detail = ""; + + object = g_value_get_object (param_values + 0); + g_return_val_if_fail (ATSPI_IS_ACCESSIBLE(object), FALSE); + + g_signal_query (signal_hint->signal_id, &signal_query); + name = signal_query.signal_name; + detail1 = g_value_get_int (param_values + 1); + detail2 = g_value_get_int (param_values + 2); + accessible = ATSPI_ACCESSIBLE (object); + + signal = dbus_message_new_signal (ATSPI_DBUS_PATH_SCREEN_READER, + ATSPI_DBUS_INTERFACE_EVENT_SCREEN_READER, + "RegionChanged"); + dbus_message_iter_init_append (signal, &iter); + dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &detail); + dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &detail1); + dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &detail2); + dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, "(so)", + &iter_variant); + dbus_message_iter_open_container (&iter_variant, DBUS_TYPE_STRUCT, NULL, + &iter_struct); + dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_STRING, &accessible->parent.app->bus_name); + dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_OBJECT_PATH, &accessible->parent.path); + dbus_message_iter_close_container (&iter_variant, &iter_struct); + dbus_message_iter_close_container (&iter, &iter_variant); + dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "{sv}", + &iter_array); + dbus_message_iter_close_container (&iter, &iter_array); + dbus_connection_send (_atspi_bus (), signal, NULL); + dbus_message_unref (signal); + return TRUE; +} + static void atspi_action_interface_init (AtspiAction *action) { @@ -109,6 +163,13 @@ static gint accessible_count = 0; #endif static void +atspi_accessible_unref (GObject *accessible) +{ + if (accessible != NULL) + g_object_unref(accessible); +} + +static void atspi_accessible_init (AtspiAccessible *accessible) { #ifdef DEBUG_REF_COUNTS @@ -119,7 +180,7 @@ atspi_accessible_init (AtspiAccessible *accessible) accessible->priv = atspi_accessible_get_instance_private (accessible); - accessible->children = g_ptr_array_new_with_free_func (g_object_unref); + accessible->children = g_ptr_array_new_with_free_func (atspi_accessible_unref); } static void @@ -189,6 +250,8 @@ atspi_accessible_finalize (GObject *object) #endif G_OBJECT_CLASS (atspi_accessible_parent_class)->finalize (object); + + /* TODO: remove emission hook */ } static void @@ -200,6 +263,33 @@ atspi_accessible_class_init (AtspiAccessibleClass *klass) object_class->finalize = atspi_accessible_finalize; quark_locale = g_quark_from_string ("accessible-locale"); + + /** + * AtspiAccessible::region-changed: + * @atspiaccessible: the object which received the signal + * @arg1: an integer specifying the current offset of the text being read, + * if the object is textual. + * @arg2: an integer specifying the ending offset of the text being read, + * if the object is textual. + * + * The signal "region-changed" is emitted by a screen reader to indicate + * that it is now reading or tracking a new object, or, a new piece of + * text within an object. This allows a magnifier to gain the information + * needed to highlight the object that the screen reader is reading. + */ + atspi_accessible_signals[REGION_CHANGED] = + g_signal_new ("region_changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AtspiAccessibleClass, region_changed), + NULL, NULL, + atspi_marshal_VOID__INT_INT, + G_TYPE_NONE, + 2, G_TYPE_INT, G_TYPE_INT); + + g_signal_add_emission_hook (atspi_accessible_signals[REGION_CHANGED], 0, + screen_reader_signal_watcher, NULL, + (GDestroyNotify) NULL); } /** @@ -1767,6 +1857,33 @@ atspi_accessible_get_object_locale (AtspiAccessible *accessible, GError **error) return locale; } +/** + * atspi_accessible_get_accessible_id: + * @obj: an #AtspiAccessible + * + * Gets the accessible id of the accessible. This is not meant to be presented + * to the user, but to be an id which is stable over application development. + * Typically, this is the gtkbuilder id. + * + * Since: 2.34 + * + * Returns: a character string representing the accessible id of the + * #AtspiAccessible object or NULL on exception. + **/ +gchar* +atspi_accessible_get_accessible_id (AtspiAccessible *obj, GError **error) +{ + gchar *accessible_id; + + g_return_val_if_fail (obj != NULL, NULL); + + if (!_atspi_dbus_get_property (obj, atspi_interface_accessible, + "AccessibleId", error, "s", &accessible_id)) + return NULL; + + return accessible_id; +} + void free_value (gpointer data) { diff --git a/atspi/atspi-accessible.h b/atspi/atspi-accessible.h index 443e395..13e4962 100644 --- a/atspi/atspi-accessible.h +++ b/atspi/atspi-accessible.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_ACCESSIBLE_H_ @@ -64,6 +64,8 @@ typedef struct _AtspiAccessibleClass AtspiAccessibleClass; struct _AtspiAccessibleClass { AtspiObjectClass parent_class; + + void (*region_changed) (AtspiAccessible *accessible, gint current_offset, gint last_offset); }; GType atspi_accessible_get_type (void); @@ -167,6 +169,8 @@ void atspi_accessible_clear_cache (AtspiAccessible *obj); guint atspi_accessible_get_process_id (AtspiAccessible *accessible, GError **error); +gchar * atspi_accessible_get_accessible_id (AtspiAccessible *obj, GError **error); + /* private */ void _atspi_accessible_add_cache (AtspiAccessible *accessible, AtspiCache flag); AtspiCache _atspi_accessible_get_cache_mask (AtspiAccessible *accessible); diff --git a/atspi/atspi-action.c b/atspi/atspi-action.c index 731773a..bc9cb7b 100644 --- a/atspi/atspi-action.c +++ b/atspi/atspi-action.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-action.h b/atspi/atspi-action.h index 99de8af..e1056e7 100644 --- a/atspi/atspi-action.h +++ b/atspi/atspi-action.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_ACTION_H_ diff --git a/atspi/atspi-application.c b/atspi/atspi-application.c index f7dd225..cccaf86 100644 --- a/atspi/atspi-application.c +++ b/atspi/atspi-application.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-application.h b/atspi/atspi-application.h index a3826d5..0662031 100644 --- a/atspi/atspi-application.h +++ b/atspi/atspi-application.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_APPLICATION_H_ @@ -64,6 +64,8 @@ struct _AtspiApplicationClass AtspiApplication * _atspi_application_new (const char *bus_name); +GType atspi_application_get_type (void); + G_END_DECLS #endif /* _ATSPI_APPLICATION_H_ */ diff --git a/atspi/atspi-collection.c b/atspi/atspi-collection.c index d3f27da..d4d1537 100644 --- a/atspi/atspi-collection.c +++ b/atspi/atspi-collection.c @@ -6,19 +6,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-collection.h b/atspi/atspi-collection.h index 2ba9361..9b564c5 100644 --- a/atspi/atspi-collection.h +++ b/atspi/atspi-collection.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_COLLECTION_H_ diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index ed22582..59879bb 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* @@ -129,6 +129,8 @@ atspi_component_get_accessible_at_point (AtspiComponent *obj, * (e.g. ATSPI_COORD_TYPE_WINDOW, ATSPI_COORD_TYPE_SCREEN). * * Gets the bounding box of the specified #AtspiComponent. + * The returned values are meaningful only if the Component has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: An #AtspiRect giving the accessible's extents. **/ @@ -164,6 +166,8 @@ atspi_component_get_extents (AtspiComponent *obj, * (e.g. ATSPI_COORD_TYPE_WINDOW, ATSPI_COORD_TYPE_SCREEN). * * Gets the minimum x and y coordinates of the specified #AtspiComponent. + * The returned values are meaningful only if the Component has both + * STATE_VISIBLE and STATE_SHOWING. * * returns: An #AtspiPoint giving the @obj's position. **/ @@ -192,6 +196,8 @@ atspi_component_get_position (AtspiComponent *obj, * @obj: a pointer to the #AtspiComponent to query. * * Gets the size of the specified #AtspiComponent. + * The returned values are meaningful only if the Component has both + * STATE_VISIBLE and STATE_SHOWING. * * returns: An #AtspiPoint giving the @obj's size. **/ diff --git a/atspi/atspi-component.h b/atspi/atspi-component.h index c84232d..4e8f0ad 100644 --- a/atspi/atspi-component.h +++ b/atspi/atspi-component.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_COMPONENT_H_ diff --git a/atspi/atspi-constants.h b/atspi/atspi-constants.h index b9f41ef..8657ead 100644 --- a/atspi/atspi-constants.h +++ b/atspi/atspi-constants.h @@ -6,19 +6,19 @@ * Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* TODO: Auto-generate this file again @@ -1234,6 +1234,12 @@ typedef enum { * @ATSPI_ROLE_DESCRIPTION_VALUE: An object that represents the description, * definition, or value of a term. @Since: 2.26. * @ATSPI_ROLE_FOOTNOTE: An object that contains the text of a footnote. @Since: 2.26. + * @ATSPI_ROLE_CONTENT_DELETION: Content previously deleted or proposed to be + * deleted, e.g. in revision history or a content view providing suggestions + * from reviewers. @Since: 2.34. + * @ATSPI_ROLE_CONTENT_INSERTION: Content previously inserted or proposed to be + * inserted, e.g. in revision history or a content view providing suggestions + * from reviewers. @Since: 2.34. * @ATSPI_ROLE_LAST_DEFINED: Not a valid role, used for finding end of * enumeration. * @@ -1367,6 +1373,8 @@ typedef enum { ATSPI_ROLE_DESCRIPTION_TERM, ATSPI_ROLE_DESCRIPTION_VALUE, ATSPI_ROLE_FOOTNOTE, + ATSPI_ROLE_CONTENT_DELETION, + ATSPI_ROLE_CONTENT_INSERTION, ATSPI_ROLE_LAST_DEFINED, } AtspiRole; @@ -1375,7 +1383,7 @@ typedef enum { * * One higher than the highest valid value of #AtspiRole. */ -#define ATSPI_ROLE_COUNT (125+1) +#define ATSPI_ROLE_COUNT (127+1) typedef enum { @@ -1462,6 +1470,9 @@ typedef enum { #define ATSPI_DBUS_INTERFACE_VALUE "org.a11y.atspi.Value" #define ATSPI_DBUS_INTERFACE_SOCKET "org.a11y.atspi.Socket" +#define ATSPI_DBUS_PATH_SCREEN_READER "/org/a11y/atspi/screenreader" +#define ATSPI_DBUS_INTERFACE_EVENT_SCREEN_READER "org.a11y.atspi.Event.ScreenReader" + #ifdef __cplusplus } #endif diff --git a/atspi/atspi-device-listener-private.h b/atspi/atspi-device-listener-private.h index 1089e45..d8b533c 100644 --- a/atspi/atspi-device-listener-private.h +++ b/atspi/atspi-device-listener-private.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_DEVICE_LISTENER_PRIVATE_H_ diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c index 56597f7..8e04c41 100644 --- a/atspi/atspi-device-listener.c +++ b/atspi/atspi-device-listener.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-device-listener.h b/atspi/atspi-device-listener.h index 3b1b96d..d91a203 100644 --- a/atspi/atspi-device-listener.h +++ b/atspi/atspi-device-listener.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_DEVICE_LISTENER_H_ diff --git a/atspi/atspi-document.c b/atspi/atspi-document.c index 98dfc4f..a92c0e2 100644 --- a/atspi/atspi-document.c +++ b/atspi/atspi-document.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-document.h b/atspi/atspi-document.h index f326d89..429b8c6 100644 --- a/atspi/atspi-document.h +++ b/atspi/atspi-document.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_DOCUMENT_H_ diff --git a/atspi/atspi-editabletext.c b/atspi/atspi-editabletext.c index 58ac715..350617e 100644 --- a/atspi/atspi-editabletext.c +++ b/atspi/atspi-editabletext.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" @@ -86,8 +86,8 @@ atspi_editable_text_set_text_contents (AtspiEditableText *obj, * @position: a #gint indicating the character offset at which to insert * the new text. * @text: a string representing the text to insert, in UTF-8 encoding. - * @length: the number of characters of text to insert. If the character - * count of text is less than or equal to length, the entire contents + * @length: the number of characters of text to insert, in bytes. If the + * byte count of text is less than or equal to length, the entire contents * of text will be inserted. * * Inserts text into an #AtspiEditableText object. diff --git a/atspi/atspi-editabletext.h b/atspi/atspi-editabletext.h index 59b2331..efa5630 100644 --- a/atspi/atspi-editabletext.h +++ b/atspi/atspi-editabletext.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_EDITABLE_TEXT_H_ diff --git a/atspi/atspi-event-listener-private.h b/atspi/atspi-event-listener-private.h index 260db74..5a1a872 100644 --- a/atspi/atspi-event-listener-private.h +++ b/atspi/atspi-event-listener-private.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_EVENT_LISTENER_PRIVATE_H_ diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c index 6a3fe6b..249890b 100644 --- a/atspi/atspi-event-listener.c +++ b/atspi/atspi-event-listener.c @@ -7,24 +7,25 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" #include "atspi-accessible-private.h" #include +#include #include typedef struct @@ -169,12 +170,15 @@ static GList *event_listeners = NULL; static gchar * convert_name_from_dbus (const char *name, gboolean path_hack) { - gchar *ret = g_malloc (g_utf8_strlen (name, -1) * 2 + 1); + gchar *ret; const char *p = name; - gchar *q = ret; + gchar *q; - if (!ret) - return NULL; + if (!name) + return g_strdup (""); + + ret = g_malloc (g_utf8_strlen (name, -1) * 2 + 1); + q = ret; while (*p) { @@ -378,14 +382,14 @@ convert_event_type_to_dbus (const char *eventType, char **categoryp, char **name if (matchrule_array) { gchar *matchrule; + (*matchrule_array) = g_ptr_array_new (); matchrule = g_strdup_printf ("type='signal',interface='org.a11y.atspi.Event.%s'", category); if (name && name [0]) { - gchar *new_str = g_strconcat (matchrule, ",member='", name, "'", NULL); - g_free (matchrule); - matchrule = new_str; + gchar *new_str = g_strconcat (matchrule, ",member='", name, "'", NULL); + g_free (matchrule); + matchrule = new_str; } - (*matchrule_array) = g_ptr_array_new (); if (detail && detail [0]) { gchar *new_str = g_strconcat (matchrule, ",arg0='", detail, "'", NULL); @@ -467,6 +471,9 @@ listener_entry_free (EventListenerEntry *e) * object:model-changed * object:active-descendant-changed * + * (screen reader events) +* screen-reader:region-changed + * * (window events) * * window:minimize @@ -506,6 +513,9 @@ listener_entry_free (EventListenerEntry *e) * In general, listening to * toolkit-specific events is not recommended. * + * Currently, object:text-reading-position needs to be specified explicitly + * (it is not implied by object:text), since it is generated by the screen + * reader and is thus a special case internally. * * Returns: #TRUE if successful, otherwise #FALSE. **/ @@ -872,6 +882,7 @@ atspi_event_copy (AtspiEvent *src) dst->detail2 = src->detail2; g_value_init (&dst->any_data, G_VALUE_TYPE (&src->any_data)); g_value_copy (&src->any_data, &dst->any_data); + dst->sender = g_object_ref (src->sender); return dst; } @@ -881,6 +892,7 @@ atspi_event_free (AtspiEvent *event) g_object_unref (event->source); g_free (event->type); g_value_unset (&event->any_data); + g_object_unref (event->sender); g_free (event); } @@ -951,6 +963,7 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) { char *detail = NULL; const char *category = dbus_message_get_interface (message); + const char *sender = dbus_message_get_sender (message); const char *member = dbus_message_get_member (message); const char *signature = dbus_message_get_signature (message); gchar *name; @@ -965,7 +978,7 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) if (strcmp (signature, "siiv(so)") != 0 && strcmp (signature, "siiva{sv}") != 0) { - g_warning ("Got invalid signature %s for signal %s from interface %s\n", signature, member, category); + g_warning ("Got invalid signature %s for signal %s from interface %s\n", signature, member, category); return DBUS_HANDLER_RESULT_HANDLED; } @@ -1014,14 +1027,17 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) converted_type = p; } e.type = converted_type; - e.source = _atspi_ref_accessible (dbus_message_get_sender(message), dbus_message_get_path(message)); - if (e.source == NULL) + if (strcmp (category, "ScreenReader") != 0) { - g_warning ("Got no valid source accessible for signal for signal %s from interface %s\n", member, category); - g_free (converted_type); - g_free (name); - g_free (detail); - return DBUS_HANDLER_RESULT_HANDLED; + e.source = _atspi_ref_accessible (sender, dbus_message_get_path (message)); + if (e.source == NULL) + { + g_warning ("Got no valid source accessible for signal %s from interface %s\n", member, category); + g_free (converted_type); + g_free (name); + g_free (detail); + return DBUS_HANDLER_RESULT_HANDLED; + } } dbus_message_iter_recurse (&iter, &iter_variant); @@ -1032,17 +1048,24 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) AtspiRect rect; if (demarshal_rect (&iter_variant, &rect)) { - g_value_init (&e.any_data, ATSPI_TYPE_RECT); - g_value_set_boxed (&e.any_data, &rect); + g_value_init (&e.any_data, ATSPI_TYPE_RECT); + g_value_set_boxed (&e.any_data, &rect); } else { AtspiAccessible *accessible; - accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant); - g_value_init (&e.any_data, ATSPI_TYPE_ACCESSIBLE); - g_value_set_instance (&e.any_data, accessible); - if (accessible) - g_object_unref (accessible); /* value now owns it */ + accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant); + if (!strcmp (category, "ScreenReader")) + { + e.source = accessible; + } + else + { + g_value_init (&e.any_data, ATSPI_TYPE_ACCESSIBLE); + g_value_set_instance (&e.any_data, accessible); + if (accessible) + g_object_unref (accessible); /* value now owns it */ + } } break; } @@ -1064,6 +1087,8 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) cache = _atspi_dbus_update_cache_from_dict (e.source, &iter); } + e.sender = _atspi_ref_accessible (sender, ATSPI_DBUS_PATH_ROOT); + if (!strncmp (e.type, "object:children-changed", 23)) { cache_process_children_changed (&e); diff --git a/atspi/atspi-event-listener.h b/atspi/atspi-event-listener.h index ee52fac..b7ad327 100644 --- a/atspi/atspi-event-listener.h +++ b/atspi/atspi-event-listener.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_EVENT_LISTENER_H_ diff --git a/atspi/atspi-gmain.c b/atspi/atspi-gmain.c index 588a60d..8d74442 100644 --- a/atspi/atspi-gmain.c +++ b/atspi/atspi-gmain.c @@ -8,7 +8,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/atspi/atspi-gmain.h b/atspi/atspi-gmain.h index 8e2396c..9efbe5e 100644 --- a/atspi/atspi-gmain.h +++ b/atspi/atspi-gmain.h @@ -5,7 +5,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/atspi/atspi-hyperlink.c b/atspi/atspi-hyperlink.c index 80f8a54..c01f547 100644 --- a/atspi/atspi-hyperlink.c +++ b/atspi/atspi-hyperlink.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-hyperlink.h b/atspi/atspi-hyperlink.h index 86efa7b..7caea90 100644 --- a/atspi/atspi-hyperlink.h +++ b/atspi/atspi-hyperlink.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_HYPERLINK_H_ diff --git a/atspi/atspi-hypertext.c b/atspi/atspi-hypertext.c index ca186ea..7ddaab6 100644 --- a/atspi/atspi-hypertext.c +++ b/atspi/atspi-hypertext.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-hypertext.h b/atspi/atspi-hypertext.h index bebcf51..891fd3a 100644 --- a/atspi/atspi-hypertext.h +++ b/atspi/atspi-hypertext.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_HYPERTEXT_H_ diff --git a/atspi/atspi-image.c b/atspi/atspi-image.c index 4f17326..4fd5ae7 100644 --- a/atspi/atspi-image.c +++ b/atspi/atspi-image.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" @@ -49,6 +49,8 @@ atspi_image_get_image_description (AtspiImage *obj, GError **error) * @obj: a pointer to the #AtspiImage to query. * * Gets the size of the image displayed in a specified #AtspiImage object. + * The returned values are meaningful only if the Image has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a pointer to an #AtspiPoint where x corresponds to * the image's width and y corresponds to the image's height. @@ -78,6 +80,8 @@ atspi_image_get_image_size (AtspiImage *obj, GError **error) * * Gets the minimum x and y coordinates of the image displayed in a * specified #AtspiImage implementor. + * The returned values are meaningful only if the Image has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a pointer to an #AtspiPoint where x and y correspond to the * minimum coordinates of the displayed image. @@ -112,6 +116,8 @@ atspi_image_get_image_position (AtspiImage *obj, * * Gets the bounding box of the image displayed in a * specified #AtspiImage implementor. + * The returned values are meaningful only if the Image has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a pointer to an #AtspiRect corresponding to the image's bounding box. The minimum x and y coordinates, * width, and height are specified. diff --git a/atspi/atspi-image.h b/atspi/atspi-image.h index 3fa40ef..57fe3a1 100644 --- a/atspi/atspi-image.h +++ b/atspi/atspi-image.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_IMAGE_H_ diff --git a/atspi/atspi-matchrule-private.h b/atspi/atspi-matchrule-private.h index e55c2fa..a8b579a 100644 --- a/atspi/atspi-matchrule-private.h +++ b/atspi/atspi-matchrule-private.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_MATCH_RULE_PRIVATE_H_ diff --git a/atspi/atspi-matchrule.c b/atspi/atspi-matchrule.c index cf6a306..6fb4210 100644 --- a/atspi/atspi-matchrule.c +++ b/atspi/atspi-matchrule.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-matchrule.h b/atspi/atspi-matchrule.h index 0a006d0..ddcb0d6 100644 --- a/atspi/atspi-matchrule.h +++ b/atspi/atspi-matchrule.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_MATCH_RULE_H_ diff --git a/atspi/atspi-misc-private.h b/atspi/atspi-misc-private.h index 314746e..f0b5adb 100644 --- a/atspi/atspi-misc-private.h +++ b/atspi/atspi-misc-private.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_MISC_PRIVATE_H_ @@ -166,6 +166,8 @@ gboolean _atspi_get_allow_sync (); gboolean _atspi_set_allow_sync (gboolean val); void _atspi_set_error_no_sync (GError **error); + +gboolean _atspi_prepare_screen_reader_interface (); G_END_DECLS #endif /* _ATSPI_MISC_PRIVATE_H_ */ diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 9b97b18..9e8595a 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* @@ -159,7 +159,8 @@ cleanup () for (i = desktop->children->len - 1; i >= 0; i--) { AtspiAccessible *child = g_ptr_array_index (desktop->children, i); - g_object_run_dispose (G_OBJECT (child->parent.app)); + if (child->parent.app) + g_object_run_dispose (G_OBJECT (child->parent.app)); g_object_run_dispose (G_OBJECT (child)); } @@ -531,8 +532,9 @@ handle_get_items (DBusPendingCall *pending, void *user_data) { const char *sender = dbus_message_get_sender (reply); const char *error = NULL; - if (!strcmp (dbus_message_get_error_name (reply), - DBUS_ERROR_SERVICE_UNKNOWN)) + const char *error_name = dbus_message_get_error_name (reply); + if (!strcmp (error_name, DBUS_ERROR_SERVICE_UNKNOWN) + || !strcmp (error_name, DBUS_ERROR_NO_REPLY)) { } else @@ -1590,7 +1592,8 @@ atspi_get_a11y_bus (void) if (address_env != NULL && *address_env != 0) address = g_strdup (address_env); #ifdef HAVE_X11 - if (!address) + if (!address && g_getenv ("DISPLAY") != NULL && + g_getenv ("WAYLAND_DISPLAY") == NULL) address = get_accessibility_bus_address_x11 (); #endif if (!address) @@ -1849,3 +1852,50 @@ _atspi_set_error_no_sync (GError **error) g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_SYNC_NOT_ALLOWED, _("Attempted synchronous call where prohibited")); } + +static const char *sr_introspection = "\n" +"\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +""; + +static DBusHandlerResult +screen_reader_filter (DBusConnection *bus, DBusMessage *message, void *user_data) +{ + if (dbus_message_is_method_call (message, DBUS_INTERFACE_INTROSPECTABLE, + "Introspect")) + { + DBusMessage *reply = dbus_message_new_method_return (message); + dbus_message_append_args (reply, DBUS_TYPE_STRING, &sr_introspection, + DBUS_TYPE_INVALID); + dbus_connection_send (bus, reply, NULL); + dbus_message_unref (reply); + return DBUS_HANDLER_RESULT_HANDLED; + } + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + +gboolean +_atspi_prepare_screen_reader_interface () +{ + static gint initialized = 0; + DBusConnection *a11y_bus = _atspi_bus (); + + if (initialized) + return (initialized > 0); + + if (dbus_bus_request_name (a11y_bus, "org.a11y.Atspi.ScreenReader", 0, NULL) < 0) + { + initialized = -1; + return FALSE; + } + + initialized = 1; + dbus_connection_add_filter (a11y_bus, screen_reader_filter, NULL, NULL); + return TRUE; +} diff --git a/atspi/atspi-misc.h b/atspi/atspi-misc.h index f13596f..0461728 100644 --- a/atspi/atspi-misc.h +++ b/atspi/atspi-misc.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_MISC_H_ diff --git a/atspi/atspi-mutter-private.h b/atspi/atspi-mutter-private.h new file mode 100644 index 0000000..49140d0 --- /dev/null +++ b/atspi/atspi-mutter-private.h @@ -0,0 +1,36 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2019 SUSE LLC. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _ATSPI_MUTTER_H_ +#define _ATSPI_MUTTER_H_ + +G_BEGIN_DECLS + +gboolean _atspi_mutter_generate_keyboard_event (glong keyval, const gchar *keystring, AtspiKeySynthType synth_type, GError **error); + +gboolean _atspi_mutter_generate_mouse_event (glong x, glong y, const gchar *name, GError **error); + +void _atspi_mutter_set_reference_window (AtspiAccessible *accessible); +G_END_DECLS + +#endif /* _ATSPI_MUTTER_H_ */ diff --git a/atspi/atspi-mutter.c b/atspi/atspi-mutter.c new file mode 100644 index 0000000..4445c18 --- /dev/null +++ b/atspi/atspi-mutter.c @@ -0,0 +1,407 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2019 SUSE LLC. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/* atspi-mutter.c: support for keyboard/mouse handling using the + * mutter/gnome-shell remote desktop interfaces + * + * This functionality is analogous to the X11-based code in + * device-event-controller-x11.c. Placing the code here, rather than in the + * registry daemon, allows the relevant dbus calls to come directly from the + * AT-SPI client, rather than at-spi2-registryd being an intermediary, + * which may be useful if a distribution wishes to lock down access to the + * remote desktop interfaces. + */ + +#include "atspi-private.h" + +typedef struct +{ + DBusConnection *bus; + const char *rd_session_id; + const char *rd_session_path; + const char *sc_session_id; + const char *sc_session_path; + const char *sc_stream_path; + dbus_uint64_t window_id; + gboolean window_id_is_explicit; +} ATSPI_MUTTER_DATA; + +static ATSPI_MUTTER_DATA data; + +#define MUTTER_REMOTE_DESKTOP_BUS_NAME "org.gnome.Mutter.RemoteDesktop" +#define MUTTER_REMOTE_DESKTOP_OBJECT_PATH "/org/gnome/Mutter/RemoteDesktop" +#define MUTTER_REMOTE_DESKTOP_INTERFACE "org.gnome.Mutter.RemoteDesktop" +#define MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE "org.gnome.Mutter.RemoteDesktop.Session" +#define MUTTER_SCREEN_CAST_BUS_NAME "org.gnome.Mutter.ScreenCast" +#define MUTTER_SCREEN_CAST_OBJECT_PATH "/org/gnome/Mutter/ScreenCast" +#define MUTTER_SCREEN_CAST_INTERFACE "org.gnome.Mutter.ScreenCast" +#define MUTTER_SCREEN_CAST_SESSION_INTERFACE "org.gnome.Mutter.ScreenCast.Session" + +/* TODO: consider porting this to gdbus */ + +static void +ensure_bus () +{ + if (data.bus) + return; + data.bus = dbus_bus_get (DBUS_BUS_SESSION, NULL); +} + +static gboolean +ensure_rd_session_path (GError **error) +{ + char *session_path; + DBusError d_error; + + if (data.rd_session_path) + return (data.rd_session_path[0] != '\0'); + ensure_bus (); + + dbus_error_init (&d_error); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, MUTTER_REMOTE_DESKTOP_OBJECT_PATH, MUTTER_REMOTE_DESKTOP_INTERFACE, "CreateSession", &d_error, "=>o", &session_path); + + data.rd_session_path = g_strdup (session_path); + if (!data.rd_session_path[0]) + return FALSE; + + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "Start", &d_error, ""); + return TRUE; +} + +static dbus_uint64_t +get_window_id (const char *name) +{ + DBusMessage *message, *reply; + DBusError d_error; + dbus_uint64_t window_id; + DBusMessageIter iter, iter_array, iter_dict, iter_sub_array, iter_sub_dict; + const char *prop_name; + const char *cur_name; + dbus_bool_t cur_focus; + gboolean have_focus; + + dbus_error_init (&d_error); + message = dbus_message_new_method_call (MUTTER_REMOTE_DESKTOP_BUS_NAME, "/org/gnome/Shell/Introspect", "org.gnome.Shell.Introspect", "GetWindows"); + reply = dbus_connection_send_with_reply_and_block (data.bus, message, -1, &d_error); + dbus_message_unref (message); + + if (!reply) + return FALSE; + if (strcmp (dbus_message_get_signature (reply), "a{ta{sv}}") != 0) + { + dbus_message_unref (reply); + return FALSE; + } + + dbus_message_iter_init (reply, &iter); + dbus_message_iter_recurse (&iter, &iter_array); + while (dbus_message_iter_get_arg_type (&iter_array) != DBUS_TYPE_INVALID) + { + dbus_message_iter_recurse (&iter_array, &iter_dict); + dbus_message_iter_get_basic (&iter_dict, &window_id); + dbus_message_iter_next (&iter_dict); + dbus_message_iter_recurse (&iter_dict, &iter_sub_array); + cur_name = NULL; + have_focus = FALSE; + while (dbus_message_iter_get_arg_type (&iter_sub_array) != DBUS_TYPE_INVALID) + { + dbus_message_iter_recurse (&iter_sub_array, &iter_sub_dict); + dbus_message_iter_get_basic (&iter_sub_dict, &prop_name); + if (!strcmp (prop_name, "wm-class")) + { + DBusMessageIter iter_variant; + dbus_message_iter_next (&iter_sub_dict); + dbus_message_iter_recurse (&iter_sub_dict, &iter_variant); + dbus_message_iter_get_basic (&iter_variant, &cur_name); + } + if (!strcmp (prop_name, "has-focus")) + { + DBusMessageIter iter_variant; + dbus_message_iter_next (&iter_sub_dict); + dbus_message_iter_recurse (&iter_sub_dict, &iter_variant); + dbus_message_iter_get_basic (&iter_variant, &cur_focus); + have_focus = TRUE; + } + if (cur_name && have_focus) + { + if ((name && !strcmp (name, cur_name)) || cur_focus) + { + dbus_message_unref (reply); + return window_id; + } + break; + } + dbus_message_iter_next (&iter_sub_array); + } + dbus_message_iter_next (&iter_array); + } + + dbus_message_unref (reply); + return 0; +} + +static gboolean +ensure_rd_session_id (GError **error) +{ + DBusMessage *message, *reply; + DBusError d_error; + const char *interface = "org.gnome.Mutter.RemoteDesktop.Session"; + const char *prop_name = "SessionId"; + DBusMessageIter iter, iter_variant; + const char *session_id; + + if (data.rd_session_id) + return (data.rd_session_id[0] != '\0'); + + if (!ensure_rd_session_path (error)) + return FALSE; + + message = dbus_message_new_method_call (MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, "org.freedesktop.DBus.Properties", "Get"); + dbus_message_append_args (message, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &prop_name, DBUS_TYPE_INVALID); + + dbus_error_init (&d_error); + reply = dbus_connection_send_with_reply_and_block (data.bus, message, -1, &d_error); + dbus_message_unref (message); + if (!reply) + return FALSE; + if (strcmp (dbus_message_get_signature (reply), "v") != 0) + { + dbus_message_unref (reply); + return FALSE; + } + dbus_message_iter_init (reply, &iter); + dbus_message_iter_recurse (&iter, &iter_variant); + dbus_message_iter_get_basic (&iter_variant, &session_id); + data.rd_session_id = g_strdup (session_id); + dbus_message_unref (reply); + return TRUE; +} + +static gboolean +ensure_sc_session (GError **error) +{ + DBusMessage *message, *reply; + DBusError d_error; + DBusMessageIter iter, iter_array, iter_dict_entry, iter_variant; + const char *prop_name = "remote-desktop-session-id"; + const char *sc_session_path; + + if (!ensure_rd_session_id (error)) + return FALSE; + + if (data.sc_session_path) + return (data.sc_session_path[0] != '\0'); + + message = dbus_message_new_method_call (MUTTER_SCREEN_CAST_BUS_NAME, MUTTER_SCREEN_CAST_OBJECT_PATH, MUTTER_SCREEN_CAST_INTERFACE, "CreateSession"); + dbus_message_iter_init_append (message, &iter); + dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "{sv}", &iter_array); + dbus_message_iter_open_container (&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict_entry); + dbus_message_iter_append_basic (&iter_dict_entry, DBUS_TYPE_STRING, &prop_name); + dbus_message_iter_open_container (&iter_dict_entry, DBUS_TYPE_VARIANT, "s", &iter_variant); + dbus_message_iter_append_basic (&iter_variant, DBUS_TYPE_STRING, &data.rd_session_id); + dbus_message_iter_close_container (&iter_dict_entry, &iter_variant); + dbus_message_iter_close_container (&iter_array, &iter_dict_entry); + dbus_message_iter_close_container (&iter, &iter_array); + dbus_error_init (&d_error); + reply = dbus_connection_send_with_reply_and_block (data.bus, message, -1, &d_error); + dbus_message_unref (message); + if (!reply) + return FALSE; + if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &sc_session_path, DBUS_TYPE_INVALID)) + { + dbus_message_unref (reply); + return FALSE; + } + + data.sc_session_path = g_strdup (sc_session_path); + dbus_message_unref (reply); + return TRUE; +} + +static gboolean +init_mutter (gboolean need_window, GError **error) +{ + dbus_uint64_t window_id; + const char *prop_name = "window-id"; + DBusError d_error; + DBusMessageIter iter, iter_array, iter_dict_entry, iter_variant; + DBusMessage *message, *reply; + const char *sc_stream_path; + + if (!ensure_rd_session_path (error)) + return FALSE; + + if (!need_window) + return TRUE; + + window_id = (data.window_id_is_explicit) ? data.window_id + : get_window_id (NULL); + if (!window_id) + return FALSE; + + if (!ensure_sc_session (error)) + return FALSE; + + if (window_id == data.window_id) + return TRUE; + + message = dbus_message_new_method_call (MUTTER_SCREEN_CAST_BUS_NAME, data.sc_session_path, MUTTER_SCREEN_CAST_SESSION_INTERFACE, "RecordWindow"); + dbus_message_iter_init_append (message, &iter); + dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "{sv}", &iter_array); + dbus_message_iter_open_container (&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict_entry); + dbus_message_iter_append_basic (&iter_dict_entry, DBUS_TYPE_STRING, &prop_name); + dbus_message_iter_open_container (&iter_dict_entry, DBUS_TYPE_VARIANT, "t", &iter_variant); + dbus_message_iter_append_basic (&iter_variant, DBUS_TYPE_UINT64, &window_id); + dbus_message_iter_close_container (&iter_dict_entry, &iter_variant); + dbus_message_iter_close_container (&iter_array, &iter_dict_entry); + dbus_message_iter_close_container (&iter, &iter_array); + dbus_error_init (&d_error); + reply = dbus_connection_send_with_reply_and_block (data.bus, message, -1, &d_error); + dbus_message_unref (message); + if (!reply) + return FALSE; + if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &sc_stream_path, DBUS_TYPE_INVALID)) + { + dbus_message_unref (reply); + return FALSE; + } + + data.sc_stream_path = g_strdup (sc_stream_path); + dbus_message_unref (reply); + data.window_id = window_id; + return TRUE; +} + +gboolean +_atspi_mutter_generate_keyboard_event (glong keyval, + const gchar *keystring, + AtspiKeySynthType synth_type, GError **error) +{ + DBusError d_error; + dbus_uint32_t d_keyval = keyval; + + if (!init_mutter (FALSE, error)) + return FALSE; + + dbus_error_init (&d_error); + switch (synth_type) + { + case ATSPI_KEY_PRESS: + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyKeyboardKeycode", &d_error, "ub", d_keyval, TRUE); + break; + case ATSPI_KEY_RELEASE: + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyKeyboardKeycode", &d_error, "ub", d_keyval, FALSE); + break; + case ATSPI_KEY_PRESSRELEASE: + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyKeyboardKeycode", &d_error, "ub", d_keyval, TRUE); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyKeyboardKeycode", &d_error, "ub", d_keyval, FALSE); + break; + case ATSPI_KEY_SYM: + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyKeyboardKeysyme", &d_error, "ub", d_keyval, TRUE); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyKeyboardKeysyme", &d_error, "ub", d_keyval, FALSE); + break; + default: + /* TODO: set error */ + g_warning ("%s: unsupported type", __func__); + return FALSE; + } + if (dbus_error_is_set (&d_error)) + { + g_warning ("GenerateKeyboardEvent failed: %s", d_error.message); + dbus_error_free (&d_error); + return FALSE; + } + + return TRUE; +} + +gboolean +_atspi_mutter_generate_mouse_event (glong x, glong y, const gchar *name, GError **error) +{ + gint button = 0; + double d_x = x, d_y = y; + DBusError d_error; + + if (!init_mutter (TRUE, error)) + return FALSE; + + dbus_error_init (&d_error); + switch (name[0]) + { + case 'b': + button = name[1] - '1'; + if (button < 0 || button > 4) + return FALSE; + if (x != -1 && y != -1) + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerMotionAbsolute", &d_error, "sdd", data.sc_stream_path, d_x, d_y); + switch (name[2]) + { + case 'p': + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, TRUE); + break; + case 'r': + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, FALSE); + break; + case 'c': + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, TRUE); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, FALSE); + break; + case 'd': + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, TRUE); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, FALSE); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, TRUE); + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerButton", &d_error, "ib", button, FALSE); + break; + default: + return FALSE; + } + break; + case 'a': /* absolute motion */ + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerMotionAbsolute", &d_error, "sdd", data.sc_stream_path, d_x, d_y); + break; + case 'r': /* relative */ + dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "NotifyPointerMotionRelative", &d_error, "dd", d_x, d_y); + break; + default: + return FALSE; + } + return TRUE; +} + +void +_atspi_mutter_set_reference_window (AtspiAccessible *accessible) +{ + if (accessible) + { + AtspiRole role = atspi_accessible_get_role (accessible, NULL); + gchar *name; + g_return_if_fail (role != ATSPI_ROLE_APPLICATION); + name = atspi_accessible_get_name (accessible, NULL); + data.window_id = get_window_id (name); + data.window_id_is_explicit = TRUE; + } + + else + { + data.window_id_is_explicit = FALSE; + } +} diff --git a/atspi/atspi-object.c b/atspi/atspi-object.c index 3545845..a838ba0 100644 --- a/atspi/atspi-object.c +++ b/atspi/atspi-object.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-object.h b/atspi/atspi-object.h index 69dd551..5acbde8 100644 --- a/atspi/atspi-object.h +++ b/atspi/atspi-object.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_OBJECT_H_ diff --git a/atspi/atspi-private.h b/atspi/atspi-private.h index 2cf5693..9ddc600 100644 --- a/atspi/atspi-private.h +++ b/atspi/atspi-private.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_PRIVATE_H_ @@ -30,6 +30,7 @@ #include "atspi-event-listener-private.h" #include "atspi-matchrule-private.h" #include "atspi-misc-private.h" +#include "atspi-mutter-private.h" #include "glib/gi18n.h" diff --git a/atspi/atspi-registry.c b/atspi/atspi-registry.c index 76b1926..c50ae20 100644 --- a/atspi/atspi-registry.c +++ b/atspi/atspi-registry.c @@ -7,19 +7,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* atspi_registry.c: Global functions wrapping the registry */ @@ -424,6 +424,12 @@ atspi_deregister_device_event_listener (AtspiDeviceListener *listener, return TRUE; } +static gboolean +using_mutter () +{ + return (g_getenv ("WAYLAND_DISPLAY") != NULL); +} + /** * atspi_generate_keyboard_event: * @keyval: a #gint indicating the keycode or keysym or modifier mask of the @@ -456,6 +462,12 @@ atspi_generate_keyboard_event (glong keyval, dbus_int32_t d_keyval = keyval; DBusError d_error; + if (using_mutter ()) + { + if (_atspi_mutter_generate_keyboard_event (keyval, keystring, synth_type, error)) + return TRUE; + } + dbus_error_init (&d_error); if (!keystring) keystring = ""; @@ -492,6 +504,14 @@ atspi_generate_mouse_event (glong x, glong y, const gchar *name, GError **error) dbus_int32_t d_x = x, d_y = y; DBusError d_error; + g_return_val_if_fail (name != NULL, FALSE); + + if (using_mutter ()) + { + if (_atspi_mutter_generate_mouse_event (x, y, name, error)) + return TRUE; + } + dbus_error_init (&d_error); dbind_method_call_reentrant (_atspi_bus(), atspi_bus_registry, atspi_path_dec, atspi_interface_dec, @@ -506,6 +526,27 @@ atspi_generate_mouse_event (glong x, glong y, const gchar *name, GError **error) return TRUE; } +/** + * atspi_set_reference_window: + * + * @accessible: the #AtspiAccessible corresponding to the window to select. + * should be a top-level window with a role of + * ATSPI_ROLE_APPLICATION. + * + * Sets the reference window that will be used when atspi_generate_mouse_event + * is called. Coordinates will be assumed to be relative to this window. This + * is needed because, due to Wayland's security model, it is not currently + * possible to retrieve global coordinates. + * If NULL is passed, then AT-SPI will use the window that has focus at the + * time that atspi_generate_mouse_event is called. + */ +void +atspi_set_reference_window (AtspiAccessible *accessible) +{ + if (using_mutter ()) + _atspi_mutter_set_reference_window (accessible); +} + AtspiKeyDefinition * atspi_key_definition_copy (AtspiKeyDefinition *src) { diff --git a/atspi/atspi-registry.h b/atspi/atspi-registry.h index 18e32a6..43150c2 100644 --- a/atspi/atspi-registry.h +++ b/atspi/atspi-registry.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_REGISTRY_H_ @@ -71,6 +71,8 @@ atspi_generate_keyboard_event (glong keyval, gboolean atspi_generate_mouse_event (glong x, glong y, const gchar *name, GError **error); +void +atspi_set_reference_window (AtspiAccessible *accessible); G_END_DECLS #endif /* _ATSPI_REGISTRY_H_ */ diff --git a/atspi/atspi-relation.c b/atspi/atspi-relation.c index 82bb668..c441f2b 100644 --- a/atspi/atspi-relation.c +++ b/atspi/atspi-relation.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-relation.h b/atspi/atspi-relation.h index 4eecad3..0c32d6a 100644 --- a/atspi/atspi-relation.h +++ b/atspi/atspi-relation.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_RELATION_H_ diff --git a/atspi/atspi-selection.c b/atspi/atspi-selection.c index 7318989..0e72845 100644 --- a/atspi/atspi-selection.c +++ b/atspi/atspi-selection.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-selection.h b/atspi/atspi-selection.h index 8ac7e44..dda225a 100644 --- a/atspi/atspi-selection.h +++ b/atspi/atspi-selection.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_SELECTION_H_ diff --git a/atspi/atspi-stateset.c b/atspi/atspi-stateset.c index 366c48b..dd99d91 100644 --- a/atspi/atspi-stateset.c +++ b/atspi/atspi-stateset.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-stateset.h b/atspi/atspi-stateset.h index f6fd32f..e9e261e 100644 --- a/atspi/atspi-stateset.h +++ b/atspi/atspi-stateset.h @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_STATE_SET_H_ diff --git a/atspi/atspi-table-cell.c b/atspi/atspi-table-cell.c index 1df1fa9..83fe534 100644 --- a/atspi/atspi-table-cell.c +++ b/atspi/atspi-table-cell.c @@ -7,19 +7,19 @@ * Copyright 2013 SUSE LLC. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include /* for malloc */ @@ -34,7 +34,7 @@ get_object_array_and_unref (DBusMessage *reply) if (!reply) return NULL; - if (strcmp (dbus_message_get_signature (reply), "(so)") != 0) + if (strcmp (dbus_message_get_signature (reply), "a(so)") != 0) { dbus_message_unref (reply); return NULL; @@ -58,6 +58,8 @@ get_object_array_and_unref (DBusMessage *reply) * @obj: a GObject instance that implements AtspiTableCellIface * * Returns the number of columns occupied by this cell accessible. + * The returned values are meaningful only if the table cell has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a gint representing the number of columns occupied by this cell, * or 0 if the cell does not implement this method. @@ -101,6 +103,8 @@ atspi_table_cell_get_column_header_cells (AtspiTableCell *obj, GError **error) * @obj: a GObject instance that implements AtspiTableCellIface * * Returns the number of rows occupied by this cell accessible. + * The returned values are meaningful only if the table cell has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a gint representing the number of rows occupied by this cell, * or 0 if the cell does not implement this method. @@ -206,6 +210,8 @@ atspi_table_cell_get_position (AtspiTableCell *obj, * @column_span: (out): the number of columns occupied by this cell. * * Gets the row and column indexes and extents of this cell accessible. + * The returned values are meaningful only if the table cell has both + * STATE_VISIBLE and STATE_SHOWING. */ void atspi_table_cell_get_row_column_span (AtspiTableCell *obj, diff --git a/atspi/atspi-table-cell.h b/atspi/atspi-table-cell.h index 757ab0d..b16cd4b 100644 --- a/atspi/atspi-table-cell.h +++ b/atspi/atspi-table-cell.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_TABLE_CELL_H_ diff --git a/atspi/atspi-table.c b/atspi/atspi-table.c index b17e2f1..08718f4 100644 --- a/atspi/atspi-table.c +++ b/atspi/atspi-table.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include /* for malloc */ @@ -285,6 +285,8 @@ atspi_table_get_column_description (AtspiTable *obj, * Gets the number of rows spanned by the table cell at the specific row * and column. (some tables can have cells which span multiple rows * and/or columns). + * The returned values are meaningful only if the Table has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a #gint indicating the number of rows spanned by the specified cell. **/ @@ -313,6 +315,8 @@ atspi_table_get_row_extent_at (AtspiTable *obj, * Gets the number of columns spanned by the table cell at the specific * row and column (some tables can have cells which span multiple * rows and/or columns). + * The returned values are meaningful only if the Table has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: a #gint indicating the number of columns spanned by the specified cell. **/ @@ -646,6 +650,8 @@ atspi_table_remove_column_selection (AtspiTable *obj, * extents, and whether the cell is currently selected. If * the child at index is not a cell (for instance, if it is * a summary, caption, etc.), #FALSE is returned. + * The returned values are meaningful only if the Table has both + * STATE_VISIBLE and STATE_SHOWING. * * Example: * If the #AtspiTable child at index '6' extends across columns 5 and 6 of diff --git a/atspi/atspi-table.h b/atspi/atspi-table.h index 1295df1..942f2f6 100644 --- a/atspi/atspi-table.h +++ b/atspi/atspi-table.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_TABLE_H_ diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c index 1e887d3..de99773 100644 --- a/atspi/atspi-text.c +++ b/atspi/atspi-text.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" @@ -618,6 +618,8 @@ atspi_text_get_character_at_offset (AtspiText *obj, * * Gets a bounding box containing the glyph representing * the character at a particular text offset. + * The returned values are meaningful only if the Text has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: An #AtspiRect specifying the position and size of the character. * @@ -690,6 +692,8 @@ atspi_text_get_offset_at_point (AtspiText *obj, * for the returned values. * * Gets the bounding box for text within a range in an #AtspiText object. + * The returned values are meaningful only if the Text has both + * STATE_VISIBLE and STATE_SHOWING. * * Returns: An #AtspiRect giving the position and size of the specified range * of text. @@ -892,6 +896,72 @@ atspi_text_set_selection (AtspiText *obj, return retval; } +/** + * atspi_text_scroll_substring_to: + * @obj: a pointer to the #AtspiText object on which to operate. + * @start_offset: a #gint indicating the start of the desired text range. + * @end_offset: a #gint indicating the first character past the desired range. + * @type: a #AtspiScrollType indicating where the object should be placed on the + * screen. + * + * Scrolls whatever container of the #AtspiText text range so it becomes + * visible on the screen. + * + * Returns: #TRUE if successful, #FALSE otherwise. + **/ +gboolean +atspi_text_scroll_substring_to (AtspiText *obj, + gint start_offset, + gint end_offset, + AtspiScrollType type, + GError **error) +{ + dbus_bool_t retval = FALSE; + + g_return_val_if_fail (obj != NULL, FALSE); + + _atspi_dbus_call (obj, atspi_interface_text, "ScrollSubstringTo", + error, "iiu=>b", + start_offset, end_offset, type, &retval); + + return retval; +} + +/** + * atspi_text_scroll_substring_to_point: + * @obj: a pointer to the #AtspiText object on which to operate. + * @start_offset: a #gint indicating the start of the desired text range. + * @end_offset: a #gint indicating the first character past the desired range. + * @coords: a #AtspiCoordType indicating whether the coordinates are relative to + * the screen, to the window, or to the parent object. + * @x: the x coordinate of the point to reach + * @y: the y coordinate of the point to reach + * + * Scrolls whatever container of the #AtspiText text range so it becomes + * visible on the screen at a given position. + * + * Returns: #TRUE if successful, #FALSE otherwise. + **/ +gboolean +atspi_text_scroll_substring_to_point (AtspiText *obj, + gint start_offset, + gint end_offset, + AtspiCoordType coords, + gint x, + gint y, + GError **error) +{ + dbus_bool_t retval = FALSE; + + g_return_val_if_fail (obj != NULL, FALSE); + + _atspi_dbus_call (obj, atspi_interface_text, "ScrollSubstringToPoint", + error, "iiuii=>b", + start_offset, end_offset, coords, x, y, &retval); + + return retval; +} + static void atspi_text_base_init (AtspiText *klass) { diff --git a/atspi/atspi-text.h b/atspi/atspi-text.h index 8e11eb0..994d12b 100644 --- a/atspi/atspi-text.h +++ b/atspi/atspi-text.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_TEXT_H_ @@ -137,6 +137,9 @@ gboolean atspi_text_remove_selection (AtspiText *obj, gint selection_num, GError gboolean atspi_text_set_selection (AtspiText *obj, gint selection_num, gint start_offset, gint end_offset, GError **error); +gboolean atspi_text_scroll_substring_to (AtspiText *obj, gint start_offset, gint end_offset, AtspiScrollType type, GError **error); + +gboolean atspi_text_scroll_substring_to_point (AtspiText *obj, gint start_offset, gint end_offset, AtspiCoordType coords, gint x, gint y, GError **error); G_END_DECLS #endif /* _ATSPI_TEXT_H_ */ diff --git a/atspi/atspi-types.h b/atspi/atspi-types.h index e458a8e..2631baf 100644 --- a/atspi/atspi-types.h +++ b/atspi/atspi-types.h @@ -7,19 +7,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_TYPES_H_ @@ -89,6 +89,7 @@ struct _AtspiEvent gint detail1; gint detail2; GValue any_data; + AtspiAccessible *sender; }; /** diff --git a/atspi/atspi-value.c b/atspi/atspi-value.c index 642533d..28acade 100644 --- a/atspi/atspi-value.c +++ b/atspi/atspi-value.c @@ -7,19 +7,19 @@ * Copyright 2010, 2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "atspi-private.h" diff --git a/atspi/atspi-value.h b/atspi/atspi-value.h index 6a1e531..a012793 100644 --- a/atspi/atspi-value.h +++ b/atspi/atspi-value.h @@ -8,19 +8,19 @@ * * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_VALUE_H_ diff --git a/atspi/atspi.h b/atspi/atspi.h index dc92de0..89ff20f 100644 --- a/atspi/atspi.h +++ b/atspi/atspi.h @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _ATSPI_H diff --git a/atspi/atspimarshal.list b/atspi/atspimarshal.list new file mode 100644 index 0000000..2d9dd51 --- /dev/null +++ b/atspi/atspimarshal.list @@ -0,0 +1,25 @@ +# see glib-genmarshal(1) for a detailed description of the file format, +# possible parameter types are: +# VOID indicates no return type, or no extra +# parameters. if VOID is used as the parameter +# list, no additional parameters may be present. +# BOOLEAN for boolean types (gboolean) +# CHAR for signed char types (gchar) +# UCHAR for unsigned char types (guchar) +# INT for signed integer types (gint) +# UINT for unsigned integer types (guint) +# LONG for signed long integer types (glong) +# ULONG for unsigned long integer types (gulong) +# ENUM for enumeration types (gint) +# FLAGS for flag enumeration types (guint) +# FLOAT for single-precision float types (gfloat) +# DOUBLE for double-precision float types (gdouble) +# STRING for string types (gchar*) +# PARAM for GParamSpec or derived types (GParamSpec*) +# BOXED for boxed (anonymous but reference counted) types (GBoxed*) +# POINTER for anonymous pointer types (gpointer) +# OBJECT for GObject or derived types (GObject*) +# NONE deprecated alias for VOID +# BOOL deprecated alias for BOOLEAN + +VOID:INT,INT diff --git a/atspi/meson.build b/atspi/meson.build index b7a9357..8a2ca27 100644 --- a/atspi/meson.build +++ b/atspi/meson.build @@ -13,6 +13,7 @@ atspi_sources = [ 'atspi-hypertext.c', 'atspi-image.c', 'atspi-matchrule.c', + 'atspi-mutter.c', 'atspi-misc.c', 'atspi-object.c', 'atspi-registry.c', @@ -57,7 +58,14 @@ atspi_headers = [ atspi_includedir = join_paths(get_option('prefix'), get_option('includedir'), 'at-spi-2.0', 'atspi') -install_headers(atspi_headers, subdir: atspi_includedir) +install_headers(atspi_headers, install_dir: atspi_includedir) + +# Marshallers +atspi_marshals = gnome.genmarshal('atspimarshal', + sources: 'atspimarshal.list', + prefix: 'atspi_marshal', +) +atspi_marshal_h = atspi_marshals[1] atspi_enums = gnome.mkenums('atspi-enum-types', sources: [ 'atspi-constants.h', 'atspi-types.h' ], @@ -67,7 +75,7 @@ atspi_enums = gnome.mkenums('atspi-enum-types', install_header: true) atspi_enum_h = atspi_enums[1] -atspi = library('atspi', atspi_sources + atspi_enums, +atspi = library('atspi', atspi_sources + atspi_enums + atspi_marshals, version: soversion, soversion: soversion.split('.')[0], include_directories: [ root_inc, registryd_inc ], diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 17f01c0..b4f49b8 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -5,19 +5,19 @@ * Copyright 2011-2018 Red Hat, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "config.h" @@ -63,6 +63,9 @@ typedef struct { /* -1 == error, 0 == pending, > 0 == running */ int a11y_bus_pid; char *a11y_bus_address; +#ifdef HAVE_X11 + gboolean x11_prop_set; +#endif int pipefd[2]; int listenfd; char *a11y_launch_error_message; @@ -323,6 +326,7 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path) { app->a11y_launch_error_message = g_strdup_printf ("Failed to read address: %s", strerror (errno)); kill (app->a11y_bus_pid, SIGTERM); + app->a11y_bus_pid = -1; goto error; } close (app->pipefd[0]); @@ -466,20 +470,22 @@ ensure_a11y_bus (A11yBusLauncher *app) #endif #ifdef HAVE_X11 - { - Display *display = XOpenDisplay (NULL); - if (display) - { - Atom bus_address_atom = XInternAtom (display, "AT_SPI_BUS", False); - XChangeProperty (display, - XDefaultRootWindow (display), - bus_address_atom, - XA_STRING, 8, PropModeReplace, - (guchar *) app->a11y_bus_address, strlen (app->a11y_bus_address)); - XFlush (display); - XCloseDisplay (display); - } - } + if (g_getenv ("DISPLAY") != NULL && g_getenv ("WAYLAND_DISPLAY") == NULL) + { + Display *display = XOpenDisplay (NULL); + if (display) + { + Atom bus_address_atom = XInternAtom (display, "AT_SPI_BUS", False); + XChangeProperty (display, + XDefaultRootWindow (display), + bus_address_atom, + XA_STRING, 8, PropModeReplace, + (guchar *) app->a11y_bus_address, strlen (app->a11y_bus_address)); + XFlush (display); + XCloseDisplay (display); + app->x11_prop_set = TRUE; + } + } #endif return TRUE; @@ -677,16 +683,6 @@ on_bus_acquired (GDBusConnection *connection, } app->session_bus = connection; - if (app->launch_immediately) - { - ensure_a11y_bus (app); - if (app->state == A11Y_BUS_STATE_ERROR) - { - g_main_loop_quit (app->loop); - return; - } - } - error = NULL; registration_id = g_dbus_connection_register_object (connection, "/org/a11y/bus", @@ -728,6 +724,18 @@ on_name_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) { + A11yBusLauncher *app = user_data; + + if (app->launch_immediately) + { + ensure_a11y_bus (app); + if (app->state == A11Y_BUS_STATE_ERROR) + { + g_main_loop_quit (app->loop); + return; + } + } + g_bus_watch_name (G_BUS_TYPE_SESSION, "org.gnome.SessionManager", G_BUS_NAME_WATCHER_FLAGS_NONE, @@ -771,50 +779,6 @@ init_sigterm_handling (A11yBusLauncher *app) app); } -static gboolean -already_running () -{ -#ifdef HAVE_X11 - Atom AT_SPI_BUS; - Atom actual_type; - Display *bridge_display; - int actual_format; - unsigned char *data = NULL; - unsigned long nitems; - unsigned long leftover; - gboolean result = FALSE; - - bridge_display = XOpenDisplay (NULL); - if (!bridge_display) - return FALSE; - - AT_SPI_BUS = XInternAtom (bridge_display, "AT_SPI_BUS", False); - XGetWindowProperty (bridge_display, - XDefaultRootWindow (bridge_display), - AT_SPI_BUS, 0L, - (long) BUFSIZ, False, - (Atom) 31, &actual_type, &actual_format, - &nitems, &leftover, &data); - - if (data) - { - GDBusConnection *bus; - bus = g_dbus_connection_new_for_address_sync ((const gchar *)data, 0, - NULL, NULL, NULL); - if (bus != NULL) - { - result = TRUE; - g_object_unref (bus); - } - } - - XCloseDisplay (bridge_display); - return result; -#else - return FALSE; -#endif -} - static GSettings * get_schema (const gchar *name) { @@ -860,9 +824,6 @@ main (int argc, gboolean screen_reader_set = FALSE; gint i; - if (already_running ()) - return 0; - _global_app = g_slice_new0 (A11yBusLauncher); _global_app->loop = g_main_loop_new (NULL, FALSE); @@ -931,19 +892,20 @@ main (int argc, * we don't want early login processes to pick up the stale address. */ #ifdef HAVE_X11 - { - Display *display = XOpenDisplay (NULL); - if (display) - { - Atom bus_address_atom = XInternAtom (display, "AT_SPI_BUS", False); - XDeleteProperty (display, - XDefaultRootWindow (display), - bus_address_atom); + if (_global_app->x11_prop_set) + { + Display *display = XOpenDisplay (NULL); + if (display) + { + Atom bus_address_atom = XInternAtom (display, "AT_SPI_BUS", False); + XDeleteProperty (display, + XDefaultRootWindow (display), + bus_address_atom); - XFlush (display); - XCloseDisplay (display); - } - } + XFlush (display); + XCloseDisplay (display); + } + } #endif if (_global_app->a11y_launch_error_message) diff --git a/bus/meson.build b/bus/meson.build index 5c7e03d..155dc53 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -44,6 +44,7 @@ else '/usr/sbin/dbus-daemon', '/libexec/dbus-daemon', '/usr/libexec/dbus-daemon', + '/usr/lib/dbus-daemon', '/usr/pkg/bin/dbus-daemon', required: false) if dbus_daemon.found() diff --git a/dbind/dbind-any.c b/dbind/dbind-any.c index ae499d7..efdba73 100644 --- a/dbind/dbind-any.c +++ b/dbind/dbind-any.c @@ -2,19 +2,19 @@ * Copyright 2008-2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* type driven marshalling */ diff --git a/dbind/dbind-any.h b/dbind/dbind-any.h index dd2a27b..859c895 100644 --- a/dbind/dbind-any.h +++ b/dbind/dbind-any.h @@ -2,19 +2,19 @@ * Copyright 2008-2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _DBIND_ANY_H_ diff --git a/dbind/dbind.c b/dbind/dbind.c index 9d7304e..e154f85 100644 --- a/dbind/dbind.c +++ b/dbind/dbind.c @@ -2,19 +2,19 @@ * Copyright 2008-2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/dbind/dbind.h b/dbind/dbind.h index f7298d0..0c10c7d 100644 --- a/dbind/dbind.h +++ b/dbind/dbind.h @@ -2,19 +2,19 @@ * Copyright 2008-2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef _DBIND_H_ diff --git a/dbind/dbtest.c b/dbind/dbtest.c index 42c1919..4f58540 100644 --- a/dbind/dbtest.c +++ b/dbind/dbtest.c @@ -2,19 +2,19 @@ * Copyright 2008-2011 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/doc/libatspi/libatspi-sections.txt b/doc/libatspi/libatspi-sections.txt index 14304ff..d7bfc10 100644 --- a/doc/libatspi/libatspi-sections.txt +++ b/doc/libatspi/libatspi-sections.txt @@ -30,6 +30,8 @@ atspi_text_set_selection atspi_text_get_string_at_offset atspi_text_get_text_attribute_value atspi_text_get_text_attributes +atspi_text_scroll_substring_to +atspi_text_scroll_substring_to_point ATSPI_TEXT ATSPI_IS_TEXT @@ -249,6 +251,7 @@ atspi_accessible_get_table_iface atspi_accessible_get_text_iface atspi_accessible_get_value_iface atspi_accessible_get_interfaces +atspi_accessible_get_accessible_id ATSPI_ACCESSIBLE ATSPI_IS_ACCESSIBLE @@ -501,6 +504,7 @@ atspi_register_device_event_listener atspi_deregister_device_event_listener atspi_generate_keyboard_event atspi_generate_mouse_event +atspi_set_reference_window
diff --git a/doc/libatspi/tmpl/atspi-accessible.sgml b/doc/libatspi/tmpl/atspi-accessible.sgml index 5b3c8ea..0e161ee 100644 --- a/doc/libatspi/tmpl/atspi-accessible.sgml +++ b/doc/libatspi/tmpl/atspi-accessible.sgml @@ -322,3 +322,13 @@ actually have children. @Returns: + + + + + +@obj: +@error: +@Returns: + + diff --git a/idl/accessible.didl b/idl/accessible.didl deleted file mode 100644 index eee462f..0000000 --- a/idl/accessible.didl +++ /dev/null @@ -1,234 +0,0 @@ - -/* - The base interface which is implemented by all accessible objects. - */ - -interface org.freestandards.atspi.Accessible { - - enum Role { - ROLE_INVALID = 0, - ROLE_ACCELERATOR_LABEL, - ROLE_ALERT, - ROLE_ANIMATION, - ROLE_ARROW, - ROLE_CALENDAR, - ROLE_CANVAS, - ROLE_CHECK_BOX, - ROLE_CHECK_MENU_ITEM, - ROLE_COLOR_CHOOSER, - ROLE_COLUMN_HEADER, - ROLE_COMBO_BOX, - ROLE_DATE_EDITOR, - ROLE_DESKTOP_ICON, - ROLE_DESKTOP_FRAME, - ROLE_DIAL, - ROLE_DIALOG, - ROLE_DIRECTORY_PANE, - ROLE_DRAWING_AREA, - ROLE_FILE_CHOOSER, - ROLE_FILLER, - ROLE_FOCUS_TRAVERSABLE, - ROLE_FONT_CHOOSER, - ROLE_FRAME, - ROLE_GLASS_PANE, - ROLE_HTML_CONTAINER, - ROLE_ICON, - ROLE_IMAGE, - ROLE_INTERNAL_FRAME, - ROLE_LABEL, - ROLE_LAYERED_PANE, - ROLE_LIST, - ROLE_LIST_ITEM, - ROLE_MENU, - ROLE_MENU_BAR, - ROLE_MENU_ITEM, - ROLE_OPTION_PANE, - ROLE_PAGE_TAB, - ROLE_PAGE_TAB_LIST, - ROLE_PANEL, - ROLE_PASSWORD_TEXT, - ROLE_POPUP_MENU, - ROLE_PROGRESS_BAR, - ROLE_PUSH_BUTTON, - ROLE_RADIO_BUTTON, - ROLE_RADIO_MENU_ITEM, - ROLE_ROOT_PANE, - ROLE_ROW_HEADER, - ROLE_SCROLL_BAR, - ROLE_SCROLL_PANE, - ROLE_SEPARATOR, - ROLE_SLIDER, - ROLE_SPIN_BUTTON, - ROLE_SPLIT_PANE, - ROLE_STATUS_BAR, - ROLE_TABLE, - ROLE_TABLE_CELL, - ROLE_TABLE_COLUMN_HEADER, - ROLE_TABLE_ROW_HEADER, - ROLE_TEAROFF_MENU_ITEM, - ROLE_TERMINAL, - ROLE_TEXT, - ROLE_TOGGLE_BUTTON, - ROLE_TOOL_BAR, - ROLE_TOOL_TIP, - ROLE_TREE, - ROLE_TREE_TABLE, - ROLE_UNKNOWN - } - - /* - RelationType specifies a relationship between objects outside of the normal - parent/child hierarchical relationship. It allows better semantic - identification of how objects are associated with one another. - */ - enum RelationType { - RELATION_NULL = 0, - RELATION_LABEL_FOR, - RELATION_LABELLED_BY, - RELATION_CONTROLLER_FOR, - RELATION_CONTROLLED_BY, - RELATION_MEMBER_OF, - RELATION_TOOLTIP_FOR, - RELATION_NODE_CHILD_OF, - RELATION_NODE_PARENT_OF, - RELATION_EXTENDED, - RELATION_FLOWS_TO, - RELATION_FLOWS_FROM, - RELATION_SUBWINDOW_OF, - RELATION_EMBEDS, - RELATION_EMBEDDED_BY, - RELATION_POPUP_FOR, - RELATION_PARENT_WINDOW_OF, - RELATION_DESCRIPTION_FOR, - RELATION_DESCRIBED_BY, - RELATION_LAST_DEFINED - } - - /* - Describes a one-to-many relationship between accessible objects. - */ - struct Relation { - RelationType type; - Reference objects []; - } - - enum uint32 StateType { - STATE_INVALID = 0, - STATE_ACTIVE, - STATE_ARMED, - STATE_BUSY, - STATE_CHECKED, - STATE_COLLAPSED, - STATE_DEFUNCT, - STATE_EDITABLE, - STATE_ENABLED, - STATE_EXPANDABLE, - STATE_EXPANDED, - STATE_FOCUSABLE, - STATE_FOCUSED, - STATE_HAS_TOOLTIP, - STATE_HORIZONTAL, - STATE_ICONIFIED, - STATE_MODAL, - STATE_MULTI_LINE, - STATE_MULTISELECTABLE, - STATE_OPAQUE, - STATE_PRESSED, - STATE_RESIZABLE, - STATE_SELECTABLE, - STATE_SELECTED, - STATE_SENSITIVE, - STATE_SHOWING, - STATE_SINGLE_LINE, - STATE_STALE, - STATE_TRANSIENT, - STATE_VERTICAL, - STATE_VISIBLE, - STATE_MANAGES_DESCENDANTS, - STATE_INDETERMINATE, - STATE_REQUIRED, - STATE_TRUNCATED, - STATE_ANIMATED, - STATE_INVALID_ENTRY, - STATE_SUPPORTS_AUTOCOMPLETION, - STATE_SELECTABLE_TEXT, - STATE_IS_DEFAULT, - STATE_VISITED, - STATE_LAST_DEFINED - } - - /* - A two integer array representing a bit-field of currently held states. - */ - typedef State uint32 []; - - /* A short string representing the object's name. */ - read property string Name; - - /* A string describing the object in more detail. */ - read property string Description; - - /* The accessible object which is this objects containing parent */ - read property Reference Parent; - - /* The number of children contained by this object */ - read property int32 ChildCount; - - /* Get the accessible child of this object at the given index */ - method GetChildAtIndex { - int32 index; - } reply { - Reference child; - } - - /* Get the index of this accessible object within its containing objects child list. */ - method GetIndexInParent reply { - int32 index; - } - - /* Access this objects non-hierarchical relationships to other accessible objects */ - method GetRelationSet reply { - RelationSet relations; - } - - /* Get the Role indicating the type of UI role played by this object. */ - method GetRole reply { - Role role; - } - - /* Get a string indicating the type of UI role played by this object */ - method GetRoleName reply { - string role; - } - - /* - Get a string indicating the type of UI role played by this object, - transalted to the current locale. - */ - method GetLocalizedRoleName { - string role; - } - - /* Access the states currently held by this object. */ - method GetState reply { - State state; - } - - /* - Get a properties applied to this object as a whole, as an - set name-value pairs. As such these attributes may be considered - weakly-typed properties or annotations, as distinct - from the strongly-typed interface instance data. - */ - method GetAttributes reply { - Attributes attributes; - } - - /* - Get the containing Application for this object. - */ - method GetApplication reply { - Reference application; - } -} - diff --git a/idl/action.didl b/idl/action.didl deleted file mode 100644 index 48e89aa..0000000 --- a/idl/action.didl +++ /dev/null @@ -1,60 +0,0 @@ - -/* - An interface through which a user-actionable UI component can be manipulated. - - Typical actions include "click", "press", "release" or "open". -*/ -interface org.freestandards.atspi.Action { - /* - Represents a single action. - */ - struct Action { - /* String containing short description of action. */ - string name; - /* The description of an action may provide information about the result. */ - string description; - /* A string containing the key-binding or "" if none exists */ - string key_binding; - } - - property read int32 NActions; - - /* Get the description for the specified action. */ - method GetDescription { - int32 index; - } reply { - string description - } - - /* Get the name of the specified action */ - method GetName { - int32 index; - } reply { - string name; - } - - method GetLocalizedName { - int32 index; - } reply { - string name; - } - - /* Get the key-binding for the specified action. */ - method GetKeyBinding { - int32 index; - } reply { - string key_binding; - } - - /* Retrieves the actions associated with the object. */ - method GetActions reply { - Action actions []; - } - - /* Causes the object to perform the specified action. */ - method GetActions { - int32 index; - } reply { - boolean success; - } -} diff --git a/idl/application.didl b/idl/application.didl deleted file mode 100644 index 546fcfd..0000000 --- a/idl/application.didl +++ /dev/null @@ -1,24 +0,0 @@ - -/* - An interface identifying an object which is the root of the - hierarchy associated with a running application. -*/ -interface org.freestandards.atspi.Application { - - /* A string indicating the type of user interface toolkit used by the application. */ - read property string ToolkitName; - - /* A string indicating the version of the applications accessibility bridge. */ - read property string Version; - - /* A string indicating the version of the AT-SPI specification - supported by the application */ - read property string AtspiVersion; - - /* Gets the locale in which the application is currently running. */ - method GetLocale { - LocaleType locale_type; - } reply { - string locale; - } -} diff --git a/idl/cache.didl b/idl/cache.didl deleted file mode 100644 index 3cf9b11..0000000 --- a/idl/cache.didl +++ /dev/null @@ -1,27 +0,0 @@ - -interface org.freestandards.atspi.Cache { - - struct CacheItem { - object path; - Reference parent; - int index_in_parent; - int child_count; - string[] interfaces; - string name; - Role role; - string description; - StateSet states; - } - - method GetItems reply { - CacheItem[] items; - } - - signal AddAccessible { - CacheItem item; - } - - signal RemoveAccessible { - Reference item; - } -} diff --git a/idl/collection.didl b/idl/collection.didl deleted file mode 100644 index f3eee6e..0000000 --- a/idl/collection.didl +++ /dev/null @@ -1,69 +0,0 @@ - -/* TODO - Need to define the 'MatchRule' struct. */ - -namespace org.freestandards.atspi { - interface Collection { - enum SortOrder { - SORT_ORDER_INVALID = 0, - SORT_ORDER_CANONICAL, - SORT_ORDER_FLOW, - SORT_ORDER_TAB, - SORT_ORDER_REVERSE_CANONICAL, - SORT_ORDER_REVERSE_FLOW, - SORT_ORDER_REVERSE_TAB, - SORT_ORDER_LAST_DEFINED - } - - enum MatchType { - MATCH_INVALID = 0, - MATCH_ALL, - MATCH_ANY, - MATCH_NONE, - MATCH_EMPTY, - MATCH_LAST_DEFINED - } - - enum TreeTraversalType { - TREE_RESTRICT_CHILDREN, - TREE_RESTRICT_SIBLING, - TREE_INORDER, - TREE_LAST_DEFINED - } - - method GetMatches { - MatchRule rule; - SortOrder sort_by; - int32 count; - boolean traverse; - } reply { - Reference matches []; - } - - method GetMatchesTo { - object current_object; - MatchRule rule; - SortOrder sort_by; - TreeTraversalType type; - boolean recurse; - int32 count; - boolean traverse; - } reply { - Reference matches []; - } - - method GetMatchesFrom { - object current_object; - MatchRule rule; - SortOrder sort_by; - TreeTraversalType type; - int32 count; - boolean traverse; - } reply { - Reference matches []; - } - - method GetActiveDescendent reply { - Reference descendent; - } - } -} diff --git a/idl/component.didl b/idl/component.didl deleted file mode 100644 index 31cfbf0..0000000 --- a/idl/component.didl +++ /dev/null @@ -1,178 +0,0 @@ - -using org.freestandards.atspi.Accessible.Reference = Reference; - -/* - The Component interface is implemented by objects which occupy on-screen space, e.g. objects - which have onscreen visual representations. The methods in Component allow clients to identify - where the objects lie in the onscreen coordinate system, their relative size, stacking order, and - position. It also provides a mechanism whereby keyboard focus may be transferred to specific - user interface elements programmatically. This is a 2D API, coordinates of 3D objects are projected into the - 2-dimensional screen view for purposes of this interface. -*/ -interface org.freestandards.atspi.Component { - - /* - Used by Component, Image and Text interfaces to specify whether coordinates are - relative to the window or screen. - */ - enum CoordType { - COORD_TYPE_SCREEN = 0, - COORD_TYPE_WINDOW = 1 - } - - /* - Used by Component and Text interfaces, a struct defining a bounding rectange. - The coordinate system is determined by the context of the API call. - */ - struct BoundingBox { - int32 x; - int32 y; - int32 width; - int32 height; - } - - /* - Indicates the relative stacking order with respect to the onscreen visual representation. - - The order of layers, from bottom to top is: - LAYER_BACKGROUND - LAYER_WINDOW - LAYER_MDI - LAYER_CANVAS - LAYER_WIDGET - LAYER_POPUP - LAYER_OVERLAY - */ - enum ComponentLayer { - LAYER_INVALID, - LAYER_BACKGROUND, - LAYER_CANVAS, - LAYER_WIDGET, - LAYER_MDI, - LAYER_POPUP, - LAYER_OVERLAY, - LAYER_WINDOW, - LAYER_LAST_DEFINED - } - - /* - Describes where the object should be placed on the window. - */ - enum uint32 ScrollType { - SCROLL_TOP_LEFT = 0, - SCROLL_BOTTOM_RIGHT, - SCROLL_TOP_EDGE, - SCROLL_BOTTOM_EDGE, - SCROLL_LEFT_EDGE, - SCROLL_RIGHT_EDGE, - SCROLL_ANYWHERE - } - - /* - Specifies whether the coordinates are relative to the screen, to the - window, or to the parent object. - */ - enum uint32 CoordType { - COORD_TYPE_SCREEN = 0, - COORD_TYPE_WINDOW, - COORD_TYPE_PARENT - } - - /* - True if the specified point lies within the components bounding box. - */ - method Contains { - int32 x; - int32 y; - CoordType coord_type; - } reply { - boolean within; - } - - /* - Return the accessible child whose bounding box contains the specified point. - */ - method GetAccessibleAtPoint { - int32 x; - int32 y; - CoordType coord_type; - } reply { - Reference child; - } - - /* - Obtain the components bounding box, in pixels, relative to the specified coordinate system. - */ - method GetExtents { - CoordType cood_type; - } reply { - BoundingBox box; - } - - /* - Obtain the position of the current component in the specified coordinate system. - */ - method GetPosition { - CoordType coord_type; - } reply { - int32 x; - int32 y; - } - - /* - Obtain the size in the specified coordinate system. - Fully contains teh object's visual representation without accounting for viewport clipping. - */ - method GetSize reply { - int32 width; - int32 height; - } - - /* - The component layer in which this object resides. - */ - method GetLayer reply { - ComponentLayer layer; - } - - /* - Obtain the relative stacking order (i.e 'Z' order) of an object. - Larger values indicate that an object is on 'top' of the stack. - Only relevenat for objects in LAYER_MDI or LAYER_WINDOW. - */ - method GetMDIZOrder reply { - int16 order; - } - - /* - Request that an object obtain keyboard focus. - */ - method GrabFocus reply { - boolean success; - } - - /* - Obtain the alpha value of the component. - Alpha values are used with Z-Order to determine whether an obeject obscures - anothers visual representation. - */ - method GetAlpha reply { - double alpha; - } - - /* - Scroll this object so it becomes visible on the screen. - */ - method ScrollTo { - ScrollType type; - } - - /* - Scroll this object so it becomes visible on the screen at a given position. - */ - method ScrollToPoint { - CoordType type; - int32 x; - int32 y; - } -} diff --git a/idl/controller.didl b/idl/controller.didl deleted file mode 100644 index 4519a0a..0000000 --- a/idl/controller.didl +++ /dev/null @@ -1,97 +0,0 @@ - -interface org.freestandards.atspi.DeviceEventController { - - enum KeySynthType { - KEY_PRESS=0, - KEY_RELEASE, - KEY_PRESSRELEASE, - KEY_SYM, - KEY_STRING, - KEY_LOCKMODIFIERS, - KEY_UNLOCKMODIFIERS - } - - /* - Consumption of events and syncronous event delivery is a sore-thumb. - - The client should really have no say over what the DeviceEventController - does with regards to event delivery as such the 'syncronous' flag is redundant. - - The 'global' flag is now useless as XEVIE is no longer maintained. As such - the DeviceEventController will not recieve any device events from applications - not participating. - - The only possibly useful flag is 'preemptive'. However all keyboard events are - sent as pre-emptive from gail so its debateable whether even this flag is really - in-use. - */ - struct EventListenerMode { - /* Controller should block while delivering this event. */ - boolean syncronous; - /* Clients are allowed to consume this event. */ - boolean preemptive; - /* - Event notifications should be sent regardless of whether - focused application participates in AT-SPI accessibility. - */ - boolean global; - } - - struct KeyDefinition { - int32 keycode; - int32 keysym; - string keystring; - int32 unused; - } - - method RegisterKeystrokeListener { - object listener; - KeyDefinition[] keys; - uint32 mask; - EventType[] type; - EventListenerMode mode; - } reply { - boolean success; - } - - method DeregisterKeystrokeListener { - object listener; - KeyDefinition[] keys; - uint32 mask; - EventType[] type; - } - - method RegisterDeviceEventListener { - object listener; - EventType[] type; - } reply { - boolean success; - } - - method DeregisterDeviceEventListener { - object listener; - EventType[] type; - } - - method NotifyListenersSync { - DeviceEvent event; - } reply { - boolean consumed; - } - - method NotifyListenersAsync { - DeviceEvent event; - } - - method GenerateKeyboardEvent { - int32 keycode; - string keystring; - KeySynthType type; - } - - method GenerateMouseEvent { - int32 x; - int32 y; - string event_name; - } -} diff --git a/idl/device.didl b/idl/device.didl deleted file mode 100644 index 78bdd12..0000000 --- a/idl/device.didl +++ /dev/null @@ -1,33 +0,0 @@ - -namespace org.freestandards.atspi { - - enum EventType { - KEY_PRESSED_EVENT=0, - KEY_RELEASED_EVENT, - BUTTON_PRESSED_EVENT, - BUTTON_RELEASED_EVENT - } - - enum ModifierType { - MODIFIER_SHIFT=0, - MODIFIER_SHIFTLOCK, - MODIFIER_CONTROL, - MODIFIER_ALT, - MODIFIER_META, - MODIFIER_META2, - MODIFIER_META3, - MODIFIER_NUMLOCK - } - - struct DeviceEvent { - EventType type; - /* An identifier for the event, corresponds to XEvent serial number. */ - int32 stream_id; - /* A numeric code identifying the hardware or button on which the event occured. */ - int16 hw_code; - ModifierType modifiers; - int32 timestamp; - string event_string; - boolean is_text; - } -} diff --git a/idl/document.didl b/idl/document.didl deleted file mode 100644 index ce2a4f0..0000000 --- a/idl/document.didl +++ /dev/null @@ -1,25 +0,0 @@ - -/* - Indicates the start of a document. - - Children are part of the document content. -*/ -interface org.freestandards.atspi.Document { - - /* Gets the locale associated with the documents content. */ - method GetLocale reply { - string locale; - } - - /* Gets the value of a single attribute. */ - method GetAttributeValue { - string key; - } reply { - string value; - } - - /* Gets all attributes for the document as a whole. These are constant for all elements within the document.*/ - method GetAttributes reply { - Attributes attributes; - } -} diff --git a/idl/event.didl b/idl/event.didl deleted file mode 100644 index d4c75cc..0000000 --- a/idl/event.didl +++ /dev/null @@ -1,79 +0,0 @@ - -namespace org.freestandards.atspi.Event { - - struct Event { - string minor; - int32 detail1; - int32 detail2; - variant val; - Reference application; - } - - interface Object { - signal PropertyChange {Event event;} - signal BoundsChanged {Event event;} - signal LinkSelected {Event event;} - signal StateChanged {Event event;} - signal ChildrenChanged {Event event;} - signal VisibleDataChanged {Event event;} - signal SelectionChanged {Event event;} - signal ModelChanged {Event event;} - signal ActiveDescendantChanged {Event event;} - signal RowInserted {Event event;} - signal RowDeleted {Event event;} - signal RowReordered {Event event;} - signal ColumnInserted {Event event;} - signal ColumnDeleted {Event event;} - signal ColumnReordered {Event event;} - signal TextBoundsChanged {Event event;} - signal TextSelectionChanged {Event event;} - signal TextChanged {Event event;} - signal TextAttributesChanged {Event event;} - signal TextCaretMoved {Event event;} - signal AttributesChanged {Event event;} - } - - interface Window { - signal PropertyChange {Event event;} - signal Minimize {Event event;} - signal Maximize {Event event;} - signal Restore {Event event;} - signal Close {Event event;} - signal Create {Event event;} - signal Reparent {Event event;} - signal DesktopCreate {Event event;} - signal DesktopDestroy {Event event;} - signal Destroy {Event event;} - signal Activate {Event event;} - signal Deactivate {Event event;} - signal Raise {Event event;} - signal Lower {Event event;} - signal Move {Event event;} - signal Resize {Event event;} - signal Shade {Event event;} - signal Ushade {Event event;} - signal Restyle {Event event;} - } - - interface Mouse { - signal Abs {Event event;} - signal Rel {Event event;} - signal Button {Event event;} - } - - interface Keyboard { - signal Modifiers {Event event;} - } - - interface Document { - signal LoadComplete {Event event;} - signal Reload {Event event;} - signal LoadStopped {Event event;} - signal ContentChanged {Event event;} - signal AttributesChanged {Event event;} - } - - interface Focus { - signal Focus {Event event;} - } -} diff --git a/idl/hypertext.didl b/idl/hypertext.didl deleted file mode 100644 index 334dafd..0000000 --- a/idl/hypertext.didl +++ /dev/null @@ -1,82 +0,0 @@ - -namespace org.freestandards.atspi { - /* - Instances of Hyperlink are returned by Hypertext object and - are the means by which end users and clients interact with linked - content. - - Hyperlink instances DO NOT neccessarily implement the Accessible interface. - */ - interface HyperLink { - /* The number of separate anchors associated with this Hyperlink. */ - read property int32 NAnchors; - - /* - The starting offset within the contianing Hypertext, - with which this Hyperlink is associated. - */ - read property int32 StartIndex; - - /* - The ending offset within the containing Hypertext with which - this Hyperlink is associated. - */ - read property int32 EndIndex; - - /* - Gets the i'th object associated with a Hyperlink. - Objects returned should implement the Action interface. - */ - method GetObject { - int32 index; - } reply { - Reference anchor; - } - - /* - Obtain a resource locator, URI, which can be used to access the content - which this link points to. - */ - method GetUri { - int32 index; - } reply { - string uri; - } - - /* - Check the hyperlink to see if a connection to its backing content can be - established or if its URI is valid. - */ - method IsValid reply { - boolean valid; - } - } - - /* - An interface used for objects which implement linking between multiple resource locations. - A hypertext instance is associated with one or more hyperlinks which are associated with - particular offests within the text. - */ - interface Hypertext { - - method GetNLinks reply { - int32 n_links; - } - - method GetLink { - int32 index; - } reply { - Reference hyperlink; - } - - /* - Get the hyperlink index, if any, associated with a particular text offset. - */ - method GetLinkIndex { - int32 offset; - } reply { - /* -1 if no hyperlink is associated. */ - int32 index; - } - } -} diff --git a/idl/image.didl b/idl/image.didl deleted file mode 100644 index 9dee626..0000000 --- a/idl/image.didl +++ /dev/null @@ -1,33 +0,0 @@ - -/* - An interface implemented by objects which render image data or - pictoral information on to the screen. -*/ -interface org.freestandards.atspi.Image { - /* A textual description of what is visually depicted on the screen. */ - read property string ImageDescription; - - /* A string corresponding to the local used by the image description. */ - read property string ImageLocale; - - /* Obtain a bounding box which entirely contains the image contents. */ - method GetImageExtents { - CoordType coord_type; - } reply { - BoundingBox; - } - - /* Get the coordinates of the image on the screen */ - method GetImagePosition { - CoordType coord_type; - } reply { - int32 x; - int32 y; - } - - /* Get the size of the current on-screen view of the image. */ - method GetImageSize reply { - int32 width; - int32 height; - } -} diff --git a/idl/listener.didl b/idl/listener.didl deleted file mode 100644 index 7e3f6a1..0000000 --- a/idl/listener.didl +++ /dev/null @@ -1,9 +0,0 @@ - -interface org.freestandards.atspi.DeviceEventListener { - - method NotifyEvent { - DeviceEvent event; - } reply { - boolean success; - } -} diff --git a/idl/selection.didl b/idl/selection.didl deleted file mode 100644 index 66fbef7..0000000 --- a/idl/selection.didl +++ /dev/null @@ -1,54 +0,0 @@ - -/* - An interface which indicates that an object exposes a 'selection' model, - allowing the 'selection' of one or more of its children. -*/ -interface org.freestandards.atspi.Selection { - /* The number of children that are currently selected. */ - read property int32 NSelectedChildren; - - /* Gets the ith SELECTED child. This is different to the index of all children. */ - method GetSelectedChild { - int32 index; - } reply { - Reference child; - } - - /* Select the child, add it to the list of selected children. */ - method SelectChild { - int32 index; - } reply { - boolean success; - } - - /* Deselect a child. The index refers to the index into the list of selected children. */ - method DeselectSelectedChild { - int32 index; - } reply { - boolean success; - } - - /* Determine whether a particular child is currently selected. */ - method IsChildSelected { - int32 index; - } reply { - boolean selected; - } - - /* Apptemt to select all of the containers children. */ - method SelectAll reply { - boolean success; - } - - /* Attempt to deselect all selected children. */ - method ClearSelection reply { - boolean success; - } - - /* Deselect a child. The index refers to the index into the list of all children. */ - method DeselectChild { - int32 index; - } reply { - boolean success; - } -} diff --git a/idl/socket.didl b/idl/socket.didl deleted file mode 100644 index 336ca6c..0000000 --- a/idl/socket.didl +++ /dev/null @@ -1,31 +0,0 @@ - -namespace org.freestandards.atspi { - /* - Accessible objects with the socket interface are capable of embeding other - accessible heirarchies as one of their children. This allows - applications to embed themselves in the heirarchy of the desktop object. - */ - interface Socket { - method Embed { - Reference plug; - } reply { - Reference socket; - } - - method Unembed { - Reference plug; - } - - /* - The available signal indicates that a socket has been - made available, it is for discovering new sockets. - This is used for when the process containing the desktop - object is re-started. - - D-Bus bus name must have been granted by the D-Bus bus. - It is used to identify the new socket. - */ - signal Available { - Reference socket; - } -} diff --git a/idl/table.didl b/idl/table.didl deleted file mode 100644 index ae1b8f0..0000000 --- a/idl/table.didl +++ /dev/null @@ -1,186 +0,0 @@ - -namespace org.freestandards.atspi { - - /* - An interface used by containers whose data is arranged in a tabular form. - Objects within tables are always children of the table object. - */ - interface Table { - read property int32 NRows; - - read property int32 NColumns; - - read property Reference caption; - - read property Reference summary; - - /* Number of rows where all cells are selected. */ - read property int32 NSelectedRows; - - /* Number of columns where all cells are selected. */ - read property int32 NSelectedColumns; - - method GetAccessibleAt { - int32 row; - int32 column; - } reply { - Reference cell; - } - - /* - Cells in a table are also children of the table in the standard heirarchy. - This method gets the child index of the given cell. - */ - method GetIndexAt { - int32 row; - int32 column; - } reply { - int32 index; - } - - /* - Indicates which row the child specified by index is on. - */ - method GetRowAtIndex { - int32 index; - } reply { - int32 row; - } - - /* - Indicates which column the child specified by index is on. - */ - method GetColumnAtIndex { - int32 index; - } reply { - int32 column; - } - - /* - Get a textual description of a row. - */ - method GetRowDescription { - int32 row; - } reply { - string description; - } - - /* - Get a textual description of a particular column. - */ - method GetColumnDescription { - int32 column; - } reply { - string description; - } - - /* - Get the number of rows spanned by the table cell at the specific row and column. - method GetRowExtentAt { - int32 row; - int32 column; - } reply { - int32 rowspan; - } - - /* - Get the number of columns spanned by the table cell at the specific row and column. - */ - method GetColumnExtentAt { - int32 row; - int32 column; - } reply { - int32 column_span; - } - - /* - Get the header object associated with a particular table row. - */ - method GetRowHeader { - int32 row; - } reply { - Reference header; - } - - /* - Get the header object associated with a particular table column. - */ - method GetColumnHeader { - int32 column; - } reply { - Reference header; - } - - /* - Obtain the indicies of all rows which are currently selected. - */ - method GetSelectedRows reply { - int32 indicies []; - } - - /* - Obtain the indicies of all columns which are currently selected. - */ - method GetSelectedColumns reply { - int32 indicies []; - } - - method IsRowSelected { - int32 row; - } reply { - boolean selected; - } - - method IsColumnSelected { - int32 column; - } reply { - boolean selected; - } - - method IsSelected { - int32 row; - int32 column; - } reply { - boolean selected; - } - - method AddRowSelection { - int32 row; - } reply { - boolean success; - } - - method AddColumnSelection { - int32 column; - } reply { - boolean success; - } - - method RemoveRowSelection { - int32 row; - } reply { - boolean success; - } - - method RemoveColumnSelection { - int32 column; - } reply { - boolean success; - } - - /* - Given a child index determine the row and column indicies and extents - and whether the cell is currently selected. - */ - method GetRowColumnExtentsAtIndex { - int32 index; - } reply { - boolean valid; - int32 row; - int32 column; - int32 row_span; - int32 column_span; - boolean selected; - } - } -} diff --git a/idl/text.didl b/idl/text.didl deleted file mode 100644 index 07ce85e..0000000 --- a/idl/text.didl +++ /dev/null @@ -1,311 +0,0 @@ - -namespace org.freestandards.atspi { - /* - The text interface should be implemented by objects which place textual information onscreen - as character strings or glyphs. The text interface allows access to textual content including - display attributes and semantic hints associated with runs of text, and to bounding boc information - for glyphs and substrings. It also alows portions of text to be selected, if the objects StateSet - includes STATE_SELECTABLE_TEXT. - */ - interface Text { - /* - Specified the boundary conditions determining a run of text - as returned from: - GetTextAtOffset - GetTextAfterOffset - GetTextBeforeOffset - */ - enum TextBoundaryType { - TEXT_BOUNDARY_CHAR, - TEXT_BOUNDARY_WORD_START, - TEXT_BOUNDARY_WORD_END, - TEXT_BOUNDARY_SENTENCE_START, - TEXT_BOUNDARY_SENTENCE_END, - TEXT_BOUNDARY_LINE_START, - TEXT_BOUNDARY_LINE_END - } - - enum TextClipType { - TEXT_CLIP_NONE, - TEXT_CLIP_MIN, - TEXT_CLIP_MAX, - TEXT_CLIP_BOTH - } - - /* - A structure used to define a contiguous range of text, including - its (unattributed) textual content. - */ - struct Range { - int32 start_offset; - int32 end_offset; - int32 content; - variant data; - } - - /* The total number of character in the text object including whitespace. */ - read property int32 CharacterCount; - - /* The current offset of the text caret in the Text object. */ - read property int32 CaretOffset; - - /* Move the text caret to a given position. */ - method SetCaretOffset { - int32 offset; - } reply { - boolean success; - } - - /* - Obtain the subset of text content that entirely precedes the given offset, - delimited by character word, line or sentente boundaries. - */ - method GetTextBeforeOffset { - int32 offset; - TextBoundaryType type; - } reply { - string s; - int32 start_offset; - int32 end_offset; - } - - /* - Obtain the subset of text content that includes the given offset, - delimited by character word, line or sentente boundaries. - */ - method GetTextAtOffset { - int32 offset; - TextBoundaryType type; - } reply { - string s; - int32 start_offset; - int32 end_offset; - } - - /* - Obtain the subset of text content that entirely follows the given offset, - delimited by character word, line or sentente boundaries. - */ - method GetTextAfterOffset { - int32 offset; - TextBoundaryType type; - } reply { - string s; - int32 start_offset; - int32 end_offset; - } - - method GetCharacterAtOffset { - int32 offset; - } reply { - /* UCS-4 representation of the character or 0 if offset out-of-range. */ - int32 c; - } - - /* - Get the value of a named attribute at a given offset. - */ - method GetAttributeValue { - int32 offset; - string attribute_key; - } reply { - string attribute_value; - } - - /* Deprecated in favor of GetAttributeRun. */ - method GetAttributes { - int32 offset; - } reply { - Attributes attributes; - int32 start_offset; - int32 end_offset; - } - - /* Deprecated in facor of GetDefaultAttributeSet. */ - method GetDefaultAttributes reply { - Attributes attributes; - } - - /* - Obtain a bounding box of the character glyph at a particular character offset, - in the given coordinate system. - */ - method GetCharacterExtents { - int32 offset; - CoordType coord; - } reply { - int32 x; - int32 y; - int32 width; - int32 height; - } - - /* - Get the offset of the character at a given on-screen coordinate. The coordinate - system used is determined by the give coordinate type. - */ - method GetOffsetAtPoint { - int32 x; - int32 y; - CoordType coord; - } reply { - /* -1 if the point is outside the bounds of any glyph. */ - int32 offset; - } - - /* - Obtain the number of separate, contiguous selections in the current Text object. - */ - method GetNSelections reply { - int32 n_selections; - } - - method GetSelection { - int32 selection_index; - } reply { - int32 start_offset; - int32 end_offset; - } - - method AddSelection { - int32 start_offset; - int32 end_offset; - } reply { - boolean success; - } - - method RemoveSelection { - int32 selection_index; - } reply { - boolean success; - } - - method SetSelection { - int32 selection_index; - int32 start_offset; - int32 end_offset; - } reply { - boolean success; - } - - /* - Obtain the bounding box which entirely contains the given text range. - Negative values may be obtained in the event that part of the text range is - off-screen. - */ - method GetRangeExtents { - int32 start_offset; - int32 end_offset; - CoordType coord; - } reply { - int32 x; - int32 y; - int32 width; - int32 height; - } - - /* - Return the text content within a bounding box. - - Depending on the clip type glyphs which are clipped by the bounding box - may, or may not be inclide in the ranges returned. - */ - method GetBoundedRanges { - int32 x; - int32 y; - int32 width; - int32 height; - CoordType coord; - ClipType x_clip; - ClipType y_clip; - } reply { - RangeType ranges []; - } - - /* - Gets the attributes of a particular text objects defined at a given offset. - The attributes are invariant over the offsets returned. - */ - method GetAttributeRun { - int32 offset; - boolean include_defaults; - } reply { - Attributes attributes; - int32 start_offset; - int32 end_offset; - } - - /* - Gets the default attributes that apply to the entire text. - */ - method GetAttributeSet reply { - Attributes attributes' - } - } - - /* - All objects supporting EditableText should also support the - Text interface. - - Provides methods for modifying textual content of components which support editing. - EditableText also interacts with the system clipboard. - */ - interface EditableText { - /* - Replace the text contents with a new string, discarding the old contents. - */ - method SetTextContents { - string new_contents; - } reply { - boolean success; - } - - /* - Insert new text contents into a given location. - */ - method InsertText { - int32 position; - string text; - int32 length; - } reply { - boolean success; - } - - /* - Copy a range of text in to the system clipboard. - */ - method CopyText { - int32 start_pos; - int32 end_pos; - } - - /* - Excise a range of text, copying it to the system clipboard. - */ - method CutText { - int32 start_pos; - int32 end_pos; - } reply { - boolean success; - } - - /* - Excise a range of text from the object without copying to the system clipboard. - */ - method DeleteText { - int32 start_pos; - int32 end_pos; - } reply { - boolean success; - } - - /* - Copy the contents of the system clip-board in to the text object. - */ - method PasteText { - int32 position; - } reply { - boolean success; - } - } -} diff --git a/idl/types.didl b/idl/types.didl deleted file mode 100644 index b8c4129..0000000 --- a/idl/types.didl +++ /dev/null @@ -1,25 +0,0 @@ -/* - Type definitions needed by multiple interfaces. -*/ - -namespace org.freestandards.atspi { - - /* - A connection independent reference to a D-Bus object. - - The D-Bus object that is referenced will support at-least - the org.freestandards.atspi.Accessible interface. - */ - struct Reference { - /* The D-Bus connection name where the object resides. */ - string name; - /* The D-Bus path of the object. */ - object path; - } - - /* - Attributes are weakly typed properties of an object consisting of string-string - key-value pairs. - */ - typedef Attributes dict ; -} diff --git a/idl/value.didl b/idl/value.didl deleted file mode 100644 index 476cb43..0000000 --- a/idl/value.didl +++ /dev/null @@ -1,15 +0,0 @@ - -/* - An interface supporting a one-dimensional scalar quantity - to be modified, or which reflects a scalar value. - */ -interface org.freestandards.atspi.Value { - - read property double MinimumValue; - - read property double MaximumValue; - - read property double MinimumIncrement; - - read property double currentValue; -} diff --git a/meson.build b/meson.build index 351b207..0a2f75e 100644 --- a/meson.build +++ b/meson.build @@ -1,12 +1,12 @@ project('at-spi2-core', 'c', - version: '2.31.1', + version: '2.34.0', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', 'warning_level=1', 'c_std=c99', ], - meson_version: '>= 0.40.1') + meson_version: '>= 0.50.0') add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE' ], language: 'c') @@ -52,10 +52,16 @@ libdbus_dep = dependency('dbus-1', version: libdbus_req_version) glib_dep = dependency('glib-2.0', version: glib_req_version) gobject_dep = dependency('gobject-2.0', version: gobject_req_version) gio_dep = dependency('gio-2.0', version: gio_req_version) -dl_dep = cc.find_library('dl', required: false) +if cc.has_function('dlopen') + dl_dep = [] +elif cc.has_function('dlopen', args: '-ldl') + dl_dep = cc.find_library('dl') +else + error('Could not find a library with the dlopen function') +endif x11_deps = [] -x11_option = get_option('enable-x11') +x11_option = get_option('x11') if x11_option != 'no' x11_dep = dependency('x11', required: false) @@ -96,7 +102,7 @@ at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'ty # introspection support have_gir = false -introspection_option = get_option('enable-introspection') +introspection_option = get_option('introspection') if introspection_option != 'no' gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false) @@ -117,7 +123,7 @@ subdir('bus') subdir('registryd') subdir('test') -if get_option('enable_docs') +if get_option('docs') subdir('doc/libatspi') endif diff --git a/meson_options.txt b/meson_options.txt index f8ec862..c8d5fd1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -19,11 +19,17 @@ option('systemd_user_dir', description: 'Location of the systemd user services', type: 'string', value: 'default') -option('enable_docs', +option('docs', description: 'Generate API reference for atspi (requires GTK-Doc)', type: 'boolean', value: false) - -option('enable-introspection', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable GObject Introspection (depends on GObject)') - -option('enable-x11', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable X11 support') +option('introspection', + description: 'Enable GObject Introspection (depends on GObject)', + type: 'combo', + choices: ['yes', 'no', 'auto'], + value: 'auto') +option('x11', + description: 'Enable X11 support', + type: 'combo', + choices: ['yes', 'no', 'auto'], + value: 'auto') diff --git a/registryd/de-marshaller.c b/registryd/de-marshaller.c index fef8e48..2f212b0 100644 --- a/registryd/de-marshaller.c +++ b/registryd/de-marshaller.c @@ -5,19 +5,19 @@ * Copyright 2008 Novell, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/registryd/de-marshaller.h b/registryd/de-marshaller.h index 9d55a9d..93eaa42 100644 --- a/registryd/de-marshaller.h +++ b/registryd/de-marshaller.h @@ -7,19 +7,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_DE_MARSHALLER_H_ diff --git a/registryd/de-types.h b/registryd/de-types.h index f08823c..ea05dda 100644 --- a/registryd/de-types.h +++ b/registryd/de-types.h @@ -7,19 +7,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_DE_TYPES_H_ diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c index e5b8dfc..df16bd8 100644 --- a/registryd/deviceeventcontroller-x11.c +++ b/registryd/deviceeventcontroller-x11.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* deviceeventcontroller-x11.c: X-specific DeviceEventController support */ @@ -140,6 +140,14 @@ keysym_mod_mask (KeySym keysym, KeyCode keycode) (sym_rtn == keysym)) { retval = Mod3Mask; } + else if (XkbLookupKeySym (display, keycode, Mod4Mask, &mods_rtn, &sym_rtn) && + (sym_rtn == keysym)) { + retval = Mod4Mask; + } + else if (XkbLookupKeySym (display, keycode, Mod5Mask, &mods_rtn, &sym_rtn) && + (sym_rtn == keysym)) { + retval = Mod5Mask; + } else if (XkbLookupKeySym (display, keycode, ShiftMask | Mod2Mask, &mods_rtn, &sym_rtn) && (sym_rtn == keysym)) { @@ -155,6 +163,11 @@ keysym_mod_mask (KeySym keysym, KeyCode keycode) (sym_rtn == keysym)) { retval = (Mod4Mask | ShiftMask); } + else if (XkbLookupKeySym (display, keycode, + ShiftMask | Mod5Mask, &mods_rtn, &sym_rtn) && + (sym_rtn == keysym)) { + retval = (Mod5Mask | ShiftMask); + } else retval = 0xFFFF; return retval; diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 4e25ad6..acd089b 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* deviceeventcontroller.c: implement the DeviceEventController interface */ @@ -1856,7 +1856,7 @@ spi_device_event_controller_class_init (SpiDEControllerClass *klass) object_class->finalize = spi_device_event_controller_object_finalize; #ifdef HAVE_X11 - if (g_getenv ("DISPLAY")) + if (g_getenv ("DISPLAY") != NULL && g_getenv ("WAYLAND_DISPLAY") == NULL) spi_dec_setup_x11 (klass); else #endif diff --git a/registryd/deviceeventcontroller.h b/registryd/deviceeventcontroller.h index 0c6eee4..94c01cf 100644 --- a/registryd/deviceeventcontroller.h +++ b/registryd/deviceeventcontroller.h @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_DEVICE_EVENT_CONTROLLER_H_ diff --git a/registryd/display.c b/registryd/display.c index 2ba781c..011f294 100644 --- a/registryd/display.c +++ b/registryd/display.c @@ -5,19 +5,19 @@ * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/registryd/display.h b/registryd/display.h index 2238a55..6d53e7b 100644 --- a/registryd/display.h +++ b/registryd/display.h @@ -5,19 +5,19 @@ * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_DISPLAY_H_ diff --git a/registryd/event-source.c b/registryd/event-source.c index 9ad3ec5..e82908a 100644 --- a/registryd/event-source.c +++ b/registryd/event-source.c @@ -5,19 +5,19 @@ * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/registryd/event-source.h b/registryd/event-source.h index 55ab663..ad080f7 100644 --- a/registryd/event-source.h +++ b/registryd/event-source.h @@ -5,19 +5,19 @@ * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_EVENT_SOURCE_H_ diff --git a/registryd/keymasks.h b/registryd/keymasks.h index 4e838b8..9f6c2c9 100644 --- a/registryd/keymasks.h +++ b/registryd/keymasks.h @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_KEYMASKS_H_ diff --git a/registryd/meson.build b/registryd/meson.build index eb8236e..c2404d2 100644 --- a/registryd/meson.build +++ b/registryd/meson.build @@ -16,7 +16,7 @@ registryd_deps = [ dl_dep, ] -x11_option = get_option('enable-x11') +x11_option = get_option('x11') if x11_option != 'no' if x11_dep.found() registryd_sources += [ diff --git a/registryd/paths.h b/registryd/paths.h index 918df67..a505222 100644 --- a/registryd/paths.h +++ b/registryd/paths.h @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_PATHS_H_ diff --git a/registryd/reentrant-list.c b/registryd/reentrant-list.c index 7f9a716..2c08c42 100644 --- a/registryd/reentrant-list.c +++ b/registryd/reentrant-list.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/registryd/reentrant-list.h b/registryd/reentrant-list.h index 901561b..e124156 100644 --- a/registryd/reentrant-list.h +++ b/registryd/reentrant-list.h @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef REENTRANT_LIST_H_ diff --git a/registryd/registry-main.c b/registryd/registry-main.c index d8b5dc5..be01d2c 100644 --- a/registryd/registry-main.c +++ b/registryd/registry-main.c @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/registryd/registry.c b/registryd/registry.c index cbf0c1b..8d35f8e 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -7,19 +7,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/registryd/registry.h b/registryd/registry.h index 16dd0d9..19b1a8f 100644 --- a/registryd/registry.h +++ b/registryd/registry.h @@ -6,19 +6,19 @@ * Copyright 2001, 2002 Ximian, Inc. * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef SPI_REGISTRY_H_ diff --git a/xml/Accessible.xml b/xml/Accessible.xml index 9240882..7015466 100644 --- a/xml/Accessible.xml +++ b/xml/Accessible.xml @@ -14,6 +14,8 @@ + + diff --git a/xml/Text.xml b/xml/Text.xml index 320ee5e..313131e 100644 --- a/xml/Text.xml +++ b/xml/Text.xml @@ -152,5 +152,19 @@ + + + + + + + + + + + + + + -- 2.7.4 From 0ed32e954e09abf691bafdb01048bb06658ed161 Mon Sep 17 00:00:00 2001 From: Bartlomiej Grzelewski Date: Thu, 4 Mar 2021 10:43:37 +0100 Subject: [PATCH 15/16] 2.39.90.1 Change-Id: I3d30aea2ebdc1e9ff5d24b564c2977d798f285d6 --- NEWS | 76 ++++ atspi/atspi-accessible.c | 50 ++- atspi/atspi-accessible.h | 1 + atspi/atspi-constants.h | 20 +- atspi/atspi-device-legacy.c | 316 +++++++++++++++++ atspi/atspi-device-legacy.h | 59 ++++ atspi/atspi-device-listener.c | 13 +- atspi/atspi-device-x11.c | 712 ++++++++++++++++++++++++++++++++++++++ atspi/atspi-device-x11.h | 59 ++++ atspi/atspi-device.c | 399 +++++++++++++++++++++ atspi/atspi-device.h | 103 ++++++ atspi/atspi-enum-types.c.template | 2 +- atspi/atspi-event-listener.c | 87 ++--- atspi/atspi-misc-private.h | 2 + atspi/atspi-misc.c | 87 ++++- atspi/atspi-registry.c | 3 +- atspi/atspi-types.h | 9 +- atspi/atspimarshal.list | 1 + atspi/meson.build | 14 +- bus/accessibility.conf.in | 2 +- bus/at-spi-bus-launcher.c | 96 +++-- bus/at-spi-dbus-bus.desktop.in | 2 +- bus/meson.build | 15 +- dbind/dbtest.c | 18 +- meson.build | 6 +- po/gl.po | 89 +---- po/pt.po | 51 +-- po/uk.po | 165 ++++----- registryd/meson.build | 1 - registryd/ucs2keysym.c | 285 ++++++++------- registryd/ucs2keysym.sh | 38 ++ test/memory.c | 8 +- test/meson.build | 17 +- test/test-application.c | 105 ++++++ xml/Accessible.xml | 18 +- xml/Action.xml | 2 +- xml/Application.xml | 2 +- xml/Cache.xml | 12 +- xml/Collection.xml | 18 +- xml/Component.xml | 4 +- xml/DeviceEventController.xml | 24 +- xml/DeviceEventListener.xml | 2 +- xml/Document.xml | 2 +- xml/Event.xml | 112 +++--- xml/Hyperlink.xml | 2 +- xml/Hypertext.xml | 2 +- xml/Image.xml | 2 +- xml/Registry.xml | 4 +- xml/Selection.xml | 2 +- xml/Socket.xml | 22 +- xml/Table.xml | 14 +- xml/TableCell.xml | 8 +- xml/Text.xml | 9 +- 53 files changed, 2573 insertions(+), 599 deletions(-) create mode 100644 atspi/atspi-device-legacy.c create mode 100644 atspi/atspi-device-legacy.h create mode 100644 atspi/atspi-device-x11.c create mode 100644 atspi/atspi-device-x11.h create mode 100644 atspi/atspi-device.c create mode 100644 atspi/atspi-device.h create mode 100755 registryd/ucs2keysym.sh create mode 100644 test/test-application.c diff --git a/NEWS b/NEWS index f18af9a..d964ce2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,79 @@ +What's new in at-spi2-core 2.39.90.1: + +* Fix a crash introduced in 2.39.90, along with a few warnings (#30). + +What's new in at-spi2-core 2.39.90: + +* Fix build with X11 disabled. + +* Various fixes for the new device API used for key monitoring and grabbing. + +* Fixed several memory leaks. + +What's new in at-spi2-core 2.39.1: + +* Don't use gdbus-broker if not running under systemd (#25). + +* Unref bus at the end of cleanup. + +* Fix XML interfaces (#26). + +* Use unix sockets instead of abstract sockets (#28). + +* Added a device API to replace the old API for capturing key + grabs. This is needed for toolkits that do not report keystrokes + to atk, such as gtk 4. + +What's new in at-spi2-core 2.37.92: + +* Fix a possible memory leak if an event name cannot be parsed. + +* _atspi_dbus_set_interfaces: fix memory leak when called with an invalid + DBus signature. + +* Fix a crash if an event listener is removed during an event callback. + + +What's new in at-spi2-core 2.37.90: + +* Add a mode-changed signal to allow a screen reader to indicate + that its mode has changed. + +* Fix use after free when a device listener is destroyed (#22). + +* Meson: de-duplicate deps of 'Requires' in pkgconfig file (!28). + +* Fix use after free when an event listener is destroyed. + +* Make at-spi-dbus-bus.desktop validate (!30). + +* atspi_accessible_set_cache_mask: relax assert that was generating a + warning and causing the function to fail in some cases. + +* Fixes for synthesizing keys. + +* Fix Qt annotations in DBus xml files. + +* Memory test: replace gedit with a light-weight test application. + +* dbtest: print to stdout instead of stderr. + +* Tests: make test a bit verbose. + +* Constants: fix typos in two _COUNT constants. + +What's new in at-spi2-core 2.35.92: + +* bus-launcher: make session management more robust. + +What's new in at-spi2-core 2.35.1: + +* Fix source reproducibility (!25). + +* Avoid depending on Meson 0.50 (#20). + +* Add ATSPI_ROLE_MARK and ATSPI_ROLE_SUGGESTION (!27). + What's new in at-spi2-core 2.34.0: * Fix a use after free when freeing an event. diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index fd6737d..b078688 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -28,6 +28,7 @@ enum { REGION_CHANGED, + MODE_CHANGED, LAST_SIGNAL }; @@ -48,21 +49,28 @@ screen_reader_signal_watcher (GSignalInvocationHint *signal_hint, const char *name; DBusMessage *signal; DBusMessageIter iter, iter_struct, iter_variant, iter_array; - dbus_int32_t detail1, detail2; + dbus_int32_t detail1 = 0, detail2 = 0; const char *detail = ""; + gchar *dbus_name; object = g_value_get_object (param_values + 0); g_return_val_if_fail (ATSPI_IS_ACCESSIBLE(object), FALSE); g_signal_query (signal_hint->signal_id, &signal_query); name = signal_query.signal_name; - detail1 = g_value_get_int (param_values + 1); - detail2 = g_value_get_int (param_values + 2); + if (signal_hint->detail) + detail = g_quark_to_string (signal_hint->detail); + if (n_param_values > 1) + detail1 = g_value_get_int (param_values + 1); + if (n_param_values > 2 && G_VALUE_HOLDS_INT (param_values + 2)) + detail2 = g_value_get_int (param_values + 2); accessible = ATSPI_ACCESSIBLE (object); + dbus_name = _atspi_strdup_and_adjust_for_dbus (name); signal = dbus_message_new_signal (ATSPI_DBUS_PATH_SCREEN_READER, ATSPI_DBUS_INTERFACE_EVENT_SCREEN_READER, - "RegionChanged"); + dbus_name); + g_free (dbus_name); dbus_message_iter_init_append (signal, &iter); dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &detail); dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &detail1); @@ -180,7 +188,7 @@ atspi_accessible_init (AtspiAccessible *accessible) accessible->priv = atspi_accessible_get_instance_private (accessible); - accessible->children = g_ptr_array_new_with_free_func (atspi_accessible_unref); + accessible->children = g_ptr_array_new_with_free_func ((GDestroyNotify) atspi_accessible_unref); } static void @@ -287,9 +295,36 @@ atspi_accessible_class_init (AtspiAccessibleClass *klass) G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); + /** + * AtspiAccessible::mode-changed: + * @atspiaccessible: the object which received the signal + * @arg1: a boolean specifying whether the mode is being toggled on or off. + * @why: an optional string explaining why the mode changed. + * + * The signal "mode-changed" is emitted by a screen reader to indicate + * that its mode has changed. This signal supports the following details: + * focus-tracking + * flat-review + * mouse-review + * say-all + * caret-tracking + */ + atspi_accessible_signals[MODE_CHANGED] = + g_signal_new ("mode_changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (AtspiAccessibleClass, mode_changed), + NULL, NULL, + atspi_marshal_VOID__INT_STRING, + G_TYPE_NONE, + 2, G_TYPE_INT, G_TYPE_STRING); + g_signal_add_emission_hook (atspi_accessible_signals[REGION_CHANGED], 0, screen_reader_signal_watcher, NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook (atspi_accessible_signals[MODE_CHANGED], 0, + screen_reader_signal_watcher, NULL, + (GDestroyNotify) NULL); } /** @@ -383,6 +418,7 @@ atspi_accessible_get_parent (AtspiAccessible *obj, GError **error) } dbus_message_iter_init (reply, &iter); dbus_message_iter_recurse (&iter, &iter_variant); + g_clear_object (&obj->accessible_parent); obj->accessible_parent = _atspi_dbus_return_accessible_from_iter (&iter_variant); dbus_message_unref (reply); _atspi_accessible_add_cache (obj, ATSPI_CACHE_PARENT); @@ -707,6 +743,8 @@ atspi_accessible_get_attributes (AtspiAccessible *obj, GError **error) { message = _atspi_dbus_call_partial (obj, atspi_interface_accessible, "GetAttributes", error, ""); + g_clear_pointer (&(obj->attributes), g_hash_table_unref); + obj->attributes = _atspi_dbus_return_hash_from_message (message); _atspi_accessible_add_cache (obj, ATSPI_CACHE_ATTRIBUTES); } @@ -1706,7 +1744,7 @@ atspi_accessible_set_cache_mask (AtspiAccessible *accessible, AtspiCache mask) { g_return_if_fail (accessible != NULL); g_return_if_fail (accessible->parent.app != NULL); - g_return_if_fail (accessible == accessible->parent.app->root); + g_return_if_fail (accessible == accessible->parent.app->root || accessible->role == ATSPI_ROLE_APPLICATION); accessible->parent.app->cache = mask; enable_caching = TRUE; } diff --git a/atspi/atspi-accessible.h b/atspi/atspi-accessible.h index 13e4962..35c0d5b 100644 --- a/atspi/atspi-accessible.h +++ b/atspi/atspi-accessible.h @@ -66,6 +66,7 @@ struct _AtspiAccessibleClass AtspiObjectClass parent_class; void (*region_changed) (AtspiAccessible *accessible, gint current_offset, gint last_offset); + void (*mode_changed) (AtspiAccessible *accessible, gboolean enabled); }; GType atspi_accessible_get_type (void); diff --git a/atspi/atspi-constants.h b/atspi/atspi-constants.h index 8657ead..3a8da00 100644 --- a/atspi/atspi-constants.h +++ b/atspi/atspi-constants.h @@ -121,7 +121,7 @@ typedef enum { * * One higher than the highest valid value of #AtspiLocaleType. **/ -#define ATSPI_LOCALE_TYPE _COUNT(5+1) +#define ATSPI_LOCALE_TYPE_COUNT (5+1) /** * AtspiCoordType: @@ -241,7 +241,7 @@ typedef enum { * One higher than the highest valid value of * #AtspiCollection_TreeTraversalType. */ -#define ATSPI_TREETRAVERSALTYPE _COUNT(3+1) +#define ATSPI_TREETRAVERSALTYPE_COUNT (3+1) /** * AtspiComponentLayer: @@ -1240,6 +1240,18 @@ typedef enum { * @ATSPI_ROLE_CONTENT_INSERTION: Content previously inserted or proposed to be * inserted, e.g. in revision history or a content view providing suggestions * from reviewers. @Since: 2.34. + * @ATSPI_ROLE_MARK: A run of content that is marked or highlighted, such as for + * reference purposes, or to call it out as having a special purpose. If the + * marked content has an associated section in the document elaborating on the + * reason for the mark, then %ATSPI_RELATION_DETAILS should be used on the mark + * to point to that associated section. In addition, the reciprocal relation + * %ATSPI_RELATION_DETAILS_FOR should be used on the associated content section + * to point back to the mark. @Since: 2.36. + * @ATSPI_ROLE_SUGGESTION: A container for content that is called out as a proposed + * change from the current version of the document, such as by a reviewer of the + * content. This role should include either %ATSPI_ROLE_CONTENT_DELETION and/or + * %ATSPI_ROLE_CONTENT_INSERTION children, in any order, to indicate what the + * actual change is. @Since: 2.36 * @ATSPI_ROLE_LAST_DEFINED: Not a valid role, used for finding end of * enumeration. * @@ -1375,6 +1387,8 @@ typedef enum { ATSPI_ROLE_FOOTNOTE, ATSPI_ROLE_CONTENT_DELETION, ATSPI_ROLE_CONTENT_INSERTION, + ATSPI_ROLE_MARK, + ATSPI_ROLE_SUGGESTION, ATSPI_ROLE_LAST_DEFINED, } AtspiRole; @@ -1383,7 +1397,7 @@ typedef enum { * * One higher than the highest valid value of #AtspiRole. */ -#define ATSPI_ROLE_COUNT (127+1) +#define ATSPI_ROLE_COUNT (129+1) typedef enum { diff --git a/atspi/atspi-device-legacy.c b/atspi/atspi-device-legacy.c new file mode 100644 index 0000000..6950bc3 --- /dev/null +++ b/atspi/atspi-device-legacy.c @@ -0,0 +1,316 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2020 SUSE LLC. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "atspi-private.h" +#include "atspi-device-legacy.h" + +#ifdef HAVE_X11 +#include +#include +#include +#include +#endif + +typedef struct +{ + guint keycode; + guint modifier; +} AtspiLegacyKeyModifier; + +typedef struct _AtspiDeviceLegacyPrivate AtspiDeviceLegacyPrivate; +struct _AtspiDeviceLegacyPrivate +{ + AtspiDeviceListener *listener; +#ifdef HAVE_X11 + Display *display; + Window window; +#endif + GSList *modifiers; + guint virtual_mods_enabled; + gboolean keyboard_grabbed; +}; + +GObjectClass *device_legacy_parent_class; + +G_DEFINE_TYPE_WITH_CODE (AtspiDeviceLegacy, atspi_device_legacy, + ATSPI_TYPE_DEVICE, + G_ADD_PRIVATE (AtspiDeviceLegacy)) + + +static guint +find_virtual_mapping (AtspiDeviceLegacy *legacy_device, gint keycode) +{ + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + GSList *l; + + for (l = priv->modifiers; l; l = l->next) + { + AtspiLegacyKeyModifier *entry = l->data; + if (entry->keycode == keycode) + return entry->modifier; + } + + return 0; +} + +static void +set_virtual_modifier (AtspiDeviceLegacy *legacy_device, gint keycode, gboolean enabled) +{ + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + guint modifier = find_virtual_mapping (legacy_device, keycode); + + if (enabled) + priv->virtual_mods_enabled |= modifier; + else + priv->virtual_mods_enabled &= ~modifier; +} + + +gboolean +key_cb (const AtspiDeviceEvent *event, void *user_data) +{ + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (user_data); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + gboolean ret = priv->keyboard_grabbed; + + set_virtual_modifier (legacy_device, event->hw_code, + event->type == (AtspiEventType)ATSPI_KEY_PRESS); + ret |= atspi_device_notify_key (ATSPI_DEVICE (legacy_device), + event->type == (AtspiEventType)ATSPI_KEY_PRESS, + event->hw_code, event->id, + event->modifiers | priv->virtual_mods_enabled, + event->event_string); + + return ret; +} + +static guint +atspi_device_legacy_get_locked_modifiers (AtspiDevice *device) +{ +#ifdef HAVE_X11 + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (device); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + XkbStateRec state_rec; + + memset (&state_rec, 0, sizeof (state_rec)); + XkbGetState (priv->display, XkbUseCoreKbd, &state_rec); + return state_rec.locked_mods; +#else + return 0; +#endif +} + +static gboolean +check_virtual_modifier (AtspiDeviceLegacy *legacy_device, guint modifier) +{ + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + GSList *l; + + for (l = priv->modifiers; l; l = l->next) + { + AtspiLegacyKeyModifier *entry = l->data; + if (entry->modifier == modifier) + return TRUE; + } + + return FALSE; +} + +static guint +get_unused_virtual_modifier (AtspiDeviceLegacy *legacy_device) +{ + guint ret = 0x1000; + + while (ret < 0x10000) + { + if (!check_virtual_modifier (legacy_device, ret)) + return ret; + ret <<= 1; + } + + return 0; +} + +static guint +atspi_device_legacy_map_modifier (AtspiDevice *device, gint keycode) +{ + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (device); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + guint ret; + AtspiLegacyKeyModifier *entry; +#ifdef HAVE_X11 + XkbDescPtr desc; + + desc = XkbGetMap (priv->display, XkbModifierMapMask, XkbUseCoreKbd); + + if (keycode < desc->min_key_code || keycode >= desc->max_key_code) + { + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + g_warning ("Passed invalid keycode %d", keycode); + return 0; + } + + ret = desc->map->modmap[keycode]; + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + if (ret & (ShiftMask | ControlMask)) + return ret; +#endif + + ret = find_virtual_mapping (legacy_device, keycode); + if (ret) + return ret; + + ret = get_unused_virtual_modifier (legacy_device); + + entry = g_new (AtspiLegacyKeyModifier, 1); + entry->keycode = keycode; + entry->modifier = ret; + priv->modifiers = g_slist_append (priv->modifiers, entry); + + return ret; +} + +static void +atspi_device_legacy_unmap_modifier (AtspiDevice *device, gint keycode) +{ + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (device); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + GSList *l; + + for (l = priv->modifiers; l; l = l->next) + { + AtspiLegacyKeyModifier *entry = l->data; + if (entry->keycode == keycode) + { + g_free (entry); + priv->modifiers = g_slist_remove (priv->modifiers, entry); + return; + } + } +} + +static guint +atspi_device_legacy_get_modifier (AtspiDevice *device, gint keycode) +{ + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (device); +#ifdef HAVE_X11 + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + XkbDescPtr desc; + guint ret; + + desc = XkbGetMap (priv->display, XkbModifierMapMask, XkbUseCoreKbd); + + if (keycode < desc->min_key_code || keycode >= desc->max_key_code) + { + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + g_warning ("Passed invalid keycode %d", keycode); + return 0; + } + + ret = desc->map->modmap[keycode]; + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + if (ret) + return ret; +#endif + + return find_virtual_mapping (legacy_device, keycode); +} + +static gboolean +atspi_device_legacy_grab_keyboard (AtspiDevice *device) +{ + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (device); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + + priv->keyboard_grabbed = TRUE; + return TRUE; +} + +static void +atspi_device_legacy_ungrab_keyboard (AtspiDevice *device) +{ + AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (device); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); + + priv->keyboard_grabbed = FALSE; +} + +static void +atspi_device_legacy_init (AtspiDeviceLegacy *device) +{ + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (device); + gint i; + + priv->listener = atspi_device_listener_new (key_cb, device, NULL); + for (i = 0; i < 256; i++) + atspi_register_keystroke_listener (priv->listener, NULL, i, 3, ATSPI_KEYLISTENER_SYNCHRONOUS | ATSPI_KEYLISTENER_CANCONSUME, NULL); + +#ifdef HAVE_X11 + priv->display=XOpenDisplay(""); + if (priv->display) + priv->window = DefaultRootWindow(priv->display); +#endif + +} + +static void +atspi_device_legacy_finalize (GObject *object) +{ + AtspiDeviceLegacy *device = ATSPI_DEVICE_LEGACY (object); + AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (device); + + g_clear_object (&priv->listener); + device_legacy_parent_class->finalize (object); +} + + +static void +atspi_device_legacy_class_init (AtspiDeviceLegacyClass *klass) +{ + GObjectClass *object_class = (GObjectClass *) klass; + AtspiDeviceClass *device_class = ATSPI_DEVICE_CLASS (klass); + + device_legacy_parent_class = g_type_class_peek_parent (klass); + object_class->finalize = atspi_device_legacy_finalize; + device_class->map_modifier = atspi_device_legacy_map_modifier; + device_class->unmap_modifier = atspi_device_legacy_unmap_modifier; + device_class->get_modifier = atspi_device_legacy_get_modifier; + device_class->get_locked_modifiers = atspi_device_legacy_get_locked_modifiers; + device_class->grab_keyboard = atspi_device_legacy_grab_keyboard; + device_class->ungrab_keyboard = atspi_device_legacy_ungrab_keyboard; +} + +/** + * atspi_device_legacy_new: + * + * Creates a new #AtspiDeviceLegacy. + * + * Returns: (transfer full): a pointer to a newly-created #AtspiDeviceLegacy. + * + **/ +AtspiDeviceLegacy * +atspi_device_legacy_new () +{ + AtspiDeviceLegacy *device = g_object_new (atspi_device_legacy_get_type (), NULL); + + return device; +} diff --git a/atspi/atspi-device-legacy.h b/atspi/atspi-device-legacy.h new file mode 100644 index 0000000..50f777e --- /dev/null +++ b/atspi/atspi-device-legacy.h @@ -0,0 +1,59 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2020 SUSE LLC. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _ATSPI_DEVICE_LEGACY_H_ +#define _ATSPI_DEVICE_LEGACY_H_ + +#include "glib-object.h" + +#include "atspi-types.h" +#include "atspi-device.h" + +G_BEGIN_DECLS + +#define ATSPI_TYPE_DEVICE_LEGACY (atspi_device_legacy_get_type ()) +#define ATSPI_DEVICE_LEGACY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DEVICE_LEGACY, AtspiDeviceLegacy)) +#define ATSPI_DEVICE_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_DEVICE_LEGACY, AtspiDeviceLegacyClass)) +#define ATSPI_IS_DEVICE_LEGACY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DEVICE_LEGACY)) +#define ATSPI_IS_DEVICE_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_DEVICE_LEGACY)) +#define ATSPI_DEVICE_LEGACY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_DEVICE_LEGACY, AtspiDeviceLegacyClass)) + +typedef struct _AtspiDeviceLegacy AtspiDeviceLegacy; +struct _AtspiDeviceLegacy +{ + AtspiDevice parent; +}; + +typedef struct _AtspiDeviceLegacyClass AtspiDeviceLegacyClass; +struct _AtspiDeviceLegacyClass +{ + AtspiDeviceClass parent_class; +}; + +GType atspi_device_legacy_get_type (void); + +AtspiDeviceLegacy *atspi_device_legacy_new (); + +G_END_DECLS + +#endif /* _ATSPI_DEVICE_LEGACY_H_ */ diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c index 8e04c41..69f77d1 100644 --- a/atspi/atspi-device-listener.c +++ b/atspi/atspi-device-listener.c @@ -32,7 +32,7 @@ typedef struct GDestroyNotify callback_destroyed; } DeviceEventHandler; -GObjectClass *device_parent_class; +GObjectClass *device_listener_parent_class; /* * Misc. helpers. @@ -177,7 +177,9 @@ atspi_device_listener_finalize (GObject *object) { AtspiDeviceListener *listener = (AtspiDeviceListener *) object; GList *l; - + + device_listeners = g_list_remove (device_listeners, listener); + for (l = listener->callbacks; l; l = l->next) { device_event_handler_free (l->data); @@ -185,7 +187,7 @@ atspi_device_listener_finalize (GObject *object) g_list_free (listener->callbacks); - device_parent_class->finalize (object); + device_listener_parent_class->finalize (object); } static void @@ -193,7 +195,7 @@ atspi_device_listener_class_init (AtspiDeviceListenerClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; - device_parent_class = g_type_class_peek_parent (klass); + device_listener_parent_class = g_type_class_peek_parent (klass); object_class->finalize = atspi_device_listener_finalize; klass->device_event = atspi_device_event_dispatch; @@ -396,7 +398,8 @@ done: gchar * _atspi_device_listener_get_path (AtspiDeviceListener *listener) -{ return g_strdup_printf ("/org/a11y/atspi/listeners/%d", listener->id); +{ + return g_strdup_printf ("/org/a11y/atspi/listeners/%d", listener->id); } G_DEFINE_BOXED_TYPE (AtspiDeviceEvent, diff --git a/atspi/atspi-device-x11.c b/atspi/atspi-device-x11.c new file mode 100644 index 0000000..e8f2199 --- /dev/null +++ b/atspi/atspi-device-x11.c @@ -0,0 +1,712 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2020 SUSE LLC. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "atspi-private.h" +#include "atspi-device-x11.h" + +#include +#include +#include +#include + + +#define ATSPI_VIRTUAL_MODIFIER_MASK 0x0000f000 + +typedef struct _AtspiDeviceX11Private AtspiDeviceX11Private; +struct _AtspiDeviceX11Private +{ + Display *display; + Window window; + GSource *source; + int xi_opcode; + int device_id; + int device_id_alt; + GSList *modifiers; + GSList *key_grabs; + guint virtual_mods_enabled; + gboolean keyboard_grabbed; +}; + +GObjectClass *device_x11_parent_class; + +typedef struct _DisplaySource +{ + GSource source; + + Display *display; + GPollFD event_poll_fd; +} DisplaySource; + +typedef struct +{ + guint keycode; + guint modifier; +} AtspiX11KeyModifier; + +typedef struct +{ + AtspiKeyDefinition *kd; + gboolean enabled; +} AtspiX11KeyGrab; + +static gboolean +event_prepare (GSource *source, gint *timeout) +{ + Display *display = ((DisplaySource *)source)->display; + gboolean retval; + + *timeout = -1; + retval = XPending (display); + + return retval; +} + +static gboolean +event_check (GSource *source) +{ + DisplaySource *display_source = (DisplaySource*)source; + gboolean retval; + + if (display_source->event_poll_fd.revents & G_IO_IN) + retval = XPending (display_source->display); + else + retval = FALSE; + + return retval; +} + +static void +xi2keyevent (XIDeviceEvent *xievent, XEvent *xkeyevent) +{ + memset (xkeyevent, 0, sizeof (*xkeyevent)); + + switch (xievent->evtype) + { + case XI_KeyPress: + xkeyevent->type = KeyPress; + break; + case XI_KeyRelease: + xkeyevent->type = KeyRelease; + break; + default: + break; + } + xkeyevent->xkey.serial = xievent->serial; + xkeyevent->xkey.send_event = xievent->send_event; + xkeyevent->xkey.display = xievent->display; + xkeyevent->xkey.window = xievent->event; + xkeyevent->xkey.root = xievent->root; + xkeyevent->xkey.subwindow = xievent->child; + xkeyevent->xkey.time = xievent->time; + xkeyevent->xkey.x = xievent->event_x; + xkeyevent->xkey.y = xievent->event_y; + xkeyevent->xkey.x_root = xievent->root_x; + xkeyevent->xkey.y_root = xievent->root_y; + xkeyevent->xkey.state = xievent->mods.effective; + xkeyevent->xkey.keycode = xievent->detail; + xkeyevent->xkey.same_screen = 1; +} + +G_DEFINE_TYPE_WITH_CODE (AtspiDeviceX11, atspi_device_x11, + ATSPI_TYPE_DEVICE, + G_ADD_PRIVATE (AtspiDeviceX11)) + + +static guint +find_virtual_mapping (AtspiDeviceX11 *x11_device, gint keycode) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + GSList *l; + + for (l = priv->modifiers; l; l = l->next) + { + AtspiX11KeyModifier *entry = l->data; + if (entry->keycode == keycode) + return entry->modifier; + } + + return 0; +} + +static gboolean +grab_should_be_enabled (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + + /* If the whole keyboard is grabbed, then all keys are grabbed elsewhere */ + if (priv->keyboard_grabbed) + return FALSE; + + guint virtual_mods_used = grab->kd->modifiers & ATSPI_VIRTUAL_MODIFIER_MASK; + return ((priv->virtual_mods_enabled & virtual_mods_used) == virtual_mods_used); +} + +static gboolean +grab_has_active_duplicate (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + GSList *l; + + for (l = priv->key_grabs; l; l = l->next) + { + AtspiX11KeyGrab *other = l->data; + if (other != grab && other->enabled && other->kd->keycode == grab->kd->keycode && (other->kd->modifiers & ~ATSPI_VIRTUAL_MODIFIER_MASK) == (grab->kd->modifiers & ~ATSPI_VIRTUAL_MODIFIER_MASK)) + return TRUE; + } + return FALSE; +} + +static void +grab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + XIGrabModifiers xi_modifiers; + XIEventMask eventmask; + unsigned char mask[XIMaskLen (XI_LASTEVENT)] = { 0 }; + + xi_modifiers.modifiers = modmask; + xi_modifiers.status = 0; + + eventmask.deviceid = XIAllDevices; + eventmask.mask_len = sizeof(mask); + eventmask.mask = mask; + + XISetMask (mask, XI_KeyPress); + XISetMask (mask, XI_KeyRelease); + + XIGrabKeycode (priv->display, XIAllMasterDevices, keycode, priv->window, XIGrabModeSync, XIGrabModeAsync, False, &eventmask, 1, &xi_modifiers); +} + +static void +enable_key_grab (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + + g_return_if_fail (priv->display != NULL); + + if (!grab_has_active_duplicate (x11_device, grab)) + grab_key (x11_device, grab->kd->keycode, grab->kd->modifiers & ~ATSPI_VIRTUAL_MODIFIER_MASK); + grab->enabled = TRUE; +} + +static void +ungrab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + XIGrabModifiers xi_modifiers; + + xi_modifiers.modifiers = modmask; + xi_modifiers.status = 0; + + XIUngrabKeycode (priv->display, XIAllMasterDevices, keycode, priv->window, sizeof(xi_modifiers), &xi_modifiers); +} + +static void +disable_key_grab (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + + g_return_if_fail (priv->display != NULL); + + if (!grab->enabled) + return; + + grab->enabled = FALSE; + + if (grab_has_active_duplicate (x11_device, grab)) + return; + + ungrab_key (x11_device, grab->kd->keycode, grab->kd->modifiers & ~ATSPI_VIRTUAL_MODIFIER_MASK); +} + +static void +refresh_key_grabs (AtspiDeviceX11 *x11_device) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + GSList *l; + + for (l = priv->key_grabs; l; l = l->next) + { + AtspiX11KeyGrab *grab = l->data; + gboolean new_enabled = grab_should_be_enabled (x11_device, grab); + if (new_enabled && !grab->enabled) + enable_key_grab (x11_device, grab); + else if (grab->enabled && !new_enabled) + disable_key_grab (x11_device, grab); + } +} + +static void +set_virtual_modifier (AtspiDeviceX11 *x11_device, gint keycode, gboolean enabled) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + guint modifier = find_virtual_mapping (x11_device, keycode); + + if (!modifier) + return; + + if (enabled) + { + if (priv->virtual_mods_enabled & modifier) + return; + priv->virtual_mods_enabled |= modifier; + } + else + { + if (!(priv->virtual_mods_enabled & modifier)) + return; + priv->virtual_mods_enabled &= ~modifier; + } + + refresh_key_grabs (x11_device); +} + +static gboolean +do_event_dispatch (gpointer user_data) +{ + AtspiDeviceX11 *device = user_data; + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (device); + Display *display = priv->display; + XEvent xevent; + char text[10]; + KeySym keysym; + XComposeStatus status; + + while (XPending (display)) + { + XNextEvent (display, &xevent); + XEvent keyevent; + + switch (xevent.type) + { + case KeyPress: + case KeyRelease: + XLookupString(&xevent.xkey, text, sizeof (text), &keysym, &status); + atspi_device_notify_key (ATSPI_DEVICE (device), (xevent.type == KeyPress), xevent.xkey.keycode, keysym, xevent.xkey.state | priv->virtual_mods_enabled, text); + break; + case GenericEvent: + if (xevent.xcookie.extension == priv->xi_opcode) + { + XGetEventData(priv->display, &xevent.xcookie); + XIRawEvent *xiRawEv = (XIRawEvent *) xevent.xcookie.data; + XIDeviceEvent *xiDevEv = (XIDeviceEvent *) xevent.xcookie.data; + switch (xevent.xcookie.evtype) + { + case XI_KeyPress: + case XI_KeyRelease: + xi2keyevent (xiDevEv, &keyevent); + XLookupString((XKeyEvent *)&keyevent, text, sizeof (text), &keysym, &status); + if (text[0] < ' ') + text[0] = '\0'; + /* The deviceid can change. Would be nice to find a better way of + handling this */ + if (priv->device_id && priv->device_id_alt && xiDevEv->deviceid != priv->device_id && xiDevEv->deviceid != priv->device_id_alt) + priv->device_id = priv->device_id_alt = 0; + else if (priv->device_id && !priv->device_id_alt && xiDevEv->deviceid != priv->device_id) + priv->device_id_alt = xiDevEv->deviceid; + if (!priv->device_id) + priv->device_id = xiDevEv->deviceid; + set_virtual_modifier (device, xiRawEv->detail, xevent.xcookie.evtype == XI_KeyPress); + if (xiDevEv->deviceid == priv->device_id) + atspi_device_notify_key (ATSPI_DEVICE (device), (xevent.xcookie.evtype == XI_KeyPress), xiRawEv->detail, keysym, keyevent.xkey.state, text); + /* otherwise it's probably a duplicate event from a key grab */ + XFreeEventData (priv->display, &xevent.xcookie); + break; + } + } + default: + if (XFilterEvent (&xevent, None)) + continue; + } + } + return TRUE; +} + +static gboolean +event_dispatch (GSource *source, GSourceFunc callback, gpointer user_data) +{ + if (callback) + callback (user_data); + return G_SOURCE_CONTINUE; +} + +static GSourceFuncs event_funcs = { + event_prepare, + event_check, + event_dispatch, + NULL +}; + +static GSource * +display_source_new (Display *display) +{ + GSource *source = g_source_new (&event_funcs, sizeof (DisplaySource)); + DisplaySource *display_source = (DisplaySource *) source; + g_source_set_name (source, "[at-spi2-core] display_source_funcs"); + + display_source->display = display; + + return source; +} + +static void +create_event_source (AtspiDeviceX11 *device) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (device); + DisplaySource *display_source; + + int connection_number = ConnectionNumber (priv->display); + + priv->source = display_source_new (priv->display); + display_source = (DisplaySource *)priv->source; + + g_source_set_priority (priv->source, G_PRIORITY_DEFAULT); + + display_source->event_poll_fd.fd = connection_number; + display_source->event_poll_fd.events = G_IO_IN; + + g_source_add_poll (priv->source, &display_source->event_poll_fd); + g_source_set_can_recurse (priv->source, TRUE); + g_source_set_callback (priv->source, do_event_dispatch, device, NULL); + g_source_attach (priv->source, NULL); +} + +static gboolean +check_virtual_modifier (AtspiDeviceX11 *x11_device, guint modifier) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + GSList *l; + + for (l = priv->modifiers; l; l = l->next) + { + AtspiX11KeyModifier *entry = l->data; + if (entry->modifier == modifier) + return TRUE; + } + + return FALSE; +} + +static guint +get_unused_virtual_modifier (AtspiDeviceX11 *x11_device) +{ + guint ret = 0x1000; + + while (ret < 0x10000) + { + if (!check_virtual_modifier (x11_device, ret)) + return ret; + ret <<= 1; + } + + return 0; +} + +static guint +atspi_device_x11_map_modifier (AtspiDevice *device, gint keycode) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + XkbDescPtr desc; + guint ret; + AtspiX11KeyModifier *entry; + + desc = XkbGetMap (priv->display, XkbModifierMapMask, XkbUseCoreKbd); + + if (keycode < desc->min_key_code || keycode >= desc->max_key_code) + { + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + g_warning ("Passed invalid keycode %d", keycode); + return 0; + } + + ret = desc->map->modmap[keycode]; + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + if (ret & (ShiftMask | ControlMask)) + return ret; + + ret = find_virtual_mapping (x11_device, keycode); + if (ret) + return ret; + + ret = get_unused_virtual_modifier (x11_device); + + entry = g_new (AtspiX11KeyModifier, 1); + entry->keycode = keycode; + entry->modifier = ret; + priv->modifiers = g_slist_append (priv->modifiers, entry); + + return ret; +} + +static void +atspi_device_x11_unmap_modifier (AtspiDevice *device, gint keycode) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + GSList *l; + + for (l = priv->modifiers; l; l = l->next) + { + AtspiX11KeyModifier *entry = l->data; + if (entry->keycode == keycode) + { + g_free (entry); + priv->modifiers = g_slist_remove (priv->modifiers, entry); + return; + } + } +} + +static guint +atspi_device_x11_get_modifier (AtspiDevice *device, gint keycode) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + XkbDescPtr desc; + guint ret; + + desc = XkbGetMap (priv->display, XkbModifierMapMask, XkbUseCoreKbd); + + if (keycode < desc->min_key_code || keycode >= desc->max_key_code) + { + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + g_warning ("Passed invalid keycode %d", keycode); + return 0; + } + + ret = desc->map->modmap[keycode]; + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); + if (ret) + return ret; + + return find_virtual_mapping (x11_device, keycode); +} + +static void +atspi_device_x11_init (AtspiDeviceX11 *device) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (device); + int first_event, first_error; + + priv->display=XOpenDisplay(""); + g_return_if_fail (priv->display != NULL); + priv->window = DefaultRootWindow(priv->display); + + if (XQueryExtension(priv->display, "XInputExtension", &priv->xi_opcode, &first_event, &first_error)) + { + int major = 2; + int minor = 1; + if (XIQueryVersion(priv->display, &major, &minor) != BadRequest) + { + XIEventMask eventmask; + unsigned char mask[XIMaskLen (XI_LASTEVENT)] = { 0 }; + + eventmask.deviceid = XIAllDevices; + eventmask.mask_len = sizeof(mask); + eventmask.mask = mask; + + XISetMask (mask, XI_KeyPress); + XISetMask (mask, XI_KeyRelease); + XISetMask (mask, XI_ButtonPress); + XISetMask (mask, XI_ButtonRelease); + XISetMask (mask, XI_Motion); + XISelectEvents (priv->display, priv->window, &eventmask, 1); + create_event_source (device); + } + } +} + +static void +atspi_device_x11_finalize (GObject *object) +{ + AtspiDeviceX11 *device = ATSPI_DEVICE_X11 (object); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (device); + GSList *l; + + for (l = priv->key_grabs; l; l = l->next) + { + AtspiX11KeyGrab *grab = l->data; + disable_key_grab (device, grab); + g_boxed_free (ATSPI_TYPE_KEY_DEFINITION, grab->kd); + g_free (grab); + } + g_slist_free (priv->key_grabs); + priv->key_grabs = NULL; + + g_slist_free_full (priv->modifiers, g_free); + priv->modifiers = NULL; + + if (priv->source) + { + g_source_destroy ((GSource *) priv->source); + g_source_unref ((GSource *) priv->source); + priv->source = NULL; + } + + device_x11_parent_class->finalize (object); +} + + +static void +atspi_device_x11_add_key_grab (AtspiDevice *device, AtspiKeyDefinition *kd) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + AtspiX11KeyGrab *grab; + + grab = g_new (AtspiX11KeyGrab, 1); + grab->kd = g_boxed_copy (ATSPI_TYPE_KEY_DEFINITION, kd); + grab->enabled = FALSE; + priv->key_grabs = g_slist_append (priv->key_grabs, grab); + if (grab_should_be_enabled (x11_device, grab)) + enable_key_grab (x11_device, grab); +} + +static void +atspi_device_x11_remove_key_grab (AtspiDevice *device, guint id) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + AtspiKeyDefinition *kd; + GSList *l; + + kd = atspi_device_get_grab_by_id (device, id); + + for (l = priv->key_grabs; l; l = g_slist_next (l)) + { + AtspiX11KeyGrab *other = l->data; + if (other->kd->keycode == kd->keycode && other->kd->modifiers == kd->modifiers) + { + disable_key_grab (x11_device, other); + priv->key_grabs = g_slist_remove (priv->key_grabs, other); + return; + } + } +} + +static guint +atspi_device_x11_get_locked_modifiers (AtspiDevice *device) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + XkbStateRec state_rec; + + memset (&state_rec, 0, sizeof (state_rec)); + XkbGetState (priv->display, XkbUseCoreKbd, &state_rec); + return state_rec.locked_mods; +} + +static void +get_keycode_range (AtspiDeviceX11 *x11_device, int *min, int *max) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + XkbDescPtr desc; + + desc = XkbGetMap (priv->display, XkbModifierMapMask, XkbUseCoreKbd); + *min = desc->min_key_code; + *max = desc->max_key_code; + XkbFreeKeyboard (desc, XkbModifierMapMask, TRUE); +} + +static gboolean +atspi_device_x11_grab_keyboard (AtspiDevice *device) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + int min, max; + gint i; + + g_return_val_if_fail (priv->display != NULL, FALSE); +#if 0 + /* THis seems like the right thing to do, but it fails for me */ + return (XGrabKeyboard (priv->display, priv->window, TRUE, GrabModeAsync, GrabModeSync, CurrentTime)) == 0; +#else + if (priv->keyboard_grabbed) + return TRUE; + priv->keyboard_grabbed = TRUE; + refresh_key_grabs (x11_device); + + get_keycode_range (x11_device, &min, &max); + for (i = min; i < max; i++) + grab_key (x11_device, i, 0); + return TRUE; +#endif +} + +static void +atspi_device_x11_ungrab_keyboard (AtspiDevice *device) +{ + AtspiDeviceX11 *x11_device = ATSPI_DEVICE_X11 (device); + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + int min, max; + gint i; + + g_return_if_fail (priv->display != NULL); +#if 0 + XUngrabKeyboard (priv->display, CurrentTime); +#else + if (!priv->keyboard_grabbed) + return; + priv->keyboard_grabbed = FALSE; + + get_keycode_range (x11_device, &min, &max); + for (i = min; i < max; i++) + ungrab_key (x11_device, i, 0); + + refresh_key_grabs (x11_device); +#endif +} + +static void +atspi_device_x11_class_init (AtspiDeviceX11Class *klass) +{ + AtspiDeviceClass *device_class = ATSPI_DEVICE_CLASS (klass); + GObjectClass *object_class = (GObjectClass *) klass; + + device_x11_parent_class = g_type_class_peek_parent (klass); + device_class->add_key_grab = atspi_device_x11_add_key_grab; + device_class->map_modifier = atspi_device_x11_map_modifier; + device_class->unmap_modifier = atspi_device_x11_unmap_modifier; + device_class->get_modifier = atspi_device_x11_get_modifier; + device_class->remove_key_grab = atspi_device_x11_remove_key_grab; + device_class->get_locked_modifiers = atspi_device_x11_get_locked_modifiers; + device_class->grab_keyboard = atspi_device_x11_grab_keyboard; + device_class->ungrab_keyboard = atspi_device_x11_ungrab_keyboard; + object_class->finalize = atspi_device_x11_finalize; +} + +/** + * atspi_device_x11_new: + * + * Creates a new #AtspiDeviceX11. + * + * Returns: (transfer full): a pointer to a newly-created #AtspiDeviceX11. + * + **/ +AtspiDeviceX11 * +atspi_device_x11_new () +{ + AtspiDeviceX11 *device = g_object_new (atspi_device_x11_get_type (), NULL); + + return device; +} diff --git a/atspi/atspi-device-x11.h b/atspi/atspi-device-x11.h new file mode 100644 index 0000000..3a91edc --- /dev/null +++ b/atspi/atspi-device-x11.h @@ -0,0 +1,59 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2020 SUSE LLC. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _ATSPI_DEVICE_X11_H_ +#define _ATSPI_DEVICE_X11_H_ + +#include "glib-object.h" + +#include "atspi-types.h" +#include "atspi-device.h" + +G_BEGIN_DECLS + +#define ATSPI_TYPE_DEVICE_X11 (atspi_device_x11_get_type ()) +#define ATSPI_DEVICE_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DEVICE_X11, AtspiDeviceX11)) +#define ATSPI_DEVICE_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_DEVICE_X11, AtspiDeviceX11Class)) +#define ATSPI_IS_DEVICE_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DEVICE_X11)) +#define ATSPI_IS_DEVICE_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_DEVICE_X11)) +#define ATSPI_DEVICE_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_DEVICE_X11, AtspiDeviceX11Class)) + +typedef struct _AtspiDeviceX11 AtspiDeviceX11; +struct _AtspiDeviceX11 +{ + AtspiDevice parent; +}; + +typedef struct _AtspiDeviceX11Class AtspiDeviceX11Class; +struct _AtspiDeviceX11Class +{ + AtspiDeviceClass parent_class; +}; + +GType atspi_device_x11_get_type (void); + +AtspiDeviceX11 *atspi_device_x11_new (); + +G_END_DECLS + +#endif /* _ATSPI_DEVICE_X11_H_ */ diff --git a/atspi/atspi-device.c b/atspi/atspi-device.c new file mode 100644 index 0000000..5f62dc3 --- /dev/null +++ b/atspi/atspi-device.c @@ -0,0 +1,399 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2020 SUSE LLC. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "atspi-private.h" +#include "atspi-device.h" +#include "atspi-device-legacy.h" +#include "atspi-device-x11.h" + +typedef struct +{ + guint id; + guint keycode; + guint keysym; + guint modifiers; + AtspiKeyCallback callback; + void *callback_data; + GDestroyNotify callback_destroyed; +} AtspiKeyGrab; + +typedef struct _AtspiDevicePrivate AtspiDevicePrivate; +struct _AtspiDevicePrivate +{ + GSList *key_watchers; + GSList *keygrabs; + guint last_grab_id; +}; + +GObjectClass *device_parent_class; + +static void +atspi_device_init (AtspiDevice *device) +{ +} + +G_DEFINE_TYPE_WITH_CODE (AtspiDevice, atspi_device, + G_TYPE_OBJECT, + G_ADD_PRIVATE (AtspiDevice)) + +static void +atspi_device_finalize (GObject *object) +{ + AtspiDevice *device = (AtspiDevice *) object; + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + + g_slist_free_full (priv->keygrabs, g_free); + priv->keygrabs = NULL; + + device_parent_class->finalize (object); +} + +static void +atspi_device_real_add_key_grab (AtspiDevice *device, AtspiKeyDefinition *kd) +{ +} + +static void +atspi_device_real_remove_key_grab (AtspiDevice *device, guint id) +{ +} + +static void +atspi_device_class_init (AtspiDeviceClass *klass) +{ + GObjectClass *object_class = (GObjectClass *) klass; + + device_parent_class = g_type_class_peek_parent (klass); + klass->add_key_grab = atspi_device_real_add_key_grab; + klass->remove_key_grab = atspi_device_real_remove_key_grab; + object_class->finalize = atspi_device_finalize; +} + +/** + * atspi_device_new: + * + * Creates a new #AtspiDevice with a specified callback function. + * + * Returns: (transfer full): a pointer to a newly-created #AtspiDevice. + * + **/ +AtspiDevice * +atspi_device_new () +{ +#ifdef HAVE_X11 + if (!g_getenv ("WAYLAND_DISPLAY") && !g_getenv ("ATSPI_USE_LEGACY_DEVICE")) + return ATSPI_DEVICE (atspi_device_x11_new ()); +#endif + + return ATSPI_DEVICE (atspi_device_legacy_new ()); +} + +gboolean +atspi_device_notify_key (AtspiDevice *device, gboolean pressed, int keycode, int keysym, gint state, gchar *text) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + GSList *l; + gboolean ret = FALSE; + + for (l = priv->key_watchers; l; l = l->next) + { + AtspiKeyGrab *grab = l->data; + grab->callback (device, pressed, keycode, keysym, state, text, grab->callback_data); + } + + for (l = priv->keygrabs; l; l = l->next) + { + AtspiKeyGrab *grab = l->data; + //if (keycode == grab->keycode && (grab->modifiers & state) == grab->modifiers) + if (keycode == grab->keycode && grab->modifiers == state) + { + if (grab->callback) + grab->callback (device, pressed, keycode, keysym, state, text, grab->callback_data); + ret = TRUE; + } + } + + return ret; +} + +static gboolean +is_id_used (AtspiDevice *device, guint id) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + GSList *l; + + for (l = priv->key_watchers; l; l = l->next) + { + AtspiKeyGrab *grab = l->data; + if (grab->id == id) + return TRUE; + } + + for (l = priv->keygrabs; l; l = l->next) + { + AtspiKeyGrab *grab = l->data; + if (grab->id == id) + return TRUE; + } + + return FALSE; +} + +static guint +get_grab_id (AtspiDevice *device) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + + while (is_id_used (device, priv->last_grab_id)) priv->last_grab_id++; + return priv->last_grab_id++; +} + +static gboolean +grab_has_duplicate (AtspiDevice *device, AtspiKeyGrab *grab) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + GSList *l; + + for (l = priv->keygrabs; l; l = l->next) + { + AtspiKeyGrab *other_grab = l->data; + if (other_grab->id != grab->id && other_grab->keycode == grab->keycode && other_grab->modifiers == grab->modifiers) + return TRUE; + } + + return FALSE; +} + +/** + *atspi_device_add_key_grab: +* @device: the device. + * @kd: a #AtspiKeyDefinition specifying the key code to grab. + * @callback: (scope notified) (allow-none): the function to call when the + * given key is pressed. + * @user_data: Data to be passed to @callback. + * @callback_destroyed: callback function to be called when @callback is + * destroyed. + * + * Returns: an identifier that can be later used to remove the grab. + * Add a key grab for the given key/modifier combination. + */ +guint +atspi_device_add_key_grab (AtspiDevice *device, AtspiKeyDefinition *kd, AtspiKeyCallback callback, void *user_data, GDestroyNotify callback_destroyed) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + AtspiKeyGrab *grab = g_new (AtspiKeyGrab, 1); + grab->keycode = kd->keycode; + grab->keysym = kd->keysym; + grab->modifiers = kd->modifiers; + grab->callback = callback; + grab->callback_data = user_data; + grab->callback_destroyed = callback_destroyed; + grab->id = get_grab_id (device); + priv->keygrabs = g_slist_append (priv->keygrabs, grab); + + if (!grab_has_duplicate (device, grab)) + ATSPI_DEVICE_GET_CLASS (device)->add_key_grab (device, kd); + return grab->id; +} + +/** + * atspi_device_remove_key_grab: + * @device: the device. + * @id: the identifier of the grab to be removed. + * + * Removes the key grab specified by @id. + */ +void +atspi_device_remove_key_grab (AtspiDevice *device, guint id) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + GSList *l; + + for (l = priv->keygrabs; l; l = l->next) + { + AtspiKeyGrab *grab = l->data; + if (grab->id == id) + { + if (!grab_has_duplicate (device, grab)) + ATSPI_DEVICE_GET_CLASS (device)->remove_key_grab (device, id); + priv->keygrabs = g_slist_remove (priv->keygrabs, grab); + if (grab->callback_destroyed) + (*grab->callback_destroyed) (grab->callback); + g_free (grab); + return; + } + } +} + +/** + *atspi_device_add_key_watcher: +* @device: the device. + * @callback: (scope notified): the function to call when the given key is + * pressed. + * @user_data: (closure callback): Data to be passed to @callback. + * @callback_destroyed: (destroy callback): callback function to be called + * when @callback is destroyed. + * + * Add a callback that will receive a notification whenever a key is + * pressed or released. + */ +void +atspi_device_add_key_watcher (AtspiDevice *device, AtspiKeyCallback callback, void *user_data, GDestroyNotify callback_destroyed) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + AtspiKeyGrab *grab = g_new0 (AtspiKeyGrab, 1); + grab->id = get_grab_id (device); + grab->callback = callback; + grab->callback_data = user_data; + grab->callback_destroyed = callback_destroyed; + priv->key_watchers = g_slist_append (priv->key_watchers, grab); +} + +AtspiKeyDefinition * +atspi_device_get_grab_by_id (AtspiDevice *device, guint id) +{ + AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); + GSList *l; + + for (l = priv->keygrabs; l; l = l->next) + { + AtspiKeyGrab *grab = l->data; + if (grab->id == id) + { + AtspiKeyDefinition *kd = g_new0 (AtspiKeyDefinition, 1); + kd->keycode = grab->keycode;\ + kd->modifiers = grab->modifiers; + return kd; + } + } + return NULL; +} + +/** + * atspi_device_map_modifier: + * @device: the device. + * @keycode: the keycode to map. + * + * Maps the specified key code to a modifier so that it can be used in + * conjunction with other keys to create a key grab. If the given keycode is + * already mapped, then this function will return the modifier that is + * currently mapped to the keycode, without doing anything else. Otherwise, + * it will use the last modifier that AT-SPI used to map a key. If no keys + * have yet been mapped using this device, then it will look for a modifier + * that is not currently being used. If no unused modifier can be found, + * then it will use the first modifier by default. + * + * Returns: the modifier that is now mapped to this keycode. This return + * value can be passed to atspi_device_add_key_grab. + */ +guint +atspi_device_map_modifier (AtspiDevice *device, gint keycode) +{ + if (ATSPI_DEVICE_GET_CLASS (device)->map_modifier) + return ATSPI_DEVICE_GET_CLASS (device)->map_modifier (device, keycode); + + return 0; +} + +/** + * atspi_device_unmap_modifier: + * @device: the device. + * @keycode: the keycode to unmap. + * + * Removes a mapped modifier from the given keycode. + */ +void +atspi_device_unmap_modifier (AtspiDevice *device, gint keycode) +{ + if (ATSPI_DEVICE_GET_CLASS (device)->unmap_modifier) + ATSPI_DEVICE_GET_CLASS (device)->unmap_modifier (device, keycode); +} + +/** + * atspi_device_get_modifier: + * @device: the device. + * @keycode: the keycode to map. + * + * Gets the modifier for a given keycode, if one exists. Does not creatt a new + * mapping. This function should be used when the intention is to query a + * locking modifier such as num lock via atspi_device_get_locked_modifiers, + * rather than to add key grabs. + * + * Returns: the modifier that is mapped to this keycode. + */ +guint +atspi_device_get_modifier (AtspiDevice *device, gint keycode) +{ + if (ATSPI_DEVICE_GET_CLASS (device)->get_modifier) + return ATSPI_DEVICE_GET_CLASS (device)->get_modifier (device, keycode); + + return 0; +} + +/** + * atspi_device_get_locked_modifiers: + * @device: the device. + * + * Returns the locked modifiers (ie, num lock, caps lock) associated with this + * keyboard. + * + * Returns: a guint of modifier flags. + */ +guint +atspi_device_get_locked_modifiers (AtspiDevice *device) +{ + if (ATSPI_DEVICE_GET_CLASS (device)->get_locked_modifiers) + return ATSPI_DEVICE_GET_CLASS (device)->get_locked_modifiers (device); + + return 0; +} + +/** + * atspi_device_grab_keyboard: + * + * Attempts to grab the entire keyboard. This should only be done + * temporarily, as it may conflict with other applications that also want to + * grab the keyboard. + * + * Returns: #TRUE if successful, #FALSE otherwise. + */ +gboolean +atspi_device_grab_keyboard (AtspiDevice *device) +{ + if (ATSPI_DEVICE_GET_CLASS (device)->grab_keyboard) + return ATSPI_DEVICE_GET_CLASS (device)->grab_keyboard (device); + + return FALSE; +} + +/** + * atspi_device_ungrab_keyboard: + * + * Removes a keyboard grab added via a call to atspi_device_add_keyboard. + */ +void +atspi_device_ungrab_keyboard (AtspiDevice *device) +{ + if (ATSPI_DEVICE_GET_CLASS (device)->ungrab_keyboard) + ATSPI_DEVICE_GET_CLASS (device)->ungrab_keyboard (device); +} + diff --git a/atspi/atspi-device.h b/atspi/atspi-device.h new file mode 100644 index 0000000..a246842 --- /dev/null +++ b/atspi/atspi-device.h @@ -0,0 +1,103 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2020 SUSE LLC. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _ATSPI_DEVICE_H_ +#define _ATSPI_DEVICE_H_ + +#include "glib-object.h" + +#include "atspi-types.h" + +G_BEGIN_DECLS + +#define ATSPI_TYPE_DEVICE (atspi_device_get_type ()) +#define ATSPI_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DEVICE, AtspiDevice)) +#define ATSPI_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_DEVICE, AtspiDeviceClass)) +#define ATSPI_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DEVICE)) +#define ATSPI_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_DEVICE)) +#define ATSPI_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_DEVICE, AtspiDeviceClass)) + +typedef struct _AtspiDevice AtspiDevice; +struct _AtspiDevice +{ + GObject parent; +}; + +typedef struct _AtspiDeviceClass AtspiDeviceClass; +struct _AtspiDeviceClass +{ + GObjectClass parent_class; + + void (*add_key_grab) (AtspiDevice *device, AtspiKeyDefinition *kd); + void (*remove_key_grab) (AtspiDevice *device, guint id); + guint (*map_modifier) (AtspiDevice *device, gint keycode); + void (*unmap_modifier) (AtspiDevice *device, gint keycode); + guint (*get_modifier) (AtspiDevice *device, gint keycode); + gboolean (*grab_keyboard) (AtspiDevice *device); + void (*ungrab_keyboard) (AtspiDevice *device); + guint (*get_locked_modifiers) (AtspiDevice *device); +}; + +GType atspi_device_get_type (void); + +/** + * AtspiKeyCallback: + * @device: the device. + * @pressed: TRUE if the key is being pressed, FALSE if being released. + * @keycode: the hardware code for the key. + * @keysym: the keysym for the key. + * @modifiers: a bitflag indicating which key modifiers are active. + * @keystring: the text corresponding to the keypress. + * @user_data: (closure): user-supplied data + * + * A callback that will be invoked when a key is pressed. + */ +typedef void (*AtspiKeyCallback) (AtspiDevice *device, gboolean pressed, guint keycode, guint keysym, guint modifiers, const gchar *keystring, void *user_data); + +AtspiDevice *atspi_device_new (); + +gboolean atspi_device_notify_key (AtspiDevice *device, gboolean pressed, int keycode, int keysym, gint state, gchar *text); + +guint atspi_device_add_key_grab (AtspiDevice *device, AtspiKeyDefinition *kd, AtspiKeyCallback callback, void *user_data, GDestroyNotify callback_destroyed); + +void atspi_device_remove_key_grab (AtspiDevice *device, guint id); + +void atspi_device_add_key_watcher (AtspiDevice *device, AtspiKeyCallback callback, void *user_data, GDestroyNotify callback_destroyed); + +AtspiKeyDefinition *atspi_device_get_grab_by_id (AtspiDevice *device, guint id); + +guint atspi_device_map_modifier (AtspiDevice *device, gint keycode); + +void atspi_device_unmap_modifier (AtspiDevice *device, gint keycode); + +guint atspi_device_get_modifier (AtspiDevice *device, gint keycode); + +guint atspi_device_get_locked_modifiers (AtspiDevice *device); + +gboolean atspi_device_grab_keyboard (AtspiDevice *device); + +void atspi_device_ungrab_keyboard (AtspiDevice *device); + +G_END_DECLS + +#endif /* _ATSPI_DEVICE_H_ */ diff --git a/atspi/atspi-enum-types.c.template b/atspi/atspi-enum-types.c.template index 385d0ee..92e4937 100644 --- a/atspi/atspi-enum-types.c.template +++ b/atspi/atspi-enum-types.c.template @@ -5,7 +5,7 @@ /*** BEGIN file-production ***/ /* enumerations from "@basename@" */ -#include "@filename@" +#include "@basename@" /*** END file-production ***/ diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c index 249890b..ca6828f 100644 --- a/atspi/atspi-event-listener.c +++ b/atspi/atspi-event-listener.c @@ -166,6 +166,9 @@ atspi_event_listener_new_simple (AtspiEventListenerSimpleCB callback, } static GList *event_listeners = NULL; +static GList *pending_removals = NULL; +static int in_send = 0; + static gchar * convert_name_from_dbus (const char *name, gboolean path_hack) @@ -332,40 +335,10 @@ demarshal_rect (DBusMessageIter *iter, AtspiRect *rect) return TRUE; } -static gchar * -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; -} - static gboolean convert_event_type_to_dbus (const char *eventType, char **categoryp, char **namep, char **detailp, GPtrArray **matchrule_array) { - gchar *tmp = strdup_and_adjust_for_dbus (eventType); + gchar *tmp = _atspi_strdup_and_adjust_for_dbus (eventType); char *category = NULL, *name = NULL, *detail = NULL; char *saveptr = NULL; @@ -420,6 +393,12 @@ listener_entry_free (EventListenerEntry *e) g_free (e->name); if (e->detail) g_free (e->detail); callback_unref (callback); + + for (int i=0; i < e->properties->len; i++) + g_free (g_array_index (e->properties, char*, i)); + + g_array_free (e->properties, TRUE); + g_free (e); } @@ -627,7 +606,7 @@ copy_event_properties (GArray *src) for (i = 0; i < src->len; i++) { gchar *dup = g_strdup (g_array_index (src, char *, i)); - g_array_append_val (dst, dup); + g_array_append_val (dst, dup); } return dst; } @@ -677,6 +656,7 @@ atspi_event_listener_register_from_callback_full (AtspiEventListenerCB callback, callback_destroyed); if (!convert_event_type_to_dbus (event_type, &e->category, &e->name, &e->detail, &matchrule_array)) { + g_free (e->event_type); g_free (e); return FALSE; } @@ -815,12 +795,12 @@ atspi_event_listener_deregister_from_callback (AtspiEventListenerCB callback, is_superset (name, e->name) && is_superset (detail, e->detail)) { - gboolean need_replace; DBusMessage *message, *reply; - need_replace = (l == event_listeners); - l = g_list_remove (l, e); - if (need_replace) - event_listeners = l; + l = g_list_next (l); + if (in_send) + pending_removals = g_list_append (pending_removals, e); + else + event_listeners = g_list_remove (event_listeners, e); for (i = 0; i < matchrule_array->len; i++) { char *matchrule = g_ptr_array_index (matchrule_array, i); @@ -837,9 +817,11 @@ atspi_event_listener_deregister_from_callback (AtspiEventListenerCB callback, if (reply) dbus_message_unref (reply); - listener_entry_free (e); + if (!in_send) + listener_entry_free (e); } - else l = g_list_next (l); + else + l = g_list_next (l); } g_free (category); g_free (name); @@ -882,7 +864,8 @@ atspi_event_copy (AtspiEvent *src) dst->detail2 = src->detail2; g_value_init (&dst->any_data, G_VALUE_TYPE (&src->any_data)); g_value_copy (&src->any_data, &dst->any_data); - dst->sender = g_object_ref (src->sender); + if (src->sender) + dst->sender = g_object_ref (src->sender); return dst; } @@ -892,7 +875,7 @@ atspi_event_free (AtspiEvent *event) g_object_unref (event->source); g_free (event->type); g_value_unset (&event->any_data); - g_object_unref (event->sender); + g_clear_object (&event->sender); g_free (event); } @@ -911,6 +894,13 @@ detail_matches_listener (const char *event_detail, const char *listener_detail) : strcmp (listener_detail, event_detail)); } +static void +resolve_pending_removal (gpointer data) +{ + event_listeners = g_list_remove (event_listeners, data); + listener_entry_free (data); +} + void _atspi_send_event (AtspiEvent *e) { @@ -931,6 +921,7 @@ _atspi_send_event (AtspiEvent *e) g_warning ("AT-SPI: Couldn't parse event: %s\n", e->type); return; } + in_send++; for (l = event_listeners; l; l = g_list_next (l)) { EventListenerEntry *entry = l->data; @@ -947,15 +938,27 @@ _atspi_send_event (AtspiEvent *e) } if (!l2) { + for (l2 = pending_removals; l2; l2 = l2->next) + { + if (l2->data == entry) + break; + } + } + if (!l2) + { entry->callback (atspi_event_copy (e), entry->user_data); called_listeners = g_list_prepend (called_listeners, entry); } } } + in_send--; if (detail) g_free (detail); g_free (name); g_free (category); g_list_free (called_listeners); + + g_list_free_full (pending_removals, resolve_pending_removal); + pending_removals = NULL; } DBusHandlerResult @@ -1057,6 +1060,7 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant); if (!strcmp (category, "ScreenReader")) { + g_object_unref (e.source); e.source = accessible; } else @@ -1116,6 +1120,7 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) g_free (name); g_free (detail); g_object_unref (e.source); + g_object_unref (e.sender); g_value_unset (&e.any_data); return DBUS_HANDLER_RESULT_HANDLED; } diff --git a/atspi/atspi-misc-private.h b/atspi/atspi-misc-private.h index f0b5adb..fb78b02 100644 --- a/atspi/atspi-misc-private.h +++ b/atspi/atspi-misc-private.h @@ -168,6 +168,8 @@ gboolean _atspi_set_allow_sync (gboolean val); void _atspi_set_error_no_sync (GError **error); gboolean _atspi_prepare_screen_reader_interface (); + +gchar * _atspi_strdup_and_adjust_for_dbus (const char *s); G_END_DECLS #endif /* _ATSPI_MISC_PRIVATE_H_ */ diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 9e8595a..7af46e9 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -35,6 +35,7 @@ #include "atspi-gmain.h" #include #include +#include static void handle_get_items (DBusPendingCall *pending, void *user_data); @@ -132,6 +133,8 @@ _atspi_bus () static AtspiAccessible *desktop; +static void cleanup_deferred_message (void); + static void cleanup () { @@ -145,15 +148,8 @@ cleanup () g_hash_table_destroy (refs); } - if (bus) - { - dbus_connection_close (bus); - dbus_connection_unref (bus); - bus = NULL; - } - if (!desktop) - return; + goto end; /* TODO: Do we need this code, or should we just dispose the desktop? */ for (i = desktop->children->len - 1; i >= 0; i--) @@ -167,6 +163,14 @@ cleanup () g_object_run_dispose (G_OBJECT (desktop->parent.app)); g_object_unref (desktop); desktop = NULL; + +end: + if (bus) + { + dbus_connection_close (bus); + dbus_connection_unref (bus); + bus = NULL; + } } static gboolean atspi_inited = FALSE; @@ -454,7 +458,16 @@ add_accessible_from_iter (DBusMessageIter *iter) if (index >= 0 && accessible->accessible_parent) { if (index >= accessible->accessible_parent->children->len) + { + /* There is no room for this object */ g_ptr_array_set_size (accessible->accessible_parent->children, index + 1); + } + else + { + /* This place is already taken - let's free this place with dignity */ + if (g_ptr_array_index (accessible->accessible_parent->children, index)) + g_object_unref (g_ptr_array_index (accessible->accessible_parent->children, index)); + } g_ptr_array_index (accessible->accessible_parent->children, index) = g_object_ref (accessible); } @@ -763,6 +776,23 @@ process_deferred_message (BusDataClosure *closure) static GQueue *deferred_messages = NULL; +static void +destroy_deferred_message_item(gpointer ptr) +{ + /* TODO this is still memory leak on c->data */ + BusDataClosure *c = ptr; + dbus_message_unref (c->message); + dbus_connection_unref (c->bus); + g_free (c); +} + +static void +cleanup_deferred_message(void) +{ + g_queue_free_full (deferred_messages, destroy_deferred_message_item); + deferred_messages = NULL; +} + static gboolean process_deferred_messages (void) { @@ -1244,7 +1274,7 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, process_deferred_messages (); if (!reply) { - // TODO: throw exception + /* TODO: throw exception */ goto done; } @@ -1275,6 +1305,11 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, } else { + if (type [0] == 's') + { + *(char**) data = NULL; + } + dbus_message_iter_get_basic (&iter_variant, data); if (type [0] == 's') *(char **)data = g_strdup (*(char **)data); @@ -1403,7 +1438,7 @@ _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *iter) accessible->interfaces = 0; if (strcmp (iter_sig, "as") != 0) { - g_warning ("_atspi_dbus_set_interfaces: Passed iterator with invalid signature %s", dbus_message_iter_get_signature (iter)); + g_warning ("_atspi_dbus_set_interfaces: Passed iterator with invalid signature %s", iter_sig); dbus_free (iter_sig); return; } @@ -1552,7 +1587,7 @@ get_accessibility_bus_address_dbus (void) address = g_strdup (tmp_address); dbus_message_unref (reply); } - + out: dbus_connection_unref (session_bus); return address; @@ -1899,3 +1934,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; +} diff --git a/atspi/atspi-registry.c b/atspi/atspi-registry.c index c50ae20..dea5878 100644 --- a/atspi/atspi-registry.c +++ b/atspi/atspi-registry.c @@ -528,7 +528,6 @@ atspi_generate_mouse_event (glong x, glong y, const gchar *name, GError **error) /** * atspi_set_reference_window: - * * @accessible: the #AtspiAccessible corresponding to the window to select. * should be a top-level window with a role of * ATSPI_ROLE_APPLICATION. @@ -557,7 +556,7 @@ atspi_key_definition_copy (AtspiKeyDefinition *src) dst->keysym = src->keysym; if (src->keystring) dst->keystring = g_strdup (src->keystring); - dst->unused = src->unused; + dst->modifiers = src->modifiers; return dst; } diff --git a/atspi/atspi-types.h b/atspi/atspi-types.h index 2631baf..ab43ca8 100644 --- a/atspi/atspi-types.h +++ b/atspi/atspi-types.h @@ -78,9 +78,16 @@ struct _AtspiKeyDefinition gint keycode; gint keysym; gchar *keystring; - gint unused; + guint modifiers; }; +/** + * ATSPI_TYPE_KEY_DEFINITION: + * + * The #GType for a boxed type holding a #AtspiKeyDefinition. + */ +#define ATSPI_TYPE_KEY_DEFINITION (atspi_key_definition_get_type ()) + typedef struct _AtspiEvent AtspiEvent; struct _AtspiEvent { diff --git a/atspi/atspimarshal.list b/atspi/atspimarshal.list index 2d9dd51..163720a 100644 --- a/atspi/atspimarshal.list +++ b/atspi/atspimarshal.list @@ -23,3 +23,4 @@ # BOOL deprecated alias for BOOLEAN VOID:INT,INT +VOID:INT,STRING diff --git a/atspi/meson.build b/atspi/meson.build index 8a2ca27..ace8502 100644 --- a/atspi/meson.build +++ b/atspi/meson.build @@ -4,6 +4,8 @@ atspi_sources = [ 'atspi-application.c', 'atspi-collection.c', 'atspi-component.c', + 'atspi-device.c', + 'atspi-device-legacy.c', 'atspi-device-listener.c', 'atspi-document.c', 'atspi-editabletext.c', @@ -34,6 +36,8 @@ atspi_headers = [ 'atspi-collection.h', 'atspi-component.h', 'atspi-constants.h', + 'atspi-device.h', + 'atspi-device-legacy.h', 'atspi-device-listener.h', 'atspi-document.h', 'atspi-editabletext.h', @@ -56,6 +60,14 @@ atspi_headers = [ 'atspi-value.h', ] +x11_option = get_option('x11') +if x11_option != 'no' + if x11_dep.found() + atspi_sources += ['atspi-device-x11.c'] + atspi_headers += ['atspi-device-x11.h'] + endif +endif + atspi_includedir = join_paths(get_option('prefix'), get_option('includedir'), 'at-spi-2.0', 'atspi') install_headers(atspi_headers, install_dir: atspi_includedir) @@ -127,7 +139,7 @@ pkgconfig.generate( description: 'Accessibility Technology software library', version: meson.project_version(), libraries: atspi, - requires: 'dbus-1 glib-2.0', + requires: ['dbus-1', 'glib-2.0'], subdirs: 'at-spi-2.0', filebase: 'atspi-2', ) diff --git a/bus/accessibility.conf.in b/bus/accessibility.conf.in index 31b6a79..79c5146 100644 --- a/bus/accessibility.conf.in +++ b/bus/accessibility.conf.in @@ -6,7 +6,7 @@ @DATADIR@/dbus-1/accessibility-services EXTERNAL - unix:tmpdir=/tmp + unix:dir=/tmp diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index b4f49b8..d7c6690 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -39,6 +39,9 @@ #include #include #endif +#ifdef DBUS_BROKER +#include +#endif typedef enum { A11Y_BUS_STATE_IDLE = 0, @@ -69,6 +72,7 @@ typedef struct { int pipefd[2]; int listenfd; char *a11y_launch_error_message; + GDBusProxy *sm_proxy; } A11yBusLauncher; static A11yBusLauncher *_global_app = NULL; @@ -140,27 +144,60 @@ client_proxy_ready_cb (GObject *source_object, } static void +client_registered (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + A11yBusLauncher *app = user_data; + GError *error = NULL; + GVariant *variant; + gchar *object_path; + GDBusProxyFlags flags; + + variant = g_dbus_proxy_call_finish (app->sm_proxy, result, &error); + if (!variant) + { + if (error != NULL) + { + g_warning ("Failed to register client: %s", error->message); + g_error_free (error); + } + } + else + { + g_variant_get (variant, "(o)", &object_path); + g_variant_unref (variant); + + flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES; + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, flags, NULL, + "org.gnome.SessionManager", object_path, + "org.gnome.SessionManager.ClientPrivate", + NULL, client_proxy_ready_cb, app); + + g_free (object_path); + } + g_clear_object (&app->sm_proxy); +} + +static void register_client (A11yBusLauncher *app) { GDBusProxyFlags flags; - GDBusProxy *sm_proxy; GError *error; const gchar *app_id; const gchar *autostart_id; gchar *client_startup_id; GVariant *parameters; - GVariant *variant; - gchar *object_path; flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS; error = NULL; - sm_proxy = g_dbus_proxy_new_sync (app->session_bus, flags, NULL, - "org.gnome.SessionManager", - "/org/gnome/SessionManager", - "org.gnome.SessionManager", - NULL, &error); + app->sm_proxy = g_dbus_proxy_new_sync (app->session_bus, flags, NULL, + "org.gnome.SessionManager", + "/org/gnome/SessionManager", + "org.gnome.SessionManager", + NULL, &error); if (error != NULL) { @@ -187,31 +224,11 @@ register_client (A11yBusLauncher *app) g_free (client_startup_id); error = NULL; - variant = g_dbus_proxy_call_sync (sm_proxy, - "RegisterClient", parameters, - G_DBUS_CALL_FLAGS_NONE, - -1, NULL, &error); - - g_object_unref (sm_proxy); - - if (error != NULL) - { - g_warning ("Failed to register client: %s", error->message); - g_error_free (error); - - return; - } - - g_variant_get (variant, "(o)", &object_path); - g_variant_unref (variant); - - flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES; - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, flags, NULL, - "org.gnome.SessionManager", object_path, - "org.gnome.SessionManager.ClientPrivate", - NULL, client_proxy_ready_cb, app); + g_dbus_proxy_call (app->sm_proxy, + "RegisterClient", parameters, + G_DBUS_CALL_FLAGS_NONE, + G_MAXINT, NULL, client_registered, app); - g_free (object_path); } static void @@ -378,11 +395,26 @@ static gboolean ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path) { char *argv[] = { DBUS_BROKER, config_path, "--scope", "user", NULL }; + char *unit; struct sockaddr_un addr = { .sun_family = AF_UNIX }; socklen_t addr_len = sizeof(addr); GPid pid; GError *error = NULL; + /* This detects whether we are running under systemd. We only try to + * use dbus-broker if we are running under systemd because D-Bus + * service activation won't work otherwise. + */ + if (sd_pid_get_user_unit (getpid (), &unit) >= 0) + { + free (unit); + } + else + { + app->state = A11Y_BUS_STATE_ERROR; + return FALSE; + } + if ((app->listenfd = socket (PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) < 0) g_error ("Failed to create listening socket: %s", strerror (errno)); diff --git a/bus/at-spi-dbus-bus.desktop.in b/bus/at-spi-dbus-bus.desktop.in index b3c90bd..a45d27e 100644 --- a/bus/at-spi-dbus-bus.desktop.in +++ b/bus/at-spi-dbus-bus.desktop.in @@ -4,6 +4,6 @@ Name=AT-SPI D-Bus Bus Exec=@libexecdir@/at-spi-bus-launcher --launch-immediately OnlyShowIn=GNOME;Unity; NoDisplay=true -AutostartCondition=GSETTINGS org.gnome.desktop.interface toolkit-accessibility +AutostartCondition=GSettings org.gnome.desktop.interface toolkit-accessibility X-GNOME-AutoRestart=true X-GNOME-Autostart-Phase=Initialization diff --git a/bus/meson.build b/bus/meson.build index 155dc53..f6c32c9 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -10,25 +10,21 @@ session_dir = join_paths(atspi_sysconfdir, 'xdg/autostart') configure_file(input: 'accessibility.conf.in', output: 'accessibility.conf', configuration: accessibility_conf, - install: true, install_dir: busconfig_dir) configure_file(input: 'at-spi-dbus-bus.desktop.in', output: 'at-spi-dbus-bus.desktop', configuration: libexec_conf, - install: true, install_dir: session_dir) configure_file(input: 'org.a11y.Bus.service.in', output: 'org.a11y.Bus.service', configuration: libexec_conf, - install: true, install_dir: dbus_services_dir) configure_file(input: 'at-spi-dbus-bus.service.in', output: 'at-spi-dbus-bus.service', configuration: libexec_conf, - install: true, install_dir: systemd_user_dir) launcher_args = [ @@ -52,13 +48,16 @@ else endif endif +needs_systemd = false if get_option('dbus_broker') != 'default' launcher_args += '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker')) + needs_systemd = true else dbus_broker = find_program('dbus-broker-launch', required: false) if dbus_broker.found() launcher_args += '-DDBUS_BROKER="@0@"'.format(dbus_broker.path()) + needs_systemd = true endif endif @@ -66,9 +65,15 @@ if get_option('default_bus') == 'dbus-broker' launcher_args += '-DWANT_DBUS_BROKER' endif +if needs_systemd + systemd_dep = dependency('libsystemd') +else + systemd_dep = dependency('', required: false) +endif + executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c', include_directories: [ root_inc, include_directories('.') ], - dependencies: [ gio_dep, x11_deps ], + dependencies: [ gio_dep, systemd_dep, x11_deps ], c_args: launcher_args, install: true, install_dir: atspi_libexecdir) diff --git a/dbind/dbtest.c b/dbind/dbtest.c index 4f58540..b338c03 100644 --- a/dbind/dbtest.c +++ b/dbind/dbtest.c @@ -86,7 +86,7 @@ void test_simple () dbind_any_free ("i", &v2); /* nop */ dbus_message_unref (msg); - fprintf (stderr, "simple ok\n"); + printf ("simple ok\n"); } void test_array () @@ -117,7 +117,7 @@ void test_array () dbind_any_free ("ai", &a2); dbus_message_unref (msg); - fprintf (stderr, "array ok\n"); + printf ("array ok\n"); } /* this taught me that the struct type is a mis-nomer, @@ -146,7 +146,7 @@ void test_struct_native () } dbus_message_iter_close_container (&iter, &arr); - fprintf (stderr, "native struct marshalling ok\n"); + printf ("native struct marshalling ok\n"); dbus_message_unref (msg); } @@ -185,7 +185,7 @@ void test_struct_simple () g_assert (!strcmp (g_array_index (a2, FooBaa, 1).baa, "baA")); g_assert (!strcmp (g_array_index (a2, FooBaa, 1).baz, "BaZ")); - fprintf (stderr, "simple struct ok\n"); + printf ("simple struct ok\n"); dbind_any_free ("a(sss)", &a2); dbus_message_unref (msg); @@ -248,7 +248,7 @@ void test_struct_complex () g_assert (c2.pad2 == 1); g_assert (!strcmp (c1.name, "stroustrup")); - fprintf (stderr, "complex struct ok\n"); + printf ("complex struct ok\n"); dbind_any_free (TYPEOF_COMPLEX, &c2); dbus_message_unref (msg); @@ -296,7 +296,7 @@ void test_struct_with_array () g_assert (p[0].pad1 == 2); g_assert (g_array_index (p[1].vals, dbus_uint32_t, 1) == 1000000000); - fprintf (stderr, "struct with array ok\n"); + printf ("struct with array ok\n"); dbind_any_free (TYPEOF_ARRAYSTRUCT, &a2); dbus_message_unref (msg); @@ -342,7 +342,7 @@ void test_twovals () dbind_any_free ("ii", &o); /* nop */ dbus_message_unref (msg); - fprintf (stderr, "two-val ok\n"); + printf ("two-val ok\n"); } void test_marshalling () @@ -355,7 +355,7 @@ void test_marshalling () test_struct_with_array (); test_twovals (); - fprintf (stderr, "Marshalling ok\n"); + printf ("Marshalling ok\n"); } void test_teamspaces (DBusConnection *bus) @@ -403,7 +403,7 @@ void test_helpers () dbind_find_c_alignment ("a(sss)"); dbind_find_c_alignment ("(s(s)yd(d)s)"); dbind_find_c_alignment ("a{ss}"); - fprintf (stderr, "helpers passed\n"); + printf ("helpers passed\n"); } int main (int argc, char **argv) diff --git a/meson.build b/meson.build index 0a2f75e..ca49dfb 100644 --- a/meson.build +++ b/meson.build @@ -1,12 +1,12 @@ project('at-spi2-core', 'c', - version: '2.34.0', + version: '2.39.90.1', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', 'warning_level=1', 'c_std=c99', ], - meson_version: '>= 0.50.0') + meson_version: '>= 0.46.0') add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE' ], language: 'c') @@ -44,7 +44,7 @@ endif # Dependencies libdbus_req_version = '>= 1.5' -glib_req_version = '>= 2.32.0' +glib_req_version = '>= 2.62.0' gobject_req_version = '>= 2.0.0' gio_req_version = '>= 2.28.0' diff --git a/po/gl.po b/po/gl.po index d7a0cf4..932ffea 100644 --- a/po/gl.po +++ b/po/gl.po @@ -6,9 +6,9 @@ msgid "" msgstr "" "Project-Id-Version: at-spi 2-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-07 00:01+0100\n" -"PO-Revision-Date: 2014-02-07 00:01+0200\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/at-spi2-core/issues\n" +"POT-Creation-Date: 2018-10-05 04:46+0000\n" +"PO-Revision-Date: 2019-12-25 05:11+0100\n" "Last-Translator: Fran Dieguez \n" "Language-Team: gnome-l10n-gl@gnome.org\n" "Language: gl\n" @@ -16,87 +16,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" +"X-Generator: Poedit 2.2.4\n" -#: ../atspi/atspi-component.c:325 ../atspi/atspi-misc.c:1034 -#: ../atspi/atspi-value.c:111 +#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 msgid "The application no longer exists" -msgstr "O aplicativo xa non existe" +msgstr "A aplicación xa non existe" -#: ../atspi/atspi-misc.c:1777 +#: atspi/atspi-misc.c:1850 msgid "Attempted synchronous call where prohibited" msgstr "Tentouse unha chamada síncrona onde estaba prohibida" - -#~ msgid "AT-SPI: Unknown signature %s for RemoveAccessible" -#~ msgstr "AT-SPI: Sinatura %s descoñecida para RemoveAccessible" - -#~ msgid "AT-SPI: Error calling getRoot for %s: %s" -#~ msgstr "AT-SPI: Erro ao chamar a getRoot para %s: %s" - -#~ msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" -#~ msgstr "AT-SPI: Erro en GetItems, emisor=%s, erro=%s" - -#~ msgid "" -#~ "AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " -#~ "signature %s" -#~ msgstr "" -#~ "AT-SPI: Chamouse a _atspi_dbus_return_accessible_from_message cunha " -#~ "sinatura estraña %s" - -#~ msgid "" -#~ "AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " -#~ "signature %s" -#~ msgstr "" -#~ "AT-SPI: Chamouse a _atspi_dbus_return_hyperlink_from_message cunha " -#~ "sinatura estraña %s" - -#~ msgid "AT-SPI: AddAccessible with unknown signature %s\n" -#~ msgstr "AT-SPI: AddAccessible con sinatura %s descoñecida\n" - -#~ msgid "AT-SPI: Could not get the display\n" -#~ msgstr "AT-SPI: Non é posíbel obter a pantalla\n" - -#~ msgid "AT-SPI: Accessibility bus not found - Using session bus.\n" -#~ msgstr "" -#~ "AT-SPI: Non foi posíbel atopar o bus de accesibilidade - Usando o bus de " -#~ "sesión.\n" - -#~ msgid "AT-SPI: Couldn't connect to bus: %s\n" -#~ msgstr "AT-SPI: Non foi posíbel conectarse ao bus: %s\n" - -#~ msgid "AT-SPI: Couldn't register with bus: %s\n" -#~ msgstr "AT-SPI: Non foi posíbel rexistrarse ao bus: %s\n" - -#~ msgid "" -#~ "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" -#~ msgstr "" -#~ "AT-SPI: agardábase unha variante ao obter %s desde a interface %s; porén " -#~ "obtívose %s\n" - -#~ msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" -#~ msgstr "" -#~ "atspi_dbus_get_property: Tipo incorrecto: esperábase %s, obtívose %c\n" - -#~ msgid "AT-SPI: Unknown interface %s" -#~ msgstr "AT-SPI: Interface %s descoñecida" - -#~ msgid "AT-SPI: expected 2 values in states array; got %d\n" -#~ msgstr "" -#~ "AT-SPI: agardábanse 2 valores na matriz de estados; porén obtivéronse %d\n" - -#~ msgid "Streamable content not implemented" -#~ msgstr "Contido en fluxo non implementado" - -#~ msgid "" -#~ "called atspi_event_listener_register_from_callback with a NULL event_type" -#~ msgstr "" -#~ "chamouse a atspi_event_listener_register_from_callback con un event_type " -#~ "nulo" - -#~ msgid "Got invalid signature %s for signal %s from interface %s\n" -#~ msgstr "" -#~ "Obtívose unha sinatura non válida %s para o sinal %s desde a interface " -#~ "%s\n" - -#~ msgid "AT-SPI: Got error: %s\n" -#~ msgstr "AT-SPI: Obtívose o erro: %s\n" diff --git a/po/pt.po b/po/pt.po index abe1ff6..9953a00 100644 --- a/po/pt.po +++ b/po/pt.po @@ -7,27 +7,25 @@ msgid "" msgstr "" "Project-Id-Version: 3.12\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=at-" -"spi&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2015-06-08 02:51+0000\n" -"PO-Revision-Date: 2015-06-24 06:27+0100\n" -"Last-Translator: Pedro Albuquerque \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/at-spi2-core/issues\n" +"POT-Creation-Date: 2020-05-27 15:50+0000\n" +"PO-Revision-Date: 2020-06-24 11:33+0100\n" +"Last-Translator: Manuela Silva \n" "Language-Team: Português \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Gtranslator 2.91.6\n" +"X-Generator: Poedit 2.3.1\n" -#: ../atspi/atspi-component.c:326 ../atspi/atspi-misc.c:1037 -#: ../atspi/atspi-value.c:111 +#: atspi/atspi-component.c:332 atspi/atspi-misc.c:1075 atspi/atspi-value.c:111 msgid "The application no longer exists" msgstr "A aplicação já não existe" -#: ../atspi/atspi-misc.c:1795 +#: atspi/atspi-misc.c:1853 msgid "Attempted synchronous call where prohibited" -msgstr "Tentada uma chamada síncrona onde é proibida" +msgstr "Tentativa de chamada síncrona onde proibida" #~ msgid "AT-SPI: Unknown signature %s for RemoveAccessible" #~ msgstr "AT-SPI: Assinatura %s desconhecida para RemoveAccessible" @@ -38,19 +36,11 @@ msgstr "Tentada uma chamada síncrona onde é proibida" #~ msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" #~ msgstr "AT-SPI: Erro em GetItems, invocador=%s, erro=%s" -#~ msgid "" -#~ "AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " -#~ "signature %s" -#~ msgstr "" -#~ "AT-SPI: Chamada de _atspi_dbus_return_accessible_from_message com " -#~ "assinatura incomun %s" +#~ msgid "AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange signature %s" +#~ msgstr "AT-SPI: Chamada de _atspi_dbus_return_accessible_from_message com assinatura incomun %s" -#~ msgid "" -#~ "AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " -#~ "signature %s" -#~ msgstr "" -#~ "AT-SPI: Chamada de _atspi_dbus_return_hyperlink_from_message com " -#~ "assinatura incomun %s" +#~ msgid "AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange signature %s" +#~ msgstr "AT-SPI: Chamada de _atspi_dbus_return_hyperlink_from_message com assinatura incomun %s" #~ msgid "AT-SPI: AddAccessible with unknown signature %s\n" #~ msgstr "AT-SPI: AddAccessible com assinatura %s desconhecida\n" @@ -59,9 +49,7 @@ msgstr "Tentada uma chamada síncrona onde é proibida" #~ msgstr "AT-SPI: Incapaz de obter o ecrã\n" #~ msgid "AT-SPI: Accessibility bus not found - Using session bus.\n" -#~ msgstr "" -#~ "AT-SPI: Incapaz de encontrar o canal de acessibilidade - A utilizar o " -#~ "canal de sessão.\n" +#~ msgstr "AT-SPI: Incapaz de encontrar o canal de acessibilidade - A utilizar o canal de sessão.\n" #~ msgid "AT-SPI: Couldn't connect to bus: %s\n" #~ msgstr "AT-SPI: Incapaz de se ligar ao canal: %s\n" @@ -69,10 +57,8 @@ msgstr "Tentada uma chamada síncrona onde é proibida" #~ msgid "AT-SPI: Couldn't register with bus: %s\n" #~ msgstr "AT-SPI: Incapaz de se registar no canal: %s\n" -#~ msgid "" -#~ "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" -#~ msgstr "" -#~ "AT-SPI: esperada uma variante ao obter %s do interface %s; obtida %s\n" +#~ msgid "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" +#~ msgstr "AT-SPI: esperada uma variante ao obter %s do interface %s; obtida %s\n" #~ msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" #~ msgstr "atspi_dbus_get_property: Tipo incorrecto: esperado %s, obtido %c\n" @@ -86,11 +72,8 @@ msgstr "Tentada uma chamada síncrona onde é proibida" #~ msgid "Streamable content not implemented" #~ msgstr "Conteúdo em fluxo (stream) não está implementado" -#~ msgid "" -#~ "called atspi_event_listener_register_from_callback with a NULL event_type" -#~ msgstr "" -#~ "invocação de atspi_event_listener_register_from_callback com event_type " -#~ "NULL" +#~ msgid "called atspi_event_listener_register_from_callback with a NULL event_type" +#~ msgstr "invocação de atspi_event_listener_register_from_callback com event_type NULL" #~ msgid "Got invalid signature %s for signal %s from interface %s\n" #~ msgstr "Obtida assinatura %s inválida para o sinal %s do interface %s\n" diff --git a/po/uk.po b/po/uk.po index 2da7bed..be0a057 100644 --- a/po/uk.po +++ b/po/uk.po @@ -5,112 +5,89 @@ msgid "" msgstr "" "Project-Id-Version: 1.1\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=at-" -"spi&component=general\n" -"POT-Creation-Date: 2011-02-04 22:21+0000\n" -"PO-Revision-Date: 2011-02-07 17:41+0300\n" -"Last-Translator: Korostil Daniel \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/at-spi2-core/issues\n" +"POT-Creation-Date: 2018-06-10 15:50+0000\n" +"PO-Revision-Date: 2019-10-18 18:08+0300\n" +"Last-Translator: vikaig \n" "Language-Team: translation@linux.org.ua\n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Virtaal 0.6.1\n" - -#: ../atspi/atspi-misc.c:290 -#, c-format -msgid "AT-SPI: Unknown signature %s for RemoveAccessible" -msgstr "AT-SPI: невідомий підпис %s для RemoveAccessible" - -#: ../atspi/atspi-misc.c:327 -#, c-format -msgid "AT-SPI: Error calling getRoot for %s: %s" -msgstr "AT-SPI: помилка виклику getRoot для %s: %s" - -#: ../atspi/atspi-misc.c:485 -#, c-format -msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" -msgstr "AT-SPI: помилка в GetItems, sender=%s, error=%s" - -#: ../atspi/atspi-misc.c:587 -#, c-format -msgid "" -"AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " -"signature %s" -msgstr "" -"AT-SPI: викликано _atspi_dbus_return_accessible_from_message з дивним " -"підписом %s" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 2.2.1\n" -#: ../atspi/atspi-misc.c:616 -#, c-format -msgid "" -"AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " -"signature %s" -msgstr "" -"AT-SPI: викликано _atspi_dbus_return_hyperlink_from_message з дивним " -"підписом %s" - -#: ../atspi/atspi-misc.c:641 -#, c-format -msgid "AT-SPI: AddAccessible with unknown signature %s\n" -msgstr "AT-SPI: AddAccessible з невідомим підписом %s\n" - -#: ../atspi/atspi-misc.c:826 -msgid "AT-SPI: Could not get the display\n" -msgstr "AT-SPI: неможливо перейти до показу\n" - -#: ../atspi/atspi-misc.c:844 -msgid "AT-SPI: Accessibility bus not found - Using session bus.\n" -msgstr "AT-SPI: не знайдено шини доступності — використовуйте шину сеансу.\n" - -#: ../atspi/atspi-misc.c:848 ../atspi/atspi-misc.c:857 -#, c-format -msgid "AT-SPI: Couldn't connect to bus: %s\n" -msgstr "AT-SPI: неможливо з'єднатись із шиною: %s\n" - -#: ../atspi/atspi-misc.c:864 -#, c-format -msgid "AT-SPI: Couldn't register with bus: %s\n" -msgstr "AT-SPI: неможливо зареєструватись із шиною: %s\n" - -#: ../atspi/atspi-misc.c:1002 ../atspi/atspi-misc.c:1053 -#: ../atspi/atspi-misc.c:1094 +#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 msgid "The application no longer exists" msgstr "Програми більше не існує" -#: ../atspi/atspi-misc.c:1130 -#, c-format -msgid "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" -msgstr "AT-SPI: очікуваний варіант, коли звантажуємо %s з інтерфейсу %s; отримаємо %" -"s\n" +#: atspi/atspi-misc.c:1850 +msgid "Attempted synchronous call where prohibited" +msgstr "Спроба синхронного виклику там, де це заборонено" -#: ../atspi/atspi-misc.c:1136 -#, c-format -msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" -msgstr "atspi_dbus_get_property: неправильний тип: очікували %s, отримали %c\n" +#~ msgid "AT-SPI: Unknown signature %s for RemoveAccessible" +#~ msgstr "AT-SPI: невідомий підпис %s для RemoveAccessible" -#: ../atspi/atspi-misc.c:1279 -#, c-format -msgid "AT-SPI: Unknown interface %s" -msgstr "AT-SPI: невідомий інтерфейс %s" +#~ msgid "AT-SPI: Error calling getRoot for %s: %s" +#~ msgstr "AT-SPI: помилка виклику getRoot для %s: %s" -#: ../atspi/atspi-misc.c:1299 -#, c-format -msgid "AT-SPI: expected 2 values in states array; got %d\n" -msgstr "AT-SPI: очікувалось 2 значення в масиві станів; отримали %d\n" +#~ msgid "AT-SPI: Error in GetItems, sender=%s, error=%s" +#~ msgstr "AT-SPI: помилка в GetItems, sender=%s, error=%s" -#: ../atspi/atspi-accessible.c:997 -msgid "Streamable content not implemented" -msgstr "Потоковий вміст не реалізовано" +#~ msgid "" +#~ "AT-SPI: Called _atspi_dbus_return_accessible_from_message with strange " +#~ "signature %s" +#~ msgstr "" +#~ "AT-SPI: викликано _atspi_dbus_return_accessible_from_message з дивним " +#~ "підписом %s" -#: ../atspi/atspi-event-listener.c:510 -msgid "" -"called atspi_event_listener_register_from_callback with a NULL event_type" -msgstr "викликано atspi_event_listener_register_from_callback з NULL event_type" +#~ msgid "" +#~ "AT-SPI: Called _atspi_dbus_return_hyperlink_from_message with strange " +#~ "signature %s" +#~ msgstr "" +#~ "AT-SPI: викликано _atspi_dbus_return_hyperlink_from_message з дивним " +#~ "підписом %s" + +#~ msgid "AT-SPI: AddAccessible with unknown signature %s\n" +#~ msgstr "AT-SPI: AddAccessible з невідомим підписом %s\n" + +#~ msgid "AT-SPI: Could not get the display\n" +#~ msgstr "AT-SPI: неможливо перейти до показу\n" + +#~ msgid "AT-SPI: Accessibility bus not found - Using session bus.\n" +#~ msgstr "" +#~ "AT-SPI: не знайдено шини доступності — використовуйте шину сеансу.\n" + +#~ msgid "AT-SPI: Couldn't connect to bus: %s\n" +#~ msgstr "AT-SPI: неможливо з'єднатись із шиною: %s\n" + +#~ msgid "AT-SPI: Couldn't register with bus: %s\n" +#~ msgstr "AT-SPI: неможливо зареєструватись із шиною: %s\n" + +#~ msgid "" +#~ "AT-SPI: expected a variant when fetching %s from interface %s; got %s\n" +#~ msgstr "" +#~ "AT-SPI: очікуваний варіант, коли звантажуємо %s з інтерфейсу %s; " +#~ "отримаємо %s\n" + +#~ msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" +#~ msgstr "" +#~ "atspi_dbus_get_property: неправильний тип: очікували %s, отримали %c\n" + +#~ msgid "AT-SPI: Unknown interface %s" +#~ msgstr "AT-SPI: невідомий інтерфейс %s" + +#~ msgid "AT-SPI: expected 2 values in states array; got %d\n" +#~ msgstr "AT-SPI: очікувалось 2 значення в масиві станів; отримали %d\n" + +#~ msgid "Streamable content not implemented" +#~ msgstr "Потоковий вміст не реалізовано" + +#~ msgid "" +#~ "called atspi_event_listener_register_from_callback with a NULL event_type" +#~ msgstr "" +#~ "викликано atspi_event_listener_register_from_callback з NULL event_type" -#: ../atspi/atspi-event-listener.c:777 -#, c-format -msgid "Got invalid signature %s for signal %s from interface %s\n" -msgstr "Отримано неправильний підпис %s для сигналу %s з інтерфейсу %s\n" +#~ msgid "Got invalid signature %s for signal %s from interface %s\n" +#~ msgstr "Отримано неправильний підпис %s для сигналу %s з інтерфейсу %s\n" diff --git a/registryd/meson.build b/registryd/meson.build index c2404d2..739509f 100644 --- a/registryd/meson.build +++ b/registryd/meson.build @@ -41,5 +41,4 @@ libexec_conf.set('libexecdir', atspi_libexecdir) configure_file(input: 'org.a11y.atspi.Registry.service.in', output: 'org.a11y.atspi.Registry.service', configuration: libexec_conf, - install: true, install_dir: join_paths(atspi_datadir, 'dbus-1/accessibility-services')) diff --git a/registryd/ucs2keysym.c b/registryd/ucs2keysym.c index b4967be..29a92f3 100644 --- a/registryd/ucs2keysym.c +++ b/registryd/ucs2keysym.c @@ -34,128 +34,132 @@ #include #include "deviceeventcontroller.h" /* for prototype */ +/* DO NOT UPATE BY HAND! + * This table can be regenerated from Xorg's keysymdef.h with the ucs2keysym.sh + * script. */ struct codepair { unsigned short keysym; unsigned short ucs; } keysymtab[] = { + { 0x0abd, 0x002e }, /* decimalpoint . FULL STOP */ { 0x0ba3, 0x003c }, /* leftcaret < LESS-THAN SIGN */ { 0x0ba6, 0x003e }, /* rightcaret > GREATER-THAN SIGN */ { 0x0bc6, 0x005f }, /* underbar _ LOW LINE */ { 0x0bc0, 0x00af }, /* overbar ¯ MACRON */ + { 0x03c0, 0x0100 }, /* Amacron Ā LATIN CAPITAL LETTER A WITH MACRON */ + { 0x03e0, 0x0101 }, /* amacron ā LATIN SMALL LETTER A WITH MACRON */ + { 0x01c3, 0x0102 }, /* Abreve Ă LATIN CAPITAL LETTER A WITH BREVE */ + { 0x01e3, 0x0103 }, /* abreve ă LATIN SMALL LETTER A WITH BREVE */ { 0x01a1, 0x0104 }, /* Aogonek Ą LATIN CAPITAL LETTER A WITH OGONEK */ { 0x01b1, 0x0105 }, /* aogonek ą LATIN SMALL LETTER A WITH OGONEK */ - { 0x01a5, 0x013d }, /* Lcaron Ľ LATIN CAPITAL LETTER L WITH CARON */ - { 0x01a3, 0x0141 }, /* Lstroke Ł LATIN CAPITAL LETTER L WITH STROKE */ - { 0x01a6, 0x015a }, /* Sacute Ś LATIN CAPITAL LETTER S WITH ACUTE */ - { 0x01aa, 0x015e }, /* Scedilla Ş LATIN CAPITAL LETTER S WITH CEDILLA */ - { 0x01a9, 0x0160 }, /* Scaron Š LATIN CAPITAL LETTER S WITH CARON */ - { 0x01ab, 0x0164 }, /* Tcaron Ť LATIN CAPITAL LETTER T WITH CARON */ - { 0x01ac, 0x0179 }, /* Zacute Ź LATIN CAPITAL LETTER Z WITH ACUTE */ - { 0x01af, 0x017b }, /* Zabovedot Ż LATIN CAPITAL LETTER Z WITH DOT ABOVE */ - { 0x01ae, 0x017d }, /* Zcaron Ž LATIN CAPITAL LETTER Z WITH CARON */ - { 0x01b3, 0x0142 }, /* lstroke ł LATIN SMALL LETTER L WITH STROKE */ - { 0x01b5, 0x013e }, /* lcaron ľ LATIN SMALL LETTER L WITH CARON */ - { 0x01b6, 0x015b }, /* sacute ś LATIN SMALL LETTER S WITH ACUTE */ - { 0x01b9, 0x0161 }, /* scaron š LATIN SMALL LETTER S WITH CARON */ - { 0x01ba, 0x015f }, /* scedilla ş LATIN SMALL LETTER S WITH CEDILLA */ - { 0x01bb, 0x0165 }, /* tcaron ť LATIN SMALL LETTER T WITH CARON */ - { 0x01bc, 0x017a }, /* zacute ź LATIN SMALL LETTER Z WITH ACUTE */ - { 0x01be, 0x017e }, /* zcaron ž LATIN SMALL LETTER Z WITH CARON */ - { 0x01bf, 0x017c }, /* zabovedot ż LATIN SMALL LETTER Z WITH DOT ABOVE */ - { 0x01c0, 0x0154 }, /* Racute Ŕ LATIN CAPITAL LETTER R WITH ACUTE */ - { 0x01c3, 0x0102 }, /* Abreve Ă LATIN CAPITAL LETTER A WITH BREVE */ - { 0x01c5, 0x0139 }, /* Lacute Ĺ LATIN CAPITAL LETTER L WITH ACUTE */ { 0x01c6, 0x0106 }, /* Cacute Ć LATIN CAPITAL LETTER C WITH ACUTE */ + { 0x01e6, 0x0107 }, /* cacute ć LATIN SMALL LETTER C WITH ACUTE */ + { 0x02c6, 0x0108 }, /* Ccircumflex Ĉ LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ + { 0x02e6, 0x0109 }, /* ccircumflex ĉ LATIN SMALL LETTER C WITH CIRCUMFLEX */ + { 0x02c5, 0x010a }, /* Cabovedot Ċ LATIN CAPITAL LETTER C WITH DOT ABOVE */ + { 0x02e5, 0x010b }, /* cabovedot ċ LATIN SMALL LETTER C WITH DOT ABOVE */ { 0x01c8, 0x010c }, /* Ccaron Č LATIN CAPITAL LETTER C WITH CARON */ - { 0x01ca, 0x0118 }, /* Eogonek Ę LATIN CAPITAL LETTER E WITH OGONEK */ - { 0x01cc, 0x011a }, /* Ecaron Ě LATIN CAPITAL LETTER E WITH CARON */ + { 0x01e8, 0x010d }, /* ccaron č LATIN SMALL LETTER C WITH CARON */ { 0x01cf, 0x010e }, /* Dcaron Ď LATIN CAPITAL LETTER D WITH CARON */ + { 0x01ef, 0x010f }, /* dcaron ď LATIN SMALL LETTER D WITH CARON */ { 0x01d0, 0x0110 }, /* Dstroke Đ LATIN CAPITAL LETTER D WITH STROKE */ - { 0x01d1, 0x0143 }, /* Nacute Ń LATIN CAPITAL LETTER N WITH ACUTE */ - { 0x01d2, 0x0147 }, /* Ncaron Ň LATIN CAPITAL LETTER N WITH CARON */ - { 0x01d5, 0x0150 }, /* Odoubleacute Ő LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ - { 0x01d8, 0x0158 }, /* Rcaron Ř LATIN CAPITAL LETTER R WITH CARON */ - { 0x01d9, 0x016e }, /* Uring Ů LATIN CAPITAL LETTER U WITH RING ABOVE */ - { 0x01db, 0x0170 }, /* Udoubleacute Ű LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ - { 0x01de, 0x0162 }, /* Tcedilla Ţ LATIN CAPITAL LETTER T WITH CEDILLA */ - { 0x01e0, 0x0155 }, /* racute ŕ LATIN SMALL LETTER R WITH ACUTE */ - { 0x01e3, 0x0103 }, /* abreve ă LATIN SMALL LETTER A WITH BREVE */ - { 0x01e5, 0x013a }, /* lacute ĺ LATIN SMALL LETTER L WITH ACUTE */ - { 0x01e6, 0x0107 }, /* cacute ć LATIN SMALL LETTER C WITH ACUTE */ - { 0x01e8, 0x010d }, /* ccaron č LATIN SMALL LETTER C WITH CARON */ + { 0x01f0, 0x0111 }, /* dstroke đ LATIN SMALL LETTER D WITH STROKE */ + { 0x03aa, 0x0112 }, /* Emacron Ē LATIN CAPITAL LETTER E WITH MACRON */ + { 0x03ba, 0x0113 }, /* emacron ē LATIN SMALL LETTER E WITH MACRON */ + { 0x03cc, 0x0116 }, /* Eabovedot Ė LATIN CAPITAL LETTER E WITH DOT ABOVE */ + { 0x03ec, 0x0117 }, /* eabovedot ė LATIN SMALL LETTER E WITH DOT ABOVE */ + { 0x01ca, 0x0118 }, /* Eogonek Ę LATIN CAPITAL LETTER E WITH OGONEK */ { 0x01ea, 0x0119 }, /* eogonek ę LATIN SMALL LETTER E WITH OGONEK */ + { 0x01cc, 0x011a }, /* Ecaron Ě LATIN CAPITAL LETTER E WITH CARON */ { 0x01ec, 0x011b }, /* ecaron ě LATIN SMALL LETTER E WITH CARON */ - { 0x01ef, 0x010f }, /* dcaron ď LATIN SMALL LETTER D WITH CARON */ - { 0x01f0, 0x0111 }, /* dstroke đ LATIN SMALL LETTER D WITH STROKE */ - { 0x01f1, 0x0144 }, /* nacute ń LATIN SMALL LETTER N WITH ACUTE */ - { 0x01f2, 0x0148 }, /* ncaron ň LATIN SMALL LETTER N WITH CARON */ - { 0x01f5, 0x0151 }, /* odoubleacute ő LATIN SMALL LETTER O WITH DOUBLE ACUTE */ - { 0x01f8, 0x0159 }, /* rcaron ř LATIN SMALL LETTER R WITH CARON */ - { 0x01f9, 0x016f }, /* uring ů LATIN SMALL LETTER U WITH RING ABOVE */ - { 0x01fb, 0x0171 }, /* udoubleacute ű LATIN SMALL LETTER U WITH DOUBLE ACUTE */ - { 0x01fe, 0x0163 }, /* tcedilla ţ LATIN SMALL LETTER T WITH CEDILLA */ - { 0x02a1, 0x0126 }, /* Hstroke Ħ LATIN CAPITAL LETTER H WITH STROKE */ - { 0x02a6, 0x0124 }, /* Hcircumflex Ĥ LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ - { 0x02a9, 0x0130 }, /* Iabovedot İ LATIN CAPITAL LETTER I WITH DOT ABOVE */ + { 0x02d8, 0x011c }, /* Gcircumflex Ĝ LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ + { 0x02f8, 0x011d }, /* gcircumflex ĝ LATIN SMALL LETTER G WITH CIRCUMFLEX */ { 0x02ab, 0x011e }, /* Gbreve Ğ LATIN CAPITAL LETTER G WITH BREVE */ - { 0x02ac, 0x0134 }, /* Jcircumflex Ĵ LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ - { 0x02b1, 0x0127 }, /* hstroke ħ LATIN SMALL LETTER H WITH STROKE */ - { 0x02b6, 0x0125 }, /* hcircumflex ĥ LATIN SMALL LETTER H WITH CIRCUMFLEX */ - { 0x02b9, 0x0131 }, /* idotless ı LATIN SMALL LETTER DOTLESS I */ { 0x02bb, 0x011f }, /* gbreve ğ LATIN SMALL LETTER G WITH BREVE */ - { 0x02bc, 0x0135 }, /* jcircumflex ĵ LATIN SMALL LETTER J WITH CIRCUMFLEX */ - { 0x02c5, 0x010a }, /* Cabovedot Ċ LATIN CAPITAL LETTER C WITH DOT ABOVE */ - { 0x02c6, 0x0108 }, /* Ccircumflex Ĉ LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ { 0x02d5, 0x0120 }, /* Gabovedot Ġ LATIN CAPITAL LETTER G WITH DOT ABOVE */ - { 0x02d8, 0x011c }, /* Gcircumflex Ĝ LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ - { 0x02dd, 0x016c }, /* Ubreve Ŭ LATIN CAPITAL LETTER U WITH BREVE */ - { 0x02de, 0x015c }, /* Scircumflex Ŝ LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ - { 0x02e5, 0x010b }, /* cabovedot ċ LATIN SMALL LETTER C WITH DOT ABOVE */ - { 0x02e6, 0x0109 }, /* ccircumflex ĉ LATIN SMALL LETTER C WITH CIRCUMFLEX */ { 0x02f5, 0x0121 }, /* gabovedot ġ LATIN SMALL LETTER G WITH DOT ABOVE */ - { 0x02f8, 0x011d }, /* gcircumflex ĝ LATIN SMALL LETTER G WITH CIRCUMFLEX */ - { 0x02fd, 0x016d }, /* ubreve ŭ LATIN SMALL LETTER U WITH BREVE */ - { 0x02fe, 0x015d }, /* scircumflex ŝ LATIN SMALL LETTER S WITH CIRCUMFLEX */ - { 0x03a2, 0x0138 }, /* kra ĸ LATIN SMALL LETTER KRA */ - { 0x03a3, 0x0156 }, /* Rcedilla Ŗ LATIN CAPITAL LETTER R WITH CEDILLA */ - { 0x03a5, 0x0128 }, /* Itilde Ĩ LATIN CAPITAL LETTER I WITH TILDE */ - { 0x03a6, 0x013b }, /* Lcedilla Ļ LATIN CAPITAL LETTER L WITH CEDILLA */ - { 0x03aa, 0x0112 }, /* Emacron Ē LATIN CAPITAL LETTER E WITH MACRON */ { 0x03ab, 0x0122 }, /* Gcedilla Ģ LATIN CAPITAL LETTER G WITH CEDILLA */ - { 0x03ac, 0x0166 }, /* Tslash Ŧ LATIN CAPITAL LETTER T WITH STROKE */ - { 0x03b3, 0x0157 }, /* rcedilla ŗ LATIN SMALL LETTER R WITH CEDILLA */ + { 0x03bb, 0x0123 }, /* gcedilla ģ LATIN SMALL LETTER G WITH CEDILLA */ + { 0x02a6, 0x0124 }, /* Hcircumflex Ĥ LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ + { 0x02b6, 0x0125 }, /* hcircumflex ĥ LATIN SMALL LETTER H WITH CIRCUMFLEX */ + { 0x02a1, 0x0126 }, /* Hstroke Ħ LATIN CAPITAL LETTER H WITH STROKE */ + { 0x02b1, 0x0127 }, /* hstroke ħ LATIN SMALL LETTER H WITH STROKE */ + { 0x03a5, 0x0128 }, /* Itilde Ĩ LATIN CAPITAL LETTER I WITH TILDE */ { 0x03b5, 0x0129 }, /* itilde ĩ LATIN SMALL LETTER I WITH TILDE */ + { 0x03cf, 0x012a }, /* Imacron Ī LATIN CAPITAL LETTER I WITH MACRON */ + { 0x03ef, 0x012b }, /* imacron ī LATIN SMALL LETTER I WITH MACRON */ + { 0x03c7, 0x012e }, /* Iogonek Į LATIN CAPITAL LETTER I WITH OGONEK */ + { 0x03e7, 0x012f }, /* iogonek į LATIN SMALL LETTER I WITH OGONEK */ + { 0x02a9, 0x0130 }, /* Iabovedot İ LATIN CAPITAL LETTER I WITH DOT ABOVE */ + { 0x02b9, 0x0131 }, /* idotless ı LATIN SMALL LETTER DOTLESS I */ + { 0x02ac, 0x0134 }, /* Jcircumflex Ĵ LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ + { 0x02bc, 0x0135 }, /* jcircumflex ĵ LATIN SMALL LETTER J WITH CIRCUMFLEX */ + { 0x03d3, 0x0136 }, /* Kcedilla Ķ LATIN CAPITAL LETTER K WITH CEDILLA */ + { 0x03f3, 0x0137 }, /* kcedilla ķ LATIN SMALL LETTER K WITH CEDILLA */ + { 0x03a2, 0x0138 }, /* kra ĸ LATIN SMALL LETTER KRA */ + { 0x01c5, 0x0139 }, /* Lacute Ĺ LATIN CAPITAL LETTER L WITH ACUTE */ + { 0x01e5, 0x013a }, /* lacute ĺ LATIN SMALL LETTER L WITH ACUTE */ + { 0x03a6, 0x013b }, /* Lcedilla Ļ LATIN CAPITAL LETTER L WITH CEDILLA */ { 0x03b6, 0x013c }, /* lcedilla ļ LATIN SMALL LETTER L WITH CEDILLA */ - { 0x03ba, 0x0113 }, /* emacron ē LATIN SMALL LETTER E WITH MACRON */ - { 0x03bb, 0x0123 }, /* gcedilla ģ LATIN SMALL LETTER G WITH CEDILLA */ - { 0x03bc, 0x0167 }, /* tslash ŧ LATIN SMALL LETTER T WITH STROKE */ + { 0x01a5, 0x013d }, /* Lcaron Ľ LATIN CAPITAL LETTER L WITH CARON */ + { 0x01b5, 0x013e }, /* lcaron ľ LATIN SMALL LETTER L WITH CARON */ + { 0x01a3, 0x0141 }, /* Lstroke Ł LATIN CAPITAL LETTER L WITH STROKE */ + { 0x01b3, 0x0142 }, /* lstroke ł LATIN SMALL LETTER L WITH STROKE */ + { 0x01d1, 0x0143 }, /* Nacute Ń LATIN CAPITAL LETTER N WITH ACUTE */ + { 0x01f1, 0x0144 }, /* nacute ń LATIN SMALL LETTER N WITH ACUTE */ + { 0x03d1, 0x0145 }, /* Ncedilla Ņ LATIN CAPITAL LETTER N WITH CEDILLA */ + { 0x03f1, 0x0146 }, /* ncedilla ņ LATIN SMALL LETTER N WITH CEDILLA */ + { 0x01d2, 0x0147 }, /* Ncaron Ň LATIN CAPITAL LETTER N WITH CARON */ + { 0x01f2, 0x0148 }, /* ncaron ň LATIN SMALL LETTER N WITH CARON */ { 0x03bd, 0x014a }, /* ENG Ŋ LATIN CAPITAL LETTER ENG */ { 0x03bf, 0x014b }, /* eng ŋ LATIN SMALL LETTER ENG */ - { 0x03c0, 0x0100 }, /* Amacron Ā LATIN CAPITAL LETTER A WITH MACRON */ - { 0x03c7, 0x012e }, /* Iogonek Į LATIN CAPITAL LETTER I WITH OGONEK */ - { 0x03cc, 0x0116 }, /* Eabovedot Ė LATIN CAPITAL LETTER E WITH DOT ABOVE */ - { 0x03cf, 0x012a }, /* Imacron Ī LATIN CAPITAL LETTER I WITH MACRON */ - { 0x03d1, 0x0145 }, /* Ncedilla Ņ LATIN CAPITAL LETTER N WITH CEDILLA */ { 0x03d2, 0x014c }, /* Omacron Ō LATIN CAPITAL LETTER O WITH MACRON */ - { 0x03d3, 0x0136 }, /* Kcedilla Ķ LATIN CAPITAL LETTER K WITH CEDILLA */ - { 0x03d9, 0x0172 }, /* Uogonek Ų LATIN CAPITAL LETTER U WITH OGONEK */ - { 0x03dd, 0x0168 }, /* Utilde Ũ LATIN CAPITAL LETTER U WITH TILDE */ - { 0x03de, 0x016a }, /* Umacron Ū LATIN CAPITAL LETTER U WITH MACRON */ - { 0x03e0, 0x0101 }, /* amacron ā LATIN SMALL LETTER A WITH MACRON */ - { 0x03e7, 0x012f }, /* iogonek į LATIN SMALL LETTER I WITH OGONEK */ - { 0x03ec, 0x0117 }, /* eabovedot ė LATIN SMALL LETTER E WITH DOT ABOVE */ - { 0x03ef, 0x012b }, /* imacron ī LATIN SMALL LETTER I WITH MACRON */ - { 0x03f1, 0x0146 }, /* ncedilla ņ LATIN SMALL LETTER N WITH CEDILLA */ { 0x03f2, 0x014d }, /* omacron ō LATIN SMALL LETTER O WITH MACRON */ - { 0x03f3, 0x0137 }, /* kcedilla ķ LATIN SMALL LETTER K WITH CEDILLA */ - { 0x03f9, 0x0173 }, /* uogonek ų LATIN SMALL LETTER U WITH OGONEK */ - { 0x03fd, 0x0169 }, /* utilde ũ LATIN SMALL LETTER U WITH TILDE */ - { 0x03fe, 0x016b }, /* umacron ū LATIN SMALL LETTER U WITH MACRON */ - { 0x08f6, 0x0192 }, /* function ƒ LATIN SMALL LETTER F WITH HOOK */ + { 0x01d5, 0x0150 }, /* Odoubleacute Ő LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ + { 0x01f5, 0x0151 }, /* odoubleacute ő LATIN SMALL LETTER O WITH DOUBLE ACUTE */ { 0x13bc, 0x0152 }, /* OE Œ LATIN CAPITAL LIGATURE OE */ { 0x13bd, 0x0153 }, /* oe œ LATIN SMALL LIGATURE OE */ + { 0x01c0, 0x0154 }, /* Racute Ŕ LATIN CAPITAL LETTER R WITH ACUTE */ + { 0x01e0, 0x0155 }, /* racute ŕ LATIN SMALL LETTER R WITH ACUTE */ + { 0x03a3, 0x0156 }, /* Rcedilla Ŗ LATIN CAPITAL LETTER R WITH CEDILLA */ + { 0x03b3, 0x0157 }, /* rcedilla ŗ LATIN SMALL LETTER R WITH CEDILLA */ + { 0x01d8, 0x0158 }, /* Rcaron Ř LATIN CAPITAL LETTER R WITH CARON */ + { 0x01f8, 0x0159 }, /* rcaron ř LATIN SMALL LETTER R WITH CARON */ + { 0x01a6, 0x015a }, /* Sacute Ś LATIN CAPITAL LETTER S WITH ACUTE */ + { 0x01b6, 0x015b }, /* sacute ś LATIN SMALL LETTER S WITH ACUTE */ + { 0x02de, 0x015c }, /* Scircumflex Ŝ LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ + { 0x02fe, 0x015d }, /* scircumflex ŝ LATIN SMALL LETTER S WITH CIRCUMFLEX */ + { 0x01aa, 0x015e }, /* Scedilla Ş LATIN CAPITAL LETTER S WITH CEDILLA */ + { 0x01ba, 0x015f }, /* scedilla ş LATIN SMALL LETTER S WITH CEDILLA */ + { 0x01a9, 0x0160 }, /* Scaron Š LATIN CAPITAL LETTER S WITH CARON */ + { 0x01b9, 0x0161 }, /* scaron š LATIN SMALL LETTER S WITH CARON */ + { 0x01de, 0x0162 }, /* Tcedilla Ţ LATIN CAPITAL LETTER T WITH CEDILLA */ + { 0x01fe, 0x0163 }, /* tcedilla ţ LATIN SMALL LETTER T WITH CEDILLA */ + { 0x01ab, 0x0164 }, /* Tcaron Ť LATIN CAPITAL LETTER T WITH CARON */ + { 0x01bb, 0x0165 }, /* tcaron ť LATIN SMALL LETTER T WITH CARON */ + { 0x03ac, 0x0166 }, /* Tslash Ŧ LATIN CAPITAL LETTER T WITH STROKE */ + { 0x03bc, 0x0167 }, /* tslash ŧ LATIN SMALL LETTER T WITH STROKE */ + { 0x03dd, 0x0168 }, /* Utilde Ũ LATIN CAPITAL LETTER U WITH TILDE */ + { 0x03fd, 0x0169 }, /* utilde ũ LATIN SMALL LETTER U WITH TILDE */ + { 0x03de, 0x016a }, /* Umacron Ū LATIN CAPITAL LETTER U WITH MACRON */ + { 0x03fe, 0x016b }, /* umacron ū LATIN SMALL LETTER U WITH MACRON */ + { 0x02dd, 0x016c }, /* Ubreve Ŭ LATIN CAPITAL LETTER U WITH BREVE */ + { 0x02fd, 0x016d }, /* ubreve ŭ LATIN SMALL LETTER U WITH BREVE */ + { 0x01d9, 0x016e }, /* Uring Ů LATIN CAPITAL LETTER U WITH RING ABOVE */ + { 0x01f9, 0x016f }, /* uring ů LATIN SMALL LETTER U WITH RING ABOVE */ + { 0x01db, 0x0170 }, /* Udoubleacute Ű LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ + { 0x01fb, 0x0171 }, /* udoubleacute ű LATIN SMALL LETTER U WITH DOUBLE ACUTE */ + { 0x03d9, 0x0172 }, /* Uogonek Ų LATIN CAPITAL LETTER U WITH OGONEK */ + { 0x03f9, 0x0173 }, /* uogonek ų LATIN SMALL LETTER U WITH OGONEK */ { 0x13be, 0x0178 }, /* Ydiaeresis Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS */ + { 0x01ac, 0x0179 }, /* Zacute Ź LATIN CAPITAL LETTER Z WITH ACUTE */ + { 0x01bc, 0x017a }, /* zacute ź LATIN SMALL LETTER Z WITH ACUTE */ + { 0x01af, 0x017b }, /* Zabovedot Ż LATIN CAPITAL LETTER Z WITH DOT ABOVE */ + { 0x01bf, 0x017c }, /* zabovedot ż LATIN SMALL LETTER Z WITH DOT ABOVE */ + { 0x01ae, 0x017d }, /* Zcaron Ž LATIN CAPITAL LETTER Z WITH CARON */ + { 0x01be, 0x017e }, /* zcaron ž LATIN SMALL LETTER Z WITH CARON */ + { 0x08f6, 0x0192 }, /* function ƒ LATIN SMALL LETTER F WITH HOOK */ { 0x01b7, 0x02c7 }, /* caron ˇ CARON */ { 0x01a2, 0x02d8 }, /* breve ˘ BREVE */ @@ -196,7 +200,7 @@ struct codepair { { 0x07d7, 0x03a7 }, /* Greek_CHI Χ GREEK CAPITAL LETTER CHI */ { 0x07d8, 0x03a8 }, /* Greek_PSI Ψ GREEK CAPITAL LETTER PSI */ { 0x07d9, 0x03a9 }, /* Greek_OMEGA Ω GREEK CAPITAL LETTER OMEGA */ - { 0x07a5, 0x03aa }, /* Greek_IOTAdiaeresis Ϊ GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ + { 0x07a5, 0x03aa }, /* Greek_IOTAdieresis Ϊ GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ { 0x07a9, 0x03ab }, /* Greek_UPSILONdieresis Ϋ GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ { 0x07b1, 0x03ac }, /* Greek_alphaaccent ά GREEK SMALL LETTER ALPHA WITH TONOS */ { 0x07b2, 0x03ad }, /* Greek_epsilonaccent έ GREEK SMALL LETTER EPSILON WITH TONOS */ @@ -326,6 +330,8 @@ struct codepair { { 0x06ac, 0x045c }, /* Macedonia_kje ќ CYRILLIC SMALL LETTER KJE */ { 0x06ae, 0x045e }, /* Byelorussian_shortu ў CYRILLIC SMALL LETTER SHORT U */ { 0x06af, 0x045f }, /* Cyrillic_dzhe џ CYRILLIC SMALL LETTER DZHE */ + { 0x06bd, 0x0490 }, /* Ukrainian_GHE_WITH_UPTURN Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ + { 0x06ad, 0x0491 }, /* Ukrainian_ghe_with_upturn ґ CYRILLIC SMALL LETTER GHE WITH UPTURN */ { 0x0ce0, 0x05d0 }, /* hebrew_aleph א HEBREW LETTER ALEF */ { 0x0ce1, 0x05d1 }, /* hebrew_bet ב HEBREW LETTER BET */ @@ -519,7 +525,6 @@ struct codepair { { 0x0ef9, 0x11f0 }, /* Hangul_J_KkogjiDalrinIeung ᇰ HANGUL JONGSEONG YESIEUNG */ { 0x0efa, 0x11f9 }, /* Hangul_J_YeorinHieuh ᇹ HANGUL JONGSEONG YEORINHIEUH */ - { 0x0aa2, 0x2002 }, /* enspace   EN SPACE */ { 0x0aa1, 0x2003 }, /* emspace   EM SPACE */ { 0x0aa3, 0x2004 }, /* em3space   THREE-PER-EM SPACE */ @@ -544,12 +549,13 @@ struct codepair { { 0x0ae6, 0x2022 }, /* enfilledcircbullet • BULLET */ { 0x0aaf, 0x2025 }, /* doubbaselinedot ‥ TWO DOT LEADER */ { 0x0aae, 0x2026 }, /* ellipsis … HORIZONTAL ELLIPSIS */ + { 0x0ad5, 0x2030 }, /* permille ‰ PER MILLE SIGN */ { 0x0ad6, 0x2032 }, /* minutes ′ PRIME */ { 0x0ad7, 0x2033 }, /* seconds ″ DOUBLE PRIME */ { 0x0afc, 0x2038 }, /* caret ‸ CARET */ { 0x047e, 0x203e }, /* overline ‾ OVERLINE */ { 0x0eff, 0x20a9 }, /* Korean_Won ₩ WON SIGN */ - { 0x13a4, 0x20ac }, /* Euro € EURO SIGN */ + { 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */ { 0x0ab8, 0x2105 }, /* careof ℅ CARE OF */ { 0x06b0, 0x2116 }, /* numerosign № NUMERO SIGN */ @@ -574,15 +580,20 @@ struct codepair { { 0x08fe, 0x2193 }, /* downarrow ↓ DOWNWARDS ARROW */ { 0x08ce, 0x21d2 }, /* implies ⇒ RIGHTWARDS DOUBLE ARROW */ { 0x08cd, 0x21d4 }, /* ifonlyif ⇔ LEFT RIGHT DOUBLE ARROW */ + { 0x08ef, 0x2202 }, /* partialderivative ∂ PARTIAL DIFFERENTIAL */ { 0x08c5, 0x2207 }, /* nabla ∇ NABLA */ { 0x0bca, 0x2218 }, /* jot ∘ RING OPERATOR */ { 0x08d6, 0x221a }, /* radical √ SQUARE ROOT */ { 0x08c1, 0x221d }, /* variation ∝ PROPORTIONAL TO */ { 0x08c2, 0x221e }, /* infinity ∞ INFINITY */ + { 0x0ba9, 0x2227 }, /* upcaret ∧ LOGICAL AND */ { 0x08de, 0x2227 }, /* logicaland ∧ LOGICAL AND */ + { 0x0ba8, 0x2228 }, /* downcaret ∨ LOGICAL OR */ { 0x08df, 0x2228 }, /* logicalor ∨ LOGICAL OR */ + { 0x0bc3, 0x2229 }, /* upshoe ∩ INTERSECTION */ { 0x08dc, 0x2229 }, /* intersection ∩ INTERSECTION */ + { 0x0bd6, 0x222a }, /* downshoe ∪ UNION */ { 0x08dd, 0x222a }, /* union ∪ UNION */ { 0x08bf, 0x222b }, /* integral ∫ INTEGRAL */ { 0x08c0, 0x2234 }, /* therefore ∴ THEREFORE */ @@ -592,44 +603,51 @@ struct codepair { { 0x08cf, 0x2261 }, /* identical ≡ IDENTICAL TO */ { 0x08bc, 0x2264 }, /* lessthanequal ≤ LESS-THAN OR EQUAL TO */ { 0x08be, 0x2265 }, /* greaterthanequal ≥ GREATER-THAN OR EQUAL TO */ + { 0x0bda, 0x2282 }, /* leftshoe ⊂ SUBSET OF */ { 0x08da, 0x2282 }, /* includedin ⊂ SUBSET OF */ + { 0x0bd8, 0x2283 }, /* rightshoe ⊃ SUPERSET OF */ { 0x08db, 0x2283 }, /* includes ⊃ SUPERSET OF */ - { 0x0bdc, 0x22a2 }, /* lefttack ⊢ RIGHT TACK */ - { 0x0bfc, 0x22a3 }, /* righttack ⊣ LEFT TACK */ - { 0x0bce, 0x22a4 }, /* uptack ⊤ DOWN TACK */ - { 0x0bc2, 0x22a5 }, /* downtack ⊥ UP TACK */ + { 0x0bfc, 0x22a2 }, /* righttack ⊢ RIGHT TACK */ + { 0x0bdc, 0x22a3 }, /* lefttack ⊣ LEFT TACK */ + { 0x0bc2, 0x22a4 }, /* downtack ⊤ DOWN TACK */ + { 0x0bce, 0x22a5 }, /* uptack ⊥ UP TACK */ + { 0x0bd3, 0x2308 }, /* upstile ⌈ LEFT CEILING */ { 0x0bc4, 0x230a }, /* downstile ⌊ LEFT FLOOR */ { 0x0afa, 0x2315 }, /* telephonerecorder ⌕ TELEPHONE RECORDER */ { 0x08a4, 0x2320 }, /* topintegral ⌠ TOP HALF INTEGRAL */ { 0x08a5, 0x2321 }, /* botintegral ⌡ BOTTOM HALF INTEGRAL */ - { 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET */ - { 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET */ + { 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET, not U+27E8 per xterm source */ + { 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET, not U+27E9 per xterm source */ { 0x0bcc, 0x2395 }, /* quad ⎕ APL FUNCTIONAL SYMBOL QUAD */ - { 0x08ab, 0x239b }, /* topleftparens ⎛ ??? */ - { 0x08ac, 0x239d }, /* botleftparens ⎝ ??? */ - { 0x08ad, 0x239e }, /* toprightparens ⎞ ??? */ - { 0x08ae, 0x23a0 }, /* botrightparens ⎠ ??? */ - { 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ ??? */ - { 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ ??? */ - { 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ ??? */ - { 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ ??? */ - { 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ ??? */ - { 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ ??? */ - { 0x08a1, 0x23b7 }, /* leftradical ⎷ ??? */ - { 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 (Unicode 3.2 draft) */ - { 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 (Unicode 3.2 draft) */ - { 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 (Unicode 3.2 draft) */ - { 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 (Unicode 3.2 draft) */ + { 0x08ab, 0x239b }, /* topleftparens ⎛ LEFT PARENTHESIS UPPER HOOK */ + { 0x08ac, 0x239d }, /* botleftparens ⎝ LEFT PARENTHESIS LOWER HOOK */ + { 0x08ad, 0x239e }, /* toprightparens ⎞ RIGHT PARENTHESIS UPPER HOOK */ + { 0x08ae, 0x23a0 }, /* botrightparens ⎠ RIGHT PARENTHESIS LOWER HOOK */ + { 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ LEFT SQUARE BRACKET UPPER CORNER */ + { 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ LEFT SQUARE BRACKET LOWER CORNER */ + { 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ RIGHT SQUARE BRACKET UPPER CORNER */ + { 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ RIGHT SQUARE BRACKET LOWER CORNER */ + { 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ LEFT CURLY BRACKET MIDDLE PIECE */ + { 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ RIGHT CURLY BRACKET MIDDLE PIECE */ + { 0x08a1, 0x23b7 }, /* leftradical ⎷ RADICAL SYMBOL BOTTOM */ + { 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 */ + { 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 */ + { 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 */ + { 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 */ + { 0x09e2, 0x2409 }, /* ht ␉ SYMBOL FOR HORIZONTAL TABULATION */ + { 0x09e5, 0x240a }, /* lf ␊ SYMBOL FOR LINE FEED */ + { 0x09e9, 0x240b }, /* vt ␋ SYMBOL FOR VERTICAL TABULATION */ { 0x09e3, 0x240c }, /* ff ␌ SYMBOL FOR FORM FEED */ { 0x09e4, 0x240d }, /* cr ␍ SYMBOL FOR CARRIAGE RETURN */ - { 0x09e5, 0x240a }, /* lf ␊ SYMBOL FOR LINE FEED */ + { 0x0aac, 0x2423 }, /* signifblank ␣ OPEN BOX */ { 0x09e8, 0x2424 }, /* nl ␤ SYMBOL FOR NEWLINE */ - { 0x09e9, 0x240b }, /* vt ␋ SYMBOL FOR VERTICAL TABULATION */ { 0x08a3, 0x2500 }, /* horizconnector ─ BOX DRAWINGS LIGHT HORIZONTAL */ + { 0x09f1, 0x2500 }, /* horizlinescan5 ─ BOX DRAWINGS LIGHT HORIZONTAL */ { 0x08a6, 0x2502 }, /* vertconnector │ BOX DRAWINGS LIGHT VERTICAL */ + { 0x09f8, 0x2502 }, /* vertbar │ BOX DRAWINGS LIGHT VERTICAL */ { 0x08a2, 0x250c }, /* topleftradical ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */ { 0x09ec, 0x250c }, /* upleftcorner ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */ { 0x09eb, 0x2510 }, /* uprightcorner ┐ BOX DRAWINGS LIGHT DOWN AND LEFT */ @@ -638,8 +656,8 @@ struct codepair { { 0x09f4, 0x251c }, /* leftt ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ { 0x09f5, 0x2524 }, /* rightt ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT */ { 0x09f7, 0x252c }, /* topt ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ - { 0x09ee, 0x253c }, /* crossinglines ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ { 0x09f6, 0x2534 }, /* bott ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL */ + { 0x09ee, 0x253c }, /* crossinglines ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ { 0x09e1, 0x2592 }, /* checkerboard ▒ MEDIUM SHADE */ { 0x0ae7, 0x25aa }, /* enfilledsqbullet ▪ BLACK SMALL SQUARE */ { 0x0ae1, 0x25ab }, /* enopensquarebullet ▫ WHITE SMALL SQUARE */ @@ -657,16 +675,29 @@ struct codepair { { 0x0acc, 0x25c1 }, /* leftopentriangle ◁ WHITE LEFT-POINTING TRIANGLE */ { 0x09e0, 0x25c6 }, /* soliddiamond ◆ BLACK DIAMOND */ { 0x0ace, 0x25cb }, /* emopencircle ○ WHITE CIRCLE */ + { 0x0bcf, 0x25cb }, /* circle ○ WHITE CIRCLE */ { 0x0ade, 0x25cf }, /* emfilledcircle ● BLACK CIRCLE */ { 0x0ae0, 0x25e6 }, /* enopencircbullet ◦ WHITE BULLET */ + + { 0x0ae5, 0x2606 }, /* openstar ☆ WHITE STAR */ + { 0x0af9, 0x260e }, /* telephone ☎ BLACK TELEPHONE */ + { 0x0aca, 0x2613 }, /* signaturemark ☓ SALTIRE */ + { 0x0aea, 0x261c }, /* leftpointer ☜ WHITE LEFT POINTING INDEX */ + { 0x0aeb, 0x261e }, /* rightpointer ☞ WHITE RIGHT POINTING INDEX */ + { 0x0af8, 0x2640 }, /* femalesymbol ♀ FEMALE SIGN */ + { 0x0af7, 0x2642 }, /* malesymbol ♂ MALE SIGN */ + { 0x0aec, 0x2663 }, /* club ♣ BLACK CLUB SUIT */ { 0x0aee, 0x2665 }, /* heart ♥ BLACK HEART SUIT */ { 0x0aed, 0x2666 }, /* diamond ♦ BLACK DIAMOND SUIT */ - { 0x0af5, 0x266f }, /* musicalsharp ♯ MUSIC SHARP SIGN */ { 0x0af6, 0x266d }, /* musicalflat ♭ MUSIC FLAT SIGN */ + { 0x0af5, 0x266f }, /* musicalsharp ♯ MUSIC SHARP SIGN */ + { 0x0af3, 0x2713 }, /* checkmark ✓ CHECK MARK */ { 0x0af4, 0x2717 }, /* ballotcross ✗ BALLOT X */ { 0x0ad9, 0x271d }, /* latincross ✝ LATIN CROSS */ { 0x0af0, 0x2720 }, /* maltesecross ✠ MALTESE CROSS */ + { 0x0abc, 0x27e8 }, /* leftanglebracket ⟨ MATHEMATICAL LEFT ANGLE BRACKET */ + { 0x0abe, 0x27e9 }, /* rightanglebracket ⟩ MATHEMATICAL RIGHT ANGLE BRACKET */ { 0x04a4, 0x3001 }, /* kana_comma 、 IDEOGRAPHIC COMMA */ { 0x04a1, 0x3002 }, /* kana_fullstop 。 IDEOGRAPHIC FULL STOP */ @@ -824,9 +855,7 @@ long ucs2keysym (long ucs) long keysym2ucs(long keysym) { - int min = 0; - int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; - int mid; + int i; /* first check for Latin-1 characters (1:1 mapping) */ if ((keysym >= 0x0020 && keysym <= 0x007e) || @@ -837,16 +866,10 @@ long keysym2ucs(long keysym) if ((keysym & 0xff000000) == 0x01000000) return keysym & 0x00ffffff; - /* binary search in table */ - while (max >= min) { - mid = (min + max) / 2; - if (keysymtab[mid].keysym < keysym) - min = mid + 1; - else if (keysymtab[mid].keysym > keysym) - max = mid - 1; - else { + for (i = 0; i < sizeof(keysymtab) / sizeof(keysymtab[0]); i++) { + if (keysymtab[i].keysym == keysym) { /* found it */ - return keysymtab[mid].ucs; + return keysymtab[i].ucs; } } diff --git a/registryd/ucs2keysym.sh b/registryd/ucs2keysym.sh new file mode 100755 index 0000000..ff37f53 --- /dev/null +++ b/registryd/ucs2keysym.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if [ "$#" = 0 ] +then + echo "Usage: $0 /path/to/keysymdef.h" + exit 1 +fi + +# We are only interested in +# - keysyms which have well-defined unicode equivalent +# - and are not just trivial unicode keysyms +# - non-latin1 keysyms +# - not the lamda aliases +# and we tinker with the alias parentheses to make sorting easier + +grep '^#define' "$1" | \ + grep -i "U+" | \ + grep -vi "0x100[0-9a-f][0-9a-f][0-9a-f][0-9a-f]" | \ + grep -vi " 0x00[0-9a-f][0-9a-f] " | \ + grep -vi "_lamda " | \ + sed -e 's/\/\*(/& /' | \ + sed -e 's/)\*\// &/' | \ + sort -k 5 | \ + perl -CS -e ' +my $last = 0; +while (<>) { + chomp; + if ( /^\#define XK_([a-zA-Z_0-9]+)(\s*) 0x([0-9a-f]+)\s*\/\*(\(?) U\+([0-9A-F]{4,6}) (.*) \)?\*\/\s*$/ ) { + my ( $xk, $space, $keysym, $paren, $unicode, $unistr ) = ( $1, $2, $3, $4, $5, $6); + $unicode = hex("0x".$unicode); + + print "\n" if (int($unicode / 256) != int($last / 256)); + $last = $unicode; + + printf " { 0x$keysym, 0x%04x }, /* $space$xk %lc $unistr */\n", $unicode, $unicode; + } +} + ' diff --git a/test/memory.c b/test/memory.c index df5e0a1..2f53dd7 100644 --- a/test/memory.c +++ b/test/memory.c @@ -1,4 +1,5 @@ #include "atspi/atspi.h" +#include #include #include #include @@ -15,19 +16,24 @@ basic (AtspiAccessible *obj) AtspiAccessible *accessible; GError *error = NULL; + printf ("getting name\n"); str = atspi_accessible_get_name (obj, &error); if (str) g_free (str); + printf ("ok, getting parent\n"); accessible = atspi_accessible_get_parent (obj, NULL); if (accessible) g_object_unref (accessible); + printf ("ok, getting children\n"); count = atspi_accessible_get_child_count (obj, &error); for (i = 0; i < count; i++) { accessible = atspi_accessible_get_child_at_index (obj, i, &error); + printf ("ok %d\n", i); if (accessible) g_object_unref (accessible); } + printf ("ok\n"); } static gboolean @@ -78,7 +84,7 @@ main() atspi_event_listener_register (listener, "object:children-changed", NULL); child_pid = fork (); if (!child_pid) - execlp ("gedit", "gedit", NULL); + execlp ("test/test-application", "test/test-application", NULL); atspi_event_main (); return 0; } diff --git a/test/meson.build b/test/meson.build index 1fb35a8..cd3db66 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,4 +1,13 @@ -test('memory', - executable('memory', 'memory.c', - include_directories: root_inc, - dependencies: [ atspi_dep ])) +testapp = executable('test-application', + 'test-application.c', + include_directories: root_inc, + dependencies: [ atspi_dep ], + ) + +memory = executable('memory', + 'memory.c', + include_directories: root_inc, + dependencies: [ atspi_dep ], + ) + +test('memory', memory, depends: testapp) diff --git a/test/test-application.c b/test/test-application.c new file mode 100644 index 0000000..621d1de --- /dev/null +++ b/test/test-application.c @@ -0,0 +1,105 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/* + * Simple test application for AT-SPI. + * + * The only thing this application does, is registering itself to the AT-SPI + * registry and then waiting to get killed by some external force. + */ + +#include +#include +#include +#include + +static GMainLoop *mainloop; + +int +register_app () +{ + DBusConnection *connection = NULL; + DBusMessage *message; + DBusMessageIter iter; + DBusMessageIter subiter; + DBusError error; + DBusMessage *reply; + const gchar *name; + gchar *path; + + + /* Set up D-Bus connection and register bus name */ + dbus_error_init (&error); + connection = atspi_get_a11y_bus (); + if (!connection) + { + printf("Couldn't get a11y bus!\n"); + return -1; + } + + /* Register this app by sending a signal out to AT-SPI registry daemon */ + message = dbus_message_new_method_call (ATSPI_DBUS_NAME_REGISTRY, + ATSPI_DBUS_PATH_ROOT, + ATSPI_DBUS_INTERFACE_SOCKET, + "Embed"); + + dbus_message_iter_init_append (message, &iter); + + name = dbus_bus_get_unique_name (connection); + path = g_strdup (ATSPI_DBUS_PATH_NULL); + + dbus_message_iter_open_container (&iter, DBUS_TYPE_STRUCT, NULL, + &subiter); + dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &name); + dbus_message_iter_append_basic (&subiter, DBUS_TYPE_OBJECT_PATH, &path); + dbus_message_iter_close_container (&iter, &subiter); + + g_free (path); + + reply = dbus_connection_send_with_reply_and_block(connection, message, -1, &error); + if (!reply) + { + printf("Did not get a reply from the registry.\n"); + dbus_message_unref (message); + dbus_error_free (&error); + return -1; + } + + dbus_message_unref (message); + dbus_message_unref (reply); + dbus_error_free (&error); + return 0; +} + +int main (int argc, char *argv[]) +{ + int ret = register_app (); + if (ret) { + printf("Failed to send dbus signals. Aborting.\n"); + return ret; + } + + // This keeps the test-application runnig indefinitely, i.e. + // until killed by an external signal. + mainloop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (mainloop); + + return 0; +} diff --git a/xml/Accessible.xml b/xml/Accessible.xml index 7015466..b081bfd 100644 --- a/xml/Accessible.xml +++ b/xml/Accessible.xml @@ -7,7 +7,7 @@ - + @@ -19,12 +19,12 @@ - + - + @@ -33,7 +33,7 @@ - + @@ -50,17 +50,21 @@ - + - + - + + + + + diff --git a/xml/Action.xml b/xml/Action.xml index 0f5aa85..1626700 100644 --- a/xml/Action.xml +++ b/xml/Action.xml @@ -26,7 +26,7 @@ - + diff --git a/xml/Application.xml b/xml/Application.xml index 04a2e70..2191f08 100644 --- a/xml/Application.xml +++ b/xml/Application.xml @@ -7,7 +7,7 @@ - + diff --git a/xml/Cache.xml b/xml/Cache.xml index e693b54..ce06ba4 100644 --- a/xml/Cache.xml +++ b/xml/Cache.xml @@ -3,18 +3,18 @@ - - + + - - + + - - + + diff --git a/xml/Collection.xml b/xml/Collection.xml index 7b39776..a6dff74 100644 --- a/xml/Collection.xml +++ b/xml/Collection.xml @@ -4,44 +4,44 @@ - + - + - + - + - + - + - + - + - + diff --git a/xml/Component.xml b/xml/Component.xml index c1258d2..94056ff 100644 --- a/xml/Component.xml +++ b/xml/Component.xml @@ -14,13 +14,13 @@ - + - + diff --git a/xml/DeviceEventController.xml b/xml/DeviceEventController.xml index 0af9aac..460e79a 100644 --- a/xml/DeviceEventController.xml +++ b/xml/DeviceEventController.xml @@ -4,24 +4,20 @@ - - - + + - - - - - - + + + + - - - + + @@ -52,12 +48,12 @@ - + - + diff --git a/xml/DeviceEventListener.xml b/xml/DeviceEventListener.xml index a6dd3b6..2c72973 100644 --- a/xml/DeviceEventListener.xml +++ b/xml/DeviceEventListener.xml @@ -4,7 +4,7 @@ - + diff --git a/xml/Document.xml b/xml/Document.xml index d12a306..a82eb98 100644 --- a/xml/Document.xml +++ b/xml/Document.xml @@ -17,7 +17,7 @@ - + diff --git a/xml/Event.xml b/xml/Event.xml index fac67de..3614358 100644 --- a/xml/Event.xml +++ b/xml/Event.xml @@ -3,190 +3,190 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/xml/Hyperlink.xml b/xml/Hyperlink.xml index 75f8099..80d5777 100644 --- a/xml/Hyperlink.xml +++ b/xml/Hyperlink.xml @@ -11,7 +11,7 @@ - + diff --git a/xml/Hypertext.xml b/xml/Hypertext.xml index 18a3b34..79b5277 100644 --- a/xml/Hypertext.xml +++ b/xml/Hypertext.xml @@ -9,7 +9,7 @@ - + diff --git a/xml/Image.xml b/xml/Image.xml index 43536ee..1dd72f1 100644 --- a/xml/Image.xml +++ b/xml/Image.xml @@ -9,7 +9,7 @@ - + diff --git a/xml/Registry.xml b/xml/Registry.xml index a3ab93c..7603328 100644 --- a/xml/Registry.xml +++ b/xml/Registry.xml @@ -13,8 +13,8 @@ - - + + diff --git a/xml/Selection.xml b/xml/Selection.xml index 2e19187..7b0ad21 100644 --- a/xml/Selection.xml +++ b/xml/Selection.xml @@ -7,7 +7,7 @@ - + diff --git a/xml/Socket.xml b/xml/Socket.xml index 5f9367e..f9ac76d 100644 --- a/xml/Socket.xml +++ b/xml/Socket.xml @@ -3,25 +3,21 @@ - - - - - - + + + + - - - + + - - - - + + + diff --git a/xml/Table.xml b/xml/Table.xml index 181acaa..3b35989 100644 --- a/xml/Table.xml +++ b/xml/Table.xml @@ -7,11 +7,11 @@ - + - + @@ -22,7 +22,7 @@ - + @@ -66,23 +66,23 @@ - + - + - + - + diff --git a/xml/TableCell.xml b/xml/TableCell.xml index c60a074..dbdbe8c 100644 --- a/xml/TableCell.xml +++ b/xml/TableCell.xml @@ -4,11 +4,15 @@ - + + + - + + + diff --git a/xml/Text.xml b/xml/Text.xml index 313131e..fe9f44b 100644 --- a/xml/Text.xml +++ b/xml/Text.xml @@ -65,12 +65,12 @@ - + - + @@ -136,7 +136,7 @@ - + @@ -145,11 +145,12 @@ - + + -- 2.7.4 From dcf4342815f8921cdf37db7d7e6c4b5fd05b74ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Tue, 1 Feb 2022 11:01:46 +0100 Subject: [PATCH 16/16] 2.42.0 Change-Id: Ie3cf2615d77cd923b22e9f6c9a7233fe8682f95a --- NEWS | 29 ++++++++++++++++++ README | 24 ++++++--------- atspi/atspi-accessible.c | 5 +++ atspi/atspi-device-legacy.c | 19 ++++++++++-- atspi/atspi-device-listener.h | 2 +- atspi/atspi-device-x11.c | 57 ++++++++++++++++++++++++++++++++--- atspi/atspi-device.c | 16 ++++++++-- atspi/atspi-event-listener.c | 5 ++- bus/00-at-spi | 10 ++++++ bus/accessibility.conf.in | 2 +- bus/meson.build | 14 +++++++++ meson.build | 2 +- po/LINGUAS | 1 + po/ab.po | 28 +++++++++++++++++ po/be.po | 32 +++++++++++--------- po/gl.po | 8 ++--- registryd/de-marshaller.c | 6 +++- registryd/deviceeventcontroller-x11.c | 2 +- registryd/deviceeventcontroller.c | 2 +- xml/Collection.xml | 6 ++-- xml/Component.xml | 2 ++ xml/Document.xml | 2 +- xml/Text.xml | 2 ++ 23 files changed, 223 insertions(+), 53 deletions(-) create mode 100755 bus/00-at-spi create mode 100644 po/ab.po diff --git a/NEWS b/NEWS index d964ce2..6738a3d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,32 @@ +What's new in at-spi2-core 2.42.0: + +* Set X root property when Xwayland starts on demand. + +* Several dbus introspection fixes. + +What's new in at-spi2-core 2.40.3: + +* Use abstract sockets if libdbus is older than 1.12.0 (#37). + +What's new in at-spi2-core 2.40.2: + +* README: Remove outdated links. + +* Key grab fixes for the new API. + +* registryd: Add a missing call to va_end. + +What's new in at-spi2-core 2.40.1: + +* Fix double free when removing event listeners (#35). + +* Fix numlock detection. + +What's new in at-spi2-core 2.39.91: +* Fix a couple of memory leaks. + +* Remove const from AtspiDeviceListenerCB prototype (#31). + What's new in at-spi2-core 2.39.90.1: * Fix a crash introduced in 2.39.90, along with a few warnings (#30). diff --git a/README b/README index e41a5c6..b377fca 100644 --- a/README +++ b/README @@ -5,24 +5,22 @@ This version of at-spi is a major break from version 1.x. It has been completely rewritten to use D-Bus rather than ORBIT / CORBA for its transport protocol. -A page including instructions for testing, project status and -TODO items is kept up to date at: +An outdated page including instructions for testing, project status and +TODO items is at: - http://www.linuxfoundation.org/en/AT-SPI_on_D-Bus + https://wiki.linuxfoundation.org/accessibility/atk/at-spi/at-spi_on_d-bus The mailing list used for general questions is: - accessibility-atspi@lists.linux-foundation.org + https://lists.linuxfoundation.org/mailman/listinfo/accessibility-atspi -For bug reports, feature requests, patches or enhancements please use -the AT-SPI project on bugzilla.gnome.org. Use the at-spi2-core component for -bugs specific to this module. +For bug reports, feature requests, patches or enhancements please use: - http://bugzilla.gnome.org + https://gitlab.gnome.org/GNOME/at-spi2-core/ A git repository with the latest development code is available at: - git://git.gnome.org/at-spi2-core + https://gitlab.gnome.org/GNOME/at-spi2-core/ More information ---------------- @@ -32,15 +30,13 @@ the results of which are available on the GNOME wiki. Keep in mind that the D-Bus AT-SPI design documents on this page have not been kept up to date. - http://live.gnome.org/GAP/AtSpiDbusInvestigation/ + https://wiki.gnome.org/Accessibility/Documentation/GNOME2/ATSPI2-Investigation Other sources of relevant information about AT-SPI and Accessibility include: - http://live.gnome.org/Accessibility - http://www.sun.com/software/star/gnome/accessibility/architecture.xml - http://accessibility.kde.org/developer/atk.php - http://www.gnome.org/~billh/at-spi-idl/html/ + https://wiki.gnome.org/Accessibility + https://community.kde.org/Accessibility Contents of this package diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index b078688..26cf0ba 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -340,8 +340,11 @@ gchar * atspi_accessible_get_name (AtspiAccessible *obj, GError **error) { g_return_val_if_fail (obj != NULL, g_strdup ("")); + if (!_atspi_accessible_test_cache (obj, ATSPI_CACHE_NAME)) { + g_free (obj->name); + obj->name = NULL; if (!_atspi_dbus_get_property (obj, atspi_interface_accessible, "Name", error, "s", &obj->name)) return g_strdup (""); @@ -366,6 +369,8 @@ atspi_accessible_get_description (AtspiAccessible *obj, GError **error) if (!_atspi_accessible_test_cache (obj, ATSPI_CACHE_DESCRIPTION)) { + g_free (obj->description); + obj->description = NULL; if (!_atspi_dbus_get_property (obj, atspi_interface_accessible, "Description", error, "s", &obj->description)) diff --git a/atspi/atspi-device-legacy.c b/atspi/atspi-device-legacy.c index 6950bc3..eb67768 100644 --- a/atspi/atspi-device-legacy.c +++ b/atspi/atspi-device-legacy.c @@ -47,6 +47,7 @@ struct _AtspiDeviceLegacyPrivate GSList *modifiers; guint virtual_mods_enabled; gboolean keyboard_grabbed; + unsigned int numlock_physical_mask; }; GObjectClass *device_legacy_parent_class; @@ -86,20 +87,27 @@ set_virtual_modifier (AtspiDeviceLegacy *legacy_device, gint keycode, gboolean e gboolean -key_cb (const AtspiDeviceEvent *event, void *user_data) +key_cb (AtspiDeviceEvent *event, void *user_data) { AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (user_data); AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); gboolean ret = priv->keyboard_grabbed; - + guint modifiers; + set_virtual_modifier (legacy_device, event->hw_code, event->type == (AtspiEventType)ATSPI_KEY_PRESS); + + modifiers = event->modifiers | priv->virtual_mods_enabled; + if (modifiers & (1 << ATSPI_MODIFIER_NUMLOCK)) + modifiers &= ~priv->numlock_physical_mask; + ret |= atspi_device_notify_key (ATSPI_DEVICE (legacy_device), event->type == (AtspiEventType)ATSPI_KEY_PRESS, event->hw_code, event->id, - event->modifiers | priv->virtual_mods_enabled, + modifiers, event->event_string); + g_boxed_free (ATSPI_TYPE_DEVICE_EVENT, event); return ret; } @@ -125,6 +133,9 @@ check_virtual_modifier (AtspiDeviceLegacy *legacy_device, guint modifier) AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device); GSList *l; + if (modifier == (1 << ATSPI_MODIFIER_NUMLOCK)) + return TRUE; + for (l = priv->modifiers; l; l = l->next) { AtspiLegacyKeyModifier *entry = l->data; @@ -268,6 +279,8 @@ atspi_device_legacy_init (AtspiDeviceLegacy *device) priv->display=XOpenDisplay(""); if (priv->display) priv->window = DefaultRootWindow(priv->display); + priv->numlock_physical_mask = XkbKeysymToModifiers (priv->display, + XK_Num_Lock); #endif } diff --git a/atspi/atspi-device-listener.h b/atspi/atspi-device-listener.h index d91a203..718a415 100644 --- a/atspi/atspi-device-listener.h +++ b/atspi/atspi-device-listener.h @@ -45,7 +45,7 @@ GType atspi_device_event_get_type (void); * Returns: #TRUE if the client wishes to consume/preempt the event, preventing it from being * relayed to the currently focussed application, #FALSE if the event delivery should proceed as normal. **/ -typedef gboolean (*AtspiDeviceListenerCB) (const AtspiDeviceEvent *stroke, +typedef gboolean (*AtspiDeviceListenerCB) (AtspiDeviceEvent *stroke, void *user_data); /** diff --git a/atspi/atspi-device-x11.c b/atspi/atspi-device-x11.c index e8f2199..4f88e60 100644 --- a/atspi/atspi-device-x11.c +++ b/atspi/atspi-device-x11.c @@ -44,6 +44,7 @@ struct _AtspiDeviceX11Private GSList *key_grabs; guint virtual_mods_enabled; gboolean keyboard_grabbed; + unsigned int numlock_physical_mask; }; GObjectClass *device_x11_parent_class; @@ -176,7 +177,7 @@ grab_has_active_duplicate (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) } static void -grab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) +grab_key_aux (AtspiDeviceX11 *x11_device, int keycode, int modmask) { AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); XIGrabModifiers xi_modifiers; @@ -197,6 +198,22 @@ grab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) } static void +grab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + + grab_key_aux (x11_device, keycode, modmask); + if (!(modmask & LockMask)) + grab_key_aux (x11_device, keycode, modmask | LockMask); + if (!(modmask & priv->numlock_physical_mask)) + { + grab_key_aux (x11_device, keycode, modmask | priv->numlock_physical_mask); + if (!(modmask & LockMask)) + grab_key_aux (x11_device, keycode, modmask | LockMask | priv->numlock_physical_mask); + } +} + +static void enable_key_grab (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) { AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); @@ -209,7 +226,7 @@ enable_key_grab (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) } static void -ungrab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) +ungrab_key_aux (AtspiDeviceX11 *x11_device, int keycode, int modmask) { AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); XIGrabModifiers xi_modifiers; @@ -221,6 +238,22 @@ ungrab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) } static void +ungrab_key (AtspiDeviceX11 *x11_device, int keycode, int modmask) +{ + AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); + + ungrab_key_aux (x11_device, keycode, modmask); + if (!(modmask & LockMask)) + ungrab_key_aux (x11_device, keycode, modmask | LockMask); + if (!(modmask & priv->numlock_physical_mask)) + { + ungrab_key_aux (x11_device, keycode, modmask | priv->numlock_physical_mask); + if (!(modmask & LockMask)) + ungrab_key_aux (x11_device, keycode, modmask | LockMask | priv->numlock_physical_mask); + } +} + +static void disable_key_grab (AtspiDeviceX11 *x11_device, AtspiX11KeyGrab *grab) { AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); @@ -290,6 +323,7 @@ do_event_dispatch (gpointer user_data) char text[10]; KeySym keysym; XComposeStatus status; + guint modifiers; while (XPending (display)) { @@ -301,7 +335,13 @@ do_event_dispatch (gpointer user_data) case KeyPress: case KeyRelease: XLookupString(&xevent.xkey, text, sizeof (text), &keysym, &status); - atspi_device_notify_key (ATSPI_DEVICE (device), (xevent.type == KeyPress), xevent.xkey.keycode, keysym, xevent.xkey.state | priv->virtual_mods_enabled, text); + modifiers = xevent.xkey.state | priv->virtual_mods_enabled; + if (modifiers & priv->numlock_physical_mask) + { + modifiers |= (1 << ATSPI_MODIFIER_NUMLOCK); + modifiers &= ~priv->numlock_physical_mask; + } + atspi_device_notify_key (ATSPI_DEVICE (device), (xevent.type == KeyPress), xevent.xkey.keycode, keysym, modifiers, text); break; case GenericEvent: if (xevent.xcookie.extension == priv->xi_opcode) @@ -326,8 +366,11 @@ do_event_dispatch (gpointer user_data) if (!priv->device_id) priv->device_id = xiDevEv->deviceid; set_virtual_modifier (device, xiRawEv->detail, xevent.xcookie.evtype == XI_KeyPress); + modifiers = keyevent.xkey.state | priv->virtual_mods_enabled; + if (modifiers & priv->numlock_physical_mask) + modifiers |= (1 << ATSPI_MODIFIER_NUMLOCK); if (xiDevEv->deviceid == priv->device_id) - atspi_device_notify_key (ATSPI_DEVICE (device), (xevent.xcookie.evtype == XI_KeyPress), xiRawEv->detail, keysym, keyevent.xkey.state, text); + atspi_device_notify_key (ATSPI_DEVICE (device), (xevent.xcookie.evtype == XI_KeyPress), xiRawEv->detail, keysym, modifiers, text); /* otherwise it's probably a duplicate event from a key grab */ XFreeEventData (priv->display, &xevent.xcookie); break; @@ -396,6 +439,9 @@ check_virtual_modifier (AtspiDeviceX11 *x11_device, guint modifier) AtspiDeviceX11Private *priv = atspi_device_x11_get_instance_private (x11_device); GSList *l; + if (modifier == (1 << ATSPI_MODIFIER_NUMLOCK)) + return TRUE; + for (l = priv->modifiers; l; l = l->next) { AtspiX11KeyModifier *entry = l->data; @@ -534,6 +580,9 @@ atspi_device_x11_init (AtspiDeviceX11 *device) create_event_source (device); } } + + priv->numlock_physical_mask = XkbKeysymToModifiers (priv->display, + XK_Num_Lock); } static void diff --git a/atspi/atspi-device.c b/atspi/atspi-device.c index 5f62dc3..e4a564c 100644 --- a/atspi/atspi-device.c +++ b/atspi/atspi-device.c @@ -107,6 +107,19 @@ atspi_device_new () return ATSPI_DEVICE (atspi_device_legacy_new ()); } +static gboolean +key_matches_modifiers (guint key_mods, guint grab_mods) +{ + /* The presence or lack thereof of locking modifiers should make no + difference when testing, but other modifiers should match. If the + keypress has modifiers that (a) the grab does not check for and (b) are + not lock modifiers, then we reject the match. Alt + left arrow should not + match a grab on left arrow, for instance, but whether numlock is on or + off would be irrelevant. */ + key_mods &= ~((1 << ATSPI_MODIFIER_SHIFTLOCK) | (1 << ATSPI_MODIFIER_NUMLOCK)); + return (key_mods == grab_mods); +} + gboolean atspi_device_notify_key (AtspiDevice *device, gboolean pressed, int keycode, int keysym, gint state, gchar *text) { @@ -123,8 +136,7 @@ atspi_device_notify_key (AtspiDevice *device, gboolean pressed, int keycode, int for (l = priv->keygrabs; l; l = l->next) { AtspiKeyGrab *grab = l->data; - //if (keycode == grab->keycode && (grab->modifiers & state) == grab->modifiers) - if (keycode == grab->keycode && grab->modifiers == state) + if (keycode == grab->keycode && key_matches_modifiers (state, grab->modifiers)) { if (grab->callback) grab->callback (device, pressed, keycode, keysym, state, text, grab->callback_data); diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c index ca6828f..5455b58 100644 --- a/atspi/atspi-event-listener.c +++ b/atspi/atspi-event-listener.c @@ -798,7 +798,10 @@ atspi_event_listener_deregister_from_callback (AtspiEventListenerCB callback, DBusMessage *message, *reply; l = g_list_next (l); if (in_send) - pending_removals = g_list_append (pending_removals, e); + { + pending_removals = g_list_remove (pending_removals, e); + pending_removals = g_list_append (pending_removals, e); + } else event_listeners = g_list_remove (event_listeners, e); for (i = 0; i < matchrule_array->len; i++) diff --git a/bus/00-at-spi b/bus/00-at-spi new file mode 100755 index 0000000..dc3bb60 --- /dev/null +++ b/bus/00-at-spi @@ -0,0 +1,10 @@ +#!/bin/sh + +# Copy a11y bus address from the DBus session bus to the X11 root property. +# This is useful when Xwayland is started on demand and if the user has an +# application with X11 access that does not have access to the session bus. + +ADDR="$( busctl call --user org.a11y.Bus /org/a11y/bus org.a11y.Bus GetAddress )" || exit 0 +ADDR="$( echo $ADDR | sed 's/s "\(.*\)"/\1/' )" || exit 0 + +exec xprop -root -format AT_SPI_BUS 8s -set AT_SPI_BUS "$ADDR" diff --git a/bus/accessibility.conf.in b/bus/accessibility.conf.in index 79c5146..33d6e1c 100644 --- a/bus/accessibility.conf.in +++ b/bus/accessibility.conf.in @@ -6,7 +6,7 @@ @DATADIR@/dbus-1/accessibility-services EXTERNAL - unix:dir=/tmp + @SOCKET_ADDRESS@ diff --git a/bus/meson.build b/bus/meson.build index f6c32c9..21408f2 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -4,8 +4,15 @@ libexec_conf.set('libexecdir', atspi_libexecdir) accessibility_conf = configuration_data() accessibility_conf.set('DATADIR', atspi_datadir) +if libdbus_dep.version().version_compare('>= 1.12.0') + accessibility_conf.set('SOCKET_ADDRESS', 'unix:dir=/tmp') +else + accessibility_conf.set('SOCKET_ADDRESS', 'unix:tmpdir=/tmp') +endif + busconfig_dir = join_paths(atspi_datadir, 'defaults/at-spi2') session_dir = join_paths(atspi_sysconfdir, 'xdg/autostart') +xwayland_session_dir = join_paths(atspi_sysconfdir, 'xdg/Xwayland-session.d') configure_file(input: 'accessibility.conf.in', output: 'accessibility.conf', @@ -27,6 +34,13 @@ configure_file(input: 'at-spi-dbus-bus.service.in', configuration: libexec_conf, install_dir: systemd_user_dir) +if x11_dep.found() + # Note: It is safe to always install it. However, we only need this on + # systemd enabled machines where Xwayland may be started on-demand. + install_data('00-at-spi', + install_dir: xwayland_session_dir) +endif + launcher_args = [ '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir), '-DDATADIR="@0@"'.format(atspi_datadir), diff --git a/meson.build b/meson.build index ca49dfb..b5104c8 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('at-spi2-core', 'c', - version: '2.39.90.1', + version: '2.42.0', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', diff --git a/po/LINGUAS b/po/LINGUAS index 4e2efbd..328b6c4 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,3 +1,4 @@ +ab an as ast diff --git a/po/ab.po b/po/ab.po new file mode 100644 index 0000000..6f34b54 --- /dev/null +++ b/po/ab.po @@ -0,0 +1,28 @@ +# Abkhazian translation for at-spi2-core. +# Copyright (C) 2011 at-spi2-core's COPYRIGHT HOLDER +# This file is distributed under the same license as the at-spi2-core package. +# Nart Tlisha , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: at-spi2-core master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=at-" +"spi&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2014-02-03 23:50+0000\n" +"PO-Revision-Date: 2021-08-16 13:50+0000\n" +"Last-Translator: Nart Tlisha \n" +"Language-Team: Abkhazian\n" +"Language: ab\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" + +#: ../atspi/atspi-component.c:325 ../atspi/atspi-misc.c:1034 +#: ../atspi/atspi-value.c:111 +msgid "The application no longer exists" +msgstr "Аԥшьы уаҳа ыҟаӡам" + +#: ../atspi/atspi-misc.c:1777 +msgid "Attempted synchronous call where prohibited" +msgstr "Синхронтәу асра аҟаҵара азин ыҟаӡам" diff --git a/po/be.po b/po/be.po index f7bc9c1..f0991f3 100644 --- a/po/be.po +++ b/po/be.po @@ -1,29 +1,31 @@ # Yuras Shumovich , 2017. msgid "" msgstr "" -"Project-Id-Version: at-spi2-core.master\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=at-" -"spi&keywords=I18N+L10N&component=at-spi2-core\n" -"POT-Creation-Date: 2017-03-13 21:58+0000\n" -"PO-Revision-Date: 2017-03-26 18:30+0300\n" +"Project-Id-Version: ab10e6d45488175674299c2d7fc854f6\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/at-spi2-core/issues\n" +"POT-Creation-Date: 2020-12-28 16:53+0000\n" +"PO-Revision-Date: 2021-06-15 12:46\n" "Last-Translator: Yuras Shumovich \n" -"Language-Team: Belarusian \n" +"Language-Team: Belarusian\n" "Language: be\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || n%10>=5 && n%10<=9 || n%100>=11 && n%100<=14 ? 2 : 3);\n" "X-Generator: Poedit 1.8.11\n" +"X-Crowdin-Project: ab10e6d45488175674299c2d7fc854f6\n" +"X-Crowdin-Project-ID: 104\n" +"X-Crowdin-Language: be\n" +"X-Crowdin-File: /Localizations/Gnome/Gnome development/in/at-spi2-core.master.be.po\n" +"X-Crowdin-File-ID: 2608\n" -#: ../atspi/atspi-component.c:326 ../atspi/atspi-misc.c:1073 -#: ../atspi/atspi-value.c:111 +#: atspi/atspi-component.c:332 atspi/atspi-misc.c:1077 atspi/atspi-value.c:111 msgid "The application no longer exists" msgstr "Праграма больш не існуе" -#: ../atspi/atspi-misc.c:1832 +#: atspi/atspi-misc.c:1855 msgid "Attempted synchronous call where prohibited" -msgstr "Спроба зрабіць сінхронны выклік, там дзе гэта забаронена" +msgstr "Спроба сінхроннага выкліку ў забароненым месцы" #~ msgid "AT-SPI: Unknown signature %s for RemoveAccessible" #~ msgstr "AT-SPI: Невядомы подпіс %s для RemoveAccessible" @@ -57,8 +59,7 @@ msgstr "Спроба зрабіць сінхронны выклік, там дз #~ "AT-SPI: пры сцягванні %s з інтэрфейсу %s чакаўся варыянт; атрыманы %s\n" #~ msgid "atspi_dbus_get_property: Wrong type: expected %s, got %c\n" -#~ msgstr "" -#~ "atspi_dbus_get_property: Няправільны тып: чакаўся %s, атрыманы %c\n" +#~ msgstr "atspi_dbus_get_property: Няправільны тып: чакаўся %s, атрыманы %c\n" #~ msgid "AT-SPI: Unknown interface %s" #~ msgstr "AT-SPI: Невядомы інтэрфейс %s" @@ -77,3 +78,4 @@ msgstr "Спроба зрабіць сінхронны выклік, там дз #~ msgid "Got invalid signature %s for signal %s from interface %s\n" #~ msgstr "Атрыманы хібны подпіс %s для сігналу %s інтэрфейсу %s\n" + diff --git a/po/gl.po b/po/gl.po index 932ffea..ed8f1fd 100644 --- a/po/gl.po +++ b/po/gl.po @@ -7,10 +7,10 @@ msgid "" msgstr "" "Project-Id-Version: at-spi 2-core\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/at-spi2-core/issues\n" -"POT-Creation-Date: 2018-10-05 04:46+0000\n" +"POT-Creation-Date: 2020-12-28 16:53+0000\n" "PO-Revision-Date: 2019-12-25 05:11+0100\n" "Last-Translator: Fran Dieguez \n" -"Language-Team: gnome-l10n-gl@gnome.org\n" +"Language-Team: Proxecto Trasno \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,10 +18,10 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.2.4\n" -#: atspi/atspi-component.c:326 atspi/atspi-misc.c:1073 atspi/atspi-value.c:111 +#: atspi/atspi-component.c:332 atspi/atspi-misc.c:1077 atspi/atspi-value.c:111 msgid "The application no longer exists" msgstr "A aplicación xa non existe" -#: atspi/atspi-misc.c:1850 +#: atspi/atspi-misc.c:1855 msgid "Attempted synchronous call where prohibited" msgstr "Tentouse unha chamada síncrona onde estaba prohibida" diff --git a/registryd/de-marshaller.c b/registryd/de-marshaller.c index 2f212b0..f109484 100644 --- a/registryd/de-marshaller.c +++ b/registryd/de-marshaller.c @@ -70,7 +70,11 @@ dbus_bool_t spi_dbus_message_iter_append_struct(DBusMessageIter *iter, ...) ptr = va_arg(args, void *); dbus_message_iter_append_basic(&iter_struct, type, ptr); } - if (!dbus_message_iter_close_container(iter, &iter_struct)) return FALSE; + if (!dbus_message_iter_close_container(iter, &iter_struct)) + { + va_end(args); + return FALSE; + } va_end(args); return TRUE; } diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c index df16bd8..55239f4 100644 --- a/registryd/deviceeventcontroller-x11.c +++ b/registryd/deviceeventcontroller-x11.c @@ -82,7 +82,7 @@ static unsigned int mouse_button_mask = Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask; static unsigned int key_modifier_mask = Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | LockMask | ControlMask | SPI_KEYMASK_NUMLOCK; -static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset */ +extern unsigned int _numlock_physical_mask; static XModifierKeymap* xmkeymap = NULL; diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index acd089b..942f383 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -73,7 +73,7 @@ static unsigned int key_modifier_mask = SPI_KEYMASK_MOD1 | SPI_KEYMASK_MOD2 | SPI_KEYMASK_MOD3 | SPI_KEYMASK_MOD4 | SPI_KEYMASK_MOD5 | SPI_KEYMASK_SHIFT | SPI_KEYMASK_SHIFTLOCK | SPI_KEYMASK_CONTROL | SPI_KEYMASK_NUMLOCK; -static unsigned int _numlock_physical_mask = SPI_KEYMASK_MOD2; /* a guess, will be reset */ +unsigned int _numlock_physical_mask = SPI_KEYMASK_MOD2; /* a guess, will be reset */ static gboolean have_mouse_listener = FALSE; static gboolean have_mouse_event_listener = FALSE; diff --git a/xml/Collection.xml b/xml/Collection.xml index a6dff74..913ebcb 100644 --- a/xml/Collection.xml +++ b/xml/Collection.xml @@ -3,7 +3,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/xml/Component.xml b/xml/Component.xml index 94056ff..afefab8 100644 --- a/xml/Component.xml +++ b/xml/Component.xml @@ -74,12 +74,14 @@ + + diff --git a/xml/Document.xml b/xml/Document.xml index a82eb98..03c9693 100644 --- a/xml/Document.xml +++ b/xml/Document.xml @@ -16,7 +16,7 @@ - + diff --git a/xml/Text.xml b/xml/Text.xml index fe9f44b..da772ae 100644 --- a/xml/Text.xml +++ b/xml/Text.xml @@ -157,6 +157,7 @@ + @@ -165,6 +166,7 @@ + -- 2.7.4