* Registers the role specified by @name. @name must be a meaningful
* name. So it should not be empty, or consisting on whitespaces.
*
+ * Deprecated: Since 2.12. If your application/toolkit doesn't find a
+ * suitable role for a specific object defined at #AtkRole, please
+ * submit a bug in order to add a new role to the specification.
+ *
* Returns: an #AtkRole for the new role if added
* properly. ATK_ROLE_INVALID in case of error.
**/
AtkRelationType relationship,
AtkObject *target);
const gchar* atk_role_get_localized_name (AtkRole role);
+G_DEPRECATED
AtkRole atk_role_register (const gchar *name);
const gchar* atk_object_get_object_locale (AtkObject *accessible);
result = FALSE;
}
- role1 = atk_role_register ("test-role");
- name = atk_role_get_name (role1);
- if (!name || strcmp (name, "test-role") != 0)
- {
- g_print ("Unexpected name for test-role. Expected 'test-role', received '%s'\n", name);
- result = FALSE;
- }
- role2 = atk_role_for_name ("test-role");
- if (role1 != role2)
- {
- g_print ("Unexpected role for test-role. Expected %i, received %i\n", role1, role2);
- result = FALSE;
- }
role2 = atk_role_for_name ("TEST_ROLE");
- if (role2 != 0)
+ if (role2 != ATK_ROLE_INVALID)
{
- g_print ("Unexpected role for TEST_ROLE. Expected %i, received %i\n", 0, role2);
+ g_print ("Unexpected role for TEST_ROLE. Expected %i, received %i\n", ATK_ROLE_INVALID, role2);
result = FALSE;
}
/*
result = FALSE;
}
- role1 = atk_role_register ("");
- if (role1 != ATK_ROLE_INVALID)
- {
- g_print ("atk_role_register allowed to register empty string, but this is "
- "an invalid role name\n");
- result = FALSE;
- }
-
- role1 = atk_role_register (" ");
- if (role1 != ATK_ROLE_INVALID)
- {
- g_print ("atk_role_register allowed to register all whitespace string, but "
- "that is an invalid role name \n");
- result = FALSE;
- }
-
return result;
}