[gtk/matthiasc/a11y-logging: 1/4] testatcontext: Print role nicks



commit 7b520a58368a16819f9225a91ba603df75004076
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 17 12:42:24 2020 -0400

    testatcontext: Print role nicks
    
    This makes for easier reading.

 gtk/gtktestatcontext.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktestatcontext.c b/gtk/gtktestatcontext.c
index 8ca3068ef9..78e13bab59 100644
--- a/gtk/gtktestatcontext.c
+++ b/gtk/gtktestatcontext.c
@@ -26,6 +26,7 @@
 #include "gtkenums.h"
 #include "gtkprivate.h"
 #include "gtkdebug.h"
+#include "gtktypebuiltins.h"
 
 struct _GtkTestATContext
 {
@@ -50,15 +51,21 @@ gtk_test_at_context_state_change (GtkATContext                *self,
   char *relations_str = gtk_accessible_attribute_set_to_string (relations);
 
   GTK_NOTE(A11Y,
-   g_print ("*** Accessible state changed for accessible “%s”, with role %d:\n"
+    {
+       GEnumClass *class = g_type_class_ref (GTK_TYPE_ACCESSIBLE_ROLE);
+       GEnumValue *value = g_enum_get_value (class, role);
+       g_print ("*** Accessible state changed for accessible “%s”, with role “%s” (%d):\n"
             "***     states = %s\n"
             "*** properties = %s\n"
             "***  relations = %s\n",
              G_OBJECT_TYPE_NAME (accessible),
+            value->value_nick,
             role,
             states_str,
             properties_str,
-            relations_str));
+            relations_str);
+       g_type_class_unref (class);
+    });
 
   g_free (states_str);
   g_free (properties_str);


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