Blame accessibility-devel-guide/zh_CN/index.docbook

Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
]>
Packit 1470ea
Packit 1470ea
<book id="index" lang="zh-CN">
Packit 1470ea
<title>GNOME 辅助功能开发者指南</title>
Packit 1470ea
<bookinfo>
Packit 1470ea
<abstract role="description">
Packit 1470ea
<para>GNOME 辅助功能指南是为那些想确保自己的程序能为更广泛的用户使用的开发人员准备的。本指南同时涵盖了许多第508节的要求。</para>
Packit 1470ea
</abstract>
Packit 1470ea
<copyright><year>2008</year> <holder>Vincent Alexander</holder></copyright>
Packit 1470ea
<copyright><year>2001, 2002</year> <holder>Calum Benson, Brian Cameron, Bill Haneman, Padraig O'Briain, Sharon Snider</holder></copyright>
Packit 1470ea
<publisher role="maintainer"> 
Packit 1470ea
<publishername>GNOME 文档项目</publishername> 
Packit 1470ea
</publisher>
Packit 1470ea
<legalnotice id="legalnotice">
Packit 1470ea
<para>在自由软件基金会发表的 GNU 自由文档许可证(GFDL)条款的约束下,此文档可以复制、分发和修改。许可证版本应为 1.1 或更新,章节应未加篡改,封面未经涂写。您可以从<ulink type="help" url="ghelp:fdl"> 这里</ulink>下载一份 GFDL,或从本手册附带的 COPYING-DOCS 文件中获取它。</para>
Packit 1470ea
<para>此手册是 GNOME 手册系列的一部分,依照 GFDL 发布。如果想单独分发此手册,您需要向手册添加一份许可证协议,如许可证第 6 节所述。</para>
Packit 1470ea
<para>许多名字被各公司注册为商标,以区别它们的产品和服务。任何 GNOME 文档中出现这些名字时,Gnome 文档项目作者都对它们加以留意,将其全名大写或首字母大写。</para>
Packit 1470ea
<para>DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES.</para>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist></para>
Packit 1470ea
</legalnotice>
Packit 1470ea
 
Packit 1470ea
<authorgroup> 
Packit 1470ea
<author><firstname>Vincent</firstname> <surname>Alexander</surname> <affiliation> <orgname>GNOME 文档项目</orgname> </affiliation></author>
Packit 1470ea
<author><firstname>Calum</firstname> <surname>Benson</surname> <affiliation> <orgname>GNOME 文档项目</orgname> </affiliation></author>
Packit 1470ea
<author><firstname>Brian</firstname> <surname>Cameron</surname> <affiliation> <orgname>GNOME 文档项目</orgname> </affiliation></author>
Packit 1470ea
<author><firstname>Bill</firstname> <surname>Haneman</surname> <affiliation> <orgname>GNOME 文档项目</orgname> </affiliation></author>
Packit 1470ea
<author><firstname>Padraig</firstname> <surname>O'Briain</surname> <affiliation> <orgname>GNOME 文档项目</orgname> </affiliation></author> 
Packit 1470ea
<author><firstname>Sharon</firstname> <surname>Snider</surname> <affiliation> <orgname>GNOME 文档项目</orgname> </affiliation></author>
Packit 1470ea
</authorgroup>
Packit 1470ea
<revhistory>
Packit 1470ea
<revision><revnumber> GNOME 2.24 辅助功能开发者指南 V2.24.0 </revnumber> <date>2008年9月</date> <revdescription> 
Packit 1470ea
<para role="author">GNOME 文档项目</para> 
Packit 1470ea
<para role="publisher">GNOME 文档项目</para> 
Packit 1470ea
</revdescription></revision>
Packit 1470ea
<revision><revnumber> GNOME 2.24 辅助功能开发者指南 V2.24.0 </revnumber> <date>2008年9月</date> <revdescription> 
Packit 1470ea
<para role="author">GNOME 文档项目</para> 
Packit 1470ea
<para role="publisher">GNOME 文档项目</para> 
Packit 1470ea
</revdescription></revision>
Packit 1470ea
</revhistory>
Packit 1470ea
<releaseinfo>本手册描述 GNOME 2.24 桌面。</releaseinfo>
Packit 1470ea
<legalnotice> 
Packit 1470ea
<title>反馈</title> 
Packit 1470ea
<para>报告 bug 或者为 GNOME 桌面和本手册提供建议, 请点击 <ulink type="help" url="ghelp:user-guide?feedback">GNOME 反馈页面</ulink>.</para>
Packit 1470ea
</legalnotice> 
Packit 1470ea
Packit 1470ea
    <othercredit class="translator">
Packit 1470ea
      <personname>
Packit 1470ea
        <firstname>keyring</firstname>
Packit 1470ea
      </personname>
Packit 1470ea
      <email>keyrings@163.com</email>
Packit 1470ea
    </othercredit>
Packit 1470ea
    <copyright>
Packit 1470ea
      
Packit 1470ea
        <year>2013</year>
Packit 1470ea
      
Packit 1470ea
      <holder>keyring</holder>
Packit 1470ea
    </copyright>
Packit 1470ea
  </bookinfo>
