mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
a11y: Add paragraph role
Add new GTK_ACCESSIBLE_ROLE_PARAGRAPH role for paragraphs. ARIA has a paragraph role as well. The paragraph role is used e.g. in document editors like LibreOffice or web browsers like Firefox. According to the ARIA spec [1], naming paragraphs is forbidden (§ 5.2.8.6), and the superclass role is section. This role will be more useful once a way to expose the textual data via the AT-SPI Text interface is also available (s. issue #5912 [2]). [1] https://www.w3.org/TR/wai-aria-1.2/ [2] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912
This commit is contained in:
parent
8ff4e27103
commit
9f078bd5c9
@ -171,6 +171,9 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
|
||||
case GTK_ACCESSIBLE_ROLE_OPTION:
|
||||
return ATSPI_ROLE_OPTION_PANE;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_PARAGRAPH:
|
||||
return ATSPI_ROLE_PARAGRAPH;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_PRESENTATION:
|
||||
return ATSPI_ROLE_INVALID;
|
||||
|
||||
|
@ -832,6 +832,7 @@ static const char *role_names[] = {
|
||||
[GTK_ACCESSIBLE_ROLE_WINDOW] = NC_("accessibility", "window"),
|
||||
[GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON] = NC_("accessibility", "toggle button"),
|
||||
[GTK_ACCESSIBLE_ROLE_APPLICATION] = NC_("accessibility", "application"),
|
||||
[GTK_ACCESSIBLE_ROLE_PARAGRAPH] = NC_("accessibility", "paragraph"),
|
||||
};
|
||||
|
||||
/*< private >
|
||||
@ -912,6 +913,7 @@ static struct {
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_APPLICATION },
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_DOCUMENT },
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_GENERIC },
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_PARAGRAPH },
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_PRESENTATION },
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_RANGE },
|
||||
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_ROW_GROUP },
|
||||
|
@ -1103,6 +1103,7 @@ static guint8 naming[] = {
|
||||
[GTK_ACCESSIBLE_ROLE_WINDOW] = NAME_FROM_AUTHOR,
|
||||
[GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON] = NAME_FROM_AUTHOR|GTK_ACCESSIBLE_NAME_REQUIRED,
|
||||
[GTK_ACCESSIBLE_ROLE_APPLICATION] = NAME_FROM_AUTHOR|GTK_ACCESSIBLE_NAME_REQUIRED,
|
||||
[GTK_ACCESSIBLE_ROLE_PARAGRAPH] = GTK_ACCESSIBLE_NAME_PROHIBITED,
|
||||
};
|
||||
|
||||
/* < private >
|
||||
|
@ -1362,6 +1362,8 @@ typedef enum {
|
||||
* @GTK_ACCESSIBLE_ROLE_APPLICATION: A toplevel element of a graphical user interface.
|
||||
* This is the role that GTK uses by default for windows.
|
||||
* Since: 4.12
|
||||
* @GTK_ACCESSIBLE_ROLE_PARAGRAPH: A paragraph of content.
|
||||
* Since: 4.14
|
||||
*
|
||||
* The accessible role for a [iface@Accessible] implementation.
|
||||
*
|
||||
@ -1448,7 +1450,8 @@ typedef enum {
|
||||
GTK_ACCESSIBLE_ROLE_WIDGET,
|
||||
GTK_ACCESSIBLE_ROLE_WINDOW,
|
||||
GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON GDK_AVAILABLE_ENUMERATOR_IN_4_10,
|
||||
GTK_ACCESSIBLE_ROLE_APPLICATION GDK_AVAILABLE_ENUMERATOR_IN_4_12
|
||||
GTK_ACCESSIBLE_ROLE_APPLICATION GDK_AVAILABLE_ENUMERATOR_IN_4_12,
|
||||
GTK_ACCESSIBLE_ROLE_PARAGRAPH GDK_AVAILABLE_ENUMERATOR_IN_4_14
|
||||
} GtkAccessibleRole;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user