[atk/atk-3] Add relation-change and attribute-change signal for AtkObject
- From: Li Yuan <liyuan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atk/atk-3] Add relation-change and attribute-change signal for AtkObject
- Date: Thu, 7 Jul 2011 04:34:14 +0000 (UTC)
commit 8757b9ecbdeaf7c6957c92bb7a0476272e4ebdfe
Author: Li Yuan <li yuan sun com>
Date: Thu Jul 7 12:38:33 2011 +0800
Add relation-change and attribute-change signal for AtkObject
Bug #649771.
atk/atkmarshal.list | 1 +
atk/atkobject.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++
atk/atkobject.h | 7 +++++-
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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]