From a06a8764c33f64e9c1b4e286e8d2cf9ed6e68b8c Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Mon, 20 Apr 2015 12:46:28 +0200 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 10/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 11/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 From 5a494df22cccdcc1fbefbe51ee9d1c3839b42d6b Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Fri, 17 Jul 2015 16:33:25 +0200 Subject: [PATCH 12/16] introduce new HIGHLIGHTABLE and HIGHLIGHTED states. Purpose of this states is to clearly inform Assistive Technology client that object can be visually marked to assist low-vision users. Idea is the same as with focused and focusable states. Change-Id: I81525d1ea130b32cdf834d4d8e54e9581cf6e665 --- atspi/atspi-constants.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atspi/atspi-constants.h b/atspi/atspi-constants.h index 838adc7..dd10679 100644 --- a/atspi/atspi-constants.h +++ b/atspi/atspi-constants.h @@ -570,6 +570,12 @@ typedef enum { * @ATSPI_STATE_READ_ONLY: Indicates that an object which is ENABLED and * SENSITIVE has a value which can be read, but not modified, by the * user. @Since: 2.16 + * @ATSPI_STATE_HIGHLIGHTED: Indicates that an object which is HIGHLIGHTABLE + * has been graphically marked to assits visally impared users. Only one + * object per window can have ATSPI_STATE_HIGHLIGHTED state. + * @ATSPI_STATE_HIGHLIGHTABLE: Indicates that an object can be graphically + * marked to assist visially impaired users. + * user. @Since: 2.16 * @ATSPI_STATE_LAST_DEFINED: This value of the enumeration should not be used * as a parameter, it indicates the number of items in the #AtspiStateType * enumeration. @@ -624,6 +630,8 @@ typedef enum { ATSPI_STATE_CHECKABLE, ATSPI_STATE_HAS_POPUP, ATSPI_STATE_READ_ONLY, + ATSPI_STATE_HIGHLIGHTED, + ATSPI_STATE_HIGHLIGHTABLE, ATSPI_STATE_LAST_DEFINED, } AtspiStateType; -- 2.7.4 From c9d7511ab0907fe6d7b23474b0ab59012b28624f Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Wed, 2 Sep 2015 14:47:04 +0200 Subject: [PATCH 13/16] Fixed crash during first boot. For some reason application couldn't open file in /tmp/. Change-Id: Ibf3eb8ed3b362c00eb6d8dfcf20df9488777c403 --- bus/at-spi-bus-launcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 7db9702..b6f7f01 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -61,7 +61,7 @@ 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) +#define LOGD(arg...) do {if (log_file) {fprintf(log_file, ##arg);fprintf(log_file, "\n"); fflush(log_file);}} while(0) #endif -- 2.7.4 From d1b090e4819f7fc7744aa141b0c182a88c650e36 Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Thu, 3 Sep 2015 16:13:53 +0200 Subject: [PATCH 14/16] Fixed issue: bus-launcher didn't start screen-reader after reader crash. Change-Id: Ic19ae2b029a4bae79e1cd1cb7300f5d59acf5722 --- bus/at-spi-bus-launcher.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index b6f7f01..73c8a73 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -705,6 +705,15 @@ void screen_reader_cb(keynode_t *node, void *user_data) if (ret < 0) return; + //check if process really exists (e.g didn't crash) + if (bl->pid > 0) + { + int err = kill(bl->pid,0); + //process doesn't exist + if (err == ESRCH) + bl->pid = 0; + } + 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)) -- 2.7.4 From 16bca52aaf6a590d26dcc073eeaf26fd2780ff58 Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Tue, 13 Oct 2015 16:05:34 +0200 Subject: [PATCH 15/16] Fixed crash during deregistering applications. Change-Id: I402bc5d6ed5f9ea503c4b310ec3c4fb9a85ca199 --- registryd/registry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registryd/registry.c b/registryd/registry.c index c533eb0..15bc7a9 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -144,11 +144,12 @@ find_index_of_reference (GPtrArray *arr, const gchar *name, const gchar * path, ref = spi_reference_new (name, path); - for (i = 0; i < arr->len && found == FALSE; i++) + for (i = 0; i < arr->len; i++) { if (compare_reference (ref, g_ptr_array_index (arr, i))); { found = TRUE; + break; } } -- 2.7.4 From 50ca96de84baae4d908d557b2a6ab39c9db02f92 Mon Sep 17 00:00:00 2001 From: Zbigniew Kosinski Date: Tue, 4 Nov 2014 15:57:36 +0100 Subject: [PATCH 16/16] Implement GrabHighlight and ClearHighligh methods. This commit adds support for new AtkComponent method interfaces. Change-Id: I66de60a86a308dc40107cf65d33c99dcbb1eaab2 Signed-off-by: Lukasz Stanislawski --- atspi/atspi-component.c | 40 ++++++++++++++++++++++++++++++++++++++++ atspi/atspi-component.h | 4 ++++ registryd/introspection.c | 8 ++++++++ registryd/registry.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index 0ab552b..41adeef 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -271,6 +271,46 @@ atspi_component_grab_focus (AtspiComponent *obj, GError **error) } /** + * atspi_component_grab_highlight: + * @obj: a pointer to the #AtspiComponent on which to operate. + * + * Attempts to set highlight to the specified + * #AtspiComponent. + * + * Returns: #TRUE if successful, #FALSE otherwise. + * + **/ +gboolean +atspi_component_grab_highlight (AtspiComponent *obj, GError **error) +{ + dbus_bool_t retval = FALSE; + + _atspi_dbus_call (obj, atspi_interface_component, "GrabHighlight", error, "=>b", &retval); + + return retval; +} + +/** + * atspi_component_clear_highlight: + * @obj: a pointer to the #AtspiComponent on which to operate. + * + * Attempts to clear highlight on the specified + * #AtspiComponent. + * + * Returns: #TRUE if successful, #FALSE otherwise. + * + **/ +gboolean +atspi_component_clear_highlight (AtspiComponent *obj, GError **error) +{ + dbus_bool_t retval = FALSE; + + _atspi_dbus_call (obj, atspi_interface_component, "ClearHighlight", error, "=>b", &retval); + + return retval; +} + +/** * atspi_component_get_alpha: * @obj: The #AtspiComponent to be queried. * diff --git a/atspi/atspi-component.h b/atspi/atspi-component.h index dd3455a..f5ddc62 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_grab_highlight (AtspiComponent *obj, GError **error); + +gboolean atspi_component_clear_highlight (AtspiComponent *obj, GError **error); + G_END_DECLS #endif /* _ATSPI_COMPONENT_H_ */ diff --git a/registryd/introspection.c b/registryd/introspection.c index edcf60d..84ce759 100644 --- a/registryd/introspection.c +++ b/registryd/introspection.c @@ -226,6 +226,14 @@ const char *spi_org_a11y_atspi_Component = " " " " "" +" " +" " +" " +"" +" " +" " +" " +"" " " " " " " diff --git a/registryd/registry.c b/registryd/registry.c index 15bc7a9..0a4e378 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -541,6 +541,30 @@ impl_GrabFocus (DBusConnection * bus, DBusMessage * message, void *user_data) } static DBusMessage * +impl_ClearHighlight (DBusConnection * bus, DBusMessage * message, void *user_data) +{ + DBusMessage *reply; + dbus_bool_t retval = FALSE; + + reply = dbus_message_new_method_return (message); + dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval, + DBUS_TYPE_INVALID); + return reply; +} + +static DBusMessage * +impl_GrabHighlight (DBusConnection * bus, DBusMessage * message, void *user_data) +{ + DBusMessage *reply; + dbus_bool_t retval = FALSE; + + reply = dbus_message_new_method_return (message); + dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval, + DBUS_TYPE_INVALID); + return reply; +} + +static DBusMessage * impl_GetAlpha (DBusConnection * bus, DBusMessage * message, void *user_data) { double rv = 1.0; @@ -1247,6 +1271,10 @@ handle_method_root (DBusConnection *bus, DBusMessage *message, void *user_data) reply = impl_GetMDIZOrder (bus, message, user_data); else if (!strcmp (member, "GrabFocus")) reply = impl_GrabFocus (bus, message, user_data); + else if (!strcmp (member, "GrabHighlight")) + reply = impl_GrabHighlight (bus, message, user_data); + else if (!strcmp (member, "ClearHighlight")) + reply = impl_ClearHighlight (bus, message, user_data); else if (!strcmp (member, "GetAlpha")) reply = impl_GetAlpha (bus, message, user_data); else -- 2.7.4