diff options
author | Li Yuan <li.yuan@sun.com> | 2011-07-07 12:38:33 +0800 |
---|---|---|
committer | Li Yuan <li.yuan@sun.com> | 2011-07-07 12:38:33 +0800 |
commit | 8757b9ecbdeaf7c6957c92bb7a0476272e4ebdfe (patch) | |
tree | abb79967e932938b54fc3cedf121806ada5cefff | |
parent | bfab4ee07e4742304771d0bd4df6d8114e350959 (diff) | |
download | atk-8757b9ecbdeaf7c6957c92bb7a0476272e4ebdfe.tar.gz |
Add relation-change and attribute-change signal for AtkObject
Bug #649771.
-rw-r--r-- | atk/atkmarshal.list | 1 | ||||
-rwxr-xr-x | atk/atkobject.c | 55 | ||||
-rwxr-xr-x | atk/atkobject.h | 7 | ||||
-rw-r--r-- | docs/tmpl/atkobject.sgml | 17 |
4 files changed, 79 insertions, 1 deletions
diff --git a/atk/atkmarshal.list b/atk/atkmarshal.list index 0763ae8..590f520 100644 --- a/atk/atkmarshal.list +++ b/atk/atkmarshal.list @@ -26,3 +26,4 @@ VOID:INT,INT VOID:INT,INT,STRING VOID:INT,INT,INT,STRING VOID:STRING,BOOLEAN +VOID:ENUM,POINTER diff --git a/atk/atkobject.c b/atk/atkobject.c index 010a8b1..b498c18 100755 --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -65,6 +65,8 @@ enum { STATE_CHANGE, VISIBLE_DATA_CHANGED, ACTIVE_DESCENDANT_CHANGED, + RELATION_CHANGE, + ATTRIBUTE_CHANGE, LAST_SIGNAL }; @@ -649,6 +651,25 @@ atk_object_class_init (AtkObjectClass *klass) g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); + atk_object_signals[RELATION_CHANGE] = + g_signal_new ("relation_change", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + (GSignalAccumulator) NULL, NULL, + atk_marshal_VOID__ENUM_POINTER, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_POINTER); + atk_object_signals[ATTRIBUTE_CHANGE] = + g_signal_new ("attribute_change", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); } static void @@ -1111,6 +1132,40 @@ atk_object_remove_property_change_handler (AtkObject *accessible, } /** + * atk_object_notify_attribute_change: + * @accessible: an #AtkObject + * @attr: The attribute which is changed + * + * Emits a attribute-change signal for the attribute. + **/ +void +atk_object_notify_attribute_change (AtkObject *accessible, + AtkAttribute *attr) +{ + g_return_if_fail (ATK_IS_OBJECT (accessible)); + + g_signal_emit (accessible, atk_object_signals[ATTRIBUTE_CHANGE], + attr, NULL); +} + +/** + * atk_object_notify_relation_change: + * @accessible: an #AtkObject + * @relation_type: the type of the changed relations + * @targets: the targets of the relations + * + * Emits a relation-change signal for the relation. + **/ +void +atk_object_notify_relation_change (AtkObject *accessible, AtkRelationType relation_type, GPtrArray *targets) +{ + g_return_if_fail (ATK_IS_OBJECT (accessible)); + + g_signal_emit (accessible, atk_object_signals[RELATION_CHANGE], + relation_type, targets, NULL); +} + +/** * atk_object_notify_state_change: * @accessible: an #AtkObject * @state: an #AtkState whose state is changed diff --git a/atk/atkobject.h b/atk/atkobject.h index 1385e54..b8f8a08 100755 --- a/atk/atkobject.h +++ b/atk/atkobject.h @@ -503,6 +503,7 @@ void (* initialize) (AtkObject * Since ATK 1.12 */ AtkAttributeSet* (*get_attributes) (AtkObject *accessible); + AtkFunction pad1; AtkFunction pad2; }; @@ -564,7 +565,11 @@ guint atk_object_connect_property_change_handler (AtkObject AtkPropertyChangeHandler *handler); void atk_object_remove_property_change_handler (AtkObject *accessible, guint handler_id); - +void atk_object_notify_relation_change (AtkObject *accessible, + AtkRelationType relation_type, + GPtrArray *targets); +void atk_object_notify_attribute_change (AtkObject *accessible, + AtkAttribute *attr); void atk_object_notify_state_change (AtkObject *accessible, AtkState state, gboolean value); diff --git a/docs/tmpl/atkobject.sgml b/docs/tmpl/atkobject.sgml index 42d1a50..9d6aa88 100644 --- a/docs/tmpl/atkobject.sgml +++ b/docs/tmpl/atkobject.sgml @@ -55,6 +55,14 @@ in the table which has focus changes. @atkobject: the object which received the signal. @arg1: the newly focused object. +<!-- ##### SIGNAL AtkObject::attribute-change ##### --> +<para> + +</para> + +@atkobject: the object which received the signal. +@arg1: + <!-- ##### SIGNAL AtkObject::children-changed ##### --> <para> The signal "children-changed" is emitted when a child is added or @@ -83,6 +91,15 @@ value has changed. @atkobject: the object which received the signal. @arg1: The new value of the property which changed. +<!-- ##### SIGNAL AtkObject::relation-change ##### --> +<para> + +</para> + +@atkobject: the object which received the signal. +@arg1: +@Param3: + <!-- ##### SIGNAL AtkObject::state-change ##### --> <para> The "state-change" signal is emitted when an object's state changes. |