From 3cc3023a48d1dea633aa141bf25cf07c31200121 Mon Sep 17 00:00:00 2001 From: Padraig O'Briain Date: Wed, 30 Oct 2002 09:42:30 +0000 Subject: Add reference to atk/atkrelationtype.h * atk/Makefile.am, atk/atk.h: Add reference to atk/atkrelationtype.h * atk/atkaction.[ch]: Add atk_action_get_localized_name. * atk/atkobject.[ch]: Add atk_role_get_localized_name, atk_object_add_relationship and atk_object_remove_relationship Add new roles ATK_ROLE_HEADER, ATK_ROLE_FOOTER, ATK_ROLE_PARAGRAPH and ATK_ROLE_RULER * atk/atkrelation.h: Move definition of AtkRelationType to atk/relationtype.h * atk/atkstate.h: Add new state ATK_STATE_MANAGES_DESCENDANTS * atk/atktext.[ch]: Add text-attributes-changed signal. * docs/atk-sections.txt, docs/tmpl/atkaction.sgml: Add new functions. * docs/tmpl/atkobject.sgml: Add new functions and new roles. * docs/tmpl/atkrelation.sgml: Add new relations * docs/tmpl/atkstate.sgml: Add new state * docs/tmpl/atktext.sgml: Add new signal * tests/testrelation.c: Add tests for new relationship functions. --- ChangeLog | 30 +++++++++++++++ atk/Makefile.am | 1 + atk/atk.h | 1 + atk/atkaction.c | 26 +++++++++++++ atk/atkaction.h | 8 +++- atk/atkobject.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++ atk/atkobject.h | 21 ++++++++++- atk/atkrelation.h | 27 +------------- atk/atkrelationtype.h | 64 ++++++++++++++++++++++++++++++++ atk/atkstate.h | 4 ++ atk/atktext.c | 9 +++++ atk/atktext.h | 3 +- docs/atk-sections.txt | 4 ++ docs/tmpl/atkaction.sgml | 10 +++++ docs/tmpl/atkobject.sgml | 35 ++++++++++++++++++ docs/tmpl/atkrelation.sgml | 3 ++ docs/tmpl/atkstate.sgml | 1 + docs/tmpl/atktext.sgml | 7 ++++ tests/testrelation.c | 65 +++++++++++++++++++++++++++++++++ 19 files changed, 380 insertions(+), 30 deletions(-) create mode 100755 atk/atkrelationtype.h diff --git a/ChangeLog b/ChangeLog index b1198d0..9f57ca5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2002-10-30 Padraig O'Briain + + * atk/Makefile.am, atk/atk.h: Add reference to atk/atkrelationtype.h + + * atk/atkaction.[ch]: Add atk_action_get_localized_name. + + * atk/atkobject.[ch]: Add atk_role_get_localized_name, + atk_object_add_relationship and atk_object_remove_relationship + Add new roles ATK_ROLE_HEADER, ATK_ROLE_FOOTER, ATK_ROLE_PARAGRAPH + and ATK_ROLE_RULER + + * atk/atkrelation.h: Move definition of AtkRelationType to + atk/relationtype.h + + * atk/atkstate.h: Add new state ATK_STATE_MANAGES_DESCENDANTS + + * atk/atktext.[ch]: Add text-attributes-changed signal. + + * docs/atk-sections.txt, docs/tmpl/atkaction.sgml: Add new functions. + + * docs/tmpl/atkobject.sgml: Add new functions and new roles. + + * docs/tmpl/atkrelation.sgml: Add new relations + + * docs/tmpl/atkstate.sgml: Add new state + + * docs/tmpl/atktext.sgml: Add new signal + + * tests/testrelation.c: Add tests for new relationship functions. + 2002-10-01 Padraig O'Briain * atk/atkobject.c (atk_object_notify): Fix leak; report and patch diff --git a/atk/Makefile.am b/atk/Makefile.am index 9d7ddc6..9e35747 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -98,6 +98,7 @@ atk_headers = \ atkimage.h \ atkregistry.h \ atkrelation.h \ + atkrelationtype.h \ atkrelationset.h \ atkselection.h \ atkstate.h \ diff --git a/atk/atk.h b/atk/atk.h index 370e25f..1f39824 100755 --- a/atk/atk.h +++ b/atk/atk.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/atk/atkaction.c b/atk/atkaction.c index 201243c..d612758 100755 --- a/atk/atkaction.c +++ b/atk/atkaction.c @@ -143,6 +143,32 @@ atk_action_get_name (AtkAction *obj, return NULL; } +/** + * atk_action_get_localized_name: + * @action: a #GObject instance that implements AtkActionIface + * @i: the action index corresponding to the action to be performed + * + * Returns the localized name of the specified action of the object. + * + * Returns a name string, or %NULL + * if @action does not implement this interface. + **/ +G_CONST_RETURN gchar* +atk_action_get_localized_name (AtkAction *obj, + gint i) +{ + AtkActionIface *iface; + + g_return_val_if_fail (ATK_IS_ACTION (obj), NULL); + + iface = ATK_ACTION_GET_IFACE (obj); + + if (iface->get_localized_name) + return (iface->get_localized_name) (obj, i); + else + return NULL; +} + /** * atk_action_get_keybinding: * @action: a #GObject instance that implements AtkActionIface diff --git a/atk/atkaction.h b/atk/atkaction.h index 1ecdc9c..8dfee9f 100755 --- a/atk/atkaction.h +++ b/atk/atkaction.h @@ -62,8 +62,8 @@ struct _AtkActionIface gboolean (*set_description) (AtkAction *action, gint i, const gchar *desc); - - AtkFunction pad1; + G_CONST_RETURN gchar* (*get_localized_name)(AtkAction *action, + gint i); AtkFunction pad2; }; @@ -93,6 +93,10 @@ gboolean atk_action_set_description (AtkAction *action, gint i, const gchar *desc); +/* NEW in ATK 1.1: */ + +G_CONST_RETURN gchar* atk_action_get_localized_name (AtkAction *action, + gint i); /* * Additional GObject properties exported by AtkAction: diff --git a/atk/atkobject.c b/atk/atkobject.c index bb2b110..2d0d023 100755 --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -1141,6 +1141,23 @@ atk_role_get_name (AtkRole role) return name; } +/** + * atk_role_get_localized_name: + * @role: The #AtkRole whose localized name is required + * + * Gets the localized description string describing the #Roleype @role. + * + * Returns: the localized string describing the AtkRole + **/ +G_CONST_RETURN gchar* +atk_role_get_localized_name (AtkRole role) +{ + G_CONST_RETURN gchar *name; + + name = atk_role_get_name (role); + return name; +} + /** * atk_role_for_name: * @name: a string which is the (non-localized) name of an ATK role. @@ -1193,3 +1210,77 @@ atk_role_for_name (const gchar *name) return role; } + +/** + * atk_object_add_relationship: + * @object: The #AtkObject to which an AtkRelation is to be added. + * @relationship: The #AtkRelationType of the relation + * @target: The #AtkObject which is to be the target of the relation. + * + * Adds a relationship of the specified type with the specified target. + * + * Returns TRUE if the relationship is added. + **/ +gboolean +atk_object_add_relationship (AtkObject *object, + AtkRelationType relationship, + AtkObject *target) +{ + AtkObject *array[1]; + AtkRelation *relation; + + g_return_val_if_fail (ATK_IS_OBJECT (object), FALSE); + g_return_val_if_fail (ATK_IS_OBJECT (target), FALSE); + + array[0] = target; + relation = atk_relation_new (array, 1, relationship); + atk_relation_set_add (object->relation_set, relation); + g_object_unref (relation); + + return TRUE; +} + +/** + * atk_object_remove_relationship: + * @object: The #AtkObject from which an AtkRelation is to be removed. + * @relationship: The #AtkRelationType of the relation + * @target: The #AtkObject which is the target of the relation to be removed. + * + * Removes a relationship of the specified type with the specified target. + * + * Returns TRUE if the relationship is removed. + **/ +gboolean +atk_object_remove_relationship (AtkObject *object, + AtkRelationType relationship, + AtkObject *target) +{ + gint n_relations, i; + gboolean ret = FALSE; + AtkRelation *relation; + + g_return_val_if_fail (ATK_IS_OBJECT (object), FALSE); + g_return_val_if_fail (ATK_IS_OBJECT (target), FALSE); + + n_relations = atk_relation_set_get_n_relations (object->relation_set); + for (i = 0; i < n_relations; i++) + { + relation = atk_relation_set_get_relation (object->relation_set, i); + if (atk_relation_get_relation_type (relation) == relationship) + { + GPtrArray *array; + gint j; + + array = atk_relation_get_target (relation); + + if (g_ptr_array_index (array, 0) == target) + { + atk_relation_set_remove (object->relation_set, relation); + ret = TRUE; + break; + } + } + } + + return ret; +} diff --git a/atk/atkobject.h b/atk/atkobject.h index fa84790..27e181e 100755 --- a/atk/atkobject.h +++ b/atk/atkobject.h @@ -26,6 +26,7 @@ extern "C" { #include #include +#include /* * AtkObject represents the minimum information all accessible objects @@ -107,7 +108,11 @@ extern "C" { *@ATK_ROLE_TREE_TABLE: An object capable of expanding and collapsing rows as well as showing multiple columns of data *@ATK_ROLE_UNKNOWN: The object contains some Accessible information, but its role is not known *@ATK_ROLE_VIEWPORT: An object usually used in a scroll pane - *@ATK_ROLE_WINDOW: A top level window with no title or border + *@ATK_ROLE_WINDOW: A top level window with no title or border. + *@ATK_ROLE_HEADER: An object that serves as a document header. + *@ATK_ROLE_FOOTER: An object that serves as a document footer. + *@ATK_ROLE_PARAGRAPH: An object which is contains a paragraph of text content. + *@ATK_ROLE_RULER: An object which describes margins and tab stops, etc. for text objects which it controls (should have CONTROLLER_FOR relation to such). *@ATK_ROLE_LAST_DEFINED: not a valid role, used for finding end of enumeration * *Describes the role of an object @@ -183,6 +188,10 @@ typedef enum ATK_ROLE_UNKNOWN, ATK_ROLE_VIEWPORT, ATK_ROLE_WINDOW, + ATK_ROLE_HEADER, + ATK_ROLE_FOOTER, + ATK_ROLE_PARAGRAPH, + ATK_ROLE_RULER, ATK_ROLE_LAST_DEFINED } AtkRole; @@ -458,6 +467,16 @@ G_CONST_RETURN gchar* atk_role_get_name (AtkRole role); AtkRole atk_role_for_name (const gchar *name); +/* NEW in 1.1: convenience API */ +gboolean atk_object_add_relationship (AtkObject *object, + AtkRelationType relationship, + AtkObject *target); +gboolean atk_object_remove_relationship (AtkObject *object, + AtkRelationType relationship, + AtkObject *target); +G_CONST_RETURN gchar* atk_role_get_localized_name (AtkRole role); + + /* * Note: the properties which are registered with the GType * property registry, for type ATK_TYPE_OBJECT, are as follows: diff --git a/atk/atkrelation.h b/atk/atkrelation.h index ae02889..3e89702 100755 --- a/atk/atkrelation.h +++ b/atk/atkrelation.h @@ -25,6 +25,7 @@ extern "C" { #endif /* __cplusplus */ #include +#include /* * An AtkRelation describes a relation between the object and one or more @@ -32,31 +33,6 @@ extern "C" { * are defined as an AtkRelationSet, which is a set of AtkRelations. */ -/** - *AtkRelationType: - *@ATK_RELATION_NULL: - *@ATK_RELATION_CONTROLLED_BY: Indicates an object controlled by one or more target objects. - *@ATK_RELATION_CONTROLLER_FOR: Indicates an object is an controller for one or more target objects. - *@ATK_RELATION_LABEL_FOR: Indicates an object is a label for one or more target objects. - *@ATK_RELATION_LABELLED_BY: Indicates an object is labelled by one or more target objects. - *@ATK_RELATION_MEMBER_OF: Indicates an object is a member of a group of one or more target objects. - *@ATK_RELATION_NODE_CHILD_OF: Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell. - *@ATK_RELATION_LAST_DEFINED: - * - *Describes the type of the relation - **/ -typedef enum -{ - ATK_RELATION_NULL = 0, - ATK_RELATION_CONTROLLED_BY, - ATK_RELATION_CONTROLLER_FOR, - ATK_RELATION_LABEL_FOR, - ATK_RELATION_LABELLED_BY, - ATK_RELATION_MEMBER_OF, - ATK_RELATION_NODE_CHILD_OF, - ATK_RELATION_LAST_DEFINED -} AtkRelationType; - #define ATK_TYPE_RELATION (atk_relation_get_type ()) #define ATK_RELATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_RELATION, AtkRelation)) #define ATK_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_RELATION, AtkRelationClass)) @@ -67,7 +43,6 @@ typedef enum typedef struct _AtkRelation AtkRelation; typedef struct _AtkRelationClass AtkRelationClass; - struct _AtkRelation { GObject parent; diff --git a/atk/atkrelationtype.h b/atk/atkrelationtype.h new file mode 100755 index 0000000..798d7c7 --- /dev/null +++ b/atk/atkrelationtype.h @@ -0,0 +1,64 @@ +/* ATK - Accessibility Toolkit + * Copyright 2002 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __ATK_RELATION_TYPE_H__ +#define __ATK_RELATION_TYPE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + *AtkRelationType: + *@ATK_RELATION_NULL: + *@ATK_RELATION_CONTROLLED_BY: Indicates an object controlled by one or more target objects. + *@ATK_RELATION_CONTROLLER_FOR: Indicates an object is an controller for one or more target objects. + *@ATK_RELATION_LABEL_FOR: Indicates an object is a label for one or more target objects. + *@ATK_RELATION_LABELLED_BY: Indicates an object is labelled by one or more target objects. + *@ATK_RELATION_MEMBER_OF: Indicates an object is a member of a group of one or more target objects. + *@ATK_RELATION_NODE_CHILD_OF: Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell. + *@ATK_RELATION_FLOWS_TO: Indicates that the object has content that flows logically to another + * AtkObject in a sequential way, (for instance text-flow). + *@ATK_RELATION_FLOWS_FROM: Indicates that the object has content that flows logically from + * another AtkObject in a sequential way, (for instance text-flow). + *@ATK_RELATION_SUBWINDOW_OF: [not sure about this one, ask peter] + *@ATK_RELATION_LAST_DEFINED: + * + *Describes the type of the relation + **/ +typedef enum +{ + ATK_RELATION_NULL = 0, + ATK_RELATION_CONTROLLED_BY, + ATK_RELATION_CONTROLLER_FOR, + ATK_RELATION_LABEL_FOR, + ATK_RELATION_LABELLED_BY, + ATK_RELATION_MEMBER_OF, + ATK_RELATION_NODE_CHILD_OF, + ATK_RELATION_FLOWS_TO, + ATK_RELATION_FLOWS_FROM, + ATK_RELATION_SUBWINDOW_OF, /* not sure about this one, ask Peter */ + ATK_RELATION_LAST_DEFINED +} AtkRelationType; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __ATK_RELATION_TYPE_H__ */ diff --git a/atk/atkstate.h b/atk/atkstate.h index ed11a44..5e7dc74 100755 --- a/atk/atkstate.h +++ b/atk/atkstate.h @@ -57,6 +57,9 @@ extern "C" { *@ATK_STATE_TRANSIENT: Indicates this object is transient *@ATK_STATE_VERTICAL: Indicates the orientation of this object is vertical *@ATK_STATE_VISIBLE: Indicates this object is visible + *@ATK_STATE_MANAGES_DESCENDANTS: Indicates that "active-descendant-changed" event + * is sent when children become 'active' (i.e. are selected or navigated to onscreen). + * Used to prevent need to enumerate all children in very large containers, like tables. *@ATK_STATE_LAST_DEFINED: Not a valid role, used for finding end of enumeration * *The possible types of states of an object @@ -92,6 +95,7 @@ typedef enum ATK_STATE_TRANSIENT, ATK_STATE_VERTICAL, ATK_STATE_VISIBLE, + ATK_STATE_MANAGES_DESCENDANTS, ATK_STATE_LAST_DEFINED } AtkStateType; diff --git a/atk/atktext.c b/atk/atktext.c index e5eb50a..06bd940 100755 --- a/atk/atktext.c +++ b/atk/atktext.c @@ -29,6 +29,7 @@ enum { TEXT_CHANGED, TEXT_CARET_MOVED, TEXT_SELECTION_CHANGED, + TEXT_ATTRIBUTES_CHANGED, LAST_SIGNAL }; @@ -129,6 +130,14 @@ atk_text_base_init (gpointer *g_class) (GSignalAccumulator) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + atk_text_signals[TEXT_ATTRIBUTES_CHANGED] = + g_signal_new ("text_attributes_changed", + ATK_TYPE_TEXT, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AtkTextIface, text_attributes_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); initialized = TRUE; diff --git a/atk/atktext.h b/atk/atktext.h index 5c667c1..533af6c 100755 --- a/atk/atktext.h +++ b/atk/atktext.h @@ -227,7 +227,8 @@ struct _AtkTextIface gint location); void (* text_selection_changed) (AtkText *text); - AtkFunction pad1; + void (* text_attributes_changed) (AtkText *text); + AtkFunction pad2; AtkFunction pad3; AtkFunction pad4; diff --git a/docs/atk-sections.txt b/docs/atk-sections.txt index 34b8800..598f6ca 100644 --- a/docs/atk-sections.txt +++ b/docs/atk-sections.txt @@ -6,6 +6,7 @@ atk_action_do_action atk_action_get_n_actions atk_action_get_description atk_action_get_name +atk_action_get_localized_name atk_action_get_keybinding atk_action_set_description @@ -173,7 +174,10 @@ atk_object_connect_property_change_handler atk_object_remove_property_change_handler atk_object_notify_state_change atk_object_initialize +atk_object_add_relationship +atk_object_remove_relationship atk_role_get_name +atk_role_get_localized_name atk_role_for_name AtkImplementorIface diff --git a/docs/tmpl/atkaction.sgml b/docs/tmpl/atkaction.sgml index 4869e9b..1dec4a9 100644 --- a/docs/tmpl/atkaction.sgml +++ b/docs/tmpl/atkaction.sgml @@ -86,6 +86,16 @@ The AtkAction structure does not contain any fields. @Returns: + + + + + +@action: +@i: +@Returns: + + diff --git a/docs/tmpl/atkobject.sgml b/docs/tmpl/atkobject.sgml index da5ded5..5ef932a 100644 --- a/docs/tmpl/atkobject.sgml +++ b/docs/tmpl/atkobject.sgml @@ -114,6 +114,10 @@ ATK_ROLE_LAST_DEFINED is not necessarily an error. @ATK_ROLE_UNKNOWN: @ATK_ROLE_VIEWPORT: @ATK_ROLE_WINDOW: +@ATK_ROLE_HEADER: +@ATK_ROLE_FOOTER: +@ATK_ROLE_PARAGRAPH: +@ATK_ROLE_RULER: @ATK_ROLE_LAST_DEFINED: @@ -369,6 +373,28 @@ atk_object_connect_property_change_handler(). @data: + + + + + +@object: +@relationship: +@target: +@Returns: + + + + + + + +@object: +@relationship: +@target: +@Returns: + + @@ -378,6 +404,15 @@ atk_object_connect_property_change_handler(). @Returns: + + + + + +@role: +@Returns: + + diff --git a/docs/tmpl/atkrelation.sgml b/docs/tmpl/atkrelation.sgml index dffe854..6d1797b 100644 --- a/docs/tmpl/atkrelation.sgml +++ b/docs/tmpl/atkrelation.sgml @@ -38,6 +38,9 @@ The AtkRelation structure should not be accessed directly. @ATK_RELATION_LABELLED_BY: @ATK_RELATION_MEMBER_OF: @ATK_RELATION_NODE_CHILD_OF: +@ATK_RELATION_FLOWS_TO: +@ATK_RELATION_FLOWS_FROM: +@ATK_RELATION_SUBWINDOW_OF: @ATK_RELATION_LAST_DEFINED: diff --git a/docs/tmpl/atkstate.sgml b/docs/tmpl/atkstate.sgml index a2bc71e..467958d 100644 --- a/docs/tmpl/atkstate.sgml +++ b/docs/tmpl/atkstate.sgml @@ -49,6 +49,7 @@ an component is described by its AtkStateSet, which is a set of AtkStates. @ATK_STATE_TRANSIENT: @ATK_STATE_VERTICAL: @ATK_STATE_VISIBLE: +@ATK_STATE_MANAGES_DESCENDANTS: @ATK_STATE_LAST_DEFINED: diff --git a/docs/tmpl/atktext.sgml b/docs/tmpl/atktext.sgml index ddc810d..73d280b 100644 --- a/docs/tmpl/atktext.sgml +++ b/docs/tmpl/atktext.sgml @@ -336,6 +336,13 @@ The AtkText structure does not contain any fields. @Returns: + + + + + +@atktext: the object which received the signal. + diff --git a/tests/testrelation.c b/tests/testrelation.c index 806e48a..b42f7c2 100644 --- a/tests/testrelation.c +++ b/tests/testrelation.c @@ -29,6 +29,12 @@ test_relation (void) { AtkRelationType type1, type2; G_CONST_RETURN gchar *name; + AtkObject *obj; + gboolean ret_value; + AtkRelationSet *set; + AtkRelation *relation; + gint n_relations; + GPtrArray *array; name = atk_relation_type_get_name (ATK_RELATION_LABEL_FOR); g_return_val_if_fail (name, FALSE); @@ -82,6 +88,65 @@ test_relation (void) g_print ("Unexpected name for undefined type %s\n", name); return FALSE; } + + obj = g_object_new (ATK_TYPE_OBJECT, NULL); + ret_value = atk_object_add_relationship (obj, ATK_RELATION_LABEL_FOR, obj); + if (!ret_value) + { + g_print ("Unexpected return value for atk_object_add_relationship\n"); + return FALSE; + } + set = atk_object_ref_relation_set (obj); + if (!set) + { + g_print ("Unexpected return value for atk_object_ref_relation_set\n"); + return FALSE; + } + n_relations = atk_relation_set_get_n_relations (set); + if (n_relations != 1) + { + g_print ("Unexpected return value (%d) for atk_relation_set_get_n_relations expected value: %d\n", n_relations, 1); + return FALSE; + } + relation = atk_relation_set_get_relation (set, 0); + if (!relation) + { + g_print ("Unexpected return value for atk_object_relation_set_get_relation\n"); + return FALSE; + } + type1 = atk_relation_get_relation_type (relation); + if (type1 != ATK_RELATION_LABEL_FOR) + { + g_print ("Unexpected return value for atk_relation_get_relation_type\n"); + return FALSE; + } + array = atk_relation_get_target (relation); + if (obj != g_ptr_array_index (array, 0)) + { + g_print ("Unexpected return value for atk_relation_get_target\n"); + return FALSE; + } + g_object_unref (set); + ret_value = atk_object_remove_relationship (obj, ATK_RELATION_LABEL_FOR, obj); + if (!ret_value) + { + g_print ("Unexpected return value for atk_object_remove_relationship\n"); + return FALSE; + } + set = atk_object_ref_relation_set (obj); + if (!set) + { + g_print ("Unexpected return value for atk_object_ref_relation_set\n"); + return FALSE; + } + n_relations = atk_relation_set_get_n_relations (set); + if (n_relations != 0) + { + g_print ("Unexpected return value (%d) for atk_relation_set_get_n_relations expected value: %d\n", n_relations, 0); + return FALSE; + } + g_object_unref (set); + g_object_unref (obj); return TRUE; } -- cgit v1.2.1