testatcontext: Print out platform changes

This helps debugging what changes orca sees.
This commit is contained in:
Matthias Clasen 2021-04-16 22:18:52 -04:00
parent 5e3e1dd6ba
commit a04ce41799

View File

@ -78,12 +78,34 @@ gtk_test_at_context_state_change (GtkATContext *self,
}
}
static void
gtk_test_at_context_platform_change (GtkATContext *self,
GtkAccessiblePlatformChange changed_platform)
{
if (GTK_DEBUG_CHECK (A11Y))
{
GtkAccessible *accessible;
accessible = gtk_at_context_get_accessible (self);
g_print ("*** Accessible platform state changed for accessible “%s”:\n",
G_OBJECT_TYPE_NAME (accessible));
if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE)
g_print ("*** focusable = %d\n",
gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE));
if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED)
g_print ("*** focused = %d\n",
gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED));
}
}
static void
gtk_test_at_context_class_init (GtkTestATContextClass *klass)
{
GtkATContextClass *context_class = GTK_AT_CONTEXT_CLASS (klass);
context_class->state_change = gtk_test_at_context_state_change;
context_class->platform_change = gtk_test_at_context_platform_change;
}
static void