Explicitly set the notebook page object as the accessible parent
of the page, otherwise, AtkObject follows the widget parents chain
and makes the notebook accessible the parent.
This drops the AtkText implementation, and also strips handling
of children out. Instead of listening for enter/leave/press/released,
just listen for state changes on the widget.
The way submenus are handled here isn't really right, since
they can come and go at runtime, but I've left it like this
for now. A side-effect is that we can't use
gtk_widget_class_set_accessible_type here, but have to
override get_accessible.
At the same time, drop the AtkText implementation.
Also, reintroduce a GtkBoxAccessible, since the previous
way of setting the role in get_accessible was affecting
GtkBox subclasses negatively.
Adjust expected test output to match.
We are listening to page-added and emit child_changed::added
in response to that, so don't let the add_gtk handler add
extraneous extra signal emissions. This fixes the child-handling
test for GtkNotebook.
Selection count is tested via assertions and can be inferred from
looking at the number of selected children.
And I'd like to reduce the output of the tests. We're outputting way too
much anyway.
Check that number of selected children == number of children that
actually are selected. If that's not the case, assert, to avoid people
being careless about adding tests.
We used to keep the GtkNotebook, but that causes issues at creation time
of the GailNotebook, when the GtkNotebook does not yet have an
accessible set and so it can't be queried.
Previously, the code tried to track the indexes of the pages and keep
them up to date in a list and tracking the index in the
GtkNotebookPage. Now, we store the widget we are tracking in the
GailNotebookPage and keep a hash table of widget=>GailNotebookPage in the
GailNotebook. This frees us from the burden of tracking page changes.
It is now done by the GailNotebook. Previously it tried to do it itself.
Also, we now use GtkNotebook::page-removed to track the removal, as
opposed to child::parent-set.