Packit 1470ea
<chapter id="gad" status="draft">
Packit 1470ea
<title>什么是辅助功能?</title>
Packit 1470ea
<para>辅助功能是指协助残疾人士参与大量日常活动,包括日常工作以及服务、产品、资讯的使用。GNOME 包含一系列库与支持框架能让残疾人士使用 GNOME 用户环境的所有功能。</para>
Packit 1470ea
<para>因此,必要时综合利用辅助技术——语音接口,屏幕阅读器,复用输入设备等等——可以帮助那些永久性或暂时性残疾人士便捷地使用 GNOME 桌面和应用程序。辅助技术对那些不在家里或办公室中使用电脑的人也非常有用。比如,如果你被堵在车流之中,你可以使用语音输入和输出来查阅你的电子邮件。</para>
Packit 1470ea
<para>辅助技术通过使用辅助工具包 (ATK) 的 API 接收来自应用程序的信息,ATK 可以在 GNOME 仓库中找到。由于辅助 API 内置到了 GNOME 的 widgets 中,所以你不需做额外工作就可以让你的 GNOME 程序合理运行在辅助技术上。例如,辅助技术能够自动读取你设置在程序中的部件的标签(比如 GTK 的函数调用:<function>gtk_label_set_text()</function> 或者 <function>gtk_button_new_with_label()</function>)。它们也能找到与某个部件相关联的任何提示文本,然后使用该文本来向用户描述那个部件。</para>
Packit 1470ea
<para>当然,你也可以多花点心思,利用辅助技术来让你的程序运行的更加流畅。这除了可以帮助个人用户,也可以让你的产品在政府部门和教育市场中更具吸引力,因为如今法律要求这个领域的很多应用必须得无障碍。</para>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>残疾类型</title>
Packit 1470ea
<para>仅在美国,大约有3000万人因为不合理设计而无法便利使用电脑。在全球范围下,大约有8%的互联网使用者有不同程度的残疾。残疾可分为以下几种:</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para><emphasis>视觉障碍 </emphasis>——包括弱视(视力昏暗模糊,远/近视,色盲和视力狭窄)到完全失明。一些糟糕的文本字体颜色选择和需要手眼协调的任务(比如移动鼠标)都可能为这些用户造成困难。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para><emphasis>运动障碍 </emphasis>——肌肉控制力差或虚弱到不足以使用标准键鼠。例如,他们可能无法同时按住两个键,或者更容易意外按错。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para><emphasis>听觉障碍 </emphasis>—— 包括弱听而听不懂到完全失聪。那些单靠声音来传达重要信息的应用程序会对这部分用户造成困难。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para><emphasis>认知与语言障碍 </emphasis>——包括阅读障碍与记忆障碍,只靠说写来处理与理解事物。复杂或不一致的显示,或者拙劣的词汇选择都会造成这部分用户使用电脑困难。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para><emphasis>癫痫疾病</emphasis>——对一些敏感的用户,某些光或声音会造成癫痫发作。</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-how-it-works">
Packit 1470ea
<title>辅助功能在 GNOME 中如何工作</title>
Packit 1470ea
<para>辅助工具包 (ATK) 描述了一组接口,要访问它们就需要通过 GUI 组件自行实现。这些接口是工具包无关的,意思就是你可以用任意部件集来实现,比如 GTK,Motif 或者 Qt 。</para>
Packit 1470ea
<para>
Packit 1470ea
The implementation for the GTK widgets is in a module called GAIL (GNOME Accessibility Implementation Library), which is dynamically loadable at runtime by a GTK application. Once
Packit 1470ea
loaded, those parts of your application that use standard GTK widgets will have a basic level of accessibility, without you having to modify your application at all. If GAIL is not
Packit 1470ea
loaded, GTK widgets will have a default accessibility implementation that essentially returns no information, though it nominally conforms to the ATK API. Applications which use
Packit 1470ea
Bonobo controls, particularly out-of-process ones, also load accessibility support code from module libgail-gnome. Whether or not applications on the GNOME desktop automatically load these accessibility support libraries depends on the value of a <application>gconf</application> key, "/desktop/gnome/interface/accessibility"; a boolean value of "true" enables support for assistive technologies and applications which call gnome_program_init will automatically load the appropriate accessibility libraries at runtime. "Pure GTK+ applications", e.g. those that use gtk+ but do not link to libgnome, rely on the value of the GTK_MODULES environment variable, which must be set to "gail:atk-bridge" in order to enable assistive technology support.
Packit 1470ea
</para>
Packit 1470ea
<para>长久以来,大部分其他桌面平台所使用的辅助技术必须为桌面应用维护一个复杂的离屏模式,这种模式基于对操作系统事件的监听,使用不受支持的操作系统、应用程序特性和 API,还有一些其他高度不可移植的技术。这就使得辅助技术支持有点 "不健壮",需要特定的操作系统和指定的应用程序,甚至还要指定的应用程序版本。相反,在 GNOME 桌面,通过 GNOME 辅助功能框架,使用服务提供者接口(SPI)独立工具包,AT(辅助技术) 需要的所有信息均可由运行的应用程序提供。SPI 为基于 UNIX 的 AT 提供一些内置服务,比如屏幕阅读器和屏幕放大镜。通过一致而稳定的 API 从运行的程序中获取辅助信息,可以在大多数情况下避免使用离屏模式。对应用程序的辅助功能支持一般通过合适的 API (比如,ATK 多用于原生C程序而Java辅助 API 用于Java 应用)内置在应用程序工具包中,然后通过相应的 "bridge" 导出成通用 "AT-SPI" 接口(见下图)。</para>
Packit 1470ea
<figure id="gad-architecture">
Packit 1470ea
<title>GNOME 辅助功能架构</title>
Packit 1470ea
<mediaobject><imageobject> <imagedata fileref="figures/GNOME_desktop_Accessibility.png" format="PNG"/> </imageobject> <textobject> <phrase> GNOME 辅助功能架构图解</phrase> </textobject></mediaobject>
Packit 1470ea
</figure>
Packit 1470ea
<para>GNOME 内置辅助功能支持意味着使用 GNOME 部件创建应用程序可以 "免费" 获得辅助技术的支持,而不用额外使用与内置支持相冲突的迂回方法。</para>
Packit 1470ea
<para>如果一个 gtk+/GNOME 部件遵循本文档中的普遍辅助指南,实现了 ATK 接口并在用户界面上扮演合适的角色,则它是具有辅助性的。 ATK 的执行由 "stock" GNOME 部件工具集提供,而且大多数情况下,由现有 GTK+/GNOME 部件派生出来的新部件同时也会继承合适的辅助功能支持。</para>
Packit 1470ea
<para>
Packit 1470ea
Though GNOME's built-in accessibility support provides significant functionality without any accessibility-specific code changes on the part of the application, applications can often improve on the default descriptions provided for some of the widgets, and tailor them to that widget's specific purpose in your application, via straightforward calls to ATK methods in the application. For instance, in most cases applications should add or change the textual descriptions for these widgets with the appropriate ATK function call, so that an assistive technology can describe their purpose or state to the user. See <link linkend="gad-coding-guidelines">Coding Guidelines for Supporting Accessibility</link> for more information.
Packit 1470ea
</para>
Packit 1470ea
<para>如果你的程序使用自定义部件,可能需要做些工作让它们得以使用辅助技术。参阅 <link linkend="gad-custom"> 让自定义组件获得辅助功能 </link> 和 <link linkend="gad-api-examples"> 使用辅助 API 的示例 </link> 获取更多信息。</para>
Packit 1470ea
<para>此外,关于 GTK/GTK+ 更多深入内容,请参阅 <ulink url="http://library.gnome.org/devel/gtk"> GTK+ 参考手册 </ulink>, <ulink url="http://live.gnome.org/GAP/AtkGuide/Gtk">ATK 指南的 GTK 章节</ulink>, GNOME 网站托管的 <ulink url="http://library.gnome.org/devel/gtk-tutorial/stable/">GTK+ 2.0 教程</ulink> 和官方 <ulink url="http://library.gnome.org/devel/gtk-faq/stable/">GTK+ FAQ</ulink>。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dev-start">
Packit 1470ea
<title>开发者快速指南</title>
Packit 1470ea
<para>这有一些常用出发点:</para>
Packit 1470ea
Packit 1470ea
<section id="dev-start-1">
Packit 1470ea
<title>如何确定应用程序是否具有辅助功能?</title>
Packit 1470ea
<para>
Packit 1470ea
To start right in, see <link linkend="gad-overview">Making a GNOME Application Accessible - Overview</link>. For a pre-coding perspective, see <link linkend="gad-ui-guidelines">User Interface Guidelines for Supporting Accessibility</link> or <link linkend="gad-coding-guidelines">Coding Guidelines for Supporting Accessibility</link>. For a checklist of post-design test items, see <link linkend="gad-checklist">User Interface Checklist</link>.
Packit 1470ea
</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dev-start-2">
Packit 1470ea
<title>有哪些常见陷阱?</title>
Packit 1470ea
<para><link linkend="gad-checklist">用户界面审查清单</link>涵盖了所有设计阶段容易被忽略的地方。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dev-start-3">
Packit 1470ea
<title>如何实现常见的 ATK 功能?</title>
Packit 1470ea
<para>可以在<link linkend="gad-api">这里</link>找到一份常见 ATK 调用的简短列表。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dev-start-4">
Packit 1470ea
<title>如何实现更复杂的 ATK 功能?</title>
Packit 1470ea
<para>参考 <link linkend="gad-custom"> 让自定义组件获得辅助功能 </link> 和 <link linkend="gad-api-examples"> 使用辅助功能 API 的示例 </link>来获取更多信息。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dev-start-5">
Packit 1470ea
<title>ATK,、AT-SPI、 GAIL 和 GTK+ 介绍</title>
Packit 1470ea
<screenshot>
Packit 1470ea
<mediaobject><imageobject> <imagedata fileref="figures/gaa.jpg"/> </imageobject> <textobject> <phrase> GNOME 辅助功能架构 </phrase> </textobject></mediaobject>
Packit 1470ea
</screenshot>
Packit 1470ea
<para>ATK 工具包可以提供额外辅助功能支持让 GNOME 使用者充分利用电脑。ATK 用于诸如屏幕阅读器、放大镜和输入设备等工具来允许通过其他方式与桌面进行富交互。详情可参阅 <ulink url="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/atk/package-summary.html"> ATK SourceForge 的项目 </ulink> 和 <ulink url="http://library.gnome.org/devel/atk/stable/">ATK 库</ulink>。</para>
Packit 1470ea
<para>AT-SPI 是基础服务接口,用于辅助技术查询和接收来自正在运行的程序的通知。全部 API 可以查阅 <ulink url="http://library.gnome.org/devel/at-spi-cspi/stable/">here</ulink>。额外材料可参阅 <ulink url="http://accessibility.kde.org/developer/atk.php#coreclasses"> KDE 辅助功能开发者社区 </ulink>。</para>
Packit 1470ea
<para>GAIL (GNOME Accessibility Implementation Library) 是 ATK 辅助功能接口的默认实现。GTK 工具集早已通过 GAIL 模块与 ATK 进行了绑定。许可条款、下载中心和其他信息可参阅 <ulink url="http://www.t2-project.org/packages/gail.html"> 这里 </ulink>。<ulink url="ftp://ftp.gnome.org/pub/GNOME/sources/gail/"> GAIL 源码 </ulink> 也提供了一份出色的教程来说明 ATK 的高级用法。此外,你也可能对 <ulink url="http://library.gnome.org/devel/gail-libgail-util/stable/"> GAIL 参考手册 </ulink>感兴趣。</para>
Packit 1470ea
<para>GTK+ 是个创建图形用户界面的 UI 库。可运行于多种类UNIX平台、Windows和基于帧缓存的设备。GTK+ 在 GNU Library General Public License (GNU LGPL)许可下发行。</para>
Packit 1470ea
<para>此外,关于 GTK/GTK+ 更多深入内容,请参阅 <ulink url="http://library.gnome.org/devel/gtk">GTK+ 参考手册</ulink>,<ulink url="http://wiki.gnome.org/Accessibility/Documentation/GNOME2/AtkGuide/Gtk">ATK 指南的 GTK+ 章节</ulink>, GNOME 网站托管的<ulink url="http://library.gnome.org/devel/gtk-tutorial/stable/">GTK+ 2.0 教程</ulink> 和官方<ulink url="http://library.gnome.org/devel/gtk-faq/stable/">GTK+ FAQ</ulink>。</para>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-overview">
Packit 1470ea
<title>让一个 GNOME 应用程序具有辅助功能 - 综述</title>
Packit 1470ea
<para>如果你的应用程序只使用标准 GTK 部件,你可以做很少甚至不做任何事情就能让程序获得(适当的)辅助功能。但要注意那些没有文字说明的GUI对象,比如没有文本标签的图形按钮或者没有工具提示信息的状态指示器。</para>
Packit 1470ea
<para>
Packit 1470ea
You can probably also improve on the default descriptions provided for some of the widgets, and tailor them to that widget's specific purpose in your application. You should add or change the textual descriptions for these widgets with the appropriate ATK function call, so that an assistive technology can describe their purpose or state to the user. See <link linkend="gad-coding-guidelines">Coding Guidelines for Supporting Accessibility</link> for more information.
Packit 1470ea
</para>
Packit 1470ea
<para>如果你的程序使用自定义部件,可能需要做些工作以使这些部件利用辅助技术。参阅 <link linkend="gad-custom"> 让自定义组件获得辅助功能 </link> 和 <link linkend="gad-api-examples"> 使用辅助功能 API 的示例</link> 获取更多信息。更多详细内容也可参见 Marc Mulcahy 的 2002 GUADEC 演示文档, <ulink url="https://projects.gnome.org/accessibility/talks/GUAD3C/making-apps-accessible/start.html">“制作具有辅助功能的 GNOME 应用程序”。</ulink></para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-coding-guidelines">
Packit 1470ea
<title>获取辅助功能的编程指南</title>
Packit 1470ea
<para>这里列出了一些可以在代码里做的事情,让程序更好的利用辅助技术。(当你想设计GUI的时候,可以看看后文里提到的这份列表 <link linkend="gad-ui-guidelines"> 支持辅助功能的UI </link>):</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>用于那些不显示短字符串的组件(比如图形按钮),使用 <function>atk_object_set_name()</function>为它指定一个名字。你可以用于纯图片按钮、具有逻辑分组的面板、文本区域等等。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>如果你没有为组件提供提示信息,使用 <function>atk_object_set_description()</function> 函数为用户提供一个辅助说明。例如,为一个 <guibutton> 关闭 </guibutton>按钮提供辅助说明:</para>
Packit 1470ea
<example>
Packit 1470ea
<title>为 GtkButton 提供辅助性说明</title>
Packit 1470ea
<programlisting>
Packit 1470ea
{
Packit 1470ea
  AtkObject *obj;
Packit 1470ea
  obj = gtk_widget_get_accessible(button);
Packit 1470ea
  atk_object_set_description(obj,_("Closes the window"));
Packit 1470ea
}
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>使用 <function>atk_image_set_description()</function> 可以为程序中所有图片图标提供一个文本说明。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>如果多个组件逻辑上是一组的,建议将它们放在一个容器里。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Whenever you have a label that describes another component, use <function>atk_relation_set_add_relation()</function> so that assistive technologies can find the component with which the label is associated. (If you associate the label with the component using <function>gtk_label_set_mnemonic_widget()</function>, the <constant>ATK_RELATION_LABEL_FOR</constant> relation is generated automatically, so the following code would not be necessary):
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>为一个 GtkWidget 关联一个 GtkLabel</title>
Packit 1470ea
<programlisting>
Packit 1470ea
{
Packit 1470ea
  GtkWidget *widget;
Packit 1470ea
  GtkLabel *label;
Packit 1470ea
Packit 1470ea
  AtkObject *atk_widget, *atk_label;
Packit 1470ea
  AtkRelationSet *relation_set;
Packit 1470ea
  AtkRelation *relation;
Packit 1470ea
  AtkObject *targets[1];
Packit 1470ea
Packit 1470ea
  atk_widget = gtk_widget_get_accessible(widget);
Packit 1470ea
  atk_label = gtk_widget_get_accessible (GTK_WIDGET(label));
Packit 1470ea
Packit 1470ea
  relation_set = atk_object_ref_relation_set (atk_label);
Packit 1470ea
  targets[0] = atk_widget;
Packit 1470ea
Packit 1470ea
  relation = atk_relation_new(targets,1, ATK_RELATION_LABEL_FOR);
Packit 1470ea
  atk_relation_set_add(relation_set,relation);
Packit 1470ea
  g_object_unref(G_OBJECT(relation));
Packit 1470ea
}
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>如果创建了一个自定义 widget,要确认是否支持辅助功能。自定义组件通常继承于其他 GTK 部件,所以必要时得重写辅助功能信息。更多信息请参考 <link linkend="gad-custom"> 让自定义组件获得辅助功能 </link>。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>不要重复造轮子!如果你的 GUI 有一个非辅助性的容器,那么该容器内的任何组件都可能失去辅助性。</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-api">
Packit 1470ea
<title>辅助功能 API</title>
Packit 1470ea
<para>这里是一部分基础 API 调用,你可以用来确认程序是否利用辅助技术并工作良好。全部的辅助功能 API 非常全面,比如可以让你写出自定义辅助部件。</para>
Packit 1470ea
Packit 1470ea
<title>常用 ATK API 调用</title>
Packit 1470ea
<tgroup cols="2" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>API</entry>
Packit 1470ea
<entry>描述</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>
Packit 1470ea
<para><function>AtkObject* gtk_widget_get_accessible (GtkWidget*)</function></para>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
<para>
Packit 1470ea
Returns the accessible object that describes the specified GTK widget to an assistive technology.
Packit 1470ea
</para>
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>
Packit 1470ea
<para><function>void atk_object_set_name (AtkObject*, const gchar*)</function></para>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
<para>为辅助对象命名。例如,如果对象是个图形按钮,按下会使得程序退出,那你可以为它命名为 "退出"。</para>
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>
Packit 1470ea
<para><function>void atk_object_set_description (AtkObject*, const gchar*)</function></para>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
<para>为辅助对象设置文字说明。例如,如果对象是个图形化的"关闭"按钮,那文字说明可以写成"关闭窗口"。</para>
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>
Packit 1470ea
<para><function>AtkRelation* atk_relation_new (AtkObject**, gint, AtkRelationType)</function></para>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
<para>在指定的键与指定的目标对象列表之间创建一个新的关系。这个关系通常指的是一个部件以某种方式关联到另一个之间的辅助技术。例如,同一个窗口下,有一个特定的 GtkLabel 才是 GtkTreeView 的标题。</para>
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>
Packit 1470ea
<para><function>void atk_image_set_description (AtkImage*, const gchar*)</function></para>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
<para>为图片辅助对象设置文字说明。例如,如果对象是面板内的一个虚拟桌面的缩略图,这个文字说明可以写成 "桌面 1 内的窗口排列图"。</para>
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-api-examples">
Packit 1470ea
<title>使用辅助功能 API 的示例</title>
Packit 1470ea
<para>前文提过,如果使用标准 GTK 部件或者任何其他实现了 ATK 接口的部件库,你可以只做一点甚至不做任何事情就可以让你的应用程序获得辅助功能。这样的话,通常只需做两件事:</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>使用 <function>atk_object_set_description()</function> 或者 <function>atk_image_set_description():</function> 为控件和图片提供文字说明</para>
Packit 1470ea
<example>
Packit 1470ea
<title>为按钮设置辅助功能说明</title>
Packit 1470ea
<programlisting>
Packit 1470ea
{
Packit 1470ea
   AtkObject *obj;
Packit 1470ea
   obj = gtk_widget_get_accessible(button);
Packit 1470ea
   atk_object_set_description(obj,_("Opens Preferences dialog"));
Packit 1470ea
}
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
<para>
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>使用 <function>atk_relation_new()</function> and <function>atk_relation_set_add()</function> 在任意特殊组合中的部件之间指定关系</para>
Packit 1470ea
<example>
Packit 1470ea
<title>在两个控件之间指定辅助关系</title>
Packit 1470ea
<programlisting>
Packit 1470ea
{
Packit 1470ea
  GtkWidget *widget;
Packit 1470ea
  GtkLabel *label;
Packit 1470ea
Packit 1470ea
  AtkObject *atk_widget, *atk_label;
Packit 1470ea
  AtkRelationSet *relation_set;
Packit 1470ea
  AtkRelation *relation;
Packit 1470ea
  AtkObject *targets[1];
Packit 1470ea
Packit 1470ea
  atk_widget = gtk_widget_get_accessible (widget);
Packit 1470ea
  atk_label = gtk_widget_get_accessible (GTK_WIDGET(label));
Packit 1470ea
Packit 1470ea
  relation_set = atk_object_ref_relation_set (atk_label);
Packit 1470ea
  targets[0] = atk_widget;
Packit 1470ea
Packit 1470ea
  relation = atk_relation_new(targets,1, ATK_RELATION_LABEL_FOR);
Packit 1470ea
  atk_relation_set_add(relation_set,relation);
Packit 1470ea
  g_object_unref(G_OBJECT(relation));
Packit 1470ea
}
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
<para>
Packit 1470ea
The examples in the rest of this section are mostly to give you a flavor of the scope of the ATK. They cover techniques that you may never need to use as an application developer, although they may be of interest if you are writing your own custom widgets (see <link linkend="gad-custom">Making Custom Components Accessible</link>) or if you want to write an assistive technology application. Whatever the purpose, the <ulink url="ftp://ftp.gnome.org/pub/GNOME/sources/gail/">GAIL source code</ulink> serves as an excellent tutorial for advanced ATK usage. Please note that since GTK+ 3.1.10, Gail has been merged into GTK+ and is no longer a module on its own.
Packit 1470ea
</para>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>Gtk 模块</title>
Packit 1470ea
<para>程序使用 GAIL(GTK 部件的辅助功能实现库)时,它会被当作 GTK 模块引入程序。GTK 模块在 <varname>GTK_MODULES</varname> 环境变量指定了模块名称时,会被加载到程序空间。如果有多个模块库,以冒号间隔。例如:</para>
Packit 1470ea
<para><userinput>setenv GTK_MODULES "libgail:libtestprops"</userinput></para>
Packit 1470ea
<para>所有 GTK 模块都有一个<function>gtk_module_init()</function> 函数。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>收集一个应用程序的辅助信息</title>
Packit 1470ea
<para>程序若想利用 ATK 调用,需要做下列一件(或以上)的事情:</para>
Packit 1470ea
<orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>创建一个事件监视器,比如使用 <function>atk_add_focus_tracker()</function> 函数:</para>
Packit 1470ea
<programlisting>atk_add_focus_tracker (_my_focus_tracker);</programlisting>
Packit 1470ea
<para> <function>_my_focus_tracker()</function> 函数原型:</para>
Packit 1470ea
<programlisting>void _my_focus_tracker (AtkObject *aobject);</programlisting>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>建立一个全局事件监听器,使用 atk_add_global_event_listener():</para>
Packit 1470ea
<programlisting>
Packit 1470ea
mouse_watcher_focus_id =   atk_add_global_event_listener(_my_global_listener,"Gtk:GtkWidget:enter_notify_event");
Packit 1470ea
</programlisting>
Packit 1470ea
<para><function>_my_global_listener</function> 拥有一个 Glib <type>GSignalEmissionHook</type> 原型。这个例子说明,一个 <type>GtkWidget</type> 对象无论何时触发一个 enter_notify_even 信号,都会调用 <function>_my_global_listener()</function>。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>下列函数调用可以访问 ATK 顶层对象。</para>
Packit 1470ea
<programlisting>AtkObject *root_obj = atk_get_root();</programlisting>
Packit 1470ea
<para>
Packit 1470ea
This returns an <type>AtkObject</type> which contains all toplevel windows in the currently running program. The user could then navigate through the object hierarchy by accessing the root object's children, which corresponds to the toplevel windows.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>查询一个 <type>AtkObject</type> 的接口</title>
Packit 1470ea
<para>在程序中定位到具有辅助性 <type>AtkObject</type> 的对象后 (比如使用 <function>gtk_widget_get_accessible()</function>),你可以用不同方式查到哪些接口已被实现:</para>
Packit 1470ea
<orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>可以使用提供的 <function>ATK_IS_...</function> 宏,例如:</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para><function>ATK_IS_ACTION(atkobj)</function></para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para><function>ATK_IS_COMPONENT(atkobj)</function></para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>等等。(每个接口都有一个)</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
<para>如果宏返回 <function>TRUE</function>,则该接口可安全用于那个 ATK 对象上。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>调用 <function>atk_object_get_role()</function> 来测试 <type>AtkObject</type> 的角色。任何已知角色均有一个指定数字对应 ATK API。</para>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>建立一个 ATK 信号处理函数</title>
Packit 1470ea
<para>使用 <constant>column_inserted</constant> 信号来举例:</para>
Packit 1470ea
<programlisting>
Packit 1470ea
table_column_inserted_id = g_signal_connect_closure_by_id (my_atk_obj, 
Packit 1470ea
g_signal_lookup("column_inserted", G_OBJECT_TYPE(my_atk_obj)), 0, 
Packit 1470ea
g_cclosure_new(G_CALLBACK (_my_table_column_inserted_func), NULL, NULL), FALSE);
Packit 1470ea
</programlisting>
Packit 1470ea
<para>这会使无论何时  <type>AtkObject</type> <varname>my_atk_object</varname> 发出一个 column_inserted 信号,都会调用 <function>_my_table_column_inserted_func()</function>。</para>
Packit 1470ea
<para>
Packit 1470ea
Connecting to a signal is slightly different if the signal supports detail. The <constant>children_changed</constant> signal supports the <parameter>add</parameter> detail. To connect to a signal when the <parameter>add</parameter> detail is also specified, this technique is used:
Packit 1470ea
</para>
Packit 1470ea
<programlisting>
Packit 1470ea
child_added_id = g_signal_connect_closure (my_atk_obj,"children_changed::add",
Packit 1470ea
g_cclosure_new (G_CALLBACK(_my_children_changed_func), NULL, NULL), FALSE);
Packit 1470ea
</programlisting>
Packit 1470ea
<para>
Packit 1470ea
This will cause <function>_my_children_changed_func()</function> to be called whenever a <constant>children_changed</constant> signal with the <parameter>add</parameter> detail is emitted on the <type>AtkObject</type> <varname>my_atk_obj</varname>.
Packit 1470ea
</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>实现一个 ATK 对象</title>
Packit 1470ea
<para>你可能需要为那些未在 GAIL(或者其他部件集中的同等库) 中实现辅助功能的部件亲自动手实现 ATK 对象。该实现应该作为一个 GTK 模块,而且要被包含在  <envar>GTK_MODULES</envar> 环境变量中,以使之在运行时被加载。</para>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>注册</title>
Packit 1470ea
<para>这个例子中,我们假设一个对象叫 GTK_TYPE_MYTYPE,ATK 的实现叫 <type>MYATKIMP_TYPE_MYTYPE</type>,需要的工厂叫 <type>MYATKIMP_TYPE_MYTYPE_FACTORY</type>。</para>
Packit 1470ea
<para>为 GTK 对象注册一个 ATK 实现,需要在模块的 <function>gtk_module_init()</function> 函数中做以下步骤:</para>
Packit 1470ea
<orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>访问默认注册表:</para>
Packit 1470ea
<programlisting>
Packit 1470ea
default_registry = atk_get_default_registry();
Packit 1470ea
</programlisting>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem><para>在该模块的 <function>gtk_module_init()</function>函数中注册 ATK 对象,函数调用如下:</para>
Packit 1470ea
<programlisting>
Packit 1470ea
atk_registry_set_factory_type (default_registry, GTK_TYPE_MYTYPE, 
Packit 1470ea
MYATKIMP_TYPE_MYTYPE_FACTORY); 
Packit 1470ea
</programlisting>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist>
Packit 1470ea
<para>这样将把 AtkObject 的实现 <type>GTK_TYPE_MYTYPE</type> 注册到 <type>MYATKIMP_TYPE_MYTYPE_FACTORY</type>中。工厂实现后就知道如何构建 <type>MYATKIMP_TYPE_MYTYPE</type>类型的对象了。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>工厂</title>
Packit 1470ea
<para>
Packit 1470ea
The factory must be implemented as a child of class type <type>ATK_TYPE_OBJECT_FACTORY</type> and must implement the function <function>create_accessible()</function>. This function must create an appropriate <type>AtkObject</type>. A factory can be used to create more than one type of object, in which case its <function>create_accessible()</function> function will need to be smart enough to build and return the correct <type>AtkObject</type>.
Packit 1470ea
</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>ATK Implementation for a Specific Object</title>
Packit 1470ea
<para>所有 <type>GObject</type> 均要实现一个 <function>get_type()</function> 函数。使用上面的命名惯例将函数命名为 <function>myatkimp_mytype_get_type()</function>。</para>
Packit 1470ea
<para>
Packit 1470ea
In this function, you specify which interfaces your object implements. If the following logic were included in this <function>get_type()</function> function, this object would implement the <type>ATK_TEXT</type> interface:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title> <function>get_type()</function> 函数示例</title>
Packit 1470ea
<programlisting>
Packit 1470ea
static const GInterfaceInfo atk_text_info = 
Packit 1470ea
{ 
Packit 1470ea
   (GInterfaceInitFunc) atk_text_interface_init, 
Packit 1470ea
   (GInterfaceFinalizeFunc) NULL, 
Packit 1470ea
   NULL 
Packit 1470ea
}; 
Packit 1470ea
Packit 1470ea
g_type_add_interface_static (type, ATK_TYPE_TEXT, 
Packit 1470ea
                             &atk_text_info); 
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
<para>函数 <function>atk_text_interface_init()</function> 需要实现的函数原型如下:</para>
Packit 1470ea
<programlisting>
Packit 1470ea
void atk_text_interface_init (AtkTextIface *iface); 
Packit 1470ea
</programlisting>
Packit 1470ea
<para>
Packit 1470ea
This function would connect the interface function calls to the specific implementation as follows:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>连接自定义接口与一个 AtkObject 实现</title>
Packit 1470ea
<programlisting>
Packit 1470ea
void 
Packit 1470ea
atk_text_interface_init (AtkTextIface *iface) 
Packit 1470ea
{ 
Packit 1470ea
   g_return_if_fail (iface != NULL); 
Packit 1470ea
   iface->get_text = myatkimp_mytype_get_text; 
Packit 1470ea
   iface->get_character_at_offset = myatkimp_mytype_get_character_at_offset; 
Packit 1470ea
   ... 
Packit 1470ea
}
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
<para>
Packit 1470ea
Then the functions <function>myatkimp_mytype_get_text()</function>, <function>myatkimp_mytype_get_character_at_offset()</function>, and the rest of the <type>ATK_TEXT</type> interface functions would need to be implemented.
Packit 1470ea
</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title><type>AtkObject</type> 实现</title>
Packit 1470ea
<para>
Packit 1470ea
<type>AtkObject</type>s are <type>GObjects</type>, and all <type>GObject</type>s need to specify the <function>get_type()</function> function. Here is an example that sets up a class and instance initializer. This <function>get_type()</function> function also specifies that the object implements <type>ATK_TEXT</type> and specifies the parent object to be <type>MYATKIMP_MYPARENTTYPE</type>.
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title> <function>get_type()</function> 的实现示例</title>
Packit 1470ea
<programlisting>
Packit 1470ea
GType 
Packit 1470ea
myatkimp_mytype_get_type (void) 
Packit 1470ea
{ 
Packit 1470ea
   static GType type = 0; 
Packit 1470ea
Packit 1470ea
   if (!type) 
Packit 1470ea
   { 
Packit 1470ea
      static const GTypeInfo tinfo = 
Packit 1470ea
      { 
Packit 1470ea
         sizeof (GailLabelClass), 
Packit 1470ea
         (GBaseInitFunc) NULL,                              /* base init */ 
Packit 1470ea
         (GBaseFinalizeFunc) NULL,                          /* base finalize */
Packit 1470ea
         (GClassInitFunc) myatkimp_mytype_class_init,       /* class init */ 
Packit 1470ea
         (GClassFinalizeFunc) NULL,                         /* class finalize */ 
Packit 1470ea
         NULL,                                              /* class data */ 
Packit 1470ea
         sizeof (GailLabel),                                /* instance size */ 
Packit 1470ea
         0,                                                 /* nb preallocs */ 
Packit 1470ea
         (GInstanceInitFunc) myatkimp_mytype_instance_init, /* instance init */ 
Packit 1470ea
         NULL                                               /* value table */ 
Packit 1470ea
      }; 
Packit 1470ea
Packit 1470ea
      /* Set up atk_text_info structure used below */ 
Packit 1470ea
      static const GInterfaceInfo atk_text_info = 
Packit 1470ea
      { 
Packit 1470ea
         (GInterfaceInitFunc) atk_text_interface_init, 
Packit 1470ea
         (GInterfaceFinalizeFunc) NULL, 
Packit 1470ea
         NULL 
Packit 1470ea
      }; 
Packit 1470ea
Packit 1470ea
      /* Set up typename and specify parent type */ 
Packit 1470ea
      type = g_type_register_static (MYATKIMP_MYPARENTTYPE, 
Packit 1470ea
            "MyatkimpMytype", &tinfo, 0); 
Packit 1470ea
Packit 1470ea
      /* This class implements interface ATK_TYPE_TEXT */ 
Packit 1470ea
      g_type_add_interface_static (type, ATK_TYPE_TEXT, 
Packit 1470ea
                                   &atk_text_info); 
Packit 1470ea
   } 
Packit 1470ea
   return type; 
Packit 1470ea
} 
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>类/实例初始化</title>
Packit 1470ea
<para>不管是 <type>GObject</type> 还是你自己的 <type>AtkObject</type> 实现,都得进行类初始化:</para>
Packit 1470ea
<orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Redefines any function calls defined by the object's parent. This is typically necessary when an object needs to implement a function like <function>atk_object_get_n_accessible_children()</function>.  This is necessary if the object has children, but they are not represented with widgets.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
For example, if your ATK implementation needs to over-ride the <type>AtkObject</type> function <function>get_name()</function>, then the class initializer would look like:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>类初始化将覆写父类的 <function>get_name()</function> 函数</title>
Packit 1470ea
<programlisting>
Packit 1470ea
myatkimp_mytype_class_init (GailLabelClass *klass) 
Packit 1470ea
{ 
Packit 1470ea
  AtkObjectClass *class = ATK_OBJECT_CLASS (klass); 
Packit 1470ea
  class->get_name = myatkimp_mytype_get_name; 
Packit 1470ea
} 
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem><para>Requires a <function>parent->init</function>, <function>parent->notify_gtk</function>, or <function>parent->finalize</function> function. This example defines all three:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>Class initializer that defines its own <function>init()</function>, <function>notify_gtk()</function> and <function>finalize()</function> functions</title>
Packit 1470ea
<programlisting>
Packit 1470ea
static ParentObjectType *parent_class = NULL; 
Packit 1470ea
Packit 1470ea
myatkimp_mytype_class_init (GailLabelClass *klass) 
Packit 1470ea
{ 
Packit 1470ea
   ParentObjectType *parent_class = (ParentObjectType*)klass; 
Packit 1470ea
Packit 1470ea
   /* 
Packit 1470ea
    * Caching the parent_class is necessary if the init, 
Packit 1470ea
    * notify_gtk, or finalize functions are set up. 
Packit 1470ea
    */ 
Packit 1470ea
    parent_class = g_type_class_ref (MYATKIMP_TYPE_PARENT); 
Packit 1470ea
Packit 1470ea
    parent_class->init = myatkimp_mytype_widget_init; 
Packit 1470ea
    parent_class->notify_gtk = myatkimp_mytype_real_notify_gtk; 
Packit 1470ea
    parent_class->finalize = myatkimp_mytype_finalize; 
Packit 1470ea
}
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
<orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>parent->init</para>
Packit 1470ea
<para>
Packit 1470ea
A <function>parent->init()</function> function may be necessary if the ATK implementation needs to do either of the following:
Packit 1470ea
</para> 
Packit 1470ea
<orderedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Cache any data obtained from a backing GTK widget.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Listen to any signals from the backing GTK widget.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist>
Packit 1470ea
<para>
Packit 1470ea
Here is an example of both:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>自定义 <function>init()</function> 函数</title>
Packit 1470ea
<programlisting>
Packit 1470ea
void 
Packit 1470ea
gail_tree_view_widget_init (MyatkimpMytype  *mytype, 
Packit 1470ea
                            GtkWidget       *gtk_widget) 
