diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-06-16 16:41:59 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-07-26 20:31:14 +0100 |
commit | c63087a5631e72cd1c45bdc5a41bf605195be64c (patch) | |
tree | 5336167dacb3d88a5d23220d0846f7847605590c /gtk/gtktreeview.c | |
parent | ea0fc7619ddd0ad20cd7c83e3e8c8672004c20c9 (diff) | |
download | gtk+-c63087a5631e72cd1c45bdc5a41bf605195be64c.tar.gz |
Remove ATK
To build a better world sometimes means having to tear the old one down.
-- Alexander Pierce, "Captain America: The Winter Soldier"
ATK served us well for nearly 20 years, but the world has changed, and
GTK has changed with it. Now ATK is mostly a hindrance towards improving
the accessibility stack:
- it maps to a very specific implementation, AT-SPI, which is Linux and
Unix specific
- it requires implementing the same functionality in three different
layers of the stack: AT-SPI, ATK, and GTK
- only GTK uses it; every other Linux and Unix toolkit and application
talks to AT-SPI directly, including assistive technologies
Sadly, we cannot incrementally port GTK to a new accessibility stack;
since ATK insulates us entirely from the underlying implementation, we
cannot replace it piecemeal. Instead, we're going to remove everything
and then incrementally build on a clean slate:
- add an "accessible" interface, implemented by GTK objects directly,
which describe the accessible role and state changes for every UI
element
- add an "assistive technology context" to proxy a native accessibility
API, and assign it to every widget
- implement the AT context depending on the platform
For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r-- | gtk/gtktreeview.c | 61 |
1 files changed, 1 insertions, 60 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 8d03b23af7..5391b78172 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -65,8 +65,6 @@ #include "gtknative.h" #include "gtkpopover.h" -#include "a11y/gtktreeviewaccessibleprivate.h" - #include "gdk/gdkeventsprivate.h" #include "gdk/gdktextureprivate.h" @@ -1613,7 +1611,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_F, GDK_CONTROL_MASK, "start-interactive-search", NULL); - gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TREE_VIEW_ACCESSIBLE); gtk_widget_class_set_css_name (widget_class, I_("treeview")); } @@ -8059,8 +8056,6 @@ gtk_tree_view_row_changed (GtkTreeModel *model, if (tree == NULL) goto done; - _gtk_tree_view_accessible_changed (tree_view, tree, node); - if (priv->fixed_height_mode && priv->fixed_height >= 0) { @@ -8186,8 +8181,6 @@ gtk_tree_view_row_inserted (GtkTreeModel *model, tmpnode = gtk_tree_rbtree_insert_after (tree, tmpnode, height, FALSE); } - _gtk_tree_view_accessible_add (tree_view, tree, tmpnode); - done: if (height > 0) { @@ -8248,12 +8241,10 @@ gtk_tree_view_row_has_child_toggled (GtkTreeModel *model, if (has_child) { GTK_TREE_RBNODE_SET_FLAG (node, GTK_TREE_RBNODE_IS_PARENT); - _gtk_tree_view_accessible_add_state (tree_view, tree, node, GTK_CELL_RENDERER_EXPANDABLE); } else { GTK_TREE_RBNODE_UNSET_FLAG (node, GTK_TREE_RBNODE_IS_PARENT); - _gtk_tree_view_accessible_remove_state (tree_view, tree, node, GTK_CELL_RENDERER_EXPANDABLE); } if (has_child && priv->is_list) @@ -8386,15 +8377,10 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, if (priv->tree == tree) priv->tree = NULL; - _gtk_tree_view_accessible_remove_state (tree_view, - tree->parent_tree, tree->parent_node, - GTK_CELL_RENDERER_EXPANDED); - _gtk_tree_view_accessible_remove (tree_view, tree, NULL); gtk_tree_rbtree_remove (tree); } else { - _gtk_tree_view_accessible_remove (tree_view, tree, node); gtk_tree_rbtree_remove_node (tree, node); } @@ -8469,8 +8455,6 @@ gtk_tree_view_rows_reordered (GtkTreeModel *model, gtk_tree_rbtree_reorder (tree, new_order, len); - _gtk_tree_view_accessible_reorder (tree_view); - gtk_widget_queue_draw (GTK_WIDGET (tree_view)); gtk_tree_view_dy_to_top_row (tree_view); @@ -9208,10 +9192,6 @@ _gtk_tree_view_set_focus_column (GtkTreeView *tree_view, return; priv->focus_column = column; - - _gtk_tree_view_accessible_update_focus_column (tree_view, - old_column, - column); } /* x and y are the mouse position @@ -10378,7 +10358,6 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, { priv->tree = gtk_tree_rbtree_new (); gtk_tree_view_build_tree (tree_view, priv->tree, &iter, 1, FALSE); - _gtk_tree_view_accessible_add (tree_view, priv->tree, NULL); } gtk_tree_path_free (path); @@ -10388,14 +10367,6 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, gtk_tree_view_real_set_cursor (tree_view, NULL, CURSOR_INVALID); - { - GtkTreeViewAccessible *accessible = - GTK_TREE_VIEW_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (tree_view))); - - if (accessible != NULL) - gtk_tree_view_accessible_update_model (accessible, priv->model); - } - g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_MODEL]); if (priv->selection) @@ -10723,7 +10694,6 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view, GtkTreeViewColumn *column) { GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); - guint position; g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), -1); g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), -1); @@ -10747,8 +10717,6 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view, G_CALLBACK (column_sizing_notify), tree_view); - position = g_list_index (priv->columns, column); - _gtk_tree_view_column_unset_tree_view (column); priv->columns = g_list_remove (priv->columns, column); @@ -10770,8 +10738,6 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } - _gtk_tree_view_accessible_remove_column (tree_view, column, position); - g_object_unref (column); g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); @@ -10837,8 +10803,6 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } - _gtk_tree_view_accessible_add_column (tree_view, column, position); - g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); return priv->n_columns; @@ -11059,8 +11023,6 @@ gtk_tree_view_move_column_after (GtkTreeView *tree_view, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); - _gtk_tree_view_accessible_reorder_column (tree_view, column); - g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); } @@ -11539,11 +11501,6 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, gtk_tree_path_get_depth (path) + 1, open_all); - _gtk_tree_view_accessible_add (tree_view, node->children, NULL); - _gtk_tree_view_accessible_add_state (tree_view, - tree, node, - GTK_CELL_RENDERER_EXPANDED); - install_presize_handler (tree_view); g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path); @@ -11676,11 +11633,6 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, /* Stop a pending double click */ gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->click_gesture)); - _gtk_tree_view_accessible_remove (tree_view, node->children, NULL); - _gtk_tree_view_accessible_remove_state (tree_view, - tree, node, - GTK_CELL_RENDERER_EXPANDED); - gtk_tree_rbtree_remove (node->children); if (cursor_changed) @@ -11905,13 +11857,7 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); if (!(flags & CURSOR_INVALID) && priv->cursor_node) - { - _gtk_tree_view_accessible_remove_state (tree_view, - priv->cursor_tree, - priv->cursor_node, - GTK_CELL_RENDERER_FOCUSED); - gtk_widget_queue_draw (GTK_WIDGET (tree_view)); - } + gtk_widget_queue_draw (GTK_WIDGET (tree_view)); /* One cannot set the cursor on a separator. Also, if * _gtk_tree_view_find_node returns TRUE, it ran out of tree @@ -11967,11 +11913,6 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, priv->cursor_node); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } - - _gtk_tree_view_accessible_add_state (tree_view, - priv->cursor_tree, - priv->cursor_node, - GTK_CELL_RENDERER_FOCUSED); } if (!gtk_widget_in_destruction (GTK_WIDGET (tree_view))) |