summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-04 15:07:51 +0100
committerAndras Timar <andras.timar@collabora.com>2014-06-20 03:37:07 -0700
commite9f0fb287cb58d7139bc39e0df89a2b521816aab (patch)
tree5e9fe32d533b958d2cb7c268062f1e5957566786 /vcl
parent3d7a2e3e5b673600f9f68c2e2dd0d040f4333e93 (diff)
fdo#35105: notify role change through a new UNO a11y event
A new UNO accessibility event called ROLE_CHANGED has been created. It should be triggered when an accessible object changes its role and every accessibility toolkit should use its own methods to make that change effective. Code to support the event in ATK has been added. Change-Id: I132e303bdb148967231334458c3cfa369c36ec8f Reviewed-on: https://gerrit.libreoffice.org/7853 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/a11y/atklistener.cxx8
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx8
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.hxx1
3 files changed, 17 insertions, 0 deletions
diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx
index f1614d8ed512..f13a0a318601 100644
--- a/vcl/unx/gtk/a11y/atklistener.cxx
+++ b/vcl/unx/gtk/a11y/atklistener.cxx
@@ -549,6 +549,14 @@ void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEven
g_signal_emit_by_name( G_OBJECT( atk_obj ), "property_change::accessible-hypertext-offset");
break;
+ case accessibility::AccessibleEventId::ROLE_CHANGED:
+ {
+ uno::Reference< accessibility::XAccessibleContext > xContext;
+ xContext = getAccessibleContextFromSource( aEvent.Source );
+ atk_object_wrapper_set_role( mpWrapper, xContext->getAccessibleRole() );
+ break;
+ }
+
default:
g_warning( "Unknown event notification %d", aEvent.EventId );
break;
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index ab0b2753fd4e..5b4da2389e38 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -877,6 +877,14 @@ void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child
/*****************************************************************************/
+void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role)
+{
+ AtkObject *atk_obj = ATK_OBJECT( wrapper );
+ atk_object_set_role( atk_obj, mapToAtkRole( role ) );
+}
+
+/*****************************************************************************/
+
#define RELEASE(i) if( i ) { i->release(); i = NULL; }
void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper)
diff --git a/vcl/unx/gtk/a11y/atkwrapper.hxx b/vcl/unx/gtk/a11y/atkwrapper.hxx
index 2b018b92a9fe..02126cbc541f 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.hxx
@@ -84,6 +84,7 @@ AtkObject * atk_object_wrapper_new(
void atk_object_wrapper_add_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
+void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role);
void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper);