[gtk+/gtk-3-16] inspector: show accessible name and description



commit e497363d608e83bc3926ae760e248945e6169dde
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Thu Mar 19 12:00:01 2015 +0100

    inspector: show accessible name and description

 gtk/inspector/misc-info.c    |   14 ++++++++
 gtk/inspector/misc-info.ui   |   68 ++++++++++++++++++++++++++++++++++++++++++
 gtk/inspector/misc-info.ui.h |    2 +
 3 files changed, 84 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/misc-info.c b/gtk/inspector/misc-info.c
index d390c16..c3496b8 100644
--- a/gtk/inspector/misc-info.c
+++ b/gtk/inspector/misc-info.c
@@ -63,6 +63,10 @@ struct _GtkInspectorMiscInfoPrivate {
   GtkWidget *framecount;
   GtkWidget *accessible_role_row;
   GtkWidget *accessible_role;
+  GtkWidget *accessible_name_row;
+  GtkWidget *accessible_name;
+  GtkWidget *accessible_description_row;
+  GtkWidget *accessible_description;
   GtkWidget *mapped_row;
   GtkWidget *mapped;
   GtkWidget *realized_row;
@@ -316,6 +320,8 @@ update_info (gpointer data)
       accessible = ATK_OBJECT (gtk_widget_get_accessible (GTK_WIDGET (sl->priv->object)));
       role = atk_object_get_role (accessible);
       gtk_label_set_text (GTK_LABEL (sl->priv->accessible_role), atk_role_get_name (role));
+      gtk_label_set_text (GTK_LABEL (sl->priv->accessible_name), atk_object_get_name (accessible));
+      gtk_label_set_text (GTK_LABEL (sl->priv->accessible_description), atk_object_get_description 
(accessible));
       gtk_widget_set_visible (sl->priv->mapped, gtk_widget_get_mapped (GTK_WIDGET (sl->priv->object)));
       gtk_widget_set_visible (sl->priv->realized, gtk_widget_get_realized (GTK_WIDGET (sl->priv->object)));
       gtk_widget_set_visible (sl->priv->is_toplevel, gtk_widget_is_toplevel (GTK_WIDGET (sl->priv->object)));
@@ -407,6 +413,8 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
       gtk_widget_show (sl->priv->mnemonic_label_row);
       gtk_widget_show (sl->priv->tick_callback_row);
       gtk_widget_show (sl->priv->accessible_role_row);
+      gtk_widget_show (sl->priv->accessible_name_row);
+      gtk_widget_show (sl->priv->accessible_description_row);
       gtk_widget_show (sl->priv->mapped_row);
       gtk_widget_show (sl->priv->realized_row);
       gtk_widget_show (sl->priv->is_toplevel_row);
@@ -426,6 +434,8 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
       gtk_widget_hide (sl->priv->clip_area_row);
       gtk_widget_hide (sl->priv->tick_callback_row);
       gtk_widget_hide (sl->priv->accessible_role_row);
+      gtk_widget_hide (sl->priv->accessible_name_row);
+      gtk_widget_hide (sl->priv->accessible_description_row);
       gtk_widget_hide (sl->priv->mapped_row);
       gtk_widget_hide (sl->priv->realized_row);
       gtk_widget_hide (sl->priv->is_toplevel_row);
@@ -581,6 +591,10 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, framerate);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_role_row);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_role);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_name_row);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_name);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, 
accessible_description_row);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, accessible_description);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, mapped_row);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, mapped);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, realized_row);
diff --git a/gtk/inspector/misc-info.ui b/gtk/inspector/misc-info.ui
index c51814d..558188e 100644
--- a/gtk/inspector/misc-info.ui
+++ b/gtk/inspector/misc-info.ui
@@ -492,6 +492,74 @@
                 </child>
 
                 <child>
+                  <object class="GtkListBoxRow" id="accessible_name_row">
+                    <property name="visible">true</property>
+                    <property name="activatable">false</property>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="visible">true</property>
+                        <property name="orientation">horizontal</property>
+                        <property name="margin">10</property>
+                        <property name="spacing">40</property>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">true</property>
+                            <property name="label" translatable="yes">Accessible name</property>
+                            <property name="halign">start</property>
+                            <property name="valign">baseline</property>
+                            <property name="xalign">0</property>
+                          </object>
+                          <packing>
+                            <property name="expand">true</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="accessible_name">
+                            <property name="visible">true</property>
+                            <property name="halign">end</property>
+                            <property name="valign">baseline</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+
+                <child>
+                  <object class="GtkListBoxRow" id="accessible_description_row">
+                    <property name="visible">true</property>
+                    <property name="activatable">false</property>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="visible">true</property>
+                        <property name="orientation">horizontal</property>
+                        <property name="margin">10</property>
+                        <property name="spacing">40</property>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">true</property>
+                            <property name="label" translatable="yes">Accessible description</property>
+                            <property name="halign">start</property>
+                            <property name="valign">baseline</property>
+                            <property name="xalign">0</property>
+                          </object>
+                          <packing>
+                            <property name="expand">true</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="accessible_description">
+                            <property name="visible">true</property>
+                            <property name="halign">end</property>
+                            <property name="valign">baseline</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+
+                <child>
                   <object class="GtkListBoxRow" id="mapped_row">
                     <property name="visible">true</property>
                     <property name="activatable">false</property>
diff --git a/gtk/inspector/misc-info.ui.h b/gtk/inspector/misc-info.ui.h
index d843c09..2c00397 100644
--- a/gtk/inspector/misc-info.ui.h
+++ b/gtk/inspector/misc-info.ui.h
@@ -13,6 +13,8 @@ N_("Tick callback");
 N_("Frame count");
 N_("Frame rate");
 N_("Accessible role");
+N_("Accessible name");
+N_("Accessible description");
 N_("Mapped");
 N_("Realized");
 N_("Is Toplevel");


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