diff options
author | Alejandro Piñeiro <apinheiro@igalia.com> | 2013-12-09 19:11:21 +0100 |
---|---|---|
committer | Alejandro Piñeiro <apinheiro@igalia.com> | 2013-12-09 19:11:21 +0100 |
commit | d8d75d3e38e8532c36f8a5d9ebeca0518b1221e6 (patch) | |
tree | bfb7f0c122f5c5e0949808cc68e62a00ad1be91a | |
parent | eacee483828a5f77e8bd80ae68edbf077549aa9e (diff) | |
download | atk-d8d75d3e38e8532c36f8a5d9ebeca0518b1221e6.tar.gz |
role: deprecate atk_role_register
https://bugzilla.gnome.org/show_bug.cgi?id=720117
-rwxr-xr-x | atk/atkobject.c | 4 | ||||
-rwxr-xr-x | atk/atkobject.h | 1 | ||||
-rw-r--r-- | tests/testrole.c | 33 |
3 files changed, 7 insertions, 31 deletions
diff --git a/atk/atkobject.c b/atk/atkobject.c index 72cfbdd..0136c7a 100755 --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -899,6 +899,10 @@ atk_object_ref_relation_set (AtkObject *accessible) * 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. **/ diff --git a/atk/atkobject.h b/atk/atkobject.h index a4ac38e..781c317 100755 --- a/atk/atkobject.h +++ b/atk/atkobject.h @@ -721,6 +721,7 @@ gboolean atk_object_remove_relationship (AtkObject * 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); diff --git a/tests/testrole.c b/tests/testrole.c index 2f5bacc..a50f096 100644 --- a/tests/testrole.c +++ b/tests/testrole.c @@ -52,23 +52,10 @@ test_role (void) 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; } /* @@ -81,22 +68,6 @@ test_role (void) 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; } |