mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
Avoid to load cally module on a11y examples
As cally is being integrated on clutter is not required to load cally module anymore. Anyway, it is still required to load the atk bridge by hand. The current way to load it could change in the future, more information here: https://bugzilla.gnome.org/show_bug.cgi?id=612599 https://bugzilla.gnome.org/show_bug.cgi?id=619946 Part [4/4] of CB#2099
This commit is contained in:
parent
790d2165f3
commit
e110b35694
@ -37,74 +37,6 @@
|
|||||||
*/
|
*/
|
||||||
#define ATK_BRIDGE_DEFAULT_MODULE_DIRECTORY PREFIXDIR"/gtk-2.0/modules"
|
#define ATK_BRIDGE_DEFAULT_MODULE_DIRECTORY PREFIXDIR"/gtk-2.0/modules"
|
||||||
|
|
||||||
/* Convenient default directory (debug purposes) */
|
|
||||||
#define CALLY_DEFAULT_MODULE_DIRECTORY "../cally/.libs"
|
|
||||||
|
|
||||||
|
|
||||||
static gchar **
|
|
||||||
_get_clutter_module_paths (void)
|
|
||||||
{
|
|
||||||
gchar **retval;
|
|
||||||
GPtrArray *paths;
|
|
||||||
const gchar *modules_dir;
|
|
||||||
|
|
||||||
paths = g_ptr_array_new ();
|
|
||||||
|
|
||||||
/* CLUTTER_[API/ABI]_VERSION_S not provided by clutter */
|
|
||||||
/* g_ptr_array_add (paths, */
|
|
||||||
/* g_build_filename (g_get_home_dir (), */
|
|
||||||
/* ".clutter-" CLUTTER_API_VERSION_S, */
|
|
||||||
/* CLUTTER_ABI_VERSION_S, */
|
|
||||||
/* "modules", */
|
|
||||||
/* NULL)); */
|
|
||||||
/* g_ptr_array_add (paths, */
|
|
||||||
/* g_build_filename (CLUTTER_LIBDIR, */
|
|
||||||
/* "clutter-" CLUTTER_API_VERSION_S, */
|
|
||||||
/* CLUTTER_ABI_VERSION_S, */
|
|
||||||
/* "modules", */
|
|
||||||
/* NULL)); */
|
|
||||||
|
|
||||||
g_ptr_array_add (paths, g_strdup (CALLY_DEFAULT_MODULE_DIRECTORY));
|
|
||||||
|
|
||||||
modules_dir = g_getenv ("CLUTTER_MODULES_PATH");
|
|
||||||
if (modules_dir)
|
|
||||||
g_ptr_array_add (paths, g_strdup (modules_dir));
|
|
||||||
|
|
||||||
g_ptr_array_add (paths, NULL);
|
|
||||||
|
|
||||||
retval = (gchar **) paths->pdata;
|
|
||||||
g_ptr_array_free (paths, FALSE);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gchar *
|
|
||||||
_search_for_clutter_module (const gchar *module_name)
|
|
||||||
{
|
|
||||||
gchar **paths, **path;
|
|
||||||
gchar *module_path = NULL;
|
|
||||||
|
|
||||||
paths = _get_clutter_module_paths ();
|
|
||||||
|
|
||||||
for (path = paths; *path; path++)
|
|
||||||
{
|
|
||||||
gchar *tmp_name;
|
|
||||||
|
|
||||||
tmp_name = g_module_build_path (*path, module_name);
|
|
||||||
if (g_file_test (tmp_name, G_FILE_TEST_EXISTS))
|
|
||||||
{
|
|
||||||
module_path = tmp_name;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (tmp_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_strfreev (paths);
|
|
||||||
|
|
||||||
return module_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
_search_for_bridge_module (const gchar *module_name)
|
_search_for_bridge_module (const gchar *module_name)
|
||||||
{
|
{
|
||||||
@ -188,15 +120,12 @@ void
|
|||||||
cally_util_a11y_init (int *argc, char ***argv)
|
cally_util_a11y_init (int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
gchar *bridge_dir = NULL;
|
gchar *bridge_dir = NULL;
|
||||||
gchar *cally_path = NULL;
|
|
||||||
gchar *bridge_path = NULL;
|
gchar *bridge_path = NULL;
|
||||||
|
|
||||||
cally_path = _search_for_clutter_module ("cally-1.0");
|
if (clutter_get_accessibility_enabled () == FALSE)
|
||||||
|
|
||||||
if (cally_path == NULL)
|
|
||||||
{
|
{
|
||||||
g_warning ("Accessibility: failed to find module 'cally-1.0' "
|
g_warning ("Accessibility: clutter has no accessibility enabled"
|
||||||
"which is needed to make this application accessible");
|
" skipping the atk-bridge load");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,11 +135,8 @@ cally_util_a11y_init (int *argc, char ***argv)
|
|||||||
|
|
||||||
bridge_path = g_module_build_path (bridge_dir, "libatk-bridge");
|
bridge_path = g_module_build_path (bridge_dir, "libatk-bridge");
|
||||||
|
|
||||||
|
|
||||||
_a11y_invoke_module (cally_path, TRUE);
|
|
||||||
_a11y_invoke_module (bridge_path, TRUE);
|
_a11y_invoke_module (bridge_path, TRUE);
|
||||||
|
|
||||||
g_free (bridge_dir);
|
g_free (bridge_dir);
|
||||||
g_free (bridge_path);
|
g_free (bridge_path);
|
||||||
g_free (cally_path);
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user