Packit 1470ea
{ 
Packit 1470ea
   /* Make sure to call the parent's init function */ 
Packit 1470ea
   parent_class->init (widget, gtk_widget); 
Packit 1470ea
   
Packit 1470ea
   /* Cache a value in the ATK implementation */ 
Packit 1470ea
   mytype->cached_value = gtk_widget_function_call(); 
Packit 1470ea
Packit 1470ea
   /* Listen to a signal */ 
Packit 1470ea
   gtk_signal_connect (GTK_OBJECT (gtk_widget), 
Packit 1470ea
                       "signal-type", 
Packit 1470ea
                       GTK_SIGNAL_FUNC (_myatkimp_mytype_signal_type), 
Packit 1470ea
                       NULL); 
Packit 1470ea
} 
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
<para>
Packit 1470ea
In this example, if the specified <type>signal-type</type> signal were generated on the backing <varname>gtk_widget</varname>, then the <function>_myatkimp_mytype_signal_type()</function> function would be called.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>parent->notify_gtk</para>
Packit 1470ea
<para>
Packit 1470ea
If the ATK implementation needs to listen to any property notifications on the backing GTK object, a <function>parent->notify_gtk()</function> function may be necessary. For example:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>自定义 <function>notify_gtk()</function> 函数</title>
Packit 1470ea
<programlisting>
Packit 1470ea
void 
Packit 1470ea
myatkimp_mytype_real_notify_gtk (GObject    *obj, 
Packit 1470ea
                                 GParamSpec *pspec) 
