Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "SWT/Devel/Gtk/Atk"
Line 3: | Line 3: | ||
== Developing ATK == | == Developing ATK == | ||
− | + | ATK is contained in it's own ATK.java file, separate from OS.java. It has it's own atk_custom.h and atk_custom.c where you add custom code. | |
Much of the core code is located in: | Much of the core code is located in: | ||
Line 9: | Line 9: | ||
== Notion of 'Roles' == | == Notion of 'Roles' == | ||
− | SWT widgets are made up of | + | SWT widgets are made up of GTK widgets. GTK widgets made made of multiple parts (e.g a Table has many Cells). Each widget part can have a role. |
E.g Table-header role, cell role, Row-header role etc... | E.g Table-header role, cell role, Row-header role etc... | ||
Line 15: | Line 15: | ||
[https://developer.gnome.org/atk/unstable/AtkObject.html#AtkRole] | [https://developer.gnome.org/atk/unstable/AtkObject.html#AtkRole] | ||
− | SWT generally makes use of these roles, but in AccessibleObject it converts | + | SWT generally makes use of these roles, but in AccessibleObject it converts ATK roles to SWT roles that can then be used by people who develop SWT applications and make custom widgets. |
== ATK Versioning == | == ATK Versioning == | ||
− | ATK has a separate version line from | + | ATK has a separate version line from GTK. In GTK we have a way to test for the version of GTK by using GTK_VERSION() macro. |
− | + | ATK has a similar notion atk_major_version(). .. [https://developer.gnome.org/atk/unstable/atk-Versioning-Utilities.html]. | |
− | However the issue there is that those function and macros were introduced in | + | However the issue there is that those function and macros were introduced in ATK 2.74. At the time of writing (2018.08.22) SWT supports GTK2.24, which has a minimum requirement of ATK 1.3. This means that we can't directly check which version of ATK we are using. |
− | This means that we can't directly check which version of | + | |
− | However, if you checkout the | + | However, if you checkout the GTK git repository and inspect ''configure.ac'', you will observe that it lists the minimum ATK version. Based on that you know that given a certain minimum GTK version you can expect a minimum ATK version. Thus you can use GTK_VERSION() function in your ATK Java code. |
− | An example listing | + | An example listing: |
− | + | GTK2.18 required ATK 1.13.0 | |
− | + | GTK3.0 - ATK 1.3 | |
− | + | GTK3.2 - ATK 2.1.5 | |
− | + | GTK3.4 - ATK 2.2 | |
− | + | GTK3.6 - ATK 2.5.8 | |
− | + | GTK3.8 - ATK 2.7.5 | |
− | + | GTK3.10 - ATK 2.7.5 | |
− | + | GTK3.14 - ATK 2.12.0 | |
== Testing ATK == | == Testing ATK == |
Latest revision as of 14:14, 22 August 2018
Contents
About ATK Accessibility Tool Kit
SWT has build in accessibility support. For example you can use Orca Screen reader : [1] to read out loud controls that your mouse hovers over.
Developing ATK
ATK is contained in it's own ATK.java file, separate from OS.java. It has it's own atk_custom.h and atk_custom.c where you add custom code.
Much of the core code is located in:
org.eclipse.swt.accessibility.AccessibleObject
Notion of 'Roles'
SWT widgets are made up of GTK widgets. GTK widgets made made of multiple parts (e.g a Table has many Cells). Each widget part can have a role. E.g Table-header role, cell role, Row-header role etc...
A complete list of roles can be found here: [2]
SWT generally makes use of these roles, but in AccessibleObject it converts ATK roles to SWT roles that can then be used by people who develop SWT applications and make custom widgets.
ATK Versioning
ATK has a separate version line from GTK. In GTK we have a way to test for the version of GTK by using GTK_VERSION() macro.
ATK has a similar notion atk_major_version(). .. [3]. However the issue there is that those function and macros were introduced in ATK 2.74. At the time of writing (2018.08.22) SWT supports GTK2.24, which has a minimum requirement of ATK 1.3. This means that we can't directly check which version of ATK we are using.
However, if you checkout the GTK git repository and inspect configure.ac, you will observe that it lists the minimum ATK version. Based on that you know that given a certain minimum GTK version you can expect a minimum ATK version. Thus you can use GTK_VERSION() function in your ATK Java code.
An example listing:
GTK2.18 required ATK 1.13.0 GTK3.0 - ATK 1.3 GTK3.2 - ATK 2.1.5 GTK3.4 - ATK 2.2 GTK3.6 - ATK 2.5.8 GTK3.8 - ATK 2.7.5 GTK3.10 - ATK 2.7.5 GTK3.14 - ATK 2.12.0
Testing ATK
When changing ATK, it's recommended to run Orca screen reader to confirm that it's still working well.
In addition, you can use Accerciser ( https://wiki.gnome.org/action/show/Apps/Accerciser?action=show&redirect=Accerciser ) as an inspector tool. It should show the accessibility hierarchy of things.