[gnome-contacts: 16/35] Improve a11y implementation



commit 42012f6ffd1ee3e1ab8796cd65b17490dcded6cb
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 4 06:27:46 2013 -0500

    Improve a11y implementation
    
    Set the role to ATK_ROLE_LIST_BOX, and add the state
    ATK_STATE_MANAGES_DESCENDANTS.

 egg-list-box-accessible.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/egg-list-box-accessible.c b/egg-list-box-accessible.c
index 56e29fc..84485e9 100644
--- a/egg-list-box-accessible.c
+++ b/egg-list-box-accessible.c
@@ -29,8 +29,36 @@ egg_list_box_accessible_init (EggListBoxAccessible *accessible)
 }
 
 static void
+egg_list_box_accessible_initialize (AtkObject *obj,
+                                    gpointer   data)
+{
+  ATK_OBJECT_CLASS (egg_list_box_accessible_parent_class)->initialize (obj, data);
+
+  obj->role = ATK_ROLE_LIST_BOX;
+}
+
+static AtkStateSet*
+egg_list_box_accessible_ref_state_set (AtkObject *obj)
+{
+  AtkStateSet *state_set;
+  GtkWidget *widget;
+
+  state_set = ATK_OBJECT_CLASS (egg_list_box_accessible_parent_class)->ref_state_set (obj);
+  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
+
+  if (widget != NULL)
+    atk_state_set_add_state (state_set, ATK_STATE_MANAGES_DESCENDANTS);
+
+  return state_set;
+}
+
+static void
 egg_list_box_accessible_class_init (EggListBoxAccessibleClass *klass)
 {
+  AtkObjectClass *object_class = ATK_OBJECT_CLASS (klass);
+
+  object_class->initialize = egg_list_box_accessible_initialize;
+  object_class->ref_state_set = egg_list_box_accessible_ref_state_set;
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]