Packit 1470ea
{ 
Packit 1470ea
   GtkWidget *widget = GTK_WIDGET (obj); 
Packit 1470ea
   AtkObject* atk_obj = gtk_widget_get_accessible (widget); 
Packit 1470ea
Packit 1470ea
   if (strcmp (pspec->name, "property-of-interest") == 0) 
Packit 1470ea
   { 
Packit 1470ea
      /* Handle the property change. */ 
Packit 1470ea
   } 
Packit 1470ea
   else 
Packit 1470ea
   { 
Packit 1470ea
      parent_class->notify_gtk (obj, pspec); 
Packit 1470ea
   } 
Packit 1470ea
} 
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>parent->finalize</para>
Packit 1470ea
<para>
Packit 1470ea
If it is necessary to free any data when a <type>GObject</type> instance is destroyed, then a <function>finalize()</function> function is needed to free the memory.  For example:
Packit 1470ea
</para>
Packit 1470ea
<example>
Packit 1470ea
<title>自定义 <function>finalize()</function> 函数</title>
Packit 1470ea
<programlisting>
Packit 1470ea
void 
Packit 1470ea
myatkimp_mytype_finalize (GObject *object) 
Packit 1470ea
{ 
Packit 1470ea
   MyAtkimpMyType *my_type = MYATKIMP_MYTYPE (object); 
Packit 1470ea
Packit 1470ea
   g_object_unref (my_type->cached_value); 
Packit 1470ea
   G_OBJECT_CLASS (parent_class)->finalize (object); 
Packit 1470ea
} 
Packit 1470ea
</programlisting>
Packit 1470ea
</example>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist>
Packit 1470ea
</listitem>
Packit 1470ea
</orderedlist>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-custom">
Packit 1470ea
<title>让自定义组件获得辅助功能</title>
Packit 1470ea
<para>
Packit 1470ea
Adding ATK support to your custom widget will assure its cooperation with the accessibility infrastructure. These are the general steps that are required:
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
assess a custom widget according to the applicable <link linkend="gad-ui-guidelines">User Interface Guidelines</link>;
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
determine which <ulink url="https://developer.gnome.org/atk/stable/interfaces.html">ATK interfaces</ulink> a custom widget should implement, according to the widget's feature set and function;
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
assess which <ulink url="https://developer.gnome.org/atk/stable/interfaces.html">ATK interfaces</ulink> can be inherited from the parent widget class;
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>部件类的 ATK 接口可以两种方式实现:</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>直接由自定义部件,或者</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
in an <ulink url="http://library.gnome.org/devel/atk/stable/AtkObject.html"><type>AtkObject</type></ulink> subtype created by a new <ulink url="http://library.gnome.org/devel/atk/stable/AtkObjectFactory.html"><type>AtkObjectFactory</type></ulink> subclass
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
<para>如果使用第二种方法,则在运行时必须使用 <type>AtkObjectFactoryRegistry</type> 来注册合适的 factory 类型。</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
<para><ulink url="ftp://ftp.gnome.org/pub/GNOME/sources/gail/">GAIL source code</ulink> 提供了一个优秀的教程讲解高级 ATK 用法。</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-ui-guidelines">
Packit 1470ea
<title>获取辅助功能支持的用户界面指南</title>
Packit 1470ea
<para>
Packit 1470ea
When designing your application's GUI, there are a number of simple guidelines you should follow to ensure that it can be used by as wide an audience as possible, whether in conjunction with assistive technologies or not. Don't be fooled into thinking that this is just a case of "making your GUI usable by people with disabilities", though, and that you shouldn't bother if you know a disabled person is never going to use your application. Following these guidelines will improve the overall usability of your application for everyone who uses it - including you!
Packit 1470ea
</para>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>综述</title>
Packit 1470ea
<para>
Packit 1470ea
We all get frustrated if we can't find a feature in an application, or make a mistake from which it takes a couple of minutes to recover, if it's possible to recover at all.  If you have some sort of disability, the chances are the effort and time penalties involved will be several times worse. Following a few basic guidelines can help prevent these sorts of situations for all users.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide Undo for every action that changes the user's data or the application's settings. If possible, provide more than one level of undo and redo, and a history list to allow preview of what actions will be undone.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide commands to restore default settings. If a particular setting could make the application completely unusable for an individual, e.g. by making the fonts very small, it would be useful to provide an option to restore the default settings outside the application itself. This could be done using a command line switch, for example.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Help prevent users from doing the wrong thing. This is particularly important for actions that could be done by accident (e.g. mouse actions) or that cannot easily be undone (e.g. overwriting a file). Consider using confirmation dialogs or forcing the user to go into a particular mode to perform potentially destructive actions.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Minimize users' memory load. For example, let the user view multiple documents at the same time, and ensure online help or other instructions can remain visible while they carry out the procedure being described. Allow them to copy any information that is displayed, and paste it anywhere that data can be entered.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't make users insert disks. Depending on a user's particular disability, they may find it difficult to physically insert or change a disk, or they may find it hard to identify the correct disk in the first place. If your application is installed from CD-ROM, provide an option to copy all the files that will be required onto the user's hard drive.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't place frequently used functions deep in a menu structure. Whether you're using a mouse, keyboard or some other input device, deeply-nested menu items are best avoided. As well as the burden of remembering where to find them, they are always more difficult and time-consuming to access.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't lead users through unnecessary steps. For example, wizards are useful for users who have trouble handling large numbers of options at one time, but other users may need to minimize the amount of time or keystrokes they use.  Such users benefit from being able to skip unnecessary steps or go directly to the one they need. Consider providing a <guibutton>Finish</guibutton> button in wizards that skips right to the end and assumes default responses for the intermediate steps. If the process has many steps, consider asking the user at the start if they want to run through all the steps, or just the most commonly-used ones.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>键盘导航</title>
Packit 1470ea
<para>
Packit 1470ea
A well-designed keyboard user interface plays a key role when you are designing accessible software. Blind users can navigate software more effectively using the keyboard, because using the mouse depends on visual feedback of the mouse pointer location. Also, mobility impairments can prevent a user from successfully navigating using the mouse, because of the fine motor control skills required.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
It is therefore important to make all mouse actions available from the keyboard, and include keyboard access to all toolbars, menus, links and buttons. Every function your application provides should be available using the keyboard alone. Hide your mouse while you're testing your application if you have to!
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Most functionality should be easy to make accessible by using keyboard mnemonics and accelerators, and the toolkit's built-in navigation features. However, operations that rely on drag-and-drop, for example, may require more thought.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide efficient keyboard access to all application features. Some users may be unable to use a mouse, and many "power-users" prefer to use the keyboard anyway. Also, some specialized assistive technology input devices may simulate keyboard events rather than mouse events. Since typing is difficult or even painful for some users, it is important to provide a keyboard interface that minimizes the number of keystrokes required for any given task.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Use a logical keyboard navigation order. When navigating around a window with the <keycap>Tab</keycap> key, keyboard focus should move between controls in a predictable order.  In Western locales, this is normally left to right and top to bottom.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Ensure correct tab order for controls whose enabled state is dependent on checkbox, radio button or toggle button state. When such a button is selected, all its dependent controls should be enabled, and all the dependent controls of any other button in the group should be disabled. When the user selects a checkbox, radio button or toggle button that has dependent controls, do not automatically give focus to the first dependent control, but instead leave the focus on the button.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't override existing system-level accessibility features. For example, <ulink url="http://www.rehab.uiuc.edu/accessx/overview.html">AccessX</ulink> is an Xserver extension that has been supported since X11R6. The MouseKeys feature of this extension allows mouse movement and button clicks to be simulated using the keypad. Therefore you should not add features to your application that can only be accessed by pressing keys on the keypad, as users relying on the MouseKeys feature will not be able to use them.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide more than one method to perform keyboard tasks where possible. Some users may find some keys and key combinations easier to use than others.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide both keyboard and mouse access to functions where possible. Some users may only be able to use either the mouse or the keyboard, but not both.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't assign awkward reaches to frequently performed keyboard operations. Some people may only be able to use one hand on the keyboard, so shortcuts that can be easily used with one hand are preferable for common operations. In any case, having to frequently perform long or difficult reaches on the keyboard can increase muscle strain for all users, increasing the risk of pain or injury.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't require repetitive use of simultaneous keypresses. Some users are only able to press and hold one key at a time. Assistive technologies such as AccessX may allow users to press the keys sequentially rather than simultaneously, but this of course means the operation will take longer for them.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Ensure that any text that can be selected with the mouse can also be selected with the keyboard. This is a convenience for all users, but especially for those for whom fine control of the mouse is difficult.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Ensure that objects that can be resized or moved by drag and drop can also be resized or moved with the keyboard. For example, icons and windows on the desktop. Where precision sizing and placement is potentially important, e.g. shapes in a diagram, also consider providing a dialog into which you can type co-ordinates, or a means of snapping objects to a user-definable grid.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't use general navigation functions to trigger operations. For example, do not use basic <keycap>Tab</keycap> keyboard navigation in a dialog to activate any actions associated with a control.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Show keyboard-invoked menus, windows and tooltips near the object they relate to. In GNOME 2.0, users can call up popup menus with <keycombo><keycap>Shift</keycap><keycap>F10</keycap></keycombo>, and tooltips with <keycombo><keycap>Shift</keycap><keycap>F1</keycap></keycombo>. Do not completely hide or obscure the object to which the menu or tooltip refers, however.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>鼠标交互</title>
Packit 1470ea
<para>记住,不是所有人都能灵巧使用鼠标,某些用户可能很难看见或跟随鼠标指针。</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't depend on input from mouse button 2 or button 3. As well as being physically more difficult to click, some pointing devices and many assistive technology devices only support button 1. Some assistive technologies may not emulate the mouse at all, but generate keyboard events instead.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Allow all mouse operations to be cancelled. Pressing the <keycap>Esc</keycap> key should cancel any mouse operation in progress, such as dragging and dropping a file in a file manager, or drawing a shape in a drawing program.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide visual feedback throughout a drag and drop operation. As the mouse passes over valid targets, highlight them and change the mouse pointer. Use the "no drop" mouse pointer when passing over invalid drop targets. See <link linkend="gad-mouse-examples">Mouse Interaction Examples</link>.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't warp the mouse pointer, or restrict mouse movement to part of the screen. This can interfere with assistive technologies, and is usually confusing even for users who don't rely on ATs.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't make mouse targets too small. In general, mouse targets should be at least the size of the "hot area" around the resizable window border in the current window manager/theme - bearing in mind that a user with impaired dexterity or vision may be using a window manager with larger areas than the default.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
Packit 1470ea
<section id="gad-mouse-examples">
Packit 1470ea
<title>鼠标交互示例</title>
Packit 1470ea
<figure>
Packit 1470ea
<title>来自 CDE/Motif 的指针 "no-drop" 示例</title>
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/nodrop.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Example of an "invalid drop target" pointer shape</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</figure>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>图形元素</title>
Packit 1470ea
<para>
Packit 1470ea
Provide options to customize the presentation of all the important graphical elements in your application. This will make it easier for people with visual or cognitive impairments to use.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't hard-code graphic attributes such as line, border or shadow thickness. These elements should ideally be read from the GTK or window manager theme. If this is not possible, provide options within your application to change them.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide descriptive names for all interface components. The GAIL library provides default accessible descriptions for many GTK widgets, but you will still need to add your own in some cases, such as for widgets that use graphics instead of text (e.g. a well in a color palette, or an icon without a label). Consider overriding the defaults with more helpful or application-specific descriptions where possible.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Allow multi-color graphical elements (e.g. toolbar icons) to be shown in monochrome only, if possible. These monochrome images should be shown in the system foreground and background colors, which the user will have chosen for themselves (by their choice of GTK theme) for maximum legibility.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Make interactive GUI elements easily identifiable. For example, do not make the user hover the mouse over an object to determine whether it is clickable or not. Leave sufficient space between objects and clearly delineate object boundaries. Don't show GUI elements that look pretty but don't actually do anything, unless you also provide an option to switch them off.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide an option to hide graphics that don't convey essential information. Graphical images can be distracting to users with some cognitive disorders. The icons on the GNOME foot menu, for example, can be switched off whilst still leaving the menus fully functional.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>字体与文本</title>
Packit 1470ea
<para>
Packit 1470ea
Even to a user with normal vision, textual output provides the majority of the information and feedback in most applications. It is therefore critical to choose and position text carefully on the screen, and leave the choice of font and size to the user, to ensure that people with vision impairments can also use your application effectively.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't hard-code font styles and sizes. The user should be able to adjust all sizes and typefaces. If for some reason you cannot make this functionality available, never hardcode any font sizes smaller than 10 points.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide options to turn off any graphical backdrops or "watermarks" behind text. Such images interfere with the contrast between the text and its background, which can cause difficulty for users with visual impairments.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Label objects with names that make sense when taken out of context. Users relying on screen readers or similar assistive technologies will not necessarily be able to immediately understand the relationship between a control and those surrounding it.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't use the same label more than once in the same window. If you use the same label in different windows, it will help if it means the same thing in both windows. Also, don't use labels that are spelled differently but sound the same, e.g. "Read" and "Red", as this could be confusing for users relying on screen-readers.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Position labels consistently throughout your application. This normally means immediately below large icons, immediately to the right of small icons, and immediately above or to the left of other controls. See <link linkend="gad-font-examples">Fonts and Text Examples</link>.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
When you use static text to label a control, end the label with a colon. For example, <guilabel>Username:</guilabel> to label a text field into which the user should type their username. This helps identify it as a control's label rather than an independent item of text.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
When you use static text to label a control, ensure that the label immediately precedes that control in the Tab order. This will ensure that the mnemonic (underlined character) you assign to the label will move focus to or activate the correct control when pressed.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide alternatives to WYSIWYG. Some users may need to print text in a small font but edit in a larger screen font, for example. Possible alternatives include displaying all text in the same font and size (both of which are chosen by the user); a "wrap-to-window" option that allows you to read all the text in a window without scrolling horizontally; a single column view that shows the window's contents in a single column even if they will be printed in multiple columns; and a text-only view, where graphics are shown as placeholders or text descriptions. If the application has panels with child controls, consider allowing the panels to resize along with the parent window.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
Packit 1470ea
<section id="gad-font-examples">
Packit 1470ea
<title>字体与文本示例</title>
Packit 1470ea
<figure id="label-placement-example">
Packit 1470ea
<title>各种 GUI 元素的正确标签布局</title>
Packit 1470ea
<informaltable frame="all">
Packit 1470ea
<tgroup cols="3" align="center">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/label_above.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>List control with label above</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
List control with label above
Packit 1470ea
</entry>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/label_below.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Large file manager icon with label underneath</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
Large file manager icon with label underneath
Packit 1470ea
</entry>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/label_right.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Small toolbar icon with label to its right</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
Small toolbar icon with label to its right
Packit 1470ea
</entry>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/label_left.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Spinbox control with label to its left</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
Spinbox control with label to its left
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
</informaltable>
Packit 1470ea
</figure>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>颜色与对比度</title>      
Packit 1470ea
<para>
Packit 1470ea
Poor choice of colors on the screen can cause problems for users with color blindness (for whom hue is important) or low-vision (for whom brightness/contrast is important). Generally, you should allow the user to customize the colors in any part of your application that conveys important information.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Users with visual impairments may require a high level of contrast between the background and text colors. Often a black background and white text is used to prevent the background from "bleeding" over. These settings are critical for users with visual impairments.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't hard-code application colors. Some users need to use particular combinations of colors and levels of contrast to be able to read the screen comfortably. Therefore all the main colors you use in your GNOME application should be taken from the GTK theme, so the user can set the colors for all their applications to something legible just by changing the theme. If for some reason you do need to use colors that are not available in the theme, ensure they are customizable within the application itself.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't use color as the only means to distinguish items of information. All such information should be provided by at least one other method, such as shape, position or textual description. See <link linkend="gad-color-examples">Color and Contrast Examples</link>.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Support all the high contrast GNOME themes.  Ensure that when one of these themes is selected, all the text in your application appears in the high contrast foreground and background colors specified by the theme.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Ensure your application is not dependent on a particular high-contrast theme. Test it with different high-contrast themes to ensure your application respects the settings.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
Packit 1470ea
<section id="gad-color-examples">
Packit 1470ea
<title>颜色与对比度示例</title>
Packit 1470ea
<example>
Packit 1470ea
<title>过度使用颜色的图例</title>
Packit 1470ea
<informaltable frame="all">
Packit 1470ea
<tgroup cols="2">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/color_only.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Example showing changes in stock price using color only</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
This display could cause problems for a red-green color-blind user (color-blindness affects as many as 1 in 7 males in some parts of the world). The lack of contrast between the red text and black background would also make it hard to read for a user with low vision, even with a screen magnifier.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/color_and_arrows.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Example showing changes in stock price using both color and arrows</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
This display reinforces the color-coding with arrows to show the stock price movement, and uses darker shades of green and red on a lighter background to provide higher contrast.  This needn't be the default color scheme if testing were to show it to be too distracting for the majority of users, but it should be possible to customize it in this way either by theming or via the application's <guilabel>Preferences</guilabel> dialog.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
</informaltable>
Packit 1470ea
</example>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>放大镜</title>
Packit 1470ea
<para>
Packit 1470ea
Many users, even those not visually impaired, benefit from magnification of text and graphics. However, without magnification, a visually impaired user may not be able to access and use the program at all.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>让用户能放大工作区。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide options in the application to scale the work area. Users need to have an option to magnify the work area 150% to 400% or more.  Test the application to confirm the object you are viewing is not affected by changing the magnification settings.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>音频</title>
Packit 1470ea
<para>
Packit 1470ea
People who have difficulty hearing, as well as those who work with the sound on their computers turned off, will be disadvantaged if your application relies on sound to convey information. In general, make sure that the user is able to have any audible information conveyed in other ways.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't assume that a user will hear audio information. This applies as much to users with broken soundcards as it does to those with hearing impairments!
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't use audio as the only means of conveying information. Give the user the option to have all audio information provided in a visual way as well. This includes providing closed captioning or transcripts for any important spoken sound clips.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Allow users to configure frequency and volume of all warning beeps and other sounds. This includes being able to turn off sound altogether.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>动画</title>
Packit 1470ea
<para>
Packit 1470ea
Used sparingly, animation can be useful for drawing attention to important information in your application - and it can look cool, too. However, it can be problematic for some users, so make sure they can turn it off.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't use flashing or blinking elements having a frequency greater than 2 Hz and lower than 55 Hz. This includes text as well as any graphical objects. Anything in this frequency range may cause particular problems for users susceptible to visually-induced seizures. Note that there is no "safe" frequency, though. If flashing is essential, you should use the system's cursor blink frequency (which should itself be customizable), or allow users to configure the frequency themselves.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't flash or blink large areas of the screen. Small areas are less likely to trigger seizures in those susceptible to them.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Make all animations optional. The animated information should be available in at least one non-animated format, at the user's request.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>键盘焦点</title>
Packit 1470ea
<para>
Packit 1470ea
Showing the keyboard focus position clearly at all times is important, both for users with vision impairments as well as "power-users" who prefer to use the keyboard rather than the mouse. There should never be any confusion as to which control on the desktop has focus at any given time. You ought to be able to leave your computer with the focus on any widget in your application, then go off and phone your girlfriend or walk the dog until you've forgotten which widget you left it on. When you return, you should be able to tell straight away exactly which widget it was.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
A visual focus indicator is an audio representation of the cursor position relative to the other objects on the desktop. This allows the user to move among objects interactively as the focus changes. The visual focus must be programmatically exposed to assistive technologies. Note that in most cases, this is handled automatically by the ATK, without requiring you to do any additional work. However, you will need to be aware of this requirement when writing your own custom widgets, for example.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Start focus at the most commonly used control. If no control in a window is deemed to be the "most" useful, start the focus at the first control in the window when that window is opened. Focus should not be started on the <guilabel>OK</guilabel> or <guilabel>Cancel</guilabel> buttons of a dialog even if they are the most commonly used controls, as they can always be activated immediately by pressing <keycap>Enter</keycap> or <keycap>Escape</keycap>.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Show current input focus clearly at all times.  Remember that in controls that include a scrolling element, it is not always sufficient to highlight just the selected element inside that scrolling area, as it may not be visible. See <link linkend="gad-focus-examples">Keyboard Focus Examples</link>.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Show input focus only in the active window. Hide all primary visual focus indicators in all windows that do not have the focus and activation. If a single window has separate panes, only one pane should have the focus indicator, and focus indicators should be hidden in all other panes. If it's important to continue showing which item in an unfocused list is selected, for example, use a secondary focus indicator. See <link linkend="gad-focus-examples">Keyboard Focus Examples</link>.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide appropriate feedback when the user attempts to navigate past the end of a group of related objects. When navigating a list, for example, stopping with audio feedback is usually preferable to moving the focus back to the first object in the list. Otherwise, users who are blind or have low vision may not realize they have returned to the beginning. In the case of a text search in a document, a dialog may pop up to indicate that the end of the document has been reached, and ask if you want to resume the search at the start of the document.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Play the system default audio or visual warning signal when the user presses an inappropriate key, or when a navigation key fails to move the focus. For example, when the focus is on the first character in a text field and the user presses left arrow key, or the user tries to perform multiple selection in a single selection dialog. (Note that users with hearing difficulties should be able to configure a system-wide visual equivalent to the default warning sound.)
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
Packit 1470ea
<section id="gad-focus-examples">
Packit 1470ea
<title>键盘焦点示例</title>
Packit 1470ea
<example><title>Example illustrating need to show focus clearly</title>
Packit 1470ea
<informaltable frame="all">
Packit 1470ea
<tgroup cols="2">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject><imageobject> <imagedata fileref="figures/badfocus1.png" format="PNG"/> </imageobject> <textobject> <phrase> 无法看见该窗口的焦点项,因为它已被滚动离屏 </phrase> </textobject></mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>该窗口某个控件获得焦点,但不知道是谁...</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject><imageobject> <imagedata fileref="figures/badfocus2.png" format="PNG"/> </imageobject> <textobject> <phrase> 滚动列表让焦点项出现在视野中 </phrase> </textobject></mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>...直到滚动列表,让当前被选的焦点项露出来。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject><imageobject> <imagedata fileref="figures/goodfocus.png" format="PNG"/> </imageobject> <textobject> <phrase> 无论当前被选项是否可见,该 list 控件始终拥有一个实边框指示焦点 </phrase> </textobject></mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
If the list control itself is given a "focused" border, it's easy to tell it has focus even when the currently-selected item isn't visible.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
</informaltable>
Packit 1470ea
</example>
Packit 1470ea
<example>
Packit 1470ea
<title>Example illustrating use of secondary focus</title>
Packit 1470ea
<informaltable frame="all">
Packit 1470ea
<tgroup cols="2">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/badfocus3.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Split-paned window in which both panes seem to have focus</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
In this example, it's impossible to tell just by looking which of the two panes actually has keyboard focus.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/goodfocus3.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Split-pane window in which secondary highlighting is used to show which pane has focus</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
By using a secondary selection highlight color in the inactive pane, it's immediately obvious that the tree control has focus here...
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry valign="middle">
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/goodfocus2.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>Split-pane window in which secondary highlighting is used to show which pane has focus</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</entry>
Packit 1470ea
<entry>
Packit 1470ea
...and that the list control has focus here.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
</informaltable>
Packit 1470ea
</example>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>计时器</title>
Packit 1470ea
<para>
Packit 1470ea
Interfaces in which things appear, disappear or happen according to some hard-coded time limit are often a hindrance to accessibility. Some users may read, type or react very slowly in comparison to others. If information they require is hidden before they are finished with it, or obscured by other information popping up which they didn't explicitly request, then your application will become very frustrating or even impossible to use.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't hard-code timeouts or other time-based features. Examples include automatic scrolling when dragging an object towards the edge of a window, holding down a scrollbar button, or automatically expanding a tree node when an object is dragged over it and held for a short time. These should either be customizable in the application, the GNOME control center, or at worst, manually editable from the command line via a configuration file or GConf entry.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Don't briefly show or hide information based on the movement of the mouse pointer. (Exception: system-provided features such as tooltips, which the user can configure on a system-wide level). If you must provide such features, make them optional so users can turn them off when a screen-review utility is installed.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>文档</title>
Packit 1470ea
<para>
Packit 1470ea
People with disabilities cannot use the application effectively if they do not have access to the required manuals and help files.  Of particular importance is keyboard navigation, since this is the only way many users can navigate the application.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide all documentation in an accessible format. ASCII text and HTML are both excellent formats for assistive technologies.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Provide alternative text descriptions for all graphics in the documentation.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Document all your application's accessibility features. Keyboard navigation and shortcuts are particularly important to document. Include an accessibility section in your documentation, where information on all the accessibility features can be found.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
</section>
Packit 1470ea
</chapter>
Packit 1470ea
Packit 1470ea
<chapter id="gtest" status="draft">
Packit 1470ea
<title>测试</title>
Packit 1470ea
<para>
Packit 1470ea
There are several points of review to conduct before declaring an application accessible. Over the course of development you may want to consider automated testing techniques. <ulink url="http://ldtp.freedesktop.org/">LDTP</ulink>, for example, may complement your automated testing plan.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
This section describes a number of tests you can perform manually on an application to test its accessibility. Passing all the tests does not necessarily imply that the application is fully accessible, but if the application fails any of these tests, then further work may need to be done to improve that aspect of its accessibility.
Packit 1470ea
</para>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>键盘导航</title>
Packit 1470ea
<para>
Packit 1470ea
The following keyboard operations should be tested. Do not use the mouse in any part of this test.
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Using only keyboard commands, move the focus through all menu bars in the application.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>确认:</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>上下文敏感的菜单显示正确。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>工具栏上列出的任何功能均能使用键盘执行。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>你可以在应用程序和对话框中的客户区操作每一个控件。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>文本和客户区内的对象可被选取。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Any keyboard enhancements or shortcuts are working as designed.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>图形元素</title>
Packit 1470ea
<para>测试并验证使用屏幕阅读器的应用程序:</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>标签与文本被正确读入,包括菜单与工具栏。</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>对象信息可正确读取。</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>视觉焦点指示器</title>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Verify that when moving among objects that the visual focus indicator is easy to identify.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Keyboard navigation through the software and menus should be clearly visible when the focus moves.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Confirm that the screen reader is tracking the visual focus indicator as you navigate using a keyboard.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Run a screen magnification program (if available) and verify that the magnifier can track the visual focus indicator as you navigate using the keyboard and mouse.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>字体与文本</title>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Change the font in the application and confirm that the settings are maintained.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Test the application by changing colors and confirm that all settings are maintained.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
If magnification is available, test the font, color, and size using the magnification option.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>颜色与对比度</title>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Print screenshots to a black and white printer and confirm that all information is visible.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Test applications using only black and white, high-contrast settings and confirm that all information is conveyed correctly.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Test that the application provides at least three combinations of color schemes and that high-contrast schemes are available (e.g. white on black or yellow on blue).
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Turn on high-contrast settings in the GNOME Control Center and confirm that the application respects these settings.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Test various themes to ensure that the software is working for all the available settings.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>音频</title>
Packit 1470ea
<para>
Packit 1470ea
There should be an option in the application to show audio alerts visually.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Test that the audio is working correctly by enabling sound in the GNOME Control Center and then perform the following actions:
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Perform an action that should generate an audio alert and confirm that the application is working as designed.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Verify that the application works correctly when increasing or decreasing the volume.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Confirm that warning messages and alerts can be heard correctly in a noisy work environment.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>动画</title>
Packit 1470ea
<para>
Packit 1470ea
Verify that an option is available to stop animation and that it is working as designed.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Turn the animation off. Confirm that all information is still conveyed correctly.
Packit 1470ea
</para>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>键盘焦点</title>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Test all messages to confirm that the user is notified before a message times out and is given the option to indicate that more time is needed.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Make sure an option has been included to adjust the response time and confirm that it is working as designed.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>文档</title>
Packit 1470ea
<para>
Packit 1470ea
Test ASCII text documentation with a screen reader to confirm that it is clear and precise and can be read by assistive technologies.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Test HTML applications using a web browser and screen reader to confirm that the documentation is accessible to assistive technologies.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Note: There are web accessibility guidelines available at <ulink url="http://www.w3.org/TR/WAI-WEBCONTENT/">http://www.w3.org/TR/WAI-WEBCONTENT/</ulink>.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Confirm the following information is included in the documentation:
Packit 1470ea
</para>
Packit 1470ea
<itemizedlist>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
State if the application does not support the standard keyboard access used by the OS.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Identify if there are unique keyboard commands.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
Identify any unique accessibility features.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
<listitem>
Packit 1470ea
<para>
Packit 1470ea
If an action is documented for the mouse, make sure there is an alternative for using the keyboard.
Packit 1470ea
</para>
Packit 1470ea
</listitem>
Packit 1470ea
</itemizedlist>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="gad-checklist">
Packit 1470ea
<title>用户界面检查清单</title>
Packit 1470ea
<para>
Packit 1470ea
This section summarizes the guidelines given in <link linkend="gad-ui-guidelines">User Interface Guidelines for Supporting Accessibility</link>. You should refer to that section of the guide for more detailed information on any of the checklist items given here.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
When testing an application for accessibility, you should go through each of the items in the list. Note whether the application passes or fails each test, or does not apply to that application.
Packit 1470ea
</para>
Packit 1470ea
Packit 1470ea
<title>通用原则列表</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>GP</entry>
Packit 1470ea
<entry>通用原则</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>GP.1</entry>
Packit 1470ea
<entry>每一个改变用户数据或程序设置的操作均可被撤消。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>GP.2</entry>
Packit 1470ea
<entry>所有应用程序设置均可被恢复默认值,而不需要用户记住默认值是什么。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>GP.3</entry>
Packit 1470ea
<entry>安装完成后,应用程序随时都可运行而不需用户插入磁盘/CD。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>GP.4</entry>
Packit 1470ea
<entry>最频繁的操作要放在菜单结构的最顶层。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>键盘导航检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>KN</entry>
Packit 1470ea
<entry>键盘导航</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>KN.1</entry>
Packit 1470ea
<entry>为所有应用程序特性提供高效地键盘访问。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>KN.2</entry>
Packit 1470ea
<entry>所有窗口拥有一个逻辑键盘导航顺序。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.3</entry>
Packit 1470ea
<entry>
Packit 1470ea
The correct tab order is used for controls whose enabled state is dependent on checkboxes, radio buttons or toggle buttons.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.4</entry>
Packit 1470ea
<entry>键盘访问的应用程序指定函数不能覆盖已存在的系统辅助功能特性。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.5</entry>
Packit 1470ea
<entry>应用程序应尽可能提供一种以上的方法来执行键盘执行的任务。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.6</entry>
Packit 1470ea
<entry>尽可能拥有可选组合键。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.7</entry>
Packit 1470ea
<entry>频繁执行的键盘操作用起来应该顺手(译注:考虑键位)。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.8</entry>
Packit 1470ea
<entry>应用程序不应使用重复、同时的按键。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.9</entry>
Packit 1470ea
<entry>应用程序应赋予键盘所有的鼠标功能。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.10</entry>
Packit 1470ea
<entry>任何文本或对象,可分别用鼠标或键盘选中。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.11</entry>
Packit 1470ea
<entry>任何可调整大小或移动的对象可分别用鼠标或键盘单独控制。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.12</entry>
Packit 1470ea
<entry>应用程序不应使用任何通用导航功能来触发操作。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KN.13</entry>
Packit 1470ea
<entry>所有键盘绑定的菜单、窗口和提示信息均要出现在与之相关联的对象旁边。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>鼠标交互检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>MI</entry>
Packit 1470ea
<entry>鼠标交互</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>MI.1</entry>
Packit 1470ea
<entry>避免依靠来自鼠标  <mousebutton>右键</mousebutton> 或 <mousebutton>中键</mousebutton> 输入的操作。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>MI.2</entry>
Packit 1470ea
<entry>所有的鼠标操作在确定之前均可被取消。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>MI.3</entry>
Packit 1470ea
<entry>为拖放操作提供视觉反馈</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>MI.4</entry>
Packit 1470ea
<entry>鼠标指针不能在程序控制下反常,或者它的移动不因程序而受限于屏幕某个区域。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>图形元素检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>GE</entry>
Packit 1470ea
<entry>图形元素</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>GE.1</entry>
Packit 1470ea
<entry>避免对图形属性,比如线、边框或阴影度进行硬编码。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>GE.2</entry>
Packit 1470ea
<entry>尽可能让多色图形元素也能显示在单色环境下。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>GE.3</entry>
Packit 1470ea
<entry>能非常容易区分可交互 GUI 元素与静态 GUI 元素。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>GE.4</entry>
Packit 1470ea
<entry>提供一个隐藏非必需图形的选项。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>字体与文本检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>FT</entry>
Packit 1470ea
<entry>字体与文本</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>FT.1</entry>
Packit 1470ea
<entry>避免字体风格或大小是硬编码的。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.2</entry>
Packit 1470ea
<entry>提供一个关闭文本图形背景的选项。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.3</entry>
Packit 1470ea
<entry>所有标签的名字在失去上下文后仍有意义。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.4</entry>
Packit 1470ea
<entry>同一个窗口不应重复使用同一个标签名。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.5</entry>
Packit 1470ea
<entry>标签的位置在整个程序中应始终如一。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.6</entry>
Packit 1470ea
<entry>
Packit 1470ea
All static text labels that identify other controls end in a colon (:).
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.7</entry>
Packit 1470ea
<entry>
Packit 1470ea
Static text labels that identify other controls immediately precede those controls in the tab order.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>FT.8</entry>
Packit 1470ea
<entry>
Packit 1470ea
An alternative to WYSIWYG is provided. For example, the ability to specify different screen and printer fonts in a text editor.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>颜色与对比度检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>CC</entry>
Packit 1470ea
<entry>颜色与对比度</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>CC.1</entry>
Packit 1470ea
<entry>应用程序的颜色避免硬编码,而应根据当前桌面主题或程序设置来确定并绘制。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>CC.2</entry>
Packit 1470ea
<entry>颜色仅用于增强说明,而不能用于传达信息或活动。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row>
Packit 1470ea
<entry>CC.3</entry>
Packit 1470ea
<entry>应用程序应支持所有可用的高对比度主题和设置。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>CC.4</entry>
Packit 1470ea
<entry>软件不应依赖任何特殊的高对比度主题或设置。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>放大功能检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>MG</entry>
Packit 1470ea
<entry>放大镜</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>MG.1</entry>
Packit 1470ea
<entry>应用程序应提供放大工作区域的能力。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>MG.2</entry>
Packit 1470ea
<entry>应用程序应提供缩放工作区域的选项。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>MG.3</entry>
Packit 1470ea
<entry>应用程序的功能不受放大或缩小改变的影响。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>音频检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>AU</entry>
Packit 1470ea
<entry>音频</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>AU.1</entry>
Packit 1470ea
<entry>声音不能是传达任何物体信息的唯一方法。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>AU.2</entry>
Packit 1470ea
<entry>用户可以配置所有声音和警告音的频率与音量。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>动画检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>AN</entry>
Packit 1470ea
<entry>动画</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>AN.1</entry>
Packit 1470ea
<entry>避免使用频率范围在 2Hz—55Hz 间的闪烁元素。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>AN.2</entry>
Packit 1470ea
<entry>任何闪烁应限制在屏幕的某个小区域里。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>AN.3</entry>
Packit 1470ea
<entry>如果动画已被启用,至少应提供一个可以在它第一次展示前关闭的选项。</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>键盘焦点检查清单</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>KF</entry>
Packit 1470ea
<entry>键盘焦点</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>KF.1</entry>
Packit 1470ea
<entry>当窗口打开后,焦点应位于最常用的控件上。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KF.2</entry>
Packit 1470ea
<entry>当前输入焦点位置总是清晰可见的。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KF.3</entry>
Packit 1470ea
<entry>输入焦点总是明确显示在某个窗口上。</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KF.4</entry>
Packit 1470ea
<entry>
Packit 1470ea
Appropriate audio or visual feedback is provided when the user attempts to navigate past either end of a group of related objects.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KF.5</entry>
Packit 1470ea
<entry>
Packit 1470ea
The default audio or visual warning signal is played when the user presses an inappropriate key.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KF.6</entry>
Packit 1470ea
<entry>
Packit 1470ea
There is sufficient audio information for the visual focus that the user can figure out what to do next.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>KF.7</entry>
Packit 1470ea
<entry>
Packit 1470ea
When using assistive technologies, such as a screen reader or braille device, the current program indicates the position and content of the visual focus indicator.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>Timing checklist</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>TM</entry>
Packit 1470ea
<entry>计时器</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>TM.1</entry>
Packit 1470ea
<entry>
Packit 1470ea
There are no hard-coded time-outs or time-based features in the application.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>TM.2</entry>
Packit 1470ea
<entry>
Packit 1470ea
The display or hiding of important information is not triggered solely by movement of the mouse pointer.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<title>Documentation checklist</title>
Packit 1470ea
<tgroup cols="3" align="left">
Packit 1470ea
Packit 1470ea
<row>
Packit 1470ea
<entry>DC</entry>
Packit 1470ea
<entry>文档</entry>
Packit 1470ea
<entry>通过/失败/NA</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<row><entry>DC.1</entry>
Packit 1470ea
<entry>
Packit 1470ea
All documentation is in an accessible format, with textual alternate descriptions provided for all figures and diagrams.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
<row><entry>DC.2</entry>
Packit 1470ea
<entry>
Packit 1470ea
The documentation includes a section that covers all the application's accessibility features.
Packit 1470ea
</entry>
Packit 1470ea
</row>
Packit 1470ea
Packit 1470ea
</tgroup>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>GOK (GNOME Onscreen Keyboard)</title>
Packit 1470ea
<note>
Packit 1470ea
<para>
Packit 1470ea
The information on this page is partially outdated: GNOME 3's <application><ulink url="http://wiki.gnome.org/Caribou">Caribou</ulink></application> has effectively replaced GNOME 2's <application>gok</application>.
Packit 1470ea
</para>
Packit 1470ea
</note>
Packit 1470ea
Packit 1470ea
<para>
Packit 1470ea
Your application should be usable via <application>gok</application>; key input should be generated entirely by <application>gok</application>, not the keyboard. The aim here would be to work with your application and the desktop in general, ensuring any type of character input can be performed with the on-screen keyboard.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
The <application>gok</application> application ships with the GNOME Desktop so should already be present. For full documentation, refer to <ulink url="http://www.gok.ca">the official gok site</ulink>.
Packit 1470ea
</para>
Packit 1470ea
<para>
Packit 1470ea
Follow these steps to verify the correct operation of <application>gok</application> with your application:
Packit 1470ea
</para>
Packit 1470ea
<procedure>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Login into the GNOME desktop
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Run <application>gok</application>
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>启动你的应用程序</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Provide input to your application with a pointing device (e.g., mouse or head-tracker) and <application>gok</application>.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Work using the auto-completion and word prediction features of <application>gok</application>.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that <application>gok</application> enables and disables the <guibutton>Menus</guibutton> and <guibutton>Toolbars</guibutton> buttons based on the kind of application invoked; for example, the <guibutton>Menus</guibutton> and <guibutton>Toolbars</guibutton> buttons are disabled for the 'Font properties' capplet, but the same buttons are enabled for the <application>Gedit</application> application.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that the <application>gok</application> on-screen keyboard provided by the <guibutton>Compose</guibutton> button can be used to type in any text for the selected application; run <application>Gedit</application>, click on the text area, and then click on the <guibutton>Compose</guibutton> button in <application>gok</application>. Select the required keys from the on-screen keyboard. The characters should appear in the <application>Gedit</application> text area.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that the <guibutton>Launcher</guibutton> button allows the user to launch any of the <application>Terminal</application>, <application>Web Browser</application> or <application>Text Editor</application> applications.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that the <guibutton>Activate</guibutton> button allows the user to activate any of the currently running application windows on the user's desktop, including GNOME panels and the GNOME desktop.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that the <guibutton>Menus</guibutton> button lists all the available menus in the current application. Verify that clicking on a menu button displays the sub-menu and menu items contained within the sub-menu. Finally, verify that clicking on a menu item activates the menu item. For example, click on the <application>Help Browser</application> application and click on the <guibutton>Menus</guibutton> button. The <application>GOK</application> window now displays the <guibutton>File</guibutton>, <guibutton>Go</guibutton> and <guibutton>Help</guibutton> buttons (the <application>Help Browser</application> menus). Click on the <guibutton>File</guibutton> button and it displays the <guibutton>New Window</guibutton> and <guibutton>Close Window</guibutton> buttons (menu items).
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that the <guibutton>Toolbars</guibutton> button lists all the available buttons in the application toolbar. For example, click on the <application>Help Browser</application> application and then click on the <guibutton>Toolbars</guibutton> button. The <application>GOK</application> window now displays the <guibutton>Back</guibutton>, <guibutton>Forward</guibutton> and <guibutton>Home</guibutton> buttons.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
<step>
Packit 1470ea
<para>
Packit 1470ea
Verify that the <guibutton>UI Grab</guibutton> button displays all the button objects for the selected application window. For example, open the 'Font Properties' capplet and click on the <guibutton>UI Grab</guibutton> button in the <application>GOK</application> window. The <application>GOK</application> window should now display the names of the buttons in the capplet - <guibutton>Sans</guibutton>, <guibutton>Sans-serif</guibutton>, <guibutton>Close</guibutton> and <guibutton>Help</guibutton>.
Packit 1470ea
</para>
Packit 1470ea
</step>
Packit 1470ea
</procedure>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section>
Packit 1470ea
<title>Accerciser</title>
Packit 1470ea
<screenshot>
Packit 1470ea
<mediaobject>
Packit 1470ea
<imageobject>
Packit 1470ea
<imagedata fileref="figures/at-arch.png" format="PNG"/>
Packit 1470ea
</imageobject>
Packit 1470ea
<textobject>
Packit 1470ea
<phrase>
Packit 1470ea
Accerciser and the GNOME Accessibility Architecture
Packit 1470ea
</phrase>
Packit 1470ea
</textobject>
Packit 1470ea
</mediaobject>
Packit 1470ea
</screenshot>
Packit 1470ea
Packit 1470ea
<para>
Packit 1470ea
<application>Accerciser</application> is an interactive Python accessibility explorer for the GNOME Desktop. It uses AT-SPI to inspect and control widgets, allowing you to check if an application is providing correct     information to assistive technologies and automated test frameworks. <application>Accerciser</application> has a simple plugin framework which you can use     to create custom views of accessibility information. Full documentation can be found <ulink url="http://library.gnome.org/devel/accerciser/stable">in the Official Accerciser Manual</ulink>. For a demonstration of <application>Accerciser</application> and <application>PyATSPI</application> (Python-wrappered access and usage of AT-SPI), see <ulink url="http://live.gnome.org/Accessibility/PythonPoweredAccessibility">this article</ulink>. For an excellent walkthrough from the author, see the article titled <ulink url="http://www.linuxjournal.com/article/9991">Make Your Application Accessible with Accerciser</ulink>.
Packit 1470ea
</para>
Packit 1470ea
<note>
Packit 1470ea
<para><application>Accerciser</application> 事实上已经取代了 <application>at-poke</application> 工具。</para>
Packit 1470ea
</note>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
</chapter>
Packit 1470ea
Packit 1470ea
</book>