From 9fc5e230f8d229329820ae9d7e409824769102ac Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Mon, 23 Mar 2015 18:30:45 -0500 Subject: [PATCH 01/16] 2.16.0 --- NEWS | 4 ++++ configure.ac | 2 +- doc/libatspi/tmpl/atspi-constants.sgml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 55d816e..1fe33be 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +What's new in at-spi2-core 2.16.0: + +* Fix a couple of gtk-doc warnings (fdo#89678). + What's new in at-spi2-core 2.15.90: * Deprecate atspi_text_get_text_{before,at,after}_offset() (bgo#697969) diff --git a/configure.ac b/configure.ac index 9bb6fa9..e90411a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([at-spi2-core], [2.15.90], [accessibility-atspi@lists.linux-foundation.org]) +AC_INIT([at-spi2-core], [2.16.0], [accessibility-atspi@lists.linux-foundation.org]) AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) diff --git a/doc/libatspi/tmpl/atspi-constants.sgml b/doc/libatspi/tmpl/atspi-constants.sgml index 967c6a1..5565e24 100644 --- a/doc/libatspi/tmpl/atspi-constants.sgml +++ b/doc/libatspi/tmpl/atspi-constants.sgml @@ -454,6 +454,10 @@ Constant definitions needed by multiple interfaces. @ATSPI_ROLE_RATING: @ATSPI_ROLE_TIMER: @ATSPI_ROLE_STATIC: +@ATSPI_ROLE_MATH_FRACTION: +@ATSPI_ROLE_MATH_ROOT: +@ATSPI_ROLE_SUBSCRIPT: +@ATSPI_ROLE_SUPERSCRIPT: @ATSPI_ROLE_LAST_DEFINED: -- 2.7.4 From b7d9e48f2141985f255bff3bba0c759c61a7b247 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 8 Apr 2015 20:19:37 +0300 Subject: [PATCH 02/16] [l10n] Updated Estonian translation --- po/et.po | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/po/et.po b/po/et.po index 5693224..e1f67bd 100644 --- a/po/et.po +++ b/po/et.po @@ -1,23 +1,26 @@ # Estonian translation for at-spi2-core. # Copyright (C) 2012 at-spi2-core's COPYRIGHT HOLDER # This file is distributed under the same license as the at-spi2-core package. -# FIRST AUTHOR , YEAR. -# Mattias Põldaru , 2012. +# Mattias Põldaru , 2012, 2015. # 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: 2012-02-28 20:29+0000\n" -"PO-Revision-Date: 2012-03-01 19:40+0200\n" +"POT-Creation-Date: 2015-03-15 03:48+0000\n" +"PO-Revision-Date: 2015-03-15 09:52+0300\n" "Last-Translator: Mattias Põldaru \n" "Language-Team: Estonian <>\n" "Language: et\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bits\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" +"X-Generator: Poedit 1.5.4\n" msgid "The application no longer exists" msgstr "Seda rakendust pole enam olemas" + +msgid "Attempted synchronous call where prohibited" +msgstr "Üritati teha sünkroonne kutse, kuid see keelati" -- 2.7.4 From bd1855e2852bf5afde27b48e07ad6321cc0c119a Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Tue, 31 Mar 2015 13:06:51 +0200 Subject: [PATCH 03/16] Bus rules for tizen updated --- bus/accessibility.conf.in | 21 ++++++++++++++++++--- registryd/org.a11y.atspi.Registry.service.in | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/bus/accessibility.conf.in b/bus/accessibility.conf.in index 31b6a79..77f12f8 100644 --- a/bus/accessibility.conf.in +++ b/bus/accessibility.conf.in @@ -8,17 +8,32 @@ unix:tmpdir=/tmp - + owner + + - - + + + + + + + + + + + + + + + 1000000000 1000000000 1000000000 diff --git a/registryd/org.a11y.atspi.Registry.service.in b/registryd/org.a11y.atspi.Registry.service.in index 5561175..204ca27 100644 --- a/registryd/org.a11y.atspi.Registry.service.in +++ b/registryd/org.a11y.atspi.Registry.service.in @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.a11y.atspi.Registry -Exec=@LIBEXECDIR@/at-spi2-registryd --use-gnome-session +Exec=@LIBEXECDIR@/at-spi2-registryd -- 2.7.4 From ee99ef51e981c4fecde47ea4861f68536ec1ccf0 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Tue, 31 Mar 2015 13:09:57 +0200 Subject: [PATCH 04/16] spec file, manifest and gbs.conf adapted for Tizen --- .gbs.conf | 2 + packaging/at-spi2-core.manifest | 5 ++ packaging/at-spi2-core.spec | 117 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 .gbs.conf create mode 100644 packaging/at-spi2-core.manifest create mode 100644 packaging/at-spi2-core.spec diff --git a/.gbs.conf b/.gbs.conf new file mode 100644 index 0000000..4d4d1fb --- /dev/null +++ b/.gbs.conf @@ -0,0 +1,2 @@ +[general] +upstream_tag = AT_SPI2_CORE_${upstreamversion} diff --git a/packaging/at-spi2-core.manifest b/packaging/at-spi2-core.manifest new file mode 100644 index 0000000..c976359 --- /dev/null +++ b/packaging/at-spi2-core.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec new file mode 100644 index 0000000..7223067 --- /dev/null +++ b/packaging/at-spi2-core.spec @@ -0,0 +1,117 @@ +%define debug_package %{nil} + +Name: at-spi2-core +Version: 2_12_0 +Release: 0 +Summary: Assistive Technology Service Provider Interface - D-Bus based implementation +License: LGPL-2.0+ +Group: System/Libraries +Url: http://www.gnome.org/ +Source: http://ftp.gnome.org/pub/GNOME/sources/at-spi2-core/2.12/%{name}-%{version}.tar.xz +Source1001: %{name}.manifest +Requires: dbus +BuildRequires: python-devel +BuildRequires: python-xml +BuildRequires: intltool +BuildRequires: dbus-devel +BuildRequires: glib2-devel +BuildRequires: libX11-devel +BuildRequires: libXtst-devel +BuildRequires: libXi-devel +BuildRequires: gettext +BuildRequires: gtk-doc + +%description +AT-SPI is a general interface for applications to make use of the +accessibility toolkit. This version is based on dbus. + +This package contains the AT-SPI registry daemon. It provides a +mechanism for all assistive technologies to discover and interact +with applications running on the desktop. + +%package -n libatspi0 +Summary: An Accessibility ToolKit -- Library +Group: System/Libraries + +%description -n libatspi0 +AT-SPI is a general interface for applications to make use of the +accessibility toolkit. This version is based on dbus. + +%package -n typelib-1_0-Atspi-2_0 +Summary: An Accessibility ToolKit -- Introspection bindings +Group: System/Libraries + +%description -n typelib-1_0-Atspi-2_0 +AT-SPI is a general interface for applications to make use of the +accessibility toolkit. This version is based on dbus. + +This package provides the GObject Introspection bindings for the +libatspi library. + +%package devel +Summary: Include Files and Libraries mandatory for Development +Group: Development/Libraries +Requires: %{name} = %{version} +Requires: libatspi0 = %{version} +Requires: typelib-1_0-Atspi-2_0 = %{version} + +%description devel +This package contains all necessary include files and libraries needed +to develop applications that require these. + +%prep +%setup -q +cp %{SOURCE1001} . + +%build +%autogen --libexecdir=%{_libexecdir}/at-spi2 \ + --with-dbus-daemondir=%{_bindir} \ + --disable-static +%__make %{?_smp_flags} + +%install +rm -rf %{buildroot} +find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f +%make_install +%find_lang %{name} + +%check +mkdir -p %{buildroot}/usr/share/license +cp -f COPYING %{buildroot}/usr/share/license/%{name} + +%clean +rm -fr %{buildroot} + +%post -n libatspi0 -p /sbin/ldconfig + +%postun -n libatspi0 -p /sbin/ldconfig + +%files -f %{name}.lang +%manifest %{name}.manifest +%defattr(-,root,root) +%doc AUTHORS README +%license COPYING +%{_libexecdir}/at-spi2/at-spi-bus-launcher +%{_libexecdir}/at-spi2/at-spi2-registryd +%config %{_sysconfdir}/at-spi2/accessibility.conf +%{_sysconfdir}/xdg/autostart/at-spi-dbus-bus.desktop +%{_datadir}/dbus-1/services/org.a11y.atspi.Registry.service +%{_datadir}/dbus-1/services/org.a11y.Bus.service + + +%files -n libatspi0 +%manifest %{name}.manifest +%defattr(-, root, root) +%{_libdir}/libatspi.so.0* + +%files -n typelib-1_0-Atspi-2_0 +%manifest %{name}.manifest +%defattr(-, root, root) + +%files devel +%manifest %{name}.manifest +%defattr(-, root, root) +%{_includedir}/at-spi-2.0 +%{_libdir}/libatspi.so +%{_libdir}/pkgconfig/atspi-2.pc + -- 2.7.4 From 86bc322d3cb4982231a07a9ccee55706faf67803 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Tue, 31 Mar 2015 19:24:53 +0200 Subject: [PATCH 05/16] condition added to exclusive build on wayland Change-Id: I0b0e12b4a83636db86db3dc23e5074605d53696a --- packaging/at-spi2-core.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index 7223067..4a861ba 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -1,4 +1,5 @@ %define debug_package %{nil} +%bcond_with x Name: at-spi2-core Version: 2_12_0 @@ -15,11 +16,14 @@ BuildRequires: python-xml BuildRequires: intltool BuildRequires: dbus-devel BuildRequires: glib2-devel +BuildRequires: gettext +BuildRequires: gtk-doc +%if !%{with x} +ExclusiveArch: +%endif BuildRequires: libX11-devel BuildRequires: libXtst-devel BuildRequires: libXi-devel -BuildRequires: gettext -BuildRequires: gtk-doc %description AT-SPI is a general interface for applications to make use of the -- 2.7.4 From a06a8764c33f64e9c1b4e286e8d2cf9ed6e68b8c Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Mon, 20 Apr 2015 12:46:28 +0200 Subject: [PATCH 06/16] Bump package version to 2.16 Change-Id: I1573d7c304e1d2e8fc1ed2ae405402727ea725eb Signed-off-by: Patryk Kaczmarek --- .gbs.conf | 2 +- packaging/at-spi2-core.spec | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gbs.conf b/.gbs.conf index 4d4d1fb..00a849f 100644 --- a/.gbs.conf +++ b/.gbs.conf @@ -1,2 +1,2 @@ [general] -upstream_tag = AT_SPI2_CORE_${upstreamversion} +upstream_tag = AT_SPI2_CORE_2_16_0 diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index 4a861ba..a88d987 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -2,13 +2,13 @@ %bcond_with x Name: at-spi2-core -Version: 2_12_0 +Version: 2.16.0 Release: 0 Summary: Assistive Technology Service Provider Interface - D-Bus based implementation License: LGPL-2.0+ Group: System/Libraries Url: http://www.gnome.org/ -Source: http://ftp.gnome.org/pub/GNOME/sources/at-spi2-core/2.12/%{name}-%{version}.tar.xz +Source: http://ftp.gnome.org/pub/GNOME/sources/at-spi2-core/2.16/%{name}-%{version}.tar.xz Source1001: %{name}.manifest Requires: dbus BuildRequires: python-devel @@ -99,7 +99,7 @@ rm -fr %{buildroot} %{_libexecdir}/at-spi2/at-spi2-registryd %config %{_sysconfdir}/at-spi2/accessibility.conf %{_sysconfdir}/xdg/autostart/at-spi-dbus-bus.desktop -%{_datadir}/dbus-1/services/org.a11y.atspi.Registry.service +%{_datadir}/dbus-1/accessibility-services/org.a11y.atspi.Registry.service %{_datadir}/dbus-1/services/org.a11y.Bus.service -- 2.7.4 From 959fde8f992372805c855f7f4caf30a690bdc137 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Thu, 23 Apr 2015 19:46:22 +0200 Subject: [PATCH 07/16] Some conditions added to build also on wayland Change-Id: Iae18df02994af3db06d333339f087a183efcdde2 Signed-off-by: Patryk Kaczmarek --- configure.ac | 4 ++-- packaging/at-spi2-core.spec | 8 +++++--- registryd/deviceeventcontroller.c | 16 ++++++++++++++++ registryd/keymasks.h | 3 +++ registryd/ucs2keysym.c | 3 ++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index e90411a..ebbeb3f 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,7 @@ save_LIBS="$LIBS" LIBS="" CPPFLAGS="$CPPFLAGS $X_CFLAGS" AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[ - AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])], + AC_MSG_WARN([Couldn't find the Xtst library. Check config.log])], $X_LIBS) AC_SUBST(XTST_LIBS) LIBS="$LIBS $save_LIBS" @@ -117,7 +117,7 @@ if test "x$have_xinput" = "xmaybe"; then LIBS="$save_LIBS" fi if test "x$have_xinput" != "xyes"; then - AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details]) + AC_MSG_WARN([Couldn't find the XInput library. Check config.log for details]) fi XINPUT_LIBS="-lXi" AC_SUBST(XINPUT_LIBS) diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index a88d987..e8808ea 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -18,12 +18,11 @@ BuildRequires: dbus-devel BuildRequires: glib2-devel BuildRequires: gettext BuildRequires: gtk-doc -%if !%{with x} -ExclusiveArch: -%endif +%if %{with x} BuildRequires: libX11-devel BuildRequires: libXtst-devel BuildRequires: libXi-devel +%endif %description AT-SPI is a general interface for applications to make use of the @@ -70,6 +69,9 @@ cp %{SOURCE1001} . %build %autogen --libexecdir=%{_libexecdir}/at-spi2 \ --with-dbus-daemondir=%{_bindir} \ +%if !%{with x} + --disable-x11 \ +%endif --disable-static %__make %{?_smp_flags} diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 8279a1d..62cd706 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -42,8 +42,10 @@ #include "keymasks.h" #include "de-types.h" #include "de-marshaller.h" +#ifdef HAVE_X11 #include "display.h" #include "event-source.h" +#endif #include "deviceeventcontroller.h" #include "reentrant-list.h" @@ -65,9 +67,14 @@ struct _SpiPoint { }; typedef struct _SpiPoint SpiPoint; static unsigned int mouse_mask_state = 0; +#ifdef HAVE_X11 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 */ +#else +static unsigned int key_modifier_mask = 255; +static unsigned int _numlock_physical_mask = (1<<4); +#endif static gboolean have_mouse_listener = FALSE; static gboolean have_mouse_event_listener = FALSE; @@ -632,7 +639,12 @@ handle_keygrab (SpiDEController *controller, grab_mask.mod_mask = key_listener->mask; if (g_slist_length (key_listener->keys) == 0) /* special case means AnyKey/AllKeys */ { +#ifdef HAVE_X11 grab_mask.key_val = AnyKey; +#else + grab_mask.key_val = 0L; +#endif + #ifdef SPI_DEBUG fprintf (stderr, "AnyKey grab!"); #endif @@ -1749,7 +1761,11 @@ impl_generate_keyboard_event (DBusConnection *bus, DBusMessage *message, void *u * in our arg list; it can contain either * a keycode or a keysym. */ +#ifdef HAVE_X11 spi_dec_synth_keysym (controller, (KeySym) keycode); +#else + spi_dec_synth_keysym (controller, (long) keycode); +#endif break; case Accessibility_KEY_STRING: if (!spi_dec_plat_synth_keystring (controller, synth_type, keycode, keystring)) diff --git a/registryd/keymasks.h b/registryd/keymasks.h index 6dc95ad..8000448 100644 --- a/registryd/keymasks.h +++ b/registryd/keymasks.h @@ -24,7 +24,10 @@ #ifndef SPI_KEYMASKS_H_ #define SPI_KEYMASKS_H_ + +#ifdef HAVE_X11 #include +#endif #include G_BEGIN_DECLS diff --git a/registryd/ucs2keysym.c b/registryd/ucs2keysym.c index b4967be..539685c 100644 --- a/registryd/ucs2keysym.c +++ b/registryd/ucs2keysym.c @@ -30,8 +30,9 @@ * This software is in the public domain. Share and enjoy! * */ - +#ifdef HAVE_X11 #include +#endif #include "deviceeventcontroller.h" /* for prototype */ struct codepair { -- 2.7.4 From 8b37292698e8765c4141c19b3e5d14b7ec579c80 Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Mon, 27 Apr 2015 10:55:14 +0200 Subject: [PATCH 08/16] bus-launcher: integrate launcher with tizen platform. at-spi-bus-launcher is now registered on vconf "db/menu/accessbiility/screen_reader" changes and launches applications registered on "read_screen" operation in application service. Change-Id: I7264004c3358654073829faaebb06f24b0a9b4d7 --- bus/Makefile.am | 4 +- bus/at-spi-bus-launcher.c | 89 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 11 ++++++ packaging/at-spi2-core.spec | 4 ++ 4 files changed, 106 insertions(+), 2 deletions(-) diff --git a/bus/Makefile.am b/bus/Makefile.am index 530d231..574e0ad 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -7,8 +7,8 @@ libexec_PROGRAMS = at-spi-bus-launcher at_spi_bus_launcher_SOURCES = at-spi-bus-launcher.c at_spi_bus_launcher_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \ -DDBUS_DAEMON=\"$(DBUS_DAEMON)\" -at_spi_bus_launcher_CFLAGS = $(GIO_CFLAGS) -at_spi_bus_launcher_LDADD = $(GIO_LIBS) $(X_LIBS) +at_spi_bus_launcher_CFLAGS = $(GIO_CFLAGS) $(APPSVC_CFLAGS) $(VCONF_CFLAGS) $(AUL_CFLAGS) +at_spi_bus_launcher_LDADD = $(GIO_LIBS) $(X_LIBS) $(APPSVC_LIBS) $(VCONF_LIBS) $(AUL_LIBS) default_sessiondir = $(sysconfdir)/xdg/autostart default_session_DATA = at-spi-dbus-bus.desktop diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index b6bd8e8..67e8bed 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -35,6 +35,12 @@ #include #endif +#define APP_CONTROL_OPERATION_SCREEN_READ "http://tizen.org/appcontrol/operation/read_screen" +#include +#include +#include +#include + typedef enum { A11Y_BUS_STATE_IDLE = 0, A11Y_BUS_STATE_READING_ADDRESS, @@ -51,7 +57,11 @@ typedef struct { GSettings *a11y_schema; GSettings *interface_schema; + gboolean screen_reader_needed; + int pid; + A11yBusState state; + /* -1 == error, 0 == pending, > 0 == running */ int a11y_bus_pid; char *a11y_bus_address; @@ -565,6 +575,70 @@ gsettings_key_changed (GSettings *gsettings, const gchar *key, void *user_data) handle_screen_reader_enabled_change (_global_app, new_val, FALSE); } +static gboolean +_launch_screen_reader(A11yBusLauncher *bl) +{ + bundle *kb = NULL; + gboolean ret = FALSE; + + kb = bundle_create(); + if (kb == NULL) + return FALSE; + + appsvc_set_operation(kb, APP_CONTROL_OPERATION_SCREEN_READ); + + bl->pid = appsvc_usr_run_service(kb, 0, NULL, NULL, getuid()); + if (bl->pid >= 0) { + ret = TRUE; + } + + bundle_free(kb); + return ret; +} + +static gboolean +_terminate_screen_reader(A11yBusLauncher *bl) +{ + int ret; + if (bl->pid <= 0) + return FALSE; + + LOGD("terminate process with pid %d", bl->pid); + if (!aul_terminate_pid(bl->pid)) + { + bl->pid = 0; + return TRUE; + } + + LOGD("Unable to terminate process using aul api. Sending SIGTERM signal"); + ret = kill(bl->pid, SIGTERM); + if (!ret) + { + bl->pid = 0; + return TRUE; + } + + LOGD("Unable to terminate process: %d with api or signal.", bl->pid); + return FALSE; +} + +void screen_reader_cb(keynode_t *node, void *user_data) +{ + A11yBusLauncher *bl = user_data; + int ret; + + ret = vconf_keynode_get_bool(node); + if (ret < 0) + return; + + bl->screen_reader_needed = ret; + + if (!bl->screen_reader_needed && (bl->pid > 0)) + _terminate_screen_reader(bl); + else if (bl->screen_reader_needed && (bl->pid <= 0)) + _launch_screen_reader(bl); +} + int main (int argc, char **argv) @@ -637,6 +711,21 @@ main (int argc, _global_app, NULL); + int ret = vconf_get_bool("db/menu/accessibility/screen_reader", &_global_app->screen_reader_needed); + if (ret != 0) + { + LOGD("Could not read 'db/menu/accessibility/screen_reader' key value.\n"); + return FALSE; + } + ret = vconf_notify_key_changed("db/menu/accessibility/screen_reader", screen_reader_cb, _global_app); + if(ret != 0) + { + LOGD("Could not add information level callback\n"); + return FALSE; + } + if (_global_app->screen_reader_needed) + _launch_screen_reader(_global_app); + g_main_loop_run (_global_app->loop); if (_global_app->a11y_bus_pid > 0) diff --git a/configure.ac b/configure.ac index ebbeb3f..bea395d 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,17 @@ PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.28]) AC_SUBST(GIO_LIBS) AC_SUBST(GIO_CFLAGS) +PKG_CHECK_MODULES(APPSVC, [appsvc]) +AC_SUBST(APPSVC_LIBS) +AC_SUBST(APPSVC_CFLAGS) + +PKG_CHECK_MODULES(VCONF, [vconf]) +AC_SUBST(VCONF_LIBS) +AC_SUBST(VCONF_CFLAGS) + +PKG_CHECK_MODULES(AUL, [aul]) +AC_SUBST(AUL_LIBS) +AC_SUBST(AUL_CFLAGS) # -------------------------------------------------------------------- # Find DL functionality diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index e8808ea..a3ecd8e 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -23,6 +23,10 @@ BuildRequires: libX11-devel BuildRequires: libXtst-devel BuildRequires: libXi-devel %endif +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(appsvc) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(aul) %description AT-SPI is a general interface for applications to make use of the -- 2.7.4 From d296b0504c3e2db54934e5b9bb37d88532d8bdc3 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Thu, 9 Jul 2015 17:40:06 +0900 Subject: [PATCH 09/16] Following security policy Change-Id: Ie15d6985ebdad7b8bd7b26a81012727387f4317a --- packaging/at-spi2-core.manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/at-spi2-core.manifest b/packaging/at-spi2-core.manifest index c976359..017d22d 100644 --- a/packaging/at-spi2-core.manifest +++ b/packaging/at-spi2-core.manifest @@ -1,5 +1,5 @@ - + -- 2.7.4 From 77598a4ad1f4486ac50429448230d679f4ddd856 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Mon, 13 Jul 2015 20:16:39 +0900 Subject: [PATCH 10/16] Using proper vconf key - VCONFKEY_SETAPPL_ACCESSIBILITY_TTS Change-Id: I90e2144132d6c940f94249fdf1d3359ecfa82237 --- bus/at-spi-bus-launcher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 67e8bed..98a0098 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -711,13 +711,13 @@ main (int argc, _global_app, NULL); - int ret = vconf_get_bool("db/menu/accessibility/screen_reader", &_global_app->screen_reader_needed); + int ret = vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &_global_app->screen_reader_needed); if (ret != 0) { - LOGD("Could not read 'db/menu/accessibility/screen_reader' key value.\n"); + LOGD("Could not read VCONFKEY_SETAPPL_ACCESSIBILITY_TTS key value.\n"); return FALSE; } - ret = vconf_notify_key_changed("db/menu/accessibility/screen_reader", screen_reader_cb, _global_app); + ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, screen_reader_cb, _global_app); if(ret != 0) { LOGD("Could not add information level callback\n"); -- 2.7.4 From c44df97989710d2829e4e56ca9e5fc6d27a47a92 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Thu, 23 Jul 2015 17:34:12 +0900 Subject: [PATCH 11/16] Using aul_launch_app to launch screen-reader Change-Id: I30d2e3405dfe42259e704ad0a1c3ff9e139a6e2e --- bus/at-spi-bus-launcher.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 98a0098..08566d6 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -585,9 +585,7 @@ _launch_screen_reader(A11yBusLauncher *bl) if (kb == NULL) return FALSE; - appsvc_set_operation(kb, APP_CONTROL_OPERATION_SCREEN_READ); - - bl->pid = appsvc_usr_run_service(kb, 0, NULL, NULL, getuid()); + bl->pid = aul_launch_app("org.tizen.screen-reader", kb); if (bl->pid >= 0) { ret = TRUE; } -- 2.7.4 From 4c1621c3d7edf56fc6a719a32dcdb83286bb0dcd Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Wed, 10 Jun 2015 12:12:54 +0200 Subject: [PATCH 12/16] Fixed state of screen-reader wher screen-reader exits abnormally When screen-reader e.g. crashed, bus-launcher didn't check if the process is still running before it tried to terminated it. In result screen-reader's invalid PID was kept and new screen-reader couldn't be launched. Change-Id: I599c7e7962a16b031e913c1a957b2f33f225a6f3 Signed-off-by: Tomasz Olszak --- bus/at-spi-bus-launcher.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 08566d6..a84270b 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -601,6 +601,16 @@ _terminate_screen_reader(A11yBusLauncher *bl) if (bl->pid <= 0) return FALSE; + + int status = aul_app_get_status_bypid(bl->pid); + + if (status < 0) + { + LOGD("App with pid %d already terminated", bl->pid); + bl->pid = 0; + return TRUE; + } + LOGD("terminate process with pid %d", bl->pid); if (!aul_terminate_pid(bl->pid)) { -- 2.7.4 From b33cafb333d26c35eba414a2bef69da87778cdf0 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Wed, 24 Jun 2015 23:18:07 +0900 Subject: [PATCH 13/16] [Prevent] CID 451233 - atspi-registry.c:atspi_deregister_keystroke_listener (dereference before null check) CID 451215 - atspi-registry.c:atspi_deregister_device_event_listener (dereference before null check) CID 451213 - atspi-registry.c:atspi_deregister_device_event_listener (dereference before null check) CID 451078 - atspi-event-listener.c:_atspi_dbus_handle_evnet (dereference after null check) CID 451077 - atspi-stateset.c:atspi_state_set_set_by_name (dereference after null check) Change-Id: I38a6c0062fdae892158fa0a18ba35aadcdc5e855 --- atspi/atspi-event-listener.c | 20 ++++++++++++-------- atspi/atspi-registry.c | 9 ++++++--- atspi/atspi-stateset.c | 1 + 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c index 292e88b..95af3a0 100644 --- a/atspi/atspi-event-listener.c +++ b/atspi/atspi-event-listener.c @@ -951,16 +951,20 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data) memset (&e, 0, sizeof (e)); - if (category) + if (!category) { - category = g_utf8_strrchr (category, -1, '.'); - if (category == NULL) - { - // TODO: Error - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - category++; + // TODO: Error + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + category = g_utf8_strrchr (category, -1, '.'); + if (category == NULL) + { + // TODO: Error + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } + category++; + dbus_message_iter_get_basic (&iter, &detail); dbus_message_iter_next (&iter); dbus_message_iter_get_basic (&iter, &detail1); diff --git a/atspi/atspi-registry.c b/atspi/atspi-registry.c index c9b11f0..759a1aa 100644 --- a/atspi/atspi-registry.c +++ b/atspi/atspi-registry.c @@ -270,7 +270,7 @@ atspi_deregister_keystroke_listener (AtspiDeviceListener *listener, GError **error) { GArray *d_key_set; - gchar *path = _atspi_device_listener_get_path (listener); + gchar *path; gint i; dbus_uint32_t d_modmask = modmask; dbus_uint32_t d_event_types = event_types; @@ -282,6 +282,7 @@ atspi_deregister_keystroke_listener (AtspiDeviceListener *listener, { return FALSE; } + path = _atspi_device_listener_get_path (listener); /* copy the keyval filter values from the C api into the DBind KeySet */ if (key_set) @@ -363,7 +364,7 @@ atspi_register_device_event_listener (AtspiDeviceListener *listener, { gboolean retval = FALSE; dbus_uint32_t d_event_types = event_types; - gchar *path = _atspi_device_listener_get_path (listener); + gchar *path; DBusError d_error; dbus_error_init (&d_error); @@ -371,6 +372,7 @@ atspi_register_device_event_listener (AtspiDeviceListener *listener, { return retval; } + path = _atspi_device_listener_get_path (listener); dbind_method_call_reentrant (_atspi_bus(), atspi_bus_registry, atspi_path_dec, atspi_interface_dec, "RegisterDeviceEventListener", &d_error, "ou=>b", path, d_event_types, &retval); if (dbus_error_is_set (&d_error)) @@ -400,7 +402,7 @@ atspi_deregister_device_event_listener (AtspiDeviceListener *listener, void *filter, GError **error) { dbus_uint32_t event_types = 0; - gchar *path = _atspi_device_listener_get_path (listener); + gchar *path; DBusError d_error; dbus_error_init (&d_error); @@ -409,6 +411,7 @@ atspi_deregister_device_event_listener (AtspiDeviceListener *listener, { return FALSE; } + path = _atspi_device_listener_get_path (listener); event_types |= (1 << ATSPI_BUTTON_PRESSED_EVENT); event_types |= (1 << ATSPI_BUTTON_RELEASED_EVENT); diff --git a/atspi/atspi-stateset.c b/atspi/atspi-stateset.c index 1f9d993..d6acc85 100644 --- a/atspi/atspi-stateset.c +++ b/atspi/atspi-stateset.c @@ -101,6 +101,7 @@ atspi_state_set_set_by_name (AtspiStateSet *set, const gchar *name, gboolean ena if (!value) { g_warning ("AT-SPI: Attempt to set unknown state '%s'", name); + return; } if (enabled) -- 2.7.4 From 1ca8754db4fb4ba989f896b7068ca6fa2016e450 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Thu, 16 Jul 2015 19:31:56 +0900 Subject: [PATCH 14/16] Fix build fail on TV product Change-Id: I727acd30bff829dbbd91bb4349ca2e79cea6a115 --- packaging/at-spi2-core.spec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index a3ecd8e..892fabd 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -5,7 +5,8 @@ Name: at-spi2-core Version: 2.16.0 Release: 0 Summary: Assistive Technology Service Provider Interface - D-Bus based implementation -License: LGPL-2.0+ +#License: LGPL-2.0+ +License: %{_builddir}/%{buildsubdir}/COPYING Group: System/Libraries Url: http://www.gnome.org/ Source: http://ftp.gnome.org/pub/GNOME/sources/at-spi2-core/2.16/%{name}-%{version}.tar.xz @@ -86,8 +87,6 @@ find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f %find_lang %{name} %check -mkdir -p %{buildroot}/usr/share/license -cp -f COPYING %{buildroot}/usr/share/license/%{name} %clean rm -fr %{buildroot} @@ -100,7 +99,7 @@ rm -fr %{buildroot} %manifest %{name}.manifest %defattr(-,root,root) %doc AUTHORS README -%license COPYING +#%license COPYING %{_libexecdir}/at-spi2/at-spi-bus-launcher %{_libexecdir}/at-spi2/at-spi2-registryd %config %{_sysconfdir}/at-spi2/accessibility.conf @@ -108,7 +107,6 @@ rm -fr %{buildroot} %{_datadir}/dbus-1/accessibility-services/org.a11y.atspi.Registry.service %{_datadir}/dbus-1/services/org.a11y.Bus.service - %files -n libatspi0 %manifest %{name}.manifest %defattr(-, root, root) -- 2.7.4 From 44dc0fb0a5cd592d4c2963ba48d38fdd736bc93a Mon Sep 17 00:00:00 2001 From: Sung-Taek Hong Date: Fri, 31 Jul 2015 15:38:10 +0900 Subject: [PATCH 15/16] [LICENSE] apply SPDX license to spec file Change-Id: I5bcc8c19f821b97138773c7302070a018ba66cc4 Signed-off-by: Sung-Taek Hong --- packaging/at-spi2-core.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index 892fabd..228b03f 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -5,8 +5,7 @@ Name: at-spi2-core Version: 2.16.0 Release: 0 Summary: Assistive Technology Service Provider Interface - D-Bus based implementation -#License: LGPL-2.0+ -License: %{_builddir}/%{buildsubdir}/COPYING +License: LGPL-2.0+ Group: System/Libraries Url: http://www.gnome.org/ Source: http://ftp.gnome.org/pub/GNOME/sources/at-spi2-core/2.16/%{name}-%{version}.tar.xz @@ -85,6 +84,8 @@ rm -rf %{buildroot} find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f %make_install %find_lang %{name} +mkdir -p %{buildroot}/%{_datadir}/usr/share/license +cp -f %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{_datadir}/usr/share/license/%{name} %check @@ -106,6 +107,7 @@ rm -fr %{buildroot} %{_sysconfdir}/xdg/autostart/at-spi-dbus-bus.desktop %{_datadir}/dbus-1/accessibility-services/org.a11y.atspi.Registry.service %{_datadir}/dbus-1/services/org.a11y.Bus.service +%{_datadir}/usr/share/license/%{name} %files -n libatspi0 %manifest %{name}.manifest -- 2.7.4 From d60d5bfb7a66fe2137f848df87d3b75c35b8f8e9 Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Fri, 31 Jul 2015 12:12:10 +0200 Subject: [PATCH 16/16] Fixed screen-reader launch(by bus-launcher) after reboot. Additionally added some debug features. DLOG doesn't work when bus-launcher is started hence possibility to log to file was introduced. Change-Id: Ie46aceae2a4718e16932a9f4e19b839797abf3a1 --- bus/at-spi-bus-launcher.c | 103 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 14 deletions(-) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index a84270b..7db9702 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -38,9 +38,33 @@ #define APP_CONTROL_OPERATION_SCREEN_READ "http://tizen.org/appcontrol/operation/read_screen" #include #include + +//uncomment if you want debug +//#ifndef TIZEN_ENGINEER_MODE +//#define TIZEN_ENGINEER_MODE +//#endif +#ifdef LOG_TAG +#undef LOG_TAG +#endif + +#define LOG_TAG "ATSPI_BUS_LAUNCHER" + #include #include +//uncomment this if you want log suring startup +//seems like dlog is not working at startup time +#define ATSPI_BUS_LAUNCHER_LOG_TO_FILE + +#ifdef ATSPI_BUS_LAUNCHER_LOG_TO_FILE +FILE *log_file; +#ifdef LOGD +#undef LOGD +#endif +#define LOGD(arg...) do {fprintf(log_file, ##arg);fprintf(log_file, "\n"); fflush(log_file);} while(0) +#endif + + typedef enum { A11Y_BUS_STATE_IDLE = 0, A11Y_BUS_STATE_READING_ADDRESS, @@ -57,6 +81,7 @@ typedef struct { GSettings *a11y_schema; GSettings *interface_schema; + int launch_screen_reader_repeats; gboolean screen_reader_needed; int pid; @@ -184,7 +209,7 @@ ensure_a11y_bus (A11yBusLauncher *app) app->state = A11Y_BUS_STATE_READING_ADDRESS; app->a11y_bus_pid = pid; - g_debug ("Launched a11y bus, child is %ld", (long) pid); + LOGD("Launched a11y bus, child is %ld", (long) pid); if (!unix_read_all_fd_to_string (app->pipefd[0], addr_buf, sizeof (addr_buf))) { app->a11y_launch_error_message = g_strdup_printf ("Failed to read address: %s", strerror (errno)); @@ -197,7 +222,7 @@ ensure_a11y_bus (A11yBusLauncher *app) /* Trim the trailing newline */ app->a11y_bus_address = g_strchomp (g_strdup (addr_buf)); - g_debug ("a11y bus address: %s", app->a11y_bus_address); + LOGD("a11y bus address: %s", app->a11y_bus_address); #ifdef HAVE_X11 { @@ -576,27 +601,67 @@ gsettings_key_changed (GSettings *gsettings, const gchar *key, void *user_data) } static gboolean -_launch_screen_reader(A11yBusLauncher *bl) +_launch_screen_reader(gpointer user_data) { + A11yBusLauncher *bl = user_data; + LOGD("Launching screen reader"); + bundle *kb = NULL; gboolean ret = FALSE; kb = bundle_create(); + if (kb == NULL) - return FALSE; + { + LOGD("Can't create bundle"); + return FALSE; + } + int operation_error = appsvc_set_operation(kb, APP_CONTROL_OPERATION_SCREEN_READ); + LOGD("appsvc_set_operation: %i", operation_error); + + bl->pid = appsvc_run_service(kb, 0, NULL, NULL); + + if (bl->pid > 0) + { + LOGD("Screen reader launched with pid: %i", bl->pid); + ret = TRUE; + } + else + { + LOGD("Can't start screen-reader - error code: %i", bl->pid); + } - bl->pid = aul_launch_app("org.tizen.screen-reader", kb); - if (bl->pid >= 0) { - ret = TRUE; - } bundle_free(kb); return ret; } static gboolean +_launch_screen_reader_repeat_until_success(gpointer user_data) { + A11yBusLauncher *bl = user_data; + + if (bl->launch_screen_reader_repeats > 100 || bl->pid > 0) + { + //do not try anymore + return FALSE; + } + + gboolean ret = _launch_screen_reader(user_data); + + if (ret) + { + //we managed to + bl->launch_screen_reader_repeats = 0; + return FALSE; + } + //try again + return TRUE; +} + +static gboolean _terminate_screen_reader(A11yBusLauncher *bl) { + LOGD("Terminating screen reader"); int ret; if (bl->pid <= 0) return FALSE; @@ -606,9 +671,9 @@ _terminate_screen_reader(A11yBusLauncher *bl) if (status < 0) { - LOGD("App with pid %d already terminated", bl->pid); - bl->pid = 0; - return TRUE; + LOGD("App with pid %d already terminated", bl->pid); + bl->pid = 0; + return TRUE; } LOGD("terminate process with pid %d", bl->pid); @@ -636,11 +701,12 @@ void screen_reader_cb(keynode_t *node, void *user_data) int ret; ret = vconf_keynode_get_bool(node); + LOGD("vconf_keynode_get_bool(node): %i", ret); if (ret < 0) return; bl->screen_reader_needed = ret; - + LOGD("bl->screen_reader_needed: %i, bl->pid: %i", ret, bl->pid); if (!bl->screen_reader_needed && (bl->pid > 0)) _terminate_screen_reader(bl); else if (bl->screen_reader_needed && (bl->pid <= 0)) @@ -651,6 +717,11 @@ int main (int argc, char **argv) { +#ifdef ATSPI_BUS_LAUNCHER_LOG_TO_FILE + log_file = fopen("/tmp/at-spi-bus-launcher.log", "a"); +#endif + + LOGD("Starting atspi bus launcher"); GError *error = NULL; GMainLoop *loop; GDBusConnection *session_bus; @@ -660,10 +731,14 @@ main (int argc, gint i; if (already_running ()) - return 0; + { + LOGD("atspi bus launcher is already running"); + return 0; + } _global_app = g_slice_new0 (A11yBusLauncher); _global_app->loop = g_main_loop_new (NULL, FALSE); + _global_app->launch_screen_reader_repeats = 0; for (i = 1; i < argc; i++) { @@ -732,7 +807,7 @@ main (int argc, return FALSE; } if (_global_app->screen_reader_needed) - _launch_screen_reader(_global_app); + g_timeout_add_seconds(2,_launch_screen_reader_repeat_until_success, _global_app); g_main_loop_run (_global_app->loop); -- 2.7.4