2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
23 * @brief Header for Eail initialization part
27 * @mainpage Manual SDK
29 * @section Description
30 * EAIL (Enlightenment Accessibility Implementation Library) is an implementation
31 * of ATK (Accessibility Toolkit) - it allows to receive accessible content
32 * representation for Elementary widgets.
33 * EAIL is meant to be a bridge between Elementary and ATK, thus various ATs can query for
34 * accessible information using AT-SPI2.
35 * ATK is an accessibility toolkit conforming to the Section 508 Standards.
36 * EAIL is developed as an Elementary module and loaded whenever Elementary
37 * ELM_MODULES environmental variable is set ("eail>eail/api" is appended).
40 * <p>In order to load properly, EAIL has to be installed in directory that is
41 * used to store the rest of Elementary modules (directory path is architecture
42 * dependent). Passing correct directory name is available via ./configure
43 * option '--with-elementary-module'.</p>
44 * <p>Below is sample configuration for x86_64
47 * ./configure --with-elementary-modules=/usr/local/lib/elementary/modules/eail/linux-gnu-x86_64-1.7.99/
50 * <p>When EAIL module is installed, Elementary library has to be notified
51 * about the new module - it needs to load EAIL module during startup.
52 * This can be done using 'ELM_MODULES' environmental variable.</p>
53 * <p>Below is a code snippet that shows how to set EAIL module load for the current
56 * export ELM_MODULES="eail>eail/api"
59 * NOTE: ELM_MODULES can also be set for every session using elementary configuration
60 * files. Details on how to do that can be found in the Elementary documentation.
62 * <p>This is all configuration needed - now an elementary application can be
63 * launched and accessible content for target application should be visible
64 * when using accessibility clients (eg. ORCA, TADEK, accerciser...).</p>
67 * @section Architecture
68 * <p>EAIL is implemented as a module of Enlightenment (it is located in Elementary
69 * modules directory). When an elementary application is being
70 * launched and ELM_MODULES is set correctly, then EAIL module is also loaded.
71 * EAIL module registers itself to ATK bridge, so accessibility client
72 * application (eg. ORCA, TADEK) can obtain information (in form of an accessible
73 * ATK object) about every visible element in application UI.</p>
75 * See the diagram of architecture below:
76 * @image html eail_component_diagram.png
79 * @section Dataflow Data Flow
80 * <p>When an accessibility client wants to get the accessible content of an application
81 * it needs to get the 'root' ATK object for application. To do that, the client has to
82 * call atk_get_root() on ATK/AT-SPI brigde. Request is propagated to EAIL which
83 * creates a new instance of EailApp which is the ATK representation of the elementary
86 * Below is a diagram that shows what is happening during that operation:
87 * @image html eail_get_root_flow.png
90 * <p>When an accessibility client holds reference to the ATK root object (EailApp), it
91 * can use an AtkObject interface to use the object's accessible functionality (eg.
92 * get name, set/get description or, the most important one, get reference to
93 * children)). To get widget's children, client has to call
94 * <b>atk_object_ref_accessible_child.</b>
97 * Below is a diagram that shows how an app child (EailWindow) is being created. For
98 * other kinds of object data flow is very similar:
99 * @image html eail_ref_window_child_flow.png
103 * Following ATK event types are supported:
106 * -# "visible-data-changed"
107 * -# "property-change"
109 * NOTE: To receive events from EAIL widget, ATK-client application needs to
110 * hold reference to the target widget (it can be achieved by eg. listing the whole
111 * widget hierarchy tree). Without that event listener for widget won't be
112 * registered and ATK events won't be propagated.
114 * To be sure that client always
115 * has the correct widget tree, it needs to refresh the widget's descendants every time
116 * it receives "visible-data-changed" event from ATK.
118 * Below is an example on how to register for events using python pyatspi binding (
119 * as mentioned above, all objects that we're interested in have to be listed at
120 * first; below is a code snippet only for event registration for pyatspi part):
122 * pyatspi.Registry.registerEventListener(test_cb, "focus")
123 * pyatspi.Registry.registerEventListener(test_cb, "object:state-changed")
124 * pyatspi.Registry.registerEventListener(test_cb, "object:visible-data-changed")
125 * pyatspi.Registry.registerEventListener(test_cb, "object:property-changed")
127 * pyatspi.Registry.start()
132 * <p>Below are some examples on how to use C API for ATK with EAIL.
135 * How to get the root ATK object for the current application:
137 * AtkObject *atk_obj = atk_get_root();
142 * How to get the children count for given ATK object:
144 * gint n = atk_object_get_n_accessible_children(atk_obj);
149 * How to obtain a reference to the first child of ATK object:
151 * AtkObject *atk_obj = atk_object_ref_accessible_child(atk_obj, 0);
156 * How to launch the first action of the given ATK object that supports ATK_ACTION
159 * gboolean success = atk_action_do_action(ATK_ACTION(atk_obj), 0);
164 * How to get the name of an action with the given index ('1'):
166 * const gchar *action_name = atk_action_get_name(ATK_ACTION(atk_obj), 1);
170 * Many more ready-to-go examples can be found in EAIL test code which can
171 * be found in <b>tests/</b> directory.
176 #include "Elementary.h"
182 EAPI int elm_modapi_init(void *m);
184 EAPI int elm_modapi_shutdown(void *m);