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/gtkmodelbutton.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/gtkmodelbutton.c')
-rw-r--r-- | gtk/gtkmodelbutton.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c index c577accb6b..815493a994 100644 --- a/gtk/gtkmodelbutton.c +++ b/gtk/gtkmodelbutton.c @@ -421,15 +421,6 @@ gtk_model_button_update_state (GtkModelButton *self) indicator_state = get_start_indicator_state (self); if (self->iconic) gtk_widget_set_state_flags (GTK_WIDGET (self), indicator_state, TRUE); - - if (self->role == GTK_BUTTON_ROLE_CHECK || - self->role == GTK_BUTTON_ROLE_RADIO) - { - AtkObject *object = _gtk_widget_peek_accessible (GTK_WIDGET (self)); - if (object) - atk_object_notify_state_change (object, ATK_STATE_CHECKED, - (indicator_state & GTK_STATE_FLAG_CHECKED)); - } } static void @@ -456,21 +447,16 @@ gtk_model_button_direction_changed (GtkWidget *widget, static void update_node_name (GtkModelButton *self) { - AtkObject *accessible; - AtkRole a11y_role; const char *start_name; const char *end_name; - accessible = gtk_widget_get_accessible (GTK_WIDGET (self)); switch (self->role) { case GTK_BUTTON_ROLE_TITLE: - a11y_role = ATK_ROLE_PUSH_BUTTON; start_name = "arrow"; end_name = NULL; break; case GTK_BUTTON_ROLE_NORMAL: - a11y_role = ATK_ROLE_PUSH_BUTTON; start_name = NULL; if (self->menu_name || self->popover) end_name = "arrow"; @@ -479,13 +465,11 @@ update_node_name (GtkModelButton *self) break; case GTK_BUTTON_ROLE_CHECK: - a11y_role = ATK_ROLE_CHECK_BOX; start_name = "check"; end_name = NULL; break; case GTK_BUTTON_ROLE_RADIO: - a11y_role = ATK_ROLE_RADIO_BUTTON; start_name = "radio"; end_name = NULL; break; @@ -500,8 +484,6 @@ update_node_name (GtkModelButton *self) end_name = NULL; } - atk_object_set_role (accessible, a11y_role); - if (start_name && !self->start_indicator) { self->start_indicator = gtk_builtin_icon_new (start_name); @@ -1067,18 +1049,6 @@ gtk_model_button_focus (GtkWidget *widget, return FALSE; } -static AtkObject * -gtk_model_button_get_accessible (GtkWidget *widget) -{ - AtkObject *object; - - object = GTK_WIDGET_CLASS (gtk_model_button_parent_class)->get_accessible (widget); - - gtk_model_button_update_state (GTK_MODEL_BUTTON (widget)); - - return object; -} - static void gtk_model_button_class_init (GtkModelButtonClass *class) { @@ -1093,7 +1063,6 @@ gtk_model_button_class_init (GtkModelButtonClass *class) widget_class->state_flags_changed = gtk_model_button_state_flags_changed; widget_class->direction_changed = gtk_model_button_direction_changed; widget_class->focus = gtk_model_button_focus; - widget_class->get_accessible = gtk_model_button_get_accessible; class->clicked = gtk_model_button_clicked; @@ -1231,7 +1200,6 @@ gtk_model_button_class_init (GtkModelButtonClass *class) widget_class->activate_signal = signals[SIGNAL_CLICKED]; - gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_PUSH_BUTTON); gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT); gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (class), I_("modelbutton")